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

body {
    font-family: 'JetBrains Mono', monospace;
    background: #0a0a0f;
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#scene-container.shake {
    animation: shake 0.2s ease-in-out;
}

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

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 15, 0.85);
    z-index: 100;
}

.hidden {
    display: none !important;
}

/* Start Screen */
#start-screen {
    cursor: pointer;
}

.title-container {
    text-align: center;
    margin-bottom: 2rem;
}

.glitch-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 900;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff,
        0 0 80px #00ffff,
        3px 3px 0 #ff00ff,
        -3px -3px 0 #00ff88;
    animation: glitch 2s infinite;
    position: relative;
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-title::before {
    color: #ff00ff;
    animation: glitch-1 0.5s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-title::after {
    color: #00ff88;
    animation: glitch-2 0.5s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch {
    0%, 90%, 100% { transform: none; }
    92% { transform: skew(-0.5deg, -0.5deg); }
    94% { transform: skew(0.5deg, 0.5deg); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(3px); }
    40% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
    80% { transform: translateX(-3px); }
}

.subtitle {
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    margin-top: 1rem;
    font-style: italic;
}

.start-prompt {
    margin: 2rem 0;
}

.blink {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    animation: blink 1s infinite;
}

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

.loading-tip {
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #666;
    margin-top: 2rem;
    transition: opacity 0.3s;
}

.high-score {
    position: absolute;
    bottom: 80px;
    font-size: 1rem;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
}

.hud-left, .hud-right {
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid #00ffff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.hud-center {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.ai-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

.ai-logo .version {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

.score-container, .level-container {
    text-align: center;
}

.label {
    display: block;
    font-size: 0.6rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.value {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 5px #00ff88;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.hud-bottom {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 400px;
}

.health-bar-container {
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 3px;
    height: 20px;
}

.health-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff88, #00ffff);
    border-radius: 6px;
    transition: width 0.3s, background 0.3s;
    box-shadow: 0 0 10px currentColor;
}

/* Level Up */
#level-up {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 200;
    animation: levelUpPop 0.5s ease-out;
}

@keyframes levelUpPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.level-up-text {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    color: #ffd700;
    text-shadow: 
        0 0 10px #ffd700,
        0 0 20px #ffd700,
        0 0 40px #ffd700;
    animation: rainbow 1s linear infinite;
}

.level-up-msg {
    display: block;
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    color: #00ff88;
    margin-top: 1rem;
    text-shadow: 0 0 10px #00ff88;
}

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Pause Menu */
#pause-menu h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    margin-bottom: 2rem;
}

.menu-btn {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    color: #00ff88;
    background: transparent;
    border: 2px solid #00ff88;
    padding: 1rem 2rem;
    margin: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-btn:hover {
    background: #00ff88;
    color: #0a0a0f;
    box-shadow: 0 0 20px #00ff88;
}

/* Game Over */
.game-over-title {
    font-size: clamp(2rem, 8vw, 4rem) !important;
}

.game-over-msg {
    color: #666;
    font-size: clamp(0.8rem, 2vw, 1rem);
    margin: 1rem 0 2rem;
    max-width: 80%;
    text-align: center;
}

.final-score, .final-level {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin: 0.5rem 0;
}

.final-score span:last-child {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    font-weight: 700;
}

.final-level span:last-child {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    font-weight: 700;
}

.restart-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00ff88;
    padding: 1rem 2rem;
    margin-top: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    animation: glow 2s infinite;
}

.restart-btn:hover {
    background: #00ff88;
    color: #0a0a0f;
    box-shadow: 0 0 30px #00ff88;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px #00ff88; }
    50% { box-shadow: 0 0 20px #00ff88, 0 0 30px #00ff88; }
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 80;
}

.joystick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 100px;
    height: 100px;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    border-radius: 50%;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.joystick {
    width: 40px;
    height: 40px;
    background: #00ffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ffff;
    transition: transform 0.1s;
}

.jump-btn {
    position: absolute;
    bottom: 50px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 255, 0.3);
    border: 2px solid #ff00ff;
    border-radius: 50%;
    color: #ff00ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    pointer-events: auto;
    cursor: pointer;
    text-shadow: 0 0 10px #ff00ff;
}

.jump-btn:active {
    background: #ff00ff;
    color: #0a0a0f;
}

/* Footer */
#footer {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #444;
    z-index: 10;
}

#footer a {
    color: #00ffff;
    text-decoration: none;
}

#footer a:hover {
    text-shadow: 0 0 5px #00ffff;
}

/* Rainbow Mode */
.rainbow-mode #scene-container {
    animation: rainbowBg 2s linear infinite;
}

@keyframes rainbowBg {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .hud-bottom {
        width: 80%;
        bottom: 220px;
    }
    
    .high-score {
        bottom: 60px;
    }
}