/* ──────────────────────────────────────────
   Number Blitz — Styles
   ────────────────────────────────────────── */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 0;
    margin: 0;
    /* Deep teal to navy gradient for focus */
    background: radial-gradient(ellipse at top left, #0f4c5c 0%, #0c1222 60%, #0a0f1c 100%);
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: rgba(0,0,0,0.15);
}

/* ── Header ── */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    position: absolute;
    top: 0.75rem; left: 0.75rem; right: 0.75rem;
    z-index: 10;
    border-radius: var(--radius-full);
}

.btn-back {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    border: none;
}

.stats {
    display: flex;
    gap: 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.round-display { color: white; }
.timer-display { color: #facc15; font-variant-numeric: tabular-nums; } /* Yellow for timer */

/* ── Target bar ── */
.target-bar {
    position: absolute;
    top: 4.25rem;
    left: 1rem; right: 1rem;
    z-index: 10;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 1.15rem;
    font-weight: 700;
    transition: transform 0.1s;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.15);
}

.target-bar.punch {
    transform: scale(1.05);
}

.target-label {
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.target-number {
    color: #10b981; /* Emerald green */
    font-size: 1.6rem;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* ── Play area ── */
.play-area {
    flex-grow: 1;
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 5rem; /* space for header + target bar */
    padding-bottom: 3rem; /* space for category bar */
}

.message-area {
    position: absolute;
    top: 50%;
    left: 0;
    text-align: center;
    width: 100%;
    font-size: 2.5rem;
    color: white;
    font-weight: 800;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* ── Grid Container ── */
.grid-container {
    display: grid;
    gap: 0.5rem;
    width: 90%;
    max-width: 400px;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.2);
    transition: opacity 0.3s;
}

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

/* ── Number Block ── */
.number-block {
    background: rgba(30, 41, 59, 0.85);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Dynamically size font based on characters if needed, but flex handles basic centering */

.number-block:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.number-block:active {
    transform: scale(0.92);
}

.number-block.tapped {
    opacity: 0;
    visibility: hidden; /* Hides it but keeps layout space */
    transition: opacity 0.15s ease, visibility 0.15s;
}

.number-block.wrong {
    animation: shake 0.3s ease;
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.2);
}

/* ── Category bar ── */
.category-bar {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-full);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── Overlays ── */
.round-clear, .game-over {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    text-align: center;
    padding: 2.5rem 2rem;
    z-index: 100;
}

.hidden { display: none; }

.round-clear-title {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #10b981, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.round-clear-detail {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.stars {
    font-size: 2rem;
    letter-spacing: 0.2rem;
    margin: 1rem 0;
}

.game-over h2 { color: #facc15; font-size: 2.25rem; margin-bottom: 0.75rem; }
.game-over p { font-size: 1.3rem; margin-bottom: 0.25rem; }
.final-message { color: var(--text-muted); font-size: 1.1rem !important; margin-top: 1rem; }

.mt-4 { margin-top: 1.5rem; }

/* ── Mobile tweaks ── */
@media (max-width: 500px) {
    .target-number { font-size: 1.4rem; }
    .number-block { font-size: 1.3rem; }
    .game-over, .round-clear { width: 92%; padding: 2rem 1.25rem; }
    .grid-container { gap: 0.4rem; padding: 0.8rem; }
}

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