/* IsGame — interface styles. § 1 mirrors the shared design system (/assets/ds/tokens.css of the portada repository);
   § 2 adds the game's neon colours. The game is always dark: the city lives at night. */

/* § 1 · brand tokens (same values as /assets/ds/tokens.css) */
@font-face { font-family: 'Allura'; src: url('../assets/fonts/allura-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('../assets/fonts/space-grotesk-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --ink-950: #0b1026; --ink-900: #0d1229; --ink-850: #121833; --ink-800: #1b2247; --ink-600: #2e3c74;
  --gold-600: #b58534; --gold-500: #c8953f; --gold-400: #e2b25c; --gold-300: #f2d18b;
  --cream-50: #fbf7ef; --mist-200: #c9cde3; --mist-300: #b9bdd3; --mist-500: #8d94b8;
  --on-gold: #1c1407;
  --success: #9fe0b4; --danger-soft: #ffb4a3;
  --radius: 18px; --radius-sm: 12px;
  --font-script: 'Allura', 'Snell Roundhand', cursive;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: .2s; --dur-base: .45s;

  /* § 2 · neon palette of Neo Academia */
  --neon-ia: #3fe0ff; --neon-data: #e2b25c; --neon-net: #a98bff; --neon-sec: #5dffa8; --neon-alert: #ff5c7a;
  --glass: rgba(11, 16, 38, .72); --glass-line: rgba(226, 178, 92, .28);
  --text: #eef0fa; --text-2: var(--mist-300);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink-950); color: var(--text); font-family: var(--font-sans); overflow: hidden; }
body { -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--gold-300); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }
body.pad-nav .pad-focus { outline: 2px solid var(--gold-400); outline-offset: 2px; }   /* gamepad: no :focus-visible without a key */

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.eyebrow { margin: 0; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-300); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 600; text-decoration: none; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), box-shadow var(--dur-fast); }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--on-gold); transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .45; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--glass-line); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold-400); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass); cursor: pointer; font-weight: 700; }

/* title and pause screens */
.screen { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: radial-gradient(90% 70% at 50% -10%, rgba(226, 178, 92, .12), transparent 60%), rgba(6, 9, 24, .55); overflow-y: auto; }
.screen-dim { background: rgba(6, 9, 24, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.boot-card { width: min(520px, 100%); text-align: center; display: grid; gap: .9rem; justify-items: center; padding: 2rem 1.5rem; border-radius: 28px; background: rgba(11, 16, 38, .62); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: rise var(--dur-base) var(--ease-out) both; }
.logo { margin: 0; font-weight: 400; line-height: .9; font-size: clamp(4rem, 16vw, 6.5rem); }
.logo-is { font-family: var(--font-script); color: var(--gold-400); text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.logo-game { font-family: var(--font-sans); font-weight: 700; letter-spacing: -.04em; font-size: .62em; color: var(--text); text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.boot-city { margin: -.3rem 0 0; display: grid; gap: .15rem; font-size: 1.1rem; font-weight: 500; letter-spacing: .02em; color: var(--gold-300); }
.boot-by { font-size: .9rem; font-weight: 400; letter-spacing: 0; color: var(--text-2); }
.boot-lead { margin: 0; color: var(--text-2); max-width: 38ch; line-height: 1.5; text-wrap: balance; }
.progress { width: 100%; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-600), var(--gold-300)); transition: width .3s var(--ease-out); }
#boot.ready .progress { display: none; }
#play { min-width: 220px; min-height: 52px; font-size: 1.05rem; }
.boot-status { margin: 0; font-size: .85rem; color: var(--text-2); min-height: 1.3em; }
.boot-options { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, .9fr) minmax(0, 1.3fr); gap: .8rem; width: 100%; }
.boot-options select { width: 100%; min-height: 44px; font-size: .9rem; }
.boot-options label { display: grid; gap: .3rem; font-size: .85rem; color: var(--text-2); text-align: left; }
select, input[type="text"] { min-height: 40px; padding: .4rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-line); background: rgba(13, 18, 41, .9); }
input[type="range"] { accent-color: var(--gold-400); width: 100%; }
.boot-hint { margin: 0; font-size: .85rem; line-height: 1.45; color: var(--mist-300); text-wrap: balance; }
.boot-error { margin: 0; color: var(--danger-soft); font-size: .95rem; line-height: 1.5; max-width: 42ch; }
.boot-error-detail { display: block; margin-top: .4rem; font-size: .8rem; color: var(--mist-300); word-break: break-word; }
#boot.failed .progress, #boot.failed #play, #boot.failed .boot-options, #boot.failed .boot-hint, #boot.failed #boot-status { display: none; }
.boot-foot { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; margin: 0; font-size: .85rem; }
.boot-foot a { text-decoration: none; opacity: .8; }

/* pause menu: one fixed-height card; only the panel scrolls, «Continuar» stays in view */
.menu-card { width: min(560px, 100%); height: min(680px, calc(100dvh - 32px)); grid-template-rows: auto auto minmax(0, 1fr) auto; gap: .8rem; padding: 1.1rem 1.25rem 1.1rem; text-align: left; justify-items: stretch; overflow: hidden; }
.menu-card h2 { margin: 0; text-align: center; font-family: var(--font-script); font-weight: 400; font-size: 2.3rem; line-height: 1; color: var(--gold-400); }
.menu-tabs { display: flex; gap: .35rem; justify-content: center; }
.tab { flex: none; min-height: 40px; padding: .45rem .85rem; border-radius: 99px; border: 1px solid var(--glass-line); background: transparent; cursor: pointer; font-size: .92rem; white-space: nowrap; }
.tab:hover { border-color: var(--gold-400); }
.tab[aria-selected="true"] { background: rgba(226, 178, 92, .18); border-color: var(--gold-400); color: var(--gold-300); }
.menu-body { overflow-y: auto; overscroll-behavior: contain; margin: 0 -.5rem; padding: .15rem .5rem .5rem; scrollbar-width: thin; scrollbar-color: var(--glass-line) transparent; }
.tab-panel { display: grid; gap: .9rem; align-content: start; }
.tab-panel label { display: grid; gap: .35rem; font-size: .85rem; color: var(--text-2); text-align: left; }
.tab-panel .hint { margin: 0; font-size: .85rem; color: var(--mist-200); }
.tab-panel .check { display: flex; align-items: center; gap: .65rem; min-height: 32px; font-size: .92rem; color: var(--text); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--gold-400); }
.tab-panel fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .85rem 1rem; margin: 0; padding: .75rem 1rem 1rem; border: 1px solid var(--glass-line); border-radius: var(--radius-sm); min-width: 0; }
.tab-panel legend { padding: 0 .4rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); }
.tab-panel fieldset .check, .tab-panel fieldset .wide { grid-column: 1 / -1; }
.range-row { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.range-row output { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab-panel input[type="range"] { height: 28px; margin: 0; cursor: pointer; }
.tab-panel select { width: 100%; }
.panel-foot { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.menu-sub { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); }
.menu-count { color: var(--text-2); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.menu-now { display: grid; gap: .3rem; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--glass-line); background: rgba(226, 178, 92, .07); }
.menu-objective { margin: 0; font-size: 1.02rem; line-height: 1.45; color: var(--text); }
.menu-district { margin: 0; font-size: .85rem; color: var(--text-2); }
.controls-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0; font-size: .92rem; }
.controls-list dt { color: var(--gold-300); font-family: var(--font-mono); font-size: .85rem; }
.controls-list dd { margin: 0; color: var(--text-2); }
.progress-list { list-style: none; margin: -.3rem 0 0; padding: 0; display: grid; gap: .4rem; font-size: .92rem; }
.progress-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .8rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .04); }
.progress-list li b { flex: none; color: var(--gold-300); }
.ach-details { display: grid; }
.ach-details summary { display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: .5rem .8rem; cursor: pointer; list-style: none; border-radius: var(--radius-sm); border: 1px solid var(--glass-line); }
.ach-details summary:hover { border-color: var(--gold-400); }
.ach-details summary::-webkit-details-marker { display: none; }
.ach-details summary::after { content: '▸'; margin-left: auto; color: var(--gold-300); font-size: 1.1rem; letter-spacing: 0; transition: transform var(--dur-fast) var(--ease-out); }
.ach-details[open] summary::after { transform: rotate(90deg); }
.ach-details summary:hover::after { color: var(--gold-300); }
.ach-details .progress-list { margin-top: .5rem; }
.ach-list li > span { display: grid; gap: .1rem; }
.ach-list small { font-size: .82rem; color: var(--text-2); line-height: 1.35; }
.ach-list li.locked strong { color: var(--text-2); font-weight: 500; }
.ach-list li.locked b { color: var(--mist-500); font-weight: 400; }
.danger-zone { display: grid; justify-items: start; gap: .6rem; padding-top: .4rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.btn-sm { min-height: 40px; padding: .45rem 1rem; font-size: .88rem; }
.btn-danger { background: transparent; border-color: rgba(255, 180, 163, .45); color: var(--danger-soft); }
.btn-danger:hover { border-color: var(--danger-soft); background: rgba(255, 180, 163, .08); }
.btn-danger-solid { background: var(--danger-soft); color: #2a0b04; }
.btn-danger-solid:hover { background: #ffc9bc; }
.confirm { display: grid; gap: .7rem; width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid rgba(255, 180, 163, .45); background: rgba(255, 180, 163, .06); }
.confirm p { margin: 0; font-size: .92rem; line-height: 1.45; }
.confirm-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.menu-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.menu-actions .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.menu-actions .btn-ghost { padding-inline: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: none; }
.hud-objective { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; max-width: min(360px, calc(100vw - 150px)); padding: .7rem 1rem; }
.hud-label { margin: 0 0 .15rem; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-300); }
#objective-text { margin: 0; font-size: .95rem; line-height: 1.35; }
.hud-timer { margin: .35rem 0 0; font-family: var(--font-mono); font-size: 1.15rem; color: var(--gold-300); }
.hud-timer.urgent { color: var(--danger-soft); font-weight: 700; }
.hud-map { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; padding: 6px; border-radius: 50%; width: 182px; height: 182px; }
#minimap { width: 100%; height: 100%; border-radius: 50%; display: block; }
.hud-district { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); margin: 0; white-space: nowrap; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.hud-counters { position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 214px); right: 14px; display: grid; gap: .35rem; justify-items: end; }
.chip { padding: .3rem .7rem; border-radius: 99px; background: var(--glass); border: 1px solid var(--glass-line); font-size: .8rem; font-variant-numeric: tabular-nums; }
.hud-speed { position: absolute; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); width: 150px; height: 150px; display: grid; place-items: center; }
.hud-speed canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-speed p { margin: 0; text-align: center; display: grid; line-height: 1; }
.hud-speed b { font-size: 2.4rem; font-variant-numeric: tabular-nums; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.hud-speed span { font-size: .75rem; letter-spacing: .2em; color: var(--text-2); }
.prompt { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); margin: 0; padding: .55rem 1rem; font-size: .95rem; white-space: nowrap; animation: rise var(--dur-fast) var(--ease-out) both; }
.prompt.in-car { bottom: max(18px, env(safe-area-inset-bottom)); }   /* below the car, not over it */
.prompt kbd { display: inline-block; min-width: 1.6em; padding: .05rem .4rem; margin-right: .45rem; border-radius: 6px; background: var(--gold-400); color: var(--on-gold); font-family: var(--font-mono); font-weight: 700; text-align: center; }
.toasts { position: absolute; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); display: grid; gap: .5rem; justify-items: center; width: min(460px, calc(100vw - 440px)); min-width: 240px; }
.toast { padding: .6rem 1rem; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--glass-line); font-size: .9rem; text-align: center; animation: toast 4.2s var(--ease-out) both; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.toast.good { border-color: rgba(93, 255, 168, .5); }
.toast.bad { border-color: rgba(255, 92, 122, .6); }
.fps { position: absolute; left: 70px; bottom: 14px; margin: 0; padding: .4rem .6rem; border-radius: 8px; background: rgba(0, 0, 0, .55); font: 11px/1.35 var(--font-mono); color: var(--success); }
.pause-btn { position: absolute; left: 14px; bottom: max(14px, env(safe-area-inset-bottom)); pointer-events: auto !important; }

/* waypoint: points at the current objective, pinned to the screen edge when it is off-screen */
.waypoint { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 2px; transform: translate(-50%, -50%); will-change: transform; }
.wp-arrow { width: 26px; height: 26px; background: var(--gold-400); clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.waypoint b { font: 600 .78rem var(--font-mono); color: var(--gold-300); text-shadow: 0 0 6px #000; }

/* high-contrast interface */
body.high-contrast { --glass: rgba(0, 0, 0, .92); --glass-line: rgba(255, 255, 255, .7); --text-2: #ffffff; }
body.high-contrast .glass, body.high-contrast .chip, body.high-contrast .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* full map and photo mode */
.bigmap-card { width: min(760px, 100%, calc(100dvh - 190px + 2rem)); padding: 1rem; display: grid; gap: .6rem; }
.bigmap-card header { display: flex; justify-content: space-between; align-items: center; }
.bigmap-card h2 { margin: 0; font-size: 1.2rem; }
#bigmap-canvas { width: min(100%, calc(100dvh - 190px)); height: auto; aspect-ratio: 1; justify-self: center; border-radius: var(--radius-sm); background: #070b1d; }   /* the whole card fits the screen */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.legend i.ring { background: none; border: 2px solid currentColor; }
.legend i.goal { width: 14px; height: 14px; border-width: 3px; }
.legend i.arrow { width: 11px; height: 12px; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%); }
.photo-bar { position: fixed; z-index: 15; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: .6rem; align-items: center; padding: .5rem .6rem .5rem 1rem; font-size: .85rem; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 24px); }
body.photo-mode #hud > :not(#toasts), body.photo-mode #touch { display: none !important; }   /* toasts stay: «Foto guardada» must be seen (the shot only takes the 3D canvas) */

/* touch controls */
#touch { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
.joy { position: absolute; left: max(22px, env(safe-area-inset-left)); bottom: max(70px, calc(env(safe-area-inset-bottom) + 56px)); width: 132px; height: 132px; border-radius: 50%; border: 1px solid var(--glass-line); background: rgba(11, 16, 38, .4); pointer-events: auto; touch-action: none; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-300), var(--gold-600)); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.touch-buttons { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(190px, calc(env(safe-area-inset-bottom) + 176px)); display: grid; gap: 14px; pointer-events: auto; }
.tbtn { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--glass-line); background: rgba(11, 16, 38, .55); font-size: 1.3rem; font-weight: 700; touch-action: none; }
.tbtn.active { background: rgba(226, 178, 92, .35); }

/* dialogue */
.dialog { position: fixed; z-index: 20; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); padding: 1rem 1.2rem 1.1rem; animation: rise var(--dur-base) var(--ease-out) both; }
.dialog header { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: .75rem; align-items: center; }
.dialog-avatar { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--mentor, var(--gold-300)); color: var(--ink-950); font-weight: 700; font-size: 1.05rem; line-height: 1; }
.dialog h2 { margin: 0; font-size: 1.15rem; line-height: 1.2; }
.dialog-role { grid-column: 2; font-size: .8rem; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; }
.dialog-step { grid-column: 3; grid-row: 1 / 3; align-self: start; font-size: .85rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dialog-text:focus { outline: none; }
.dialog-text { margin: .7rem 0 .9rem; font-size: 1.02rem; line-height: 1.55; min-height: 3.1em; white-space: pre-line; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { padding: .55rem .95rem; border-radius: 99px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .04); cursor: pointer; text-align: left; transition: border-color var(--dur-fast), background var(--dur-fast); }
.choice:hover, .choice:focus-visible { border-color: var(--gold-400); background: rgba(226, 178, 92, .12); }
.choice.primary { border-color: var(--gold-400); color: var(--gold-300); }
.dialog-form { display: flex; gap: .5rem; margin-top: .7rem; }
.dialog-form input { flex: 1; min-width: 0; }

/* cards */
.card-modal { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; background: rgba(6, 9, 24, .55); }
.card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 1.4rem 1.4rem 1.2rem; display: grid; gap: .7rem; animation: rise var(--dur-base) var(--ease-out) both; }
.card > * { min-width: 0; }   /* a long code line scrolls inside its <pre>, it never widens the card */
#card-body { display: grid; gap: .6rem; min-width: 0; }
.card h2 { margin: 0; font-size: 1.45rem; }
.card p { margin: 0; line-height: 1.55; color: var(--text-2); }
.card p.strong { color: var(--text); }
.card code, .card pre { font-family: var(--font-mono); }
.card pre { margin: 0; padding: .8rem 1rem; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .45); border: 1px solid var(--glass-line); color: #e8ecf8; font-size: .9rem; overflow-x: auto; white-space: pre; }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.card-actions .choice { flex: 1 1 100%; }
.card .badge { justify-self: start; padding: .25rem .7rem; border-radius: 99px; font-size: .78rem; background: rgba(93, 255, 168, .14); color: var(--success); border: 1px solid rgba(93, 255, 168, .35); }
.card .feedback { min-height: 1.4em; font-size: .9rem; }
.card .feedback.bad { color: var(--danger-soft); }
.card .feedback.good { color: var(--success); }
.card.fact { border-color: rgba(226, 178, 92, .45); }
.card p.aside { font-size: .9rem; color: var(--mist-300); }
.choice.right { border-color: rgba(159, 224, 180, .7); color: var(--success); background: rgba(159, 224, 180, .08); }
.choice.wrong { border-color: rgba(255, 180, 163, .6); color: var(--danger-soft); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.right) { opacity: .55; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise-centered { from { opacity: 0; transform: translate(-50%, 14px); } }
.dialog { animation-name: rise-centered; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.prompt { animation-name: none; }

/* medium widths: the centred toasts would run into the objective card, so they drop below it */
@media (min-width: 701px) and (max-width: 1240px) {
  .toasts { top: calc(max(14px, env(safe-area-inset-top)) + 122px); width: min(460px, calc(100vw - 340px)); }
}
@media (max-width: 700px) {
  .boot-options { grid-template-columns: 1fr 1fr; }
  .boot-options label:last-child { grid-column: 1 / -1; }
  .hud-objective { max-width: calc(100vw - 150px); padding: .55rem .8rem; }
  #objective-text { font-size: .85rem; }
  .hud-map { width: 116px; height: 116px; padding: 4px; }
  .hud-district { bottom: -22px; font-size: .7rem; left: auto; right: 0; transform: none; letter-spacing: .12em; }   /* flush with the minimap, never past the screen edge */
  .fps { left: 14px; }   /* the pause button lives on the right on phones */
  .hud-counters { top: calc(max(14px, env(safe-area-inset-top)) + 146px); }
  .hud-speed { width: 112px; height: 112px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .hud-speed b { font-size: 1.7rem; }
  .toasts { width: calc(100vw - 32px); top: auto; bottom: 46%; }
  .dialog { padding: .8rem .9rem .9rem; }
  .dialog-text { font-size: .95rem; }
  .pause-btn { left: auto; right: 14px; top: calc(max(14px, env(safe-area-inset-top)) + 262px); bottom: auto; }
  .prompt { bottom: 34%; }
  .prompt.in-car { bottom: 25%; }   /* between the car and the joystick */
  .menu-card { padding: .9rem .9rem 1rem; }
  .menu-tabs { justify-content: flex-start; overflow-x: auto; margin: 0 -.9rem; padding: 0 .9rem 2px; scrollbar-width: none; scroll-padding-inline: .9rem; }
  .menu-tabs::-webkit-scrollbar { display: none; }
  .menu-tabs.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
  .menu-tabs.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
  .menu-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
  .menu-actions .btn-primary { flex: 1 1 auto; }
  .menu-actions .btn-ghost { flex: 0 1 auto; padding-inline: .85rem; font-size: .85rem; font-weight: 500; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
