/* ──────────────────────────────────────────
   Word Catcher — Styles
   ────────────────────────────────────────── */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 0;
    margin: 0;
    background: radial-gradient(ellipse at top left, #162544 0%, #0c1222 50%, #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;
}

.lives { color: white; }
.score-display { color: var(--accent); }

/* ── 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;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    transition: transform 0.3s;
}

.target-bar.flash {
    animation: targetPulse 0.4s ease;
}

@keyframes targetPulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(56,189,248,0.5); }
    50%  { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(56,189,248,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(56,189,248,0); }
}

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

.target-word {
    color: #38bdf8;
    font-size: 1.4rem;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* ── Play area ── */
.play-area {
    flex-grow: 1;
    position: relative;
    margin: 0;
    overflow: hidden;
    padding-top: 8rem; /* space below header + target 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);
}

/* ── Falling blocks ── */
.falling-block {
    position: absolute;
    top: 0;
    width: auto;
    min-width: 72px;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    cursor: pointer;
    z-index: 3;
    animation-name: fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    opacity: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    /* prevent text wrapping for multi-char words */
    white-space: nowrap;
}

.falling-block:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 8px 28px rgba(56,189,248,0.3);
}

.falling-block:active {
    transform: scale(0.9);
}

@keyframes fall {
    0%   { transform: translateY(-60px); opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { transform: translateY(calc(100vh - 100px)); opacity: 0; }
}

/* ── 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);
}

.category-icon {
    font-size: 1.1rem;
}

/* ── Feedback ── */
.feedback-splash {
    position: absolute;
    font-size: 3.5rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.feedback-splash.correct { color: var(--success); }
.feedback-splash.incorrect { color: var(--error); }

.combo-text {
    position: absolute;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fbbf24;
    pointer-events: none;
    z-index: 21;
    transform: translate(-50%, -120%);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    letter-spacing: 0.05em;
}

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

.game-over.hidden { display: none; }
.game-over h2 { color: var(--error); font-size: 2.25rem; margin-bottom: 0.75rem; }
.game-over p { font-size: 1.3rem; margin-bottom: 0.25rem; }
.final-streak { color: #fbbf24; font-size: 1rem !important; }

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

.round-clear.hidden { display: none; }
.round-clear-title {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--success), 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;
}

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

/* ── Mobile tweaks ── */
@media (max-width: 500px) {
    .target-word { font-size: 1.2rem; }
    .falling-block { font-size: 1.4rem; min-width: 60px; padding: 0.4rem 0.75rem; }
    .game-over, .round-clear { width: 92%; padding: 2rem 1.25rem; }
}
