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

body {
    background: #0C0D14;
    color: #e0e0e0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HUD ─────────────────────────────────────────────── */

#hud {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 16px;
    background: #111220;
    border-bottom: 1px solid #1e2035;
    flex-shrink: 0;
    z-index: 10;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hud-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
}

.hud-item span:last-child {
    font-size: 22px;
    font-weight: 700;
    color: #e0e0e0;
    font-variant-numeric: tabular-nums;
}

/* ── Timer Bar ───────────────────────────────────────── */

#timer-bar-wrap {
    height: 4px;
    background: #1a1b2e;
    flex-shrink: 0;
}

#timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff4466, #ffaa22);
    transition: width 0.1s linear;
}

/* ── Game Area ───────────────────────────────────────── */

#game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    background:
        linear-gradient(rgba(30, 32, 53, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 32, 53, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: #0C0D14;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* ── Overlays ────────────────────────────────────────── */

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 13, 20, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    max-width: 400px;
    padding: 24px;
}

.overlay-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #ff4466;
    text-shadow: 0 0 30px rgba(255, 68, 102, 0.4);
}

.overlay-content p {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 8px;
}

.overlay-content .sub {
    font-size: 13px;
    color: #666;
    margin-bottom: 28px;
}

/* ── Stats Grid ──────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0 28px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid #1e2035;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #ff4466;
}

/* ── Neon Button ─────────────────────────────────────── */

.btn-neon {
    background: transparent;
    color: #ff4466;
    border: 2px solid #ff4466;
    padding: 14px 40px;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s;
    box-shadow: 0 0 15px rgba(255, 68, 102, 0.2), inset 0 0 15px rgba(255, 68, 102, 0.1);
}

.btn-neon:hover {
    background: rgba(255, 68, 102, 0.15);
    box-shadow: 0 0 30px rgba(255, 68, 102, 0.4), inset 0 0 20px rgba(255, 68, 102, 0.15);
    transform: translateY(-1px);
}

.btn-neon:active {
    transform: translateY(1px);
}

/* ── Red Flash ───────────────────────────────────────── */

#game-area.miss-flash {
    animation: missFlash 0.2s ease-out;
}

@keyframes missFlash {
    0% { box-shadow: inset 0 0 60px rgba(255, 40, 40, 0.4); }
    100% { box-shadow: inset 0 0 0 transparent; }
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 480px) {
    .hud-item span:last-child {
        font-size: 18px;
    }
    .hud-label {
        font-size: 9px;
    }
    .overlay-content h1 {
        font-size: 32px;
    }
    .stat-value {
        font-size: 22px;
    }
    .btn-neon {
        padding: 12px 28px;
        font-size: 15px;
    }
}
