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

body {
    overflow: hidden;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Press Start 2P', monospace;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

#scene-container canvas {
    filter: contrast(1.05) saturate(1.1);
}

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 100;
}

#hud-left, #hud-right {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border: 3px solid #ffd700;
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

#ring-icon {
    font-size: 20px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

#ring-count, #timer {
    color: #ffd700;
    font-size: 18px;
    text-shadow: 2px 2px 0 #000, 0 0 10px #ffd700;
}

#hud-center {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 3px solid #ffd700;
    border-radius: 8px;
    padding: 10px 24px;
    color: #fff;
    font-size: 14px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
    letter-spacing: 2px;
}

#start-screen, #game-over-screen, #victory-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, rgba(26, 26, 46, 0.95) 0%, rgba(15, 52, 96, 0.98) 100%);
    z-index: 200;
    gap: 20px;
}

#game-title {
    font-size: clamp(36px, 10vw, 72px);
    color: #ffd700;
    text-shadow: 4px 4px 0 #e74c3c, 8px 8px 0 #000, 0 0 40px #ffd700;
    animation: titlePulse 1.5s ease-in-out infinite;
    letter-spacing: 8px;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#subtitle {
    font-size: clamp(12px, 3vw, 20px);
    color: #3498db;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 4px;
}

#start-prompt {
    font-size: clamp(14px, 3vw, 20px);
    color: #2ecc71;
    animation: blink 1s ease-in-out infinite;
    margin-top: 40px;
    text-shadow: 0 0 20px #2ecc71;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#controls-info {
    font-size: clamp(8px, 2vw, 12px);
    color: #95a5a6;
    text-align: center;
    line-height: 2;
    margin-top: 20px;
}

#high-score-display {
    font-size: clamp(10px, 2.5vw, 14px);
    color: #ffd700;
    margin-top: 30px;
}

#game-over-text {
    font-size: clamp(32px, 8vw, 56px);
    color: #e74c3c;
    text-shadow: 4px 4px 0 #000, 0 0 30px #e74c3c;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#respawn-text {
    font-size: clamp(12px, 3vw, 18px);
    color: #f39c12;
    animation: blink 0.5s ease-in-out infinite;
}

#victory-text {
    font-size: clamp(24px, 6vw, 48px);
    color: #2ecc71;
    text-shadow: 4px 4px 0 #000, 0 0 40px #2ecc71;
    animation: victoryBounce 0.6s ease-out;
}

@keyframes victoryBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#final-stats {
    font-size: clamp(10px, 2.5vw, 16px);
    color: #ffd700;
    text-align: center;
    line-height: 2.5;
    margin: 20px 0;
}

#play-again {
    font-size: clamp(12px, 3vw, 16px);
    color: #3498db;
    animation: blink 1s ease-in-out infinite;
}

.hidden {
    display: none !important;
}

#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 150;
    pointer-events: none;
}

#joystick-container {
    pointer-events: auto;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 3px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-stick {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffd700 0%, #f39c12 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    transition: transform 0.1s ease-out;
}

#jump-button {
    pointer-events: auto;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 4px solid #ffd700;
    border-radius: 50%;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.2);
    text-shadow: 2px 2px 0 #000;
    transition: transform 0.1s, box-shadow 0.1s;
}

#jump-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.5);
}

#footer-link {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: #ffd700;
    text-decoration: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #ffd700;
    z-index: 300;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

#footer-link:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

@media (max-width: 768px) {
    #hud {
        padding: 10px 12px;
    }
    
    #hud-left, #hud-right {
        padding: 8px 12px;
    }
    
    #ring-count, #timer {
        font-size: 14px;
    }
    
    #hud-center {
        font-size: 10px;
        padding: 8px 12px;
    }
    
    #footer-link {
        bottom: 140px;
        font-size: 8px;
        padding: 8px 14px;
    }
}