* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    padding: 15px 20px;
    border-bottom: 4px solid #C62828;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 28px;
    text-shadow: 3px 3px 0 #C62828;
    letter-spacing: 2px;
}

#currency-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#banana-count {
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #C62828;
}

#bps {
    font-size: 16px;
    color: #FFD54F;
    text-shadow: 1px 1px 0 #F57C00;
}

#prestige-level {
    background: #FFD54F;
    color: #263238;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    border: 3px solid #F57C00;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#ship-container {
    flex: 6;
    position: relative;
    background: linear-gradient(180deg, #81D4FA 0%, #4FC3F7 100%);
    border: 4px solid #0277BD;
}

#ship-canvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
    image-rendering: pixelated;
}

#upgrade-panel {
    flex: 4;
    background: linear-gradient(135deg, #37474F 0%, #263238 100%);
    border-left: 4px solid #1A237E;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#upgrade-tabs {
    display: flex;
    background: #1A237E;
    border-bottom: 4px solid #0D47A1;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: #283593;
    border: none;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-right: 2px solid #1A237E;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #3F51B5;
}

.tab-btn.active {
    background: #5C6BC0;
    border-bottom: 4px solid #FFD54F;
}

#upgrade-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.upgrade-item {
    background: #455A64;
    border: 3px solid #546E7A;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.upgrade-item.affordable {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.upgrade-item.affordable:hover {
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
}

.upgrade-icon {
    font-size: 32px;
    width: 40px;
    text-align: center;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-weight: bold;
    font-size: 16px;
    color: #FFD54F;
}

.upgrade-desc {
    font-size: 12px;
    color: #B0BEC5;
}

.upgrade-owned {
    font-size: 11px;
    color: #78909C;
    margin-top: 4px;
}

.upgrade-buy {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    border: 3px solid #2E7D32;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.upgrade-buy:hover:not(:disabled) {
    background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
    transform: scale(1.05);
}

.upgrade-buy:disabled {
    background: #455A64;
    border-color: #37474F;
    cursor: not-allowed;
    opacity: 0.5;
}

footer {
    background: linear-gradient(135deg, #1A237E 0%, #0D47A1 100%);
    padding: 12px 20px;
    border-top: 4px solid #283593;
    display: flex;
    gap: 10px;
    align-items: center;
}

footer button {
    background: linear-gradient(135deg, #5C6BC0 0%, #3F51B5 100%);
    border: 3px solid #283593;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

footer button:hover {
    background: linear-gradient(135deg, #7986CB 0%, #5C6BC0 100%);
    transform: translateY(-2px);
}

#prestige-btn {
    background: linear-gradient(135deg, #FFD54F 0%, #FFA726 100%);
    border-color: #F57C00;
    color: #263238;
}

#prestige-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #FFE082 0%, #FFB74D 100%);
}

#prestige-btn.disabled {
    background: #455A64;
    border-color: #37474F;
    cursor: not-allowed;
    opacity: 0.5;
}

#footer-link {
    margin-left: auto;
    font-size: 12px;
    color: #B0BEC5;
}

#footer-link a {
    color: #FFD54F;
    text-decoration: none;
}

#footer-link a:hover {
    text-decoration: underline;
}

#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#modal.hidden {
    display: none;
}

#modal-content {
    background: linear-gradient(135deg, #37474F 0%, #263238 100%);
    border: 4px solid #1A237E;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

#modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #EF5350;
    border: 3px solid #C62828;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-body h2 {
    color: #FFD54F;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #37474F;
}

.stat-row {
    background: #455A64;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 2px solid #546E7A;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: #455A64;
    border: 3px solid #546E7A;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.achievement-card.unlocked {
    border-color: #FFD54F;
    box-shadow: 0 0 15px rgba(255, 213, 79, 0.5);
}

.achievement-card.locked {
    opacity: 0.4;
}

.achievement-card .achievement-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.achievement-card .achievement-name {
    font-weight: bold;
    color: #FFD54F;
    margin-bottom: 5px;
}

.achievement-card .achievement-desc {
    font-size: 11px;
    color: #B0BEC5;
}

.achievement-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    border: 4px solid #2E7D32;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: right 0.5s;
    z-index: 999;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-notification .achievement-icon {
    font-size: 48px;
}

.achievement-notification .achievement-title {
    color: #FFD54F;
    font-weight: bold;
    font-size: 14px;
}

.achievement-notification .achievement-name {
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    #ship-container {
        flex: 1;
        min-height: 300px;
    }
    
    #upgrade-panel {
        flex: 1;
        border-left: none;
        border-top: 4px solid #1A237E;
    }
    
    header {
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 20px;
    }
    
    #banana-count {
        font-size: 24px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #263238;
}

::-webkit-scrollbar-thumb {
    background: #546E7A;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #78909C;
}