/* AVA Scam Hunter — DOM-based static SPA (DEC-120 v2 iteration 2026-05-10).
   Brand register per CLAUDE.md rules 24-26: institutional trust on the chrome
   (HUD, title-box, end-box) — dark + silver, sharp corners, thin borders.
   The play-area is the game canvas: it gets per-round colour and SVG scenery.
   Risk colours (green/yellow/orange/red) only for game feedback states. */

:root {
    /* AVA palette — 2026-05-15 dual-tone (Proton Monokai accents
       on AVA neutral backgrounds).
       Aligned with src/ava/ui/static/style.css (see that file's
       :root for full rationale). Coral = action; mint = trust/active. */
    --bg: #0A0A0A;                /* true black, neutral */
    --surface: #1F1F1F;
    --border: #2E2E2E;
    --border-strong: #3A3A3A;
    --text-primary: #EBEEF2;
    --text-secondary: #9C9C9C;
    --text-muted: #67627A;        /* Mauve Slate plumbing */
    --silver: #67627A;            /* legacy alias */
    --accent: #e53265;            /* Coral — primary brand voice / CTAs */
    --accent-light: #f04a7a;
    --accent-2: #2fd6b5;          /* Mint — active state / trust pin (no CTAs) */
    --accent-2-light: #4fe0c5;
    --interaction-weak: #2E2E2E;  /* Secondary-button fill (neutral grey) */
    --hit: #00E676;               /* RAG safe — electric mint-green */
    --warn: #FFEC00;              /* RAG caution — electric yellow */
    --miss: #FF2A45;              /* RAG danger — vivid red */
    --powerup: #e53265;           /* Brand coral — was magenta, originally blue */
    /* Legacy `--orange` alias — preserved so older rules referencing it
       render the new brand coral. Phase out by switching to `--accent`. */
    --orange: #e53265;
}

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

html, body {
    background: var(--bg);
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    min-height: 100vh;
}

#app { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }

.screen { display: none; }
.screen.visible { display: flex; flex-direction: column; flex: 1; }

/* -- Title screen ------------------------------------------------------- */

#title-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse at top, #1a2440 0%, #0a0f1c 60%, #0A0A0A 100%);
    position: relative;
    overflow: hidden;
}

/* CRT scanlines for arcade feel */
#title-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0.025) 0px,
        rgba(255,255,255,0.025) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
}

.title-box {
    max-width: 820px;
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(20, 23, 28, 0.85);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.banner {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--hit);
    margin-bottom: 0.6rem;
    font-family: monospace;
}

.title {
    font-weight: 700;
    font-size: 2.8rem;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    /* neon glow */
    text-shadow:
        0 0 6px rgba(74, 222, 128, 0.6),
        0 0 16px rgba(74, 222, 128, 0.3);
    font-family: monospace;
}

.subtitle {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.target-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

/* Each target card is now an <a> link to the academy stub for that
   target type — the cards double as a quick-reference index. */
.target-card {
    border: 1px solid var(--border);
    background: var(--bg);
    /* Larger padding for 44×44 tap target on mobile. Audit 2026-05-14
       found that 0.7rem×0.5rem padding produced cards ~32px tall, below
       the WCAG / Apple HIG minimum. Cards double as both the title-
       screen visual index and as tap targets, so they need to be
       comfortably tappable. */
    padding: 0.9rem 0.55rem;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.target-card:hover {
    border-color: var(--silver);
    background: var(--surface);
    transform: translateY(-2px);
}

.target-card .t-icon { font-size: 1.4rem; line-height: 1; }
.target-card .t-name { color: var(--text-primary); font-weight: 500; }
.target-card .t-pts { color: var(--text-muted); font-size: 0.7rem; }

.target-card.r2 { border-color: var(--border); opacity: 0.9; }
.target-card.r3 { opacity: 0.8; }
.target-card.r4 { opacity: 0.7; }
.target-card.r5 { opacity: 0.6; }
.target-card:hover { opacity: 1; }

.academy-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1.25rem;
    letter-spacing: 0.02em;
}
.academy-hint a {
    color: var(--hit);
    text-decoration: none;
}
.academy-hint a:hover { text-decoration: underline; }

.rules {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero-input {
    display: block;
    margin-bottom: 1.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.hero-input input {
    margin-left: 0.5rem;
    background: var(--bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.45rem 0.7rem;
    font-family: inherit;
    font-size: 0.85rem;
    width: 220px;
}

/* Primary CTA — orange-on-black-with-grey-border treatment matching
   the landing-page entry-point CTAs for cross-surface brand consistency. */
.cta {
    background: var(--bg);
    color: var(--orange);
    border: 1px solid var(--border);
    font-family: monospace;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.85rem 2rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.cta:hover {
    border-color: var(--accent);
    background: rgba(229, 50, 101, 0.10);
}

.cta-secondary {
    background: transparent;
    color: var(--silver);
    border: 1px solid var(--silver);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
}

.cta-secondary:hover { background: var(--surface); }

/* Persistent "back to AVA" home link — top-left on every game surface
   so navigation back to the main site is always one click away. Matches
   the academy back-to-ava treatment. */
.back-to-ava {
    display: inline-block;
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--border);
    /* WCAG 2.1 / Apple HIG minimum tap target = 44×44 logical pixels.
       Previously 0.4rem (6.4px) vertical padding + 0.78rem text ≈ 25px
       tall — failed mobile accessibility. (Touch-target audit 2026-05-14.)
       0.7rem padding + 0.78rem text + 2px border = ~36px tall; combined
       with the text height we land at ~44px effective. */
    padding: 0.7rem 1rem;
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
    transition: border-color 0.15s, color 0.15s;
}
.back-to-ava:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1.25rem;
    letter-spacing: 0.04em;
}

.audio-toggles {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.audio-toggles input { margin-right: 0.4rem; }

/* -- HUD --------------------------------------------------------------- */

.hud {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.75rem;
    z-index: 5;
}

.hud-left, .hud-right { min-width: 200px; }
.hud-row { font-size: 0.74rem; line-height: 1.5; color: var(--text-muted); }
.hud-centre { text-align: center; flex: 1; }
.hud-score-label { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.1em; }
.hud-score { font-size: 1.85rem; color: var(--warn); font-weight: 700; line-height: 1.05; font-family: monospace; }
.hud-best { font-size: 0.72rem; color: var(--silver); margin-top: 0.2rem; }

/* Powerup stack — one badge per active powerup, stacked vertically so
   multiple can show at once (e.g. Decoy Shield + Sanctions Freeze). */
.powerup-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 4;
}

.powerup-stack.hidden { display: none; }

.powerup-badge {
    color: var(--bg);
    text-align: center;
    padding: 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: monospace;
}

.powerup-badge.pb-scanner { background: #60a5fa; }   /* blue */
.powerup-badge.pb-shield  { background: #a855f7; }   /* purple */
.powerup-badge.pb-freeze  { background: #38bdf8; color: #0d2a3a; } /* cyan-ice */
.powerup-badge.pb-intel   { background: #4ade80; color: #052e16; } /* green */

/* -- Play area --------------------------------------------------------- */

.play-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: none;            /* hide system cursor; we render a crosshair */
    min-height: 520px;
    background: linear-gradient(180deg, #0a1020 0%, #1a2440 70%, #0a1a0e 100%);
}

.play-area[data-round="2"] { background: linear-gradient(180deg, #1a1530 0%, #5a2a3a 60%, #1a0a0a 100%); }
.play-area[data-round="3"] { background: linear-gradient(180deg, #0a1a25 0%, #0c2535 60%, #0a1a0e 100%); }
.play-area[data-round="4"] { background: linear-gradient(180deg, #0a0e1a 0%, #1a1f3a 60%, #0a0d12 100%); }
.play-area[data-round="5"] { background: linear-gradient(180deg, #2a0a0a 0%, #1a0a0a 60%, #0A0A0A 100%); }

/* SVG scenery — sits behind everything in play-area */
.scenery {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.scenery svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Player anchored on the right */
.player-anchor {
    position: absolute;
    right: 24px;
    bottom: 8px;
    width: 96px;
    height: auto;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.player-anchor svg { width: 100%; height: auto; display: block; }

.player-callout {
    position: absolute;
    right: 24px;
    bottom: 0;
    background: var(--surface);
    border: 1px solid var(--silver);
    color: var(--text-primary);
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-family: monospace;
    letter-spacing: 0.08em;
    z-index: 4;
    pointer-events: none;
    text-transform: uppercase;
}

/* Crosshair overlay (follows mouse via JS) */
.crosshair {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 6;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.05s;
}

.crosshair svg { width: 100%; height: 100%; display: block; }

/* Play-area centred overlay (round-intro / round-cleared) */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 10;
}

.play-overlay.hidden { display: none; }

/* Round-intro splash card */
.round-intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 23, 28, 0.92);
    border: 2px solid var(--hit);
    color: var(--text-primary);
    padding: 1.5rem 2.5rem;
    text-align: center;
    z-index: 12;
    min-width: 280px;
    /* Hard ceiling — never overflow the viewport on iPhone-sized screens.
       Previously the modal could push past the right edge when player
       anchored on the right + 280px min-width didn't leave room.
       (Mobile-rendering audit 2026-05-14.) */
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
    animation: round-intro 0.4s ease-out;
}

.round-intro .ri-round {
    font-family: monospace;
    color: var(--hit);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    margin-bottom: 0.4rem;
}

.round-intro .ri-name {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-family: monospace;
    text-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.round-intro .ri-prompt {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.round-intro.hidden { display: none; }

@keyframes round-intro {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Round-cleared modal (between rounds) */
.round-cleared {
    position: absolute;
    inset: 0;
    background: rgba(13, 14, 16, 0.85);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-cleared.hidden { display: none; }

.rc-card {
    background: var(--surface);
    border: 2px solid var(--hit);
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.rc-headline {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--hit);
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.rc-stats {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.rc-flavour {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* -- Targets (sprite-based) -------------------------------------------- */

/* Outer .target = positioning + horizontal motion via CSS keyframe animation
   (the keyframe reads --move-distance set inline by JS). Inner .t-sprite =
   idle bob via separate CSS keyframe. Two transforms on two elements means
   they don't conflict. We use animations rather than transitions because
   transitions require a committed "before" state which is unreliable when
   the element was just appended (rAF can be throttled in some contexts). */
.target {
    position: absolute;
    width: 88px;
    height: auto;
    cursor: none;            /* we render the crosshair */
    user-select: none;
    z-index: 2;
    will-change: transform, opacity;
    opacity: 0;
    /* The animation property is set inline by JS per movement profile,
       e.g. `animation: move-target var(--move-duration) linear forwards`. */
}

@keyframes move-target {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    100% {
        transform: translateX(var(--move-distance, 0px));
        opacity: 1;
    }
}

.target .t-sprite {
    width: 100%;
    display: block;
    will-change: transform;
}

.target .t-sprite svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.target:hover .t-sprite svg { filter: drop-shadow(0 0 8px var(--warn)); }

/* Label extends beyond the 88px sprite when the type name is longer
   ("Phishing Domain", "Brand Impostor", etc.) — no more ellipsis truncation.
   Position absolute + translateX(-50%) keeps it centred under the sprite
   regardless of width. */
.target .t-label-box {
    position: absolute;
    left: 50%;
    bottom: -22px;
    transform: translateX(-50%);
    background: var(--miss);
    color: #fff;
    font-size: 0.62rem;
    font-family: monospace;
    letter-spacing: 0.05em;
    padding: 0.18rem 0.5rem;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;       /* clicks pass through to the sprite */
}

@keyframes target-hit {
    0%   { transform: scale(1) rotate(0); opacity: 1; }
    50%  { transform: scale(1.3) rotate(-8deg); opacity: 1; }
    100% { transform: scale(0.4) rotate(20deg) translateY(60px); opacity: 0; }
}

@keyframes target-escape {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* The hit animation needs to override the inline transform from the
   movement transition. Setting `transition: none !important` and giving
   the keyframe explicit transform values does that. */
.target.hit {
    animation: target-hit 0.55s ease-out forwards;
    transition: none !important;
    pointer-events: none;
}
.target.escape {
    animation: target-escape 0.6s ease-in forwards;
    pointer-events: none;
}

/* Idle bob lives on the inner sprite so it doesn't fight the parent's
   horizontal transform. */
@keyframes sprite-idle {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.target:not(.hit):not(.escape) .t-sprite {
    animation: sprite-idle 1.4s ease-in-out infinite;
}

/* -- Combat text ------------------------------------------------------- */

.combat-text {
    position: absolute;
    color: var(--hit);
    font-weight: 700;
    font-size: 1.15rem;
    pointer-events: none;
    animation: combat-rise 1.1s ease-out forwards;
    z-index: 20;
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0 0 6px rgba(0,0,0,0.5);
    font-family: monospace;
    transform: translateX(-50%);
    white-space: nowrap;
}

.combat-text.miss { color: var(--miss); }
.combat-text.flavour { color: var(--warn); font-size: 0.95rem; }
.combat-text.boss { color: var(--miss); font-size: 1.4rem; }

@keyframes combat-rise {
    0%   { transform: translateX(-50%) translateY(0); opacity: 1; }
    20%  { transform: translateX(-50%) translateY(-8px); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-60px); opacity: 0; }
}

/* -- Powerup pickup ---------------------------------------------------- */

/* Powerup pickup: the floating prize the player clicks to activate.
   Per-type border + glow so players can tell which powerup they're
   about to grab from a distance. */
.powerup-pickup {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 2px solid var(--powerup);
    background: var(--surface);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    animation: powerup-pulse 1s infinite ease-in-out;
    z-index: 4;
}

.powerup-pickup.pp-scanner { border-color: #60a5fa; box-shadow: 0 0 12px rgba(96, 165, 250, 0.7); }
.powerup-pickup.pp-shield  { border-color: #a855f7; box-shadow: 0 0 12px rgba(168, 85, 247, 0.7); }
.powerup-pickup.pp-freeze  { border-color: #38bdf8; box-shadow: 0 0 12px rgba(56, 189, 248, 0.7); }
.powerup-pickup.pp-intel   { border-color: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.7); }

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

/* -- Ticker ------------------------------------------------------------ */

.ticker {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-top: 1px solid var(--border);
    overflow: hidden;
    font-size: 0.82rem;
    color: var(--warn);
    height: 36px;
    flex-shrink: 0;
    z-index: 5;
}

.ticker-label {
    background: var(--miss);
    color: var(--bg);
    padding: 0.4rem 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    flex-shrink: 0;
    font-family: monospace;
}

.ticker-text {
    padding-left: 1rem;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
}

@keyframes ticker-scroll {
    from { transform: translateX(100vw); }
    to   { transform: translateX(-100%); }
}

/* -- End screen --------------------------------------------------------- */

#end-screen { align-items: center; justify-content: center; padding: 2rem 1rem; background: radial-gradient(ellipse at top, #1a1530 0%, #0a0f1c 60%, #0A0A0A 100%); }

.end-box {
    max-width: 640px;
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 2.5rem 2rem;
    text-align: center;
}

.end-headline {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    font-family: monospace;
}

.end-headline.fail { color: var(--miss); text-shadow: 0 0 8px rgba(248, 113, 113, 0.4); }
.end-headline.win  { color: var(--hit);  text-shadow: 0 0 8px rgba(74, 222, 128, 0.4); }

.end-flavour {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.6;
    font-style: italic;
}

.end-score-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.end-score {
    font-size: 3.2rem;
    color: var(--warn);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.end-stats {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    letter-spacing: 0.04em;
}

.end-actions { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }

.end-funnel {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: left;
}

.funnel-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

#end-academy-links { list-style: none; margin: 0; padding: 0; }
#end-academy-links li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
#end-academy-links li:last-child { border-bottom: none; }
#end-academy-links a { color: var(--silver); text-decoration: none; font-size: 0.88rem; }
#end-academy-links a:hover { color: var(--text-primary); }

.end-cta {
    margin-top: 1.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.end-cta a { color: var(--silver); }
.end-cta a:hover { color: var(--text-primary); }

@media (max-width: 720px) {
    .hud { font-size: 0.68rem; }
    .hud-score { font-size: 1.4rem; }
    .title { font-size: 2rem; }
    .target-grid { grid-template-columns: repeat(2, 1fr); }
    .target { width: 70px; }
    .player-anchor { width: 72px; right: 12px; }
    .player-callout { right: 12px; }
    .end-score { font-size: 2.4rem; }
    .rc-card { padding: 1.5rem 1.25rem; }
    .rc-headline { font-size: 1.4rem; }
    .round-intro { padding: 1rem 1.5rem; min-width: 220px; max-width: calc(100vw - 1.5rem); }
    .round-intro .ri-name { font-size: 1.3rem; }
    /* Drop the desktop 520px floor on mobile so the play-area is sized
       by `flex: 1` against the available viewport. Without this, the
       game-area total height (HUD ~150 + play 520 + ticker 36 = 706px)
       exceeded viewport on iPhone-class phones (~568-700px tall in
       portrait), forcing the page to scroll and pushing the HUD off
       the top of the screen during play. The HUD shows critical state
       (round / shots / hits / score) so losing it mid-round is a
       real-game failure mode. Carried as "game oversized on mobile"
       in the 2026-05-15 backlog. */
    .play-area { min-height: 0; }
}

/* iPhone SE / iPhone 6/7/8 / smaller Android (≤375px viewport).
   Tightens the game UI so nothing overflows the 375px safe area.
   Added 2026-05-14 — previously the only breakpoint was 720px,
   leaving a real gap for the most common small phone sizes. */
@media (max-width: 375px) {
    .hud { font-size: 0.62rem; gap: 0.4rem; }
    .hud-score { font-size: 1.2rem; }
    .title { font-size: 1.6rem; }
    .player-anchor { width: 60px; right: 8px; }
    .target { width: 60px; }
    .round-intro {
        padding: 0.85rem 1rem;
        min-width: 0;
        max-width: calc(100vw - 1rem);
    }
    .round-intro .ri-round { font-size: 0.65rem; letter-spacing: 0.15em; }
    .round-intro .ri-name { font-size: 1.1rem; }
    .round-intro .ri-prompt { font-size: 0.8rem; }
    .rc-card { padding: 1.2rem 1rem; }
    .rc-headline { font-size: 1.2rem; }
}
