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

body {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    font-family: system-ui, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Screens */
.screen {
    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.95);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Game Title */
.game-title {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    color: #00ffff;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff,
        0 0 40px #00ffff;
    margin-bottom: 0.5rem;
    text-align: center;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow:
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff;
    }
    50% {
        text-shadow:
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 60px #00ffff,
            0 0 80px #00ffff;
    }
}

.game-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #ff00ff;
    text-shadow:
        0 0 10px #ff00ff,
        0 0 20px #ff00ff;
    margin-bottom: 2rem;
    text-align: center;
}

/* Buttons */
.btn-primary {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #0a0a0f;
    background: linear-gradient(135deg, #00ffff, #00ff88);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.8),
        0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Controls Info */
.controls-info {
    margin-top: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.control-item {
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    color: #00ffff;
}

.control-text {
    color: #ccc;
}

/* High Score Display */
.highscore-display {
    margin-top: 2rem;
    color: #ff00ff;
    font-size: 1.2rem;
    text-shadow: 0 0 10px #ff00ff;
}

/* HUD */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 5;
}

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

.score-container,
.highscore-container,
.coins-container {
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    min-width: 100px;
}

.score-label,
.coins-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value,
.coins-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

#highscore.score-value {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

/* Energy Bar */
.energy-bar-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.energy-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ffff, #ff00ff, #ffff00);
    background-size: 200% 100%;
    animation: energyGlow 1s linear infinite;
    transition: width 0.3s ease;
}

@keyframes energyGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.energy-bar-container.hidden {
    display: none;
}

/* Game Over Screen */
.game-over-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: bold;
    color: #ff0055;
    text-shadow:
        0 0 10px #ff0055,
        0 0 20px #ff0055,
        0 0 30px #ff0055;
    margin-bottom: 1rem;
    animation: gameOverPulse 1.5s ease-in-out infinite;
}

@keyframes gameOverPulse {
    0%, 100% {
        text-shadow:
            0 0 10px #ff0055,
            0 0 20px #ff0055;
    }
    50% {
        text-shadow:
            0 0 20px #ff0055,
            0 0 40px #ff0055,
            0 0 60px #ff0055;
    }
}

.final-score {
    background: rgba(0, 0, 0, 0.7);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 0, 85, 0.3);
    margin-bottom: 2rem;
    min-width: 250px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-row:last-child {
    border-bottom: none;
}

.score-row span:first-child {
    color: #888;
}

.score-row span:last-child {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 10px #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .controls-info {
        font-size: 0.75rem;
        padding: 0 1rem;
    }

    .btn-primary {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    .score-container,
    .highscore-container,
    .coins-container {
        min-width: 80px;
        padding: 0.4rem 0.8rem;
    }

    .score-value,
    .coins-value {
        font-size: 1rem;
    }
}

/* Loading Overlay */
#loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #00ffff;
    font-size: 1.5rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 255, 255, 0.2);
    border-top: 5px solid #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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