* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: #1a1a2e;
    overflow: hidden;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100%;
    max-height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    pointer-events: auto;
}

.screen.active {
    display: flex;
}

.game-title {
    font-size: clamp(24px, 8vw, 48px);
    text-align: center;
    line-height: 1.4;
    background: linear-gradient(180deg, 
        #FFE135 0%, 
        #FF6B35 30%, 
        #FF4444 60%, 
        #CC3366 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    filter: drop-shadow(3px 3px 0 #222) drop-shadow(-1px -1px 0 #000);
    animation: titleBounce 1s ease-in-out infinite;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.fury-icon {
    width: 80px;
    height: 40px;
    background: linear-gradient(180deg, #4a4a4a 0%, #2d2d2d 100%);
    clip-path: polygon(100% 50%, 70% 20%, 10% 30%, 0% 50%, 10% 70%, 70% 80%);
    animation: furyHover 0.5s ease-in-out infinite;
    position: relative;
}

.fury-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 10px;
    background: #ff4400;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    clip-path: polygon(100% 50%, 0% 0%, 0% 100%);
    opacity: 0.8;
    animation: thruster 0.1s linear infinite;
}

@keyframes furyHover {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

@keyframes thruster {
    0%, 100% { opacity: 0.6; transform: translateY(-50%) scaleX(0.8); }
    50% { opacity: 1; transform: translateY(-50%) scaleX(1.2); }
}

.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(12px, 3vw, 16px);
    padding: 15px 40px;
    background: linear-gradient(180deg, #7DC67D 0%, #5BA35B 50%, #4A8B4A 100%);
    border: 4px solid #2d5a2d;
    border-radius: 8px;
    color: white;
    text-shadow: 2px 2px 0 #2d5a2d;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #2d5a2d,
        0 8px 10px rgba(0,0,0,0.3);
    transition: all 0.1s;
}

.pixel-btn:hover {
    transform: translateY(2px);
    box-shadow: 
        0 4px 0 #2d5a2d,
        0 6px 8px rgba(0,0,0,0.3);
}

.pixel-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #2d5a2d,
        0 4px 6px rgba(0,0,0,0.3);
}

.instructions {
    font-size: clamp(8px, 2vw, 12px);
    color: #aaa;
    text-align: center;
    margin-top: 10px;
}

.game-over-title {
    font-size: clamp(20px, 6vw, 36px);
    background: linear-gradient(180deg, #FFB347 0%, #FF8C00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(3px 3px 0 #8B4513);
    animation: gameOverShake 0.5s ease-in-out;
}

@keyframes gameOverShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.score-panel {
    background: linear-gradient(180deg, #A8D8A8 0%, #8BC88B 100%);
    border: 4px solid #4a6b4a;
    border-radius: 8px;
    padding: 20px 30px;
    display: flex;
    gap: 30px;
    box-shadow: 
        inset 0 -4px 0 rgba(0,0,0,0.2),
        0 8px 0 #3d5a3d;
}

.medal-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.medal {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #666, #333);
    border: 3px solid #222;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.medal.bronze {
    background: radial-gradient(circle at 30% 30%, #cd7f32, #8b4513);
    border-color: #5c3317;
}

.medal.silver {
    background: radial-gradient(circle at 30% 30%, #e8e8e8, #a8a8a8);
    border-color: #666;
}

.medal.gold {
    background: radial-gradient(circle at 30% 30%, #ffd700, #daa520);
    border-color: #b8860b;
}

.medal.platinum {
    background: radial-gradient(circle at 30% 30%, #e5e4e2, #a0b0c0);
    border-color: #708090;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.5), 0 0 20px rgba(255,255,255,0.3);
}

.score-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label {
    font-size: clamp(8px, 2vw, 10px);
    color: #4a6b4a;
}

.score-value {
    font-size: clamp(16px, 4vw, 24px);
    color: #222;
}

.new-badge {
    background: #ff4444;
    color: white;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 2px;
}

.new-badge.hidden {
    visibility: hidden;
}

.button-row {
    display: flex;
    gap: 20px;
}

#score-display {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(32px, 8vw, 48px);
    color: white;
    text-shadow: 
        3px 3px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000;
    z-index: 10;
    display: none;
}

#score-display.visible {
    display: block;
}

#sound-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

#sound-toggle.sound-off::after {
    content: '🔇';
}

#sound-toggle.sound-on::after {
    content: '';
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .score-panel {
        padding: 15px 20px;
        gap: 20px;
    }
    
    .button-row {
        gap: 10px;
    }
    
    .pixel-btn {
        padding: 12px 25px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) {
    .game-title {
        font-size: 24px;
    }
    
    .score-panel {
        padding: 10px 15px;
    }
    
    .game-over-title {
        font-size: 24px;
    }
}

