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

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

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

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

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
    z-index: 10;
    transition: opacity 0.3s ease;
}

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

/* Start Screen */
#start-screen {
    padding: 20px;
    text-align: center;
}

.game-title {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #feca57, #ff9ff3, #54a0ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #a0a0c0;
    margin-bottom: 30px;
}

.primary-btn {
    padding: 15px 50px;
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: bold;
    color: #1a1a3a;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.6);
}

.primary-btn:active {
    transform: scale(0.98);
}

.controls-info {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.controls-info p {
    color: #a0a0c0;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease infinite;
}

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

.high-score {
    margin-top: 30px;
    font-size: 1.2rem;
    color: #54a0ff;
    padding: 15px 30px;
    background: rgba(84, 160, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(84, 160, 255, 0.3);
}

/* Game Over Screen */
.game-over-title {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    animation: shake 0.5s ease;
}

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

.final-score {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: #ffffff;
    margin-bottom: 10px;
}

.high-score-final {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: #54a0ff;
    margin-bottom: 30px;
}

/* HUD */
.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 5;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    font-weight: bold;
}

.hud-icon {
    font-size: 1.3rem;
}

#score {
    color: #feca57;
}

#fire-meter {
    color: #ff6b6b;
}

/* Pause Button */
.pause-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    color: white;
    z-index: 5;
    transition: all 0.2s ease;
}

.pause-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
}

/* Responsive */
@media (max-width: 600px) {
    .hud {
        flex-direction: column;
        gap: 10px;
        align-items: flex-end;
    }

    .controls-info p {
        font-size: 1rem;
    }
}

/* Loading Spinner */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #54a0ff;
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Score Popups */
#score-popups {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.score-popup {
    position: absolute;
    font-size: clamp(1rem, 4vw, 2rem);
    font-weight: bold;
    color: #feca57;
    text-shadow: 0 0 10px rgba(254, 202, 87, 0.8);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: float-up 1s ease-out forwards;
}

.score-popup.combo {
    color: #ff6b6b;
    font-size: clamp(1.5rem, 5vw, 3rem);
    text-shadow: 0 0 15px rgba(255, 107, 107, 0.9);
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(1);
    }
}
