/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

body {
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    background: #0a0a1a;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* ========== OVERLAYS ========== */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(10, 10, 30, 0.85) 0%, rgba(5, 5, 20, 0.95) 100%);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.4s ease;
}

.overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.overlay-content {
    text-align: center;
    max-width: 500px;
    padding: 2.5rem;
}

/* ========== TITLE ========== */
.title-container {
    margin-bottom: 2rem;
}

.title-container h1 {
    font-size: 3.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #FF8C00, #FF6347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* ========== INSTRUCTIONS ========== */
.instructions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
}

.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFD700;
    min-width: 80px;
}

/* ========== BUTTONS ========== */
.game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #FF8C00, #FF6347);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 99, 71, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 40px rgba(255, 99, 71, 0.55);
}

.game-btn:active {
    transform: translateY(0) scale(0.98);
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(255, 99, 71, 0.4);
    }

    50% {
        box-shadow: 0 8px 48px rgba(255, 99, 71, 0.7);
    }
}

.hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ========== GAME OVER ========== */
#gameover-screen h1 {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FF4444, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.score-display {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.score-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.score-value {
    font-size: 3rem;
    font-weight: 900;
    color: #FFD700;
}

.stats-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== HUD ========== */
#hud {
    position: fixed;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    gap: 1.2rem;
}

#hud.hidden {
    display: none;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

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

#hud-combo {
    color: #FF6347;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .title-container h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .game-btn {
        font-size: 1.1rem;
        padding: 0.8rem 2rem;
    }

    .score-value {
        font-size: 2.2rem;
    }

    .hud-item {
        font-size: 0.9rem;
        padding: 0.4rem 0.7rem;
    }
}