/* Brush Pass — "field dossier" theme.
 *
 * Design direction: a Cold War-era case file, not a neon spy-thriller HUD.
 * Aged paper for the canvas, dark stamped-ink panels for structure/controls,
 * brass hardware for accents. Two type families do two different jobs:
 * monospace ("typewriter") for short UI chrome — titles, buttons, labels,
 * tabs, numbers — and a serif for anything meant to be *read*, like the
 * activity feed and field-report entries, so it feels like typed prose in a
 * report rather than app UI.
 *
 * Every color pair below was chosen against computed WCAG contrast ratios
 * (not eyeballed) — see the comments next to each variable. Token/HQ colors
 * additionally always carry a dark ink border and a non-color cue (a letter
 * symbol, a flag, a name) so color is never the only way to tell two things
 * apart.
 */
:root {
  /* Canvas: aged paper. */
  --paper: #e8dfc4;
  --paper-elevated: #ddd0af;
  --paper-dim: #c9bb95; /* secondary text ON dark ink panels, 8.36:1 */

  /* Dark "stamped ink" panels: topbar, action bar, modal, node pins. */
  --ink-panel: #2b2013;
  --ink-elevated: #3a2c19;

  /* Text on paper. */
  --ink: #241b10;      /* primary text on paper, 12.74:1 */
  --ink-dim: #5c4d33;   /* secondary text on paper, 6.15:1 */

  /* Text on dark ink panels. */
  --text: var(--paper);       /* 11.97:1 on --ink-panel */
  --text-dim: var(--paper-dim);

  /* Brass accents. */
  --accent: #7d4f0c;         /* accent text/links on paper, 5.27:1 */
  --accent-strong: #c99a3f;  /* decorative fill (buttons, glow) — pairs with dark ink text, 6.60:1 */
  --accent-border: #8f6a1f;  /* accent used as a border/ring, 3.22–3.71:1 */

  --danger: #8c2f2f;   /* 6.16:1 on paper, 4.36:1 on ink-panel */
  --success: #2f5f30;  /* 5.64:1 on paper */
  --success-border: #4f9e52; /* 4.81:1 on ink-panel, for glow rings on dark node pins */

  /* Player/HQ colors — always paired with a dark ink border + a name/flag,
     never the sole cue. Each verified >=3:1 against paper. */
  --gold: #8f6208;
  --crimson: #a3313c;
  --teal: #1f7a72;
  --violet: #6a4e9c;
  /* Round 35: added for the not-yet-registered "1776 -- Culper Ring" board
     (see src/engine/boards/culperRing.js) -- its French HQ (Newport) needed
     a 5th HQ color distinct from the 4 above. Picked to sit at the same
     rough darkness/saturation as its siblings (a muted "royal/French
     blue"), matching their >=3:1-on-paper intent, though it hasn't been
     run through the same measured contrast pass those 4 got -- worth a
     real check before this board ever goes live. */
  --blue: #2f5a94;

  --line: #8a7550; /* borders on paper, 3.33:1 */

  --radius: 10px;
  --font-mono: "Courier New", Courier, ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  font-family: var(--font-mono);
}

* { box-sizing: border-box; }

/* Round 52.1 (2026-09-22): "Larger text" (Settings → Text). Every size in
   this file is in rem, so scaling the root scales the lot; node pins and
   tokens are px-sized on purpose and keep their footprint on the board. */
html[data-text="large"] { font-size: 112.5%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}
/* Deliberately no `height: 100%` here (Round 15 fix) — #app's own
   `min-height: 100vh` below already guarantees the page is at least a full
   screen tall, and a *fixed* height:100% on both html and body was making
   <body> its own independent scroll container whenever #app's content grew
   taller than one screen (a definite-height box with overflowing content
   creates a new scroll context, and Chromium doesn't always propagate that
   up to the viewport the way you'd expect). That meant `window.scrollTo()`
   — used to reset scroll position on screen changes, see app.js's
   `resetScrollIfNewView` — silently did nothing, since it only touches the
   viewport's scroll position, not a nested <body> scrollTop. Letting body's
   height stay auto (grows to fit its content, same as any normal element)
   keeps there being exactly one scroll container — the viewport — so
   scrollTo() actually reaches it. */


/* Faint aged-paper texture: layered radial gradients (Round 9), plus a
   local dossier-art SVG layer (Round 12, assets/bg-dossier.svg — grid
   lines, loose continent shapes, redaction bars, an "EYES ONLY" stamp,
   all baked in at very low opacity in the SVG itself). Still a single
   local, dependency-free asset — no CDN, no external fonts/images — same
   philosophy as the gradients it sits alongside. */
body {
  background-image:
    radial-gradient(circle at 20% 15%, rgba(139, 115, 66, 0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(139, 115, 66, 0.07), transparent 45%),
    radial-gradient(circle at 50% 95%, rgba(139, 115, 66, 0.06), transparent 50%),
    url("assets/bg-dossier.svg");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, auto, cover;
  background-position: 0 0, 0 0, 0 0, center;
  background-attachment: fixed, fixed, fixed, fixed;
}

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

/* ---------- Round 27: screen-specific cinematic backgrounds ----------
   Neal supplied an asset pack (see design/GDD.md's Round 27 entry) with a
   photo-real "cluttered spy desk" background per screen, extracted from a
   single generated contact sheet and cropped clean here (captions/bleed
   removed — see the note in the same GDD entry on why every file in that
   pack needed real cleanup before use). These sit ON TOP of the existing
   body texture above, scoped to specific screens via a modifier class, so
   every screen that doesn't opt in (modals, in-game panels, etc.) is
   completely unaffected — the aged-paper canvas is still the default.
   Every foreground surface (`.setup-card`, `.banner`, node buttons) already
   has its own opaque background per the file's WCAG-verified palette, so
   the only thing these new backgrounds can affect is text that sits
   directly on the screen with no card behind it (title/tagline/tutorial
   nudge) — `.has-photo-bg` brightens exactly those and adds a dark vignette
   so they stay legible over a busy photo, per the pack's own guidance
   ("never let scenery sit directly behind important labels"). */
.has-photo-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.has-photo-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,10,4,0.6) 0%, rgba(15,10,4,0.28) 32%, rgba(15,10,4,0.62) 100%);
  pointer-events: none;
}
.has-photo-bg > * { position: relative; z-index: 1; }
.has-photo-bg .brand-title { color: var(--accent-strong); text-shadow: 0 2px 8px rgba(0,0,0,0.85); }
.has-photo-bg .brand-tag,
.has-photo-bg .tutorial-nudge { color: var(--paper-dim); text-shadow: 0 1px 5px rgba(0,0,0,0.85); }
/* Round 36 follow-up: Neal — "hard to read the name with the dark text over
   the dark background." .home-identity-name/.link-btn had no color rule of
   their own, so on the photo-backed home screen they fell back to the
   normal (dark-ink) text color meant for opaque cards, same failure mode
   .brand-tag/.tutorial-nudge above were already fixed for. */
.has-photo-bg .home-identity-name { color: var(--paper-dim); text-shadow: 0 1px 5px rgba(0,0,0,0.85); }
.has-photo-bg .home-identity-row .link-btn { color: var(--accent-strong); text-shadow: 0 1px 5px rgba(0,0,0,0.85); }
.has-photo-bg.win-screen h1 { color: var(--accent-strong); text-shadow: 0 2px 8px rgba(0,0,0,0.85); }
.has-photo-bg.win-screen p { color: var(--paper-dim); text-shadow: 0 1px 5px rgba(0,0,0,0.85); }

.bg-menu   { background-image: url("assets/img/backgrounds/bg-menu.jpg"); }
.bg-setup  { background-image: url("assets/img/backgrounds/bg-setup.jpg"); }
.bg-lobby  { background-image: url("assets/img/backgrounds/bg-lobby.jpg"); }
.bg-victory { background-image: url("assets/img/backgrounds/bg-victory.jpg"); }
.bg-defeat  { background-image: url("assets/img/backgrounds/bg-defeat.jpg"); }

button {
  font-family: inherit;
  cursor: pointer;
}

/* Visible, high-contrast keyboard focus ring everywhere (mouse/touch users
   never see it, since it's the default focus-visible behavior). */
button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-border);
  outline-offset: 2px;
}

/* Screen-reader-only content — visually hidden but still reachable by
   assistive tech, unlike display:none/visibility:hidden which hide it from
   both. Used for the persistent aria-live announcer app.js appends to
   <body> at module load (see that file's own comment on it for why it has
   to live outside render()'s rebuilt DOM tree). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Splash screen (Round 14) ---------- */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  animation: splash-fade-in 0.4s ease both;
}

/* ---------- Opening intro sequence (Round 21) ----------
   A short "opening a case file" beat in front of the original splash
   content: a folder icon drops in, a TOP SECRET stamp slams onto it, then
   the whole stage fades away to reveal .splash-content underneath. Timings
   here are cross-referenced with app.js's renderSplashScreen() JS comment
   (the sound-cue setTimeout offsets) and SPLASH_AUTO_DISMISS_MS — keep all
   three in sync if any of this is retimed. .intro-stage sits absolutely
   positioned over .splash-content (both centered the same way inside the
   flex .splash-screen), so the folder appears to sit exactly where the
   title will end up, then gets out of the way rather than the layout
   visibly jumping between the two. */
.intro-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* .splash-screen itself already handles tap-anywhere-to-skip */
  animation: intro-stage-exit 0.4s ease forwards;
  animation-delay: 1.55s;
}
.intro-folder-svg {
  width: min(220px, 55vw);
  height: auto;
  opacity: 0;
  transform: translateY(-36px) scale(0.85);
  animation: intro-folder-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.3s;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}
.intro-stamp {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.05rem, 5vw, 1.5rem);
  letter-spacing: 0.12em;
  color: var(--danger);
  border: 3px solid var(--danger);
  border-radius: 6px;
  padding: 6px 14px;
  opacity: 0;
  transform: rotate(-10deg) scale(2.4);
  animation: intro-stamp-slam 0.22s ease-out forwards;
  animation-delay: 0.95s;
}
@keyframes intro-folder-drop {
  0% { opacity: 0; transform: translateY(-36px) scale(0.85); }
  70% { opacity: 1; transform: translateY(4px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes intro-stamp-slam {
  0% { opacity: 0; transform: rotate(-10deg) scale(2.4); }
  60% { opacity: 1; transform: rotate(-10deg) scale(0.92); }
  100% { opacity: 1; transform: rotate(-10deg) scale(1); }
}
@keyframes intro-stage-exit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9) translateY(-8px); }
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  animation: splash-content-in 0.5s ease forwards;
  animation-delay: 1.7s;
}
@keyframes splash-content-in {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}
.splash-title {
  font-family: var(--font-mono);
  font-size: 3rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0;
  text-transform: uppercase;
}
.splash-tag {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
  margin: 0 0 16px;
  font-size: 1.05rem;
}
.splash-portraits {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
/* Round 27: operativePortraitIcon() now renders an <img> (real portrait
   photo) instead of an SVG sprite in the normal case, falling back to the
   old sprite only on load failure. object-fit keeps the ~768x732 source
   photos from stretching/squishing at the small square sizes every call
   site requests; this rule is harmless on the SVG fallback (object-fit is
   simply a no-op there). */
.operative-portrait {
  object-fit: cover;
  object-position: center;
  display: block;
}
.splash-portraits .operative-portrait {
  border-radius: 8px;
  opacity: 0;
  transform: translateY(10px);
  animation: splash-portrait-in 0.5s ease forwards;
}
.splash-portraits .operative-portrait:nth-child(1) { animation-delay: 1.95s; }
.splash-portraits .operative-portrait:nth-child(2) { animation-delay: 2.1s; }
.splash-portraits .operative-portrait:nth-child(3) { animation-delay: 2.25s; }
.splash-portraits .operative-portrait:nth-child(4) { animation-delay: 2.4s; }
.splash-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  animation: splash-fade-in 0.6s ease forwards;
  animation-delay: 2.6s;
}
@keyframes splash-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes splash-portrait-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Setup screen ---------- */

.setup-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 48px;
  text-align: center;
  gap: 18px;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0;
  text-transform: uppercase;
}

.brand-tag {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
  margin: -8px 0 12px;
  font-size: 1rem;
}

.setup-card {
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 6px 16px rgba(36,27,16,0.15);
}

.setup-card h2 {
  font-size: 0.95rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
}

.option-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.pill-btn {
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.pill-btn.selected {
  background: var(--ink-panel);
  border-color: var(--ink-panel);
  color: var(--accent-strong);
  font-weight: 700;
}

.opponent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}
.opponent-row:first-child { border-top: none; }
.opponent-row span { font-family: var(--font-serif); font-size: 1rem; }

.opponent-row select,
.opponent-row input[type="text"] {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 40px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.opponent-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.opponent-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

label.opponent-row {
  cursor: pointer;
  text-align: left;
}
label.opponent-row span { flex: 1; }

/* Round 17: the board picker (solo setup + online room creation) shows a
   one-line description of whichever board is currently selected, below its
   row of pill buttons — same treatment as .tutorial-nudge below, so it reads
   as a quiet hint rather than competing with the picker itself. */
.board-picker-desc {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
  font-size: 0.88rem;
  margin: -6px 0 14px;
  text-align: center;
}

/* Round 41 follow-up: boards past the 2 free starters cost Credits (see
   src/shop/boardUnlocks.js) — a locked pill dims exactly like
   .campaign-operation.locked already does elsewhere, so "locked" reads the
   same way everywhere in the app rather than inventing a second visual
   language for it. */
.pill-btn-locked {
  opacity: 0.6;
}
.board-unlock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 14px;
}
.board-unlock-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
}
.board-unlock-row .secondary-btn {
  width: auto;
  min-width: 0;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.8rem;
  margin-top: 0;
}
.board-unlock-row .secondary-btn:disabled {
  opacity: 0.5;
}

/* Round 61: Cold War Files story maps in the ordinary board picker. */
.pill-btn-story {
  border-color: var(--gold, #c9a227);
}
.board-story-tag,
.board-story-hint {
  font-size: 0.8rem;
  color: var(--ink-dim);
  text-align: center;
  margin: -8px 0 12px;
}
.board-story-tag {
  color: var(--gold, #c9a227);
  font-weight: 600;
}

/* Online multiplayer room code — large, spaced-out, easy to read aloud or
   type on another device. Reuses the same ink-panel/gold-on-dark treatment
   as other "important chrome" elements (topbar, action bar) for contrast
   verified the same way (see offbook-theme.md, kept as the internal memory filename). */
.room-code-display {
  background: var(--ink-panel);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  border-radius: var(--radius);
  padding: 14px 10px 14px 18px; /* extra left padding to visually re-center given the right-heavy letter-spacing */
  margin-bottom: 14px;
}

.primary-btn {
  background: var(--ink-panel);
  color: var(--accent-strong);
  border: 1.5px solid var(--ink-panel);
  border-radius: 10px;
  padding: 15px 20px;
  min-height: 48px;
  font-size: 1.05rem;
  font-weight: 700;
  width: 100%;
  margin-top: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.primary-btn:disabled { opacity: 0.5; }

/* Round 44: a mode-select entry for content that exists but can't be
   opened yet — today just the "1776 — Culper Ring" paid pack, greyed out
   while its art is still in production (see shop/expansions.js).
   Deliberately still legible rather than dimmed into the background: the
   point of showing a locked pack at all is that a player reads what's
   coming, so this sits at a lighter opacity than .primary-btn:disabled's
   flat 0.5, keeps the full-width shape of the buttons around it, and adds
   a dashed border so "not available" reads structurally and not by color
   alone. The disabled attribute is what actually blocks interaction — the
   styling here never carries that on its own. */
.primary-btn.locked-btn:disabled {
  /* Transparent, so the paper card underneath shows through — which makes
     the ON-PAPER text tokens the right ones here, NOT the on-dark ones the
     enclosing .primary-btn uses (its own label is --accent-strong because
     it sits on a dark --ink-panel fill). --ink-dim is the documented
     "secondary text on paper" token at 6.15:1; --paper-dim would be light
     text on a light ground. Deliberately no `opacity` either: dimming the
     whole button would drag both of those ratios back down, and the dashed
     border plus the muted ink already carry "unavailable" without it.
     This has to override .primary-btn:disabled's own `opacity: 0.5`
     EXPLICITLY — simply omitting the property here leaves that 0.5 in
     force and silently halves both contrast ratios above. */
  opacity: 1;
  background: transparent;
  border-style: dashed;
  border-color: var(--accent-border);
  color: var(--ink-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.locked-btn-note {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* --accent (5.27:1 on paper), not --accent-strong — the latter is
     documented as a decorative FILL that pairs with dark ink text, and
     reads washed out when used as text on paper. */
  color: var(--accent);
}

/* Round 23: layers on top of .primary-btn for a genuinely irreversible
   confirm action (standing down) — same shape/size, just recolored toward
   --danger so it visually reads differently from an ordinary confirm. */
.danger-btn {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.secondary-btn {
  background: transparent;
  color: var(--ink-dim);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  min-height: 44px;
}

/* ---------- Game screen ---------- */

.game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  /* Notched phones (viewport-fit=cover in index.html lets content draw
     under the notch/status bar) — keep the topbar's own content clear of
     it rather than letting the title/buttons sit underneath. */
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--ink-panel);
  border-bottom: 3px double var(--accent-border);
  gap: 8px;
}

.topbar .title {
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.08em;
  font-size: 1.15rem;
  text-transform: uppercase;
}

.turn-indicator {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.help-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-border);
  background: var(--ink-panel);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  /* Round 37: Neal's feedback — the in-game Settings gear specifically
     (an <img> icon, the only .help-btn whose sole content is an icon —
     see uiIcon()) looked off-center/cut off. This button relied on
     default button/text baseline alignment, which happens to look right
     for a text/emoji label ("←", "?", "🏳", "Exit") but not for an <img>
     dropped in as the only child. Real flex centering fixes the icon case
     without changing how any text/emoji .help-btn already looks. */
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-btn:hover, .help-btn:focus-visible {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px var(--accent-strong) inset;
}

/* Round 23: layers on .help-btn for the in-game "Stand Down" (forfeit)
   icon — a subtle --danger tint on the border/text only, so it's
   distinguishable from Settings/Help at a glance without shouting (the
   real confirmation happens in the modal, not via alarming button color). */
.stand-down-btn {
  border-color: var(--danger);
  color: var(--danger);
}

/* Round 22: a top-left "back" button for the Solo Setup / online
   Join-Host / online waiting-room sub-screens, replacing a full-width
   button that used to sit at the very bottom of each card (easy to miss,
   and not the conventional spot). Reuses `.help-btn`'s round-icon look.
   Deliberately laid out IN-FLOW (a real row at the top of the screen, not
   position: fixed floating over the title) — a fixed-position version was
   tried first and its 42px corner square visibly collided with the
   "BRUSH PASS" wordmark on narrow phones (caught via a Playwright
   bounding-box check at 320px width before shipping); an in-flow row
   naturally pushes the title down instead of overlapping it, at any
   width. */
.setup-topbar {
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: flex-start;
  margin-bottom: -6px;
}
.screen-back-btn {
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  touch-action: manipulation;
}

.player-strip {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: var(--paper-elevated);
  border-bottom: 1px solid var(--line);
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 36px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.player-chip.active {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border) inset;
  background: var(--paper-elevated);
}

/* Round 19: an AI's active turn gets a louder, pulsing highlight instead of
   the plain "active" treatment above — real playtesting feedback was that
   whose turn it is (especially an AI's) wasn't clear enough at a glance. */
.player-chip.ai-active {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px var(--accent-strong) inset;
  animation: ai-active-pulse 1.3s infinite ease-in-out;
}
@keyframes ai-active-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-strong) inset; }
  50% { box-shadow: 0 0 0 2px var(--accent-strong) inset, 0 0 8px 1px var(--accent-strong); }
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}
.color-dot.gold { background: var(--gold); }
.color-dot.crimson { background: var(--crimson); }
.color-dot.teal { background: var(--teal); }
.color-dot.violet { background: var(--violet); }
.color-dot.blue { background: var(--blue); }

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 14px 4px;
  background: var(--paper);
  border-bottom: 1px dashed var(--line);
}
/* Round 81: the feed opens the Field Report (see renderActivityFeed). The
   "Full report ›" tag sits on its own line, right-aligned, so it never
   steals width from the move text itself. */
.activity-feed.tappable { cursor: pointer; -webkit-tap-highlight-color: rgba(201, 154, 63, 0.2); }
.activity-feed.tappable:active { background: var(--paper-elevated); }
.activity-more {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}
.activity-entry {
  font-family: var(--font-serif);
  font-size: 0.9rem; /* Round 52.1: was 0.8rem */
  color: var(--ink-dim);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-entry.latest {
  opacity: 1;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem; /* Round 52.1: was 0.86rem */
}
.activity-entry.skip {
  color: var(--danger);
  opacity: 1;
}

/* A player who just lost a challenge gets this badge on their chip in the
   always-visible player strip, from the moment the skip is scheduled until
   it's actually consumed — see renderPlayerStrip's comment for why this
   needed to be persistent rather than just a log line. */
.player-chip.skip-pending {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger) inset;
}
.skip-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem; /* Round 52.1: was 0.62rem */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--danger);
  background: rgba(140, 47, 47, 0.15);
  border: 1px solid var(--danger);
  border-radius: 999px;
  padding: 2px 6px;
  white-space: nowrap;
}

.board-wrap {
  position: relative;
  /* Round 81 (tester Dan Nilles, 2026-10-13): the briefcase marker
     (z-index 45) and a selected spy pin (40) were competing with modals
     (20) and the dossier popup (30) in the page-wide stacking order, so
     the case drew on top of a tutorial card's text. Isolating the board
     keeps every z-index inside it local — the board as a whole stays
     under any popup. Nothing inside the board is position: fixed. */
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 62vh;
  margin: 8px auto 0;
  background: var(--paper);
}

/* Round 27: the "Operations Table" background from Neal's asset pack,
   applied specifically to the game board per the pack's own recommended
   v1 order (this was step 1). The pack explicitly calls out that gameplay
   should use the quietest image with the board's center kept low-contrast
   and empty — the cropped source image already has a naturally dark,
   quiet center (desk clutter only around the edges), so the darkening
   overlay here is lighter than the menu/setup screens' — just enough to
   guarantee the road lines and node pins (both already opaque/high-contrast
   by themselves) never fight with a bright patch of the underlying photo. */
.board-wrap.has-board-photo-bg {
  background-image:
    radial-gradient(ellipse at center, rgba(10,7,3,0.35) 0%, rgba(10,7,3,0.55) 100%),
    url("assets/img/backgrounds/bg-board.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Round 43: an equipped Board Theme replaces the photo above outright
   (Neal's call — see renderBoard() in app.js for the full reasoning).
   The actual gradient/image is set inline per-item from catalog.js's
   `swatch`, so this class only carries what's true for EVERY theme: the
   same --paper base showing through if a swatch ever fails to resolve,
   and the same sizing the photo rule uses. Deliberately a separate class
   rather than reusing .has-board-photo-bg with an override, so "is this
   board wearing the default photo or a purchased theme" is answerable
   from the DOM at a glance. */
.board-wrap.has-board-theme {
  background-repeat: no-repeat;
}
/* Round 59: The Cold War Files' own map backdrops (assets/cw/*.svg). */
.board-wrap.has-board-story-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* A faint diagonal "CLASSIFIED" watermark behind the board — decorative
   only (very low opacity, never touches text contrast), pointer-events
   disabled so it never intercepts taps. */
.board-wrap::before {
  content: "CLASSIFIED";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14vw;
  letter-spacing: 0.1em;
  color: var(--ink);
  opacity: 0.045;
  transform: rotate(-24deg);
  pointer-events: none;
  user-select: none;
}

.board-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.node-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid var(--accent-border);
  background: radial-gradient(circle at 35% 30%, var(--ink-elevated), var(--ink-panel) 75%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1px;
  box-shadow: 0 1px 2px rgba(36,27,16,0.4);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.node-btn .node-glyph {
  font-size: 0.85em;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
  pointer-events: none;
}
.node-btn .node-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  font-family: var(--font-mono);
  /* Round 52.1: was 0.62rem (10px) in --ink-dim over the photo board —
     Play testing feedback (Riley, Peter Wilton): "small text", "text hard
     to see". Bigger, full-ink, and a paper halo so it reads on any patch
     of the background. */
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  /* Round 55: Neal found the R52 halo "a bit blurry… with the outline and
     bolder". The two blurred layers are gone; what's left is a crisp
     one-pixel paper edge on four sides, and the weight is back to 600. */
  text-shadow: 1px 0 0 var(--paper), -1px 0 0 var(--paper), 0 1px 0 var(--paper), 0 -1px 0 var(--paper);
  /* Round 67 (2026-09-27): tester George Gray — "the names of the spies and
     locations are hard to read with the color/font chosen." Outlined thin
     typewriter letters straight on a textured board were the third try at
     this (R52 halo, R55 crisp edge). Map-style label chips instead: a dark
     tag behind every name, light text, a plain sans-serif (Courier New
     isn't on Android anyway, so phones were getting a fallback mono), no
     outline. Reads the same on the desk photo, every board theme and every
     Cold War map backdrop. */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: #f6eed6;
  background: rgba(24, 17, 9, 0.8);
  border-radius: 5px;
  padding: 1px 5px 2px;
  text-shadow: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
/* Round 52.1: nodes on the board's edge hang their label inward so it
   stays on screen (see renderBoard's edge-left/edge-right classes). */
/* Round 55: the inner ring is where labels cram ("Marseilles" into the
   hub, Copenhagen against Exchange) — a touch smaller there only. */
.node-btn.inner .node-label { font-size: 0.66rem; }
.node-btn .node-label.edge-right { left: auto; right: -4px; transform: none; }
.node-btn .node-label.edge-left { left: -4px; transform: none; }
/* Round 24 playtest feedback: "The Headquarters should be a different shape
   and size than the other cities. Likewise the center exchange/starting
   area needs to be a different shape such as an octagon or hexagon." Every
   node used to be a plain circle differing only by size — .hub and .hq now
   get real distinct silhouettes instead, on top of their existing size/
   color treatment. */
.node-btn.hub {
  width: 48px;
  height: 48px;
  font-weight: 700;
  /* The shape/background/border/shadow all move to ::before below instead
     of living on the button itself — verified empirically (a throwaway
     Playwright screenshot) that clip-path on the button clips EVERYTHING
     painted by it, including the node-label child below, which is
     positioned outside the button's own box via top:100%. A separate
     ::before layer gets clipped to the octagon; the button's real children
     (glyph, label) are untouched and paint on top of it normally. */
  background: none;
  border: none;
  box-shadow: none;
}
.node-btn.hub::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 35% 30%, #4a3a22, var(--ink-panel) 75%);
  border: 2px solid var(--accent-strong);
  box-shadow: 0 1px 2px rgba(36,27,16,0.4);
  /* A regular octagon inscribed in the square box — Neal's own suggestion
     ("such as an octagon or hexagon"). clip-path rather than border-radius
     since no polygon this angular is achievable with rounded corners alone.
     Left un-rounded (sharp vertices) so it doesn't read as just a fancy
     circle from a glance — it's the one node on the board meant to look
     structurally different, matching its role as the single shared center
     every HQ radiates out from. */
  clip-path: polygon(29.3% 0%, 70.7% 0%, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0% 70.7%, 0% 29.3%);
}
.node-btn.hub .node-glyph { font-size: 1.1rem; color: var(--accent-strong); position: relative; }
.node-btn.inner { width: 30px; height: 30px; }
.node-btn.inner .node-glyph { font-size: 0.82rem; }
.node-btn.corner { width: 27px; height: 27px; }
.node-btn.corner .node-glyph { font-size: 0.74rem; }
.node-btn.outer { width: 24px; height: 24px; }
.node-btn.outer .node-glyph { font-size: 0.66rem; }
/* Round 75: Outpost's cities are drawn larger — its pinwheel layout has the
   room (keep in step with NODE_SIZE_PX_BY_LAYOUT in app.js). */
.layout-outpost .node-btn.inner { width: 36px; height: 36px; }
.layout-outpost .node-btn.inner .node-glyph { font-size: 1rem; }
.layout-outpost .node-btn.outer { width: 32px; height: 32px; }
.layout-outpost .node-btn.outer .node-glyph { font-size: 0.9rem; }
.node-btn.hq {
  /* Bumped up from 38px — bigger than every plain city, on par with the
     hub — plus a rounded-square "badge/crest" silhouette instead of a
     circle. Deliberately NOT clip-path (unlike .hub above): HQ nodes carry
     an owner-color ring/glow (see renderBoard() in app.js) including an
     outward bloom for the player's own HQ, and clip-path clips box-shadow
     to the same path — it would truncate that glow right at the shape's
     edge instead of letting it bloom outward. border-radius has no such
     issue and still reads as clearly non-circular. */
  width: 44px;
  height: 44px;
  font-weight: 700;
  border-width: 2px;
  border-radius: 22% / 22%;
  background: radial-gradient(circle at 35% 30%, #4a3418, var(--ink-panel) 75%);
}
.node-btn.hq .node-glyph { font-size: 0.98rem; }
.node-btn.legal-target { border-color: var(--success-border); box-shadow: 0 0 0 3px rgba(79,158,82,0.4); }
.node-btn.legal-target .node-label { color: #ffffff; background: rgba(28, 110, 58, 0.92); font-weight: 700; }

/* Round 19: the player's own HQ gets an explicit "HOME" tag above the node
   (the node-label with the city name already sits below it — see
   .node-btn .node-label above), on top of the brighter glow set inline in
   app.js's renderBoard(). Real playtesting feedback was that a colored ring
   alone wasn't enough to identify your own base at a glance. */
.my-hq-badge {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 3px;
  background: var(--accent-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.6rem; /* Round 52.1: was 0.5rem */
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.operative-token {
  position: absolute;
  /* Round 69: a map pin standing on its city (see PIN_TRANSFORM in
     app.js — keep the two in step). Was a 32px circle centred on the city,
     which read as one more city and hid the city's flag. The pin's tip sits
     at the top of the city; --fan tilts pins that share a city apart around
     their tips. */
  transform: translate(-50%, calc(-100% - var(--pin-lift, 10px))) rotate(var(--fan, 0deg));
  transform-origin: 50% calc(100% + var(--fan-pivot, 0px)); /* R69.1: card-fan pivot below the tip */
  width: 26px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
  --op-color: var(--accent-strong);
}
.operative-token .spy-pin {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.operative-token .spy-pin-body { fill: var(--op-color); stroke: var(--ink); stroke-width: 2.5; }
.operative-token .spy-pin-shine { fill: rgba(255, 255, 255, 0.38); }
.operative-token .spy-pin-symbol {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 26px; /* the pin's round head (the path's circle is at y 16 of 44) */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}
/* R69.1: in a fanned hand the symbol stays upright so it reads easily. */
.operative-token .spy-pin-symbol { rotate: calc(-1 * var(--fan, 0deg)); }
.operative-token.wide-symbol .spy-pin-symbol { font-size: 0.6rem; letter-spacing: -0.02em; }
/* Round 69 (Neal: "Sometimes it is hard for me to tell which spy I
   selected"): the old dark outline was nearly invisible on the dark
   cities. Now a bright gold glow, and the pin stands a little taller. */
.operative-token.selected {
  scale: 1.14;
  z-index: 40 !important;
  filter: drop-shadow(0 0 2px #ffd54a) drop-shadow(0 0 5px #ffd54a) drop-shadow(0 0 9px rgba(255, 213, 74, 0.8));
  animation: spy-pin-selected 1.6s ease-in-out infinite;
}
@keyframes spy-pin-selected {
  50% { filter: drop-shadow(0 0 1px #ffd54a) drop-shadow(0 0 3px #ffd54a) drop-shadow(0 0 5px rgba(255, 213, 74, 0.55)); }
}
@media (prefers-reduced-motion: reduce) {
  .operative-token.selected { animation: none; }
}
.operative-token.carrying .spy-pin-body {
  /* Round 69: a gold rim on the pin (was a gold ring round the circle). */
  stroke: var(--accent-strong);
  stroke-width: 3.2;
}
.operative-token.carrying::after {
  content: "";
  position: absolute;
  top: -5px; /* Round 69: hugging the pin's head (was -14/-10 off a circle) */
  right: -9px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent-strong) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="2" y="8" width="20" height="13" rx="2" fill="%23c99a3f" stroke="%23241b10" stroke-width="1.5"/><rect x="9" y="4.5" width="6" height="4.5" rx="1" fill="none" stroke="%23241b10" stroke-width="2"/></svg>') center / contain no-repeat;
  border: 1px solid var(--ink);
}

/* Round 50.1: the Find-a-game countdown — one big number. */
.queue-timer { font-size: 3rem; font-weight: 800; text-align: center; line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Round 50.1: the visible turn clock on another player's turn (online). */
.banner.turn-rope { display: flex; flex-direction: column; gap: 6px; }

/* Round 50: the public "heavily bought" marker — one player has at least
   HEAVILY_BOUGHT_AT on this operative (who and how much stay hidden). A
   small gold coin at the top-left, opposite the briefcase badge. */
.operative-token.heavily-bought::before {
  content: "$";
  position: absolute;
  top: -5px;
  left: -9px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: var(--ink);
  border: 1px solid var(--ink);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 13px;
  text-align: center;
  letter-spacing: 0;
  z-index: 1;
}

/* Distinct color per operative so several tokens sharing a city stay
   legible — but color is a secondary cue: the letter symbol (checked at
   5.8:1+ contrast against every one of these fills) and the dark ink
   border are what actually identify each operative. */
.operative-token.op-sterling { --op-color: #e0b64e; }
.operative-token.op-franc { --op-color: #6fa8dc; }
.operative-token.op-ruble { --op-color: #e07a7a; }
.operative-token.op-yuan { --op-color: #f2a65a; }
.operative-token.op-peso { --op-color: #7fc97f; }
.operative-token.op-rand { --op-color: #b48ead; }
.operative-token.op-dinar { --op-color: #4fc3c9; }
.operative-token.op-yen { --op-color: #e893c0; }

.briefcase-marker {
  position: absolute;
  z-index: 45;
  transform: translate(-50%, -50%);
  display: flex;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  pointer-events: none;
}

.panel {
  background: var(--ink-panel);
  border-top: 3px double var(--accent-border);
  padding: 12px 14px 18px;
  /* Keep the action buttons clear of the home-indicator gesture bar on
     notched phones (viewport-fit=cover lets content draw underneath it). */
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.banner {
  background: var(--ink-elevated);
  border: 1.5px solid var(--accent-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text);
}

/* Round 23: color treatments for flashToast()'s three tones. .toast-error
   keeps the exact colors flashError() always used (bad news / rejected
   action); .toast-warn is the jeopardy/high-stakes alert color (amber,
   not red — these are tense moments, not something gone wrong);
   .toast-info is the neutral "closing in on a win" flavor. */
.toast-error { background: #3a1f1f; border-color: #c15a5a; }
.toast-warn { background: #3a2c14; border-color: var(--accent-strong); }
.toast-info { background: #1c2f38; border-color: #5aa0c1; }
/* Round 27: toast-warn's alert-triangle icon (see flashToast()) */
/* Round 37: base rule for every uiIcon() <img> (app.js) — the icon-pack
   PNGs (Round 27) are all a non-square 202×242 source, but uiIcon() sets
   equal width/height attributes to fit a target size, which squished
   every icon's true aspect ratio with no object-fit to compensate.
   object-fit: contain letter-boxes instead of stretching, and display:
   block drops the small baseline gap an inline <img> normally carries —
   both matter most for .help-btn's Settings gear (the one call site where
   an icon is a button's entire content, not sitting inline next to text —
   see .help-btn's own Round 37 comment above). */
.ui-icon-img { display: block; object-fit: contain; }
.toast-with-icon { display: flex; align-items: center; gap: 8px; }
.toast-with-icon .ui-icon-img { flex: 0 0 auto; }

/* Round 56 (2026-09-23): the center callouts — see app.js showCallout().
   A card in the middle of the board for the few moments something went
   against the player (lost challenge, snatched case, blocked delivery, a
   rival conceding): what happened, then what to do about it. Sits a
   little above true center so it never covers the action buttons under
   the board; tap anywhere on it to dismiss. Not a modal — nothing behind
   it is blocked, and it keeps out of the way of the challenge buttons. */
.callout {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 60;
  width: min(92vw, 420px);
  padding: 14px 16px 12px;
  border-radius: 12px;
  background: var(--ink-elevated);
  border: 2px solid var(--accent-strong);
  color: var(--text);
  font-family: var(--font-serif);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: callout-in 180ms ease-out;
}
.callout-concede { border-color: #5aa0c1; }
.callout-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
  margin-bottom: 6px;
}
.callout-concede .callout-title { color: #8cc4dd; }
.callout-body { font-size: 1rem; line-height: 1.35; }
.callout-next {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text-dim);
}
.callout-ok { margin-top: 12px; width: 100%; }
/* Round 77: a visible close button (the card was already tap-to-dismiss). */
.callout { padding-right: 44px; }
.callout-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.callout-close:hover, .callout-close:focus-visible { background: rgba(255, 255, 255, 0.12); }
@keyframes callout-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
/* Round 27: hourglass icon on the online waiting-room copy (see
   renderOnlineMenuCard()'s waiting-room branch above it in app.js). */
.waiting-line { display: flex; align-items: center; gap: 8px; justify-content: center; }

/* Round 19: a distinct, animated treatment for "an AI is about to move" so
   it reads unmistakably as "wait, something's happening" rather than
   blending into every other static banner (challenge invites, waiting-on-
   others text, etc.) — see the renderModal comment above where this is
   built, and the player-strip .ai-active rule above for the matching chip
   highlight. */
.banner.ai-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  border-color: var(--accent-strong);
}
.thinking-dots {
  display: inline-flex;
  gap: 3px;
}
.thinking-dots .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-strong);
  opacity: 0.3;
  animation: thinking-pulse 1.1s infinite ease-in-out;
}
.thinking-dots .dot:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes thinking-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* Round 28: the online rope timer on a challenge decision — see
   renderRopeBar in app.js. The fill shrinks left-to-right and shifts from
   brass to danger-red as it burns down, like a fuse; the "12s" label next
   to it is the accessible/reduced-motion source of truth (it's re-rendered
   every second regardless of whether the bar itself is animating — see
   ensureRopeTicking), not just decoration on top of the animation. */
.rope-bar {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rope-bar-track {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background: var(--ink-panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.rope-bar-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  transform-origin: left;
  background: var(--accent-strong);
  animation-name: rope-burn;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes rope-burn {
  0% { transform: scaleX(1); background: var(--accent-strong); }
  60% { background: var(--accent-strong); }
  100% { transform: scaleX(0); background: var(--danger); }
}
.rope-bar-label {
  align-self: flex-end;
  font-size: 0.8rem; /* Round 52.1: was 0.72rem */
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .rope-bar-fill { animation: none; transform: scaleX(1); background: var(--accent-strong); }
}

.action-row {
  display: flex;
  gap: 8px;
}

.action-btn {
  flex: 1;
  background: var(--ink-elevated);
  border: 1.5px solid var(--accent-border);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 8px;
  min-height: 48px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.action-btn:disabled { opacity: 0.4; }
.action-btn.danger { border-color: #c96a6a; color: #e0a0a0; }
.action-btn.go { background: var(--accent-strong); color: var(--ink); border-color: var(--accent-strong); }

/* ---------- Floating "Notebook" widget (Round 19, second follow-up) ----------
   Replaces the old permanent Board/My Bank Book/Field Report tab row (see
   the comment above the `ui` declaration in app.js for the full "why") — a
   floating action button that opens a card floating above the board,
   which can also shrink to a small "PiP" bubble. z-index 15: above the
   board/panel's normal flow, below modals (20) and the dossier popup (30),
   so a real modal always wins if one happens to be open at the same time. */
.notebook-fab, .notebook-bubble {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  background: var(--accent-strong);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Round 22: prevents a mobile browser from treating a single
     tap here as the start of a double-tap-to-zoom gesture, which can make
     the very first tap feel like it "did nothing." Applied defensively —
     not confirmed as the cause of Neal's report, just a real risk this
     removes for free since these buttons are never meant to be zoomed. */
  touch-action: manipulation;
}
/* The open-me button is a pill with an icon + label ("📔 Bank Book") —
   Round 22: a bare icon wasn't self-explanatory (Neal didn't
   know what it did and called it "the little dossier," confusing it with
   the separate operative-dossier popup); a plain-language label removes
   the guesswork before it's even tapped. The minimized bubble stays a
   small icon+label circle instead — it's a "put this back where it was"
   control the player just used, not a first encounter, so compactness
   matters more than a full label there. */
.notebook-fab {
  height: 48px;
  padding: 0 16px 0 14px;
  border-radius: 999px;
  gap: 8px;
  font-size: 1.25rem;
}
.notebook-fab-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.notebook-bubble {
  width: 60px; height: 60px;
  border-radius: 50%;
  flex-direction: column;
  gap: 1px;
  font-size: 1.1rem;
}
.notebook-bubble-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.notebook-panel {
  position: fixed;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  max-width: 380px;
  margin-left: auto;
  z-index: 15;
  background: var(--ink-panel);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notebook-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.notebook-segmented {
  display: flex;
  gap: 4px;
  flex: 1;
}
.segmented-btn {
  flex: 1;
  background: transparent;
  border: 1.5px solid var(--accent-border);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 7px 8px;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}
.segmented-btn.active { color: var(--ink); background: var(--accent-strong); border-color: var(--accent-strong); }
.notebook-icon-btn {
  background: transparent;
  border: 1.5px solid var(--accent-border);
  color: var(--text-dim);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: 1rem;
}

.sheet {
  max-height: 40vh;
  overflow-y: auto;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed var(--accent-border);
}
.ledger-row .amt { color: var(--text); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* Round 55: where the money went — summary rows above the per-spy ledger,
   and a small detail line under any spy whose bribe has been drained. */
.ledger-row.ledger-summary { color: var(--text-dim); }
.ledger-heading { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin: 10px 0 2px; }
.ledger-detail { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); padding: 0 0 6px 12px; border-bottom: 1px dashed var(--accent-border); font-variant-numeric: tabular-nums; }
/* Round 19, second follow-up: an operative's name in the ledger is now a
   real tap target (opens the dossier popup below) — styled to still read
   as inline text, not an obvious button, so the ledger doesn't suddenly
   look cluttered with button chrome. */
.ledger-op-btn {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.log-entry { padding: 4px 0; }

/* ---------- Dossier popup (Round 19, second follow-up) ---------- */
.dossier-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36,27,16,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 20px;
}
.dossier-card {
  background: var(--paper-elevated);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  padding: 16px;
  /* Round 27, second follow-up: column layout — a header row (portrait +
     name/flavor) with the new multi-sentence bio as its own full-width
     paragraph underneath. A real bio wrapped inside a narrow text column
     squeezed next to a 64px portrait for the whole card's height read
     cramped, so only the header row is a portrait+text pairing now. */
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: 100%;
  position: relative;
}
.dossier-header { display: flex; align-items: flex-start; gap: 14px; padding-right: 22px; }
.dossier-info { display: flex; flex-direction: column; gap: 3px; }
.dossier-name { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; color: var(--ink); }
.dossier-flavor { color: var(--ink-dim); font-size: 0.85rem; }
.dossier-bio { color: var(--ink); font-size: 0.85rem; line-height: 1.45; }
.dossier-burned { color: var(--danger); font-size: 0.8rem; font-weight: 600; margin-top: 2px; }
.dossier-card .notebook-icon-btn { position: absolute; top: 8px; right: 8px; }

/* ---------- Your Dossier stats screen (Round 28, fifth follow-up) ----------
   Surfaces src/dossier/stats.js's data. Deliberately reuses .instructions-
   heading/.instructions-body for section labels and body copy rather than
   inventing a parallel type scale — this is the same "static reference
   info in a modal" shape as How to Play and Settings, just with numbers
   instead of rules text. */
.dossier-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.dossier-stat-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dossier-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dossier-stat-label {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.dossier-favorite-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.dossier-favorite-info { display: flex; flex-direction: column; gap: 4px; }
.dossier-favorite-info .instructions-body { margin: 0; }

/* "Fuller Dossier" pass: commendations (achievements). Locked and unlocked
   share one layout — a plain border/dim-text card that gains a gold border
   and accent-tinted title once earned — rather than two visually distinct
   card styles, so the grid reads as one coherent list of goals rather than
   a jarring mix. */
.dossier-achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.dossier-achievement-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dossier-achievement-card.unlocked {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border) inset;
}
.dossier-achievement-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-dim);
}
.dossier-achievement-card.unlocked .dossier-achievement-title { color: var(--gold); }
.dossier-achievement-desc {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: var(--ink-dim);
  line-height: 1.3;
}

/* ---------- Play Games sign-in card (Play Games pass) ----------
   Sits at the top of the Your Dossier modal, above the stats above — same
   card language as .dossier-stat-tile/.dossier-favorite-card (var(--paper)
   fill, var(--line) border) but with an var(--accent-border) outline so it
   reads as its own distinct block rather than one more stat tile. */
.play-games-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--accent-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.play-games-status-row {
  display: flex;
  flex-wrap: wrap; /* R82.2: a long email + "Switch account" no longer overflow the card (Neal's iPhone screenshot) — the button drops to its own line */
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.play-games-player {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.play-games-card .secondary-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  min-height: 38px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.play-games-error {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--danger);
}

/* Round 34, third follow-up: League screen's "Sign in with Google" portability
   section — same card language as .play-games-card above (same reasoning:
   its own distinct block, not one more stat tile), reused wholesale rather
   than duplicated with new values since both are optional-account-status
   cards that only ever appear one at a time on two different screens. */
.league-portability-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--accent-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.league-portability-status {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.league-portability-card .secondary-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  min-height: 38px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.league-portability-error {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--danger);
}
/* 2026-09-03 follow-up: the pre-emptive "if you've already used this
   account elsewhere" note on the League screen's sign-in prompt, and the
   Play Games cross-awareness note that lives alongside it — visually a
   quieter caveat than .instructions-body's main explainer text, not an
   error (that stays .league-portability-error, and .play-games-card
   reuses .instructions-body directly for its own cross-awareness note
   since play-games-card has no smaller "note" tier defined yet). */
.league-portability-note {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-dim);
}

/* ---------- Modal ---------- */

/* Round 77: .board-wrap is its own stacking context (isolation: isolate), so
   the pins (z 10–40) and briefcase (z 45) on the board can never draw over
   this backdrop (z 20) — the case icon was showing through the Pay screen. */
.board-wrap { isolation: isolate; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36,27,16,0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.modal {
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-top: 4px double var(--accent-border);
  border-radius: 16px 16px 0 0;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 520px;
  /* Safety net for short viewports (Round 15) — without this, a modal with
     enough content (e.g. all 8 operative chips in the Pay/Out pickers) can
     run right up against the bottom edge with zero margin on a short phone
     screen, and would clip its confirm/cancel buttons entirely on anything
     even slightly taller than what was tested. .instructions-modal already
     had its own tighter max-height; this gives every other modal the same
     protection. */
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
}
.modal h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.modal > div { font-family: var(--font-serif); font-size: 0.95rem; color: var(--ink-dim); }

/* Header row with a pinned close button (Round 15) — see renderInstructionsModal's
   comment for why: a modal long enough to need scrolling shouldn't bury its
   only dismiss control at the bottom. */
.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  color: inherit;
  font-size: inherit;
}
.modal-header-row h3 { margin: 0; }
.modal-close-x {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instructions-modal {
  max-height: 82vh;
  overflow-y: auto;
}

/* Settings modal (Round 13) */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.settings-row:last-of-type { border-bottom: none; }
/* Round 19: the Playtesting section's Share/Copy/Download row has three
   buttons, which .settings-row's default space-between-and-nowrap layout
   (fine for a single control on the right) can overflow at 320-360px
   widths. Let it wrap onto a second line instead. */
.settings-row.log-actions-row { flex-wrap: wrap; justify-content: flex-start; }
.settings-row.log-actions-row button { flex: 1 1 auto; min-width: 0; }
.settings-row span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.settings-row input[type="range"] {
  flex: 1;
  max-width: 160px;
  accent-color: var(--accent);
}
.toggle-btn {
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 8px 18px;
  min-height: 40px;
  min-width: 64px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}
.toggle-btn.on { background: var(--ink-panel); border-color: var(--ink-panel); color: var(--accent-strong); }
.instructions-heading {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.instructions-body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

/* Round 37: collapsible sections (Dossier + League — see
   renderCollapsibleSection() in app.js). Follow-up: the first version
   reused .instructions-heading's plain colored-text look almost verbatim,
   which read as an ordinary section label rather than something tappable
   (Neal's feedback — "hard for people to know they can expand"). Now a
   real bordered pill with its own background, closer to this file's other
   button treatments, plus a trailing "Tap to view"/"Tap to hide" hint
   (app.js) — the caret alone wasn't a strong enough affordance on its own. */
.collapsible-section + .collapsible-section {
  margin-top: 10px;
}
.collapsible-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 4px 0 0;
  padding: 8px 12px;
  background: var(--paper-dim, rgba(0, 0, 0, 0.04));
  border: 1.5px solid var(--accent-border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.collapsible-header:hover, .collapsible-header:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  background: rgba(0, 0, 0, 0.07);
}
.collapsible-header:active {
  transform: translateY(1px);
}
.collapsible-caret {
  flex: 0 0 auto;
  font-size: 1.1em;
}
.collapsible-hint {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink-dim);
  opacity: 0.8;
}
.collapsible-header:hover .collapsible-hint, .collapsible-header:focus-visible .collapsible-hint {
  color: var(--accent-strong);
}
.collapsible-body {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Round 33, twelfth follow-up: a quiet release-version stamp in the Settings
   modal (see src/version.js) — mono like .instructions-heading's labels
   since it reads as a build tag, not prose, but sized down and dimmed
   further so it doesn't compete with Credits/legal above it. */
.version-footer {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  opacity: 0.75;
}

/* The "How to Play" roster gallery (Round 12) — a small dossier card per
   operative, portrait + symbol/name + flavor text. Purely reference
   material: nothing here is interactive, so no touch-target minimums apply,
   but text still meets the same contrast pairs used everywhere else
   (--ink on --paper-elevated, already verified in offbook-theme.md). */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 6px 0 4px;
}
.roster-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-elevated);
}
.roster-card .operative-portrait { border-radius: 6px; flex-shrink: 0; }
.roster-info { min-width: 0; }
.roster-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.roster-flavor {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--ink-dim);
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.select-chip {
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 6px 10px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.select-chip.selected { border-color: var(--accent); background: var(--ink-panel); color: var(--accent-strong); }
.select-chip:disabled { opacity: 0.3; }
/* Round 77: your own stake on each spy, in the Pay screen. */
.select-chip .chip-stake { font-size: 0.7rem; font-weight: 700; opacity: 0.55; margin-top: 2px; }
.select-chip .chip-stake.has-stake { opacity: 1; color: var(--accent); }
.select-chip.selected .chip-stake.has-stake { color: var(--accent-strong); }
.pay-stake-line { margin: 10px 0 2px; font-family: var(--font-serif); font-size: 0.95rem; line-height: 1.35; }
/* The little dossier-photo badge (Round 12) rendered above the symbol/name
   in each operative chip — see operativePortraitIcon() in app.js. Purely
   decorative, so it never needs to change with .selected state. */
.select-chip .operative-portrait { border-radius: 4px; flex-shrink: 0; }

/* Round 35: "Recruit a Source" modal (campaign hub) — richer than
   .select-grid's plain symbol/name chips, since a real pick here needs the
   operative's bio and their power description on the card to actually be
   an informed choice, not just an id. Two-up on anything wide enough,
   stacked on a narrow phone (same breakpoint idea as .select-grid, just a
   card instead of a small chip). */
.recruit-source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 420px) {
  .recruit-source-grid { grid-template-columns: 1fr 1fr; }
}
.recruit-source-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recruit-source-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
}
.recruit-source-bio {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-dim);
}
.recruit-source-power {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--accent-strong);
}
.recruit-source-card .primary-btn {
  margin-top: 2px;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
}
.stepper button {
  background: var(--paper);
  border: 1.5px solid var(--line);
  color: var(--ink);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.3rem;
}

/* Round 34: the range slider added alongside the existing +/- stepper
   buttons (never replacing them — see renderAmountStepper's doc comment in
   app.js for why both stay). Reuses the same accent-color/track treatment
   as the Settings volume sliders (.settings-row input[type="range"]) for
   visual consistency, just full-width instead of capped at 160px since
   this one is the main way to cover a big jump, not a secondary control. */
.amount-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.amount-slider {
  width: 100%;
  accent-color: var(--accent);
}
.amount-slider:disabled {
  opacity: 0.4;
}
.stepper-amount {
  min-width: 90px;
  text-align: center;
}

.win-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 24px;
}
.win-screen h1 { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.win-screen p { font-family: var(--font-serif); font-size: 1.05rem; color: var(--ink-dim); }

/* ---------- Dramatic ending (Round 23) ----------
   Neal's playtest feedback: "the end of a game needs to be more dramatic."
   Reuses the same stamped-ink visual language as the opening intro
   sequence's TOP SECRET stamp (.intro-stamp in the block above) rather than
   inventing a new motif — a case-file stamp slamming down reads the same
   whether it's opening the file or closing it. Color (not just text)
   distinguishes win from loss at a glance: success green for CASE CLOSED,
   danger red for COVER BLOWN. app.js times sfx.introStamp() to this same
   0.15s delay — keep both in sync if either side's timing changes. */
.ending-stamp-stage {
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}
.ending-stamp {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.15rem, 6vw, 1.8rem);
  letter-spacing: 0.1em;
  border: 4px solid currentColor;
  border-radius: 8px;
  padding: 8px 20px;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-8deg) scale(2.4);
  animation: ending-stamp-slam 0.35s ease-out 0.15s forwards;
}
.ending-stamp-win { color: var(--success); }
.ending-stamp-lose { color: var(--danger); }
@keyframes ending-stamp-slam {
  0% { opacity: 0; transform: rotate(-8deg) scale(2.6); }
  55% { opacity: 1; transform: rotate(-8deg) scale(0.9); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}

/* Short "debrief" stats recap sitting alongside the existing full reveal
   table below — a few concrete numbers from THIS game (computed from the
   action log in computeGameStats(), never a running tally) rather than just
   announcing a winner and moving straight to the raw investment grid. */
.stats-recap {
  width: 100%;
  max-width: 460px;
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stats-recap h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-align: center;
}
.stats-recap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 100px;
}
.stat-chip-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}
.stat-chip-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

/* Round 33, sixth follow-up: Neal — "when a game is done, the text and
   numbers are dark against a dark background, hard to read." Root cause:
   this table never had its own background — only `th` did. That was fine
   on the plain paper canvas (the page's own light background showed
   through), but the Round 27 victory/defeat screens sit on a dark photo
   (`.has-photo-bg`/`.bg-victory`/`.bg-defeat`, see the block above), and
   every plain `td` — the investment reveal numbers themselves — kept its
   default `--ink` (near-black) text with nothing opaque behind it,
   landing dark-on-dark exactly like Neal described. `.stats-recap` right
   above this on the same screen already gets its own opaque
   `--paper-elevated` card for the same reason; this just brings the
   reveal table in line with that same "every foreground surface owns its
   background" rule the Round 27 comment above intended but didn't
   actually apply here. */
.reveal-table {
  width: 100%;
  max-width: 460px;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.reveal-table th, .reveal-table td {
  border: 1px solid var(--line);
  padding: 7px;
  text-align: center;
  color: var(--ink);
}
.reveal-table th { background: var(--paper-elevated); color: var(--ink-dim); }
.reveal-table td.top { color: var(--success); font-weight: 700; }

/* ---------- Tutorial (Round 15) ----------
 *
 * The interactive guided tutorial reuses existing modal/banner/button
 * patterns wherever possible (it IS a real game, just with tips layered
 * on top) — these rules only cover what's genuinely new: the "TUTORIAL"
 * badge, the mode-select nudge paragraph, the topbar Exit button (which
 * needs to fit a text label inside the round .help-btn treatment), the
 * tip modal's accent ring so it reads as distinct from an ordinary
 * pay/out/settings modal, and the win-screen completion summary.
 */
.tutorial-nudge {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
  font-size: 0.88rem;
  margin: -4px 0 4px;
  max-width: 420px;
}

.tutorial-exit-btn {
  width: auto;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The tip modal gets a brass ring instead of the default modal border so
   it's visually distinct from ordinary pay/out/settings modals at a
   glance — same shape/behavior, different "this is teaching you" cue. */
.modal.tutorial-tip {
  border: 2px solid var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(201, 154, 63, 0.25), 0 10px 30px rgba(36, 27, 16, 0.35);
}
.tutorial-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(201, 154, 63, 0.18);
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.tutorial-complete-banner {
  text-align: left;
}
.tutorial-complete-banner h3 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
}
.tutorial-complete-banner p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ---------- Campaign mode v1 (Round 33, second follow-up) ----------
 *
 * The campaign hub reuses .setup-card/.option-row/.pill-btn/.primary-btn/
 * .secondary-btn wherever those already fit (it's laid out the same as
 * Solo Setup, just with a different card body) — these rules only cover
 * what's genuinely new: the Influence balance chip, the ability list, and
 * the operation list's locked/completed states. The win-screen result
 * banner reuses .banner + the tutorial-complete-banner's h3/p treatment
 * directly (see renderWinScreen's campaign-result-banner in app.js), so it
 * doesn't need its own rules here beyond the h3 color override below.
 */
.campaign-hub-card {
  max-width: 460px;
  text-align: left;
}
.campaign-desc {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: -6px 0 14px;
}

.campaign-influence-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: var(--paper);
  border: 1.5px solid var(--accent-strong);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.campaign-influence-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.campaign-influence-amount {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.campaign-ability-list,
.campaign-operation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.campaign-ability,
.campaign-operation {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.campaign-ability strong,
.campaign-operation strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.campaign-ability p,
.campaign-operation p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-dim);
}
.campaign-ability button,
.campaign-operation button {
  width: auto;
  min-width: 0;
  padding: 8px 16px;
  min-height: 40px;
  font-size: 0.85rem;
}

.campaign-ability.unlocked {
  border-color: var(--success);
}
.campaign-ability-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
}

.campaign-operation.completed {
  border-color: var(--accent-strong);
}
.campaign-operation-reward {
  font-family: var(--font-mono);
  color: var(--accent-strong) !important;
  font-size: 0.8rem !important;
}
.campaign-operation.locked {
  opacity: 0.6;
}
.campaign-operation.locked p {
  margin-bottom: 0;
  font-style: italic;
}

/* Round 59: the compact campaign hub. */
.campaign-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.campaign-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--accent-strong);
  border-radius: 10px;
  padding: 8px 4px;
}
.campaign-hub-card .collapsible-section { margin-bottom: 10px; }
.campaign-star-note { margin: 4px 0 10px !important; font-size: 0.82rem !important; }
.campaign-hub-card .collapsible-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.campaign-operation.compact { padding: 8px 12px; }
button.campaign-operation-head {
  width: 100%;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.campaign-operation.compact strong { margin-bottom: 0; }

/* Round 58: The Cold War Files — chapters, stars, objectives, era flags. */
.campaign-chapter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.campaign-chapter-title {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.campaign-chapter .campaign-desc { margin: -4px 0 4px; }
.campaign-chapter-lock {
  background: var(--paper-elevated);
  border: 1.5px dashed var(--accent-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.campaign-chapter-lock p { margin: 0; font-size: 0.88rem; line-height: 1.4; color: var(--ink); }
.campaign-chapter-lock button { width: 100%; min-height: 44px; }
.campaign-operation-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.campaign-operation-head strong { margin-bottom: 4px; }
.campaign-stars {
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  white-space: nowrap;
}
.campaign-stars.large { display: block; font-size: 1.6rem; color: var(--accent-strong); margin: 2px 0 6px; }
.campaign-operation-rivals {
  font-family: var(--font-mono);
  font-size: 0.78rem !important;
}
.campaign-objectives {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--ink-dim);
}
.campaign-result-banner .campaign-objectives { color: var(--text-dim); }
.campaign-objective.met { color: var(--accent-strong); font-weight: 600; }
.svg-flag svg { display: inline-block; border-radius: 1px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35); }

.campaign-result-banner {
  text-align: left;
}
.campaign-result-banner h3 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
}
.campaign-result-banner p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ---------- Culper Ring campaign hub (Round 42) ----------
 * Reuses .setup-card/.campaign-influence-row/.campaign-ability/
 * .campaign-operation*/.campaign-result-banner wherever those already fit
 * exactly (same "field dossier" card language as the Classic campaign hub
 * and League above) — these rules only cover what's genuinely new: the
 * faction picker list and each operation's free-pick/alternate operative
 * chips. */
.culper-ring-factions-card,
.culper-ring-hub-card {
  max-width: 460px;
  text-align: left;
}

.culper-ring-faction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.culper-ring-faction-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.culper-ring-faction-row .color-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.culper-ring-faction-row.completed {
  border-color: var(--accent-strong);
}
.culper-ring-faction-info {
  flex: 1;
  min-width: 0;
}
.culper-ring-faction-info strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
}
.culper-ring-faction-info p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--ink-dim);
}
.culper-ring-faction-row button {
  width: auto;
  min-width: 0;
  padding: 8px 16px;
  min-height: 40px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.culper-ring-operative-pick-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.culper-ring-operative-chip {
  flex: 1;
  min-width: 0;
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.culper-ring-operative-chip strong {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--ink);
}
.culper-ring-operative-role {
  font-size: 0.72rem;
  color: var(--ink-dim);
  font-style: italic;
}
.culper-ring-operative-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
}
.culper-ring-operative-chip.owned {
  border-color: var(--success);
}
.culper-ring-operative-chip.owned .culper-ring-operative-label {
  color: var(--success);
}

/* ---------- League mode (Round 34 follow-up) ----------
 * Same visual language as the campaign hub just above (.campaign-hub-card
 * etc.) — a real rating deserves the same "field dossier" card treatment
 * as everything else here, not a bolted-on different look. */
.league-card {
  max-width: 460px;
  text-align: left;
}
.league-explainer {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-dim);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: -6px 0 14px;
}

.league-my-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--paper);
  border: 1.5px solid var(--accent-strong);
  border-radius: 10px;
  padding: 16px 14px;
  margin-bottom: 18px;
  text-align: center;
}
.league-rating-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1;
}
.league-rating-tier {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.league-rating-record {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-top: 4px;
}

.league-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.league-leaderboard-row {
  display: grid;
  grid-template-columns: 2em 1fr auto auto;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.league-leaderboard-row.is-me {
  border-color: var(--accent-strong);
}
.league-rank {
  font-family: var(--font-mono);
  color: var(--ink-dim);
}
.league-name {
  font-family: var(--font-serif);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-tier {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}
.league-rating {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-strong);
}

.league-result-banner {
  text-align: left;
}
.league-result-banner h3 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
}
.league-result-banner p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ---------- Friends (League mode follow-up #2) ----------
 * Same card/row visual language as .league-card just above — a second card
 * stacked below the leaderboard on the League screen (see renderSetup's
 * "league" branch), not a separate screen. */
.friends-card {
  max-width: 460px;
  text-align: left;
  margin-top: 16px;
}
.friend-code-mine {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--accent-strong);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
}
.friend-code-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
}

.friends-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.friends-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.friend-record {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-strong);
  white-space: nowrap;
}

.friend-remove-btn {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  min-height: 30px;
  white-space: nowrap;
}
.friend-remove-confirm {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  min-height: 30px;
  white-space: nowrap;
}

/* ---------- Cosmetics shop (Round 34 follow-up) ----------
 * Same "field dossier" card language as .campaign-hub-card/.league-card —
 * a shop tab on the Dossier modal deserves the same visual treatment as
 * everything else there, not a bolted-on different look. Swatches
 * (.shop-item-swatch and its type variants) are deliberately plain CSS,
 * not images — see shop/catalog.js's own comment on why: no real art
 * exists yet, and this keeps the earn->unlock->equip pipeline fully real
 * and testable in the meantime. */
.shop-card {
  max-width: 520px;
  text-align: left;
}
.shop-credits-balance {
  background: var(--paper);
  border: 1.5px solid var(--accent-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold);
}
.shop-buy-credits-btn {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  min-height: 36px;
  opacity: 0.55;
  width: 100%;
  margin-bottom: 4px;
}
.shop-category {
  margin-top: 4px;
}
/* Round 48: Shop category tabs (one category at a time, owned/total on
   each tab) — reuses .option-row/.pill-btn, plus a small count badge. */
.shop-tab-row {
  justify-content: flex-start;
  margin: 10px 0 8px;
}
.shop-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.shop-tab-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.75;
}
.shop-category-desc {
  margin: 0 0 8px;
}
/* Round 48: the daily login bonus card (renderDailyBonusModal). */
.daily-bonus-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--gold);
  text-align: center;
  margin: 8px 0 2px;
}
.daily-bonus-streak {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.daily-bonus-day {
  min-width: 34px;
  padding: 6px 4px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: center;
  color: var(--ink-dim);
}
.daily-bonus-day.is-done {
  border-color: var(--accent-border);
  color: var(--ink);
}
.daily-bonus-day.is-today {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}
.shop-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.shop-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}
.shop-item-card.shop-item-equipped {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border) inset;
}
.shop-item-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}
.shop-item-swatch-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--paper-dim, var(--paper));
}
.shop-item-swatch-ring {
  border-width: 4px;
  border-style: solid;
  background: transparent;
}
/* Round 43 (Titles): the only swatch variant that isn't standing in for
   art that hasn't shipped — a title is text, so its preview is the real
   title rendered as a small nameplate. Width is allowed to grow past the
   other variants' fixed 40px (the longest title, "The Quartermaster",
   would otherwise wrap to four cramped lines) while keeping the same
   40px height and border treatment so the grid still reads as one row of
   evenly-sized previews. */
.shop-item-swatch-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 40px;
  max-width: 108px;
  padding: 0 8px;
  background: var(--paper-dim, var(--paper));
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.02em;
  color: var(--ink);
}
/* Round 36 follow-up: the first real `image`-backed shop items (the 8
   operative-portrait skins) — same 40px footprint as the other swatch
   variants above, just filled with a real photo instead of a color/emoji. */
.shop-item-swatch-image {
  overflow: hidden;
  padding: 0;
}
.shop-item-swatch-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Round 36 follow-up: the one-time "choose your operative" starter-avatar
   picker (renderStarterAvatarChooserModal in app.js) — a grid of all 8
   operative portraits, reusing .shop-item-swatch-image's own image sizing
   at a slightly larger, easier-to-tap size. */
.starter-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.starter-avatar-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.starter-avatar-choice:hover,
.starter-avatar-choice:focus-visible {
  border-color: var(--accent-border);
}
.starter-avatar-choice .shop-item-swatch-image {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}
.starter-avatar-skip {
  display: block;
  margin: 4px auto 0;
}

/* Round 36: player avatar — composites the 3 AVATAR_CATEGORIES cosmetics
   (see shopProgress.js) into one small visual, reusing the same
   placeholder-swatch approach as .shop-item-swatch above (no real art
   assets exist yet). Shown on the home screen, in the Dossier, and in the
   in-game player strip (renderPlayerAvatar/renderAvatarBox in app.js). */
.player-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--paper-dim, var(--paper));
  flex-shrink: 0;
  overflow: visible;
}
.player-avatar-framed {
  border-width: 4px;
  border-style: solid;
}
.player-avatar-ai {
  background: var(--paper-dim, var(--paper));
  border-style: dashed;
}
.player-avatar-badge {
  /* Round 37: Neal's feedback — this covered too much of the avatar,
     worst on the smallest (22px in-game player-strip chip) avatars. The
     font-size formula itself was fixed in app.js's renderAvatarBox(); this
     border/padding trim is the other half — the old 1.5px border + 2px
     padding added a fixed ~7px to the badge's visual footprint regardless
     of the (now smaller) text inside it, which dominated at the 22px size. */
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  line-height: 1;
  padding: 1px;
}

.home-identity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.home-identity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-identity-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
}
.dossier-identity-row {
  margin-bottom: 14px;
}

/* Round 43 (Titles): a player's equipped callsign, shown beside/below
   their name (see renderPlayerTitle in app.js). Two variants: "block"
   sits under the name in the roomier home/Dossier identity rows,
   "inline" rides along inside the tight in-game player-strip chip, where
   it has to stay clearly secondary to the name it follows and must not
   push the chip wide enough to break the strip's single-row scroll. */
.player-title {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--accent-strong, var(--accent-border));
}
.player-title-block {
  display: block;
  font-size: 0.8rem;
  margin-top: 1px;
}
.player-title-inline {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The home screen's identity row sits on the photo background, where
   plain --accent-strong loses contrast — same problem, and same fix, as
   the .has-photo-bg .home-identity-name rule near the top of this file. */
.has-photo-bg .player-title { color: var(--accent-strong); text-shadow: 0 1px 5px rgba(0,0,0,0.85); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-strong, var(--accent-border));
  text-decoration: underline;
  font-size: 0.82rem;
  cursor: pointer;
  align-self: flex-start;
}
.shop-item-name {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  line-height: 1.25;
}
.shop-item-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}
.shop-item-card .secondary-btn {
  padding: 6px 10px;
  min-height: 32px;
  font-size: 0.7rem;
  width: 100%;
  margin-top: 0;
}
.shop-item-card .secondary-btn:disabled {
  opacity: 0.5;
}

.shop-credits-earned {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold);
}

/* ---------- Small-screen tuning (Round 15) ----------
 *
 * Feedback from real phone testers: the game had the right board-game
 * feel but wasn't tailored for small screens — everything above was
 * designed/tuned without a dedicated pass for short or narrow viewports.
 * This trims vertical chrome (topbar/player-strip/panel padding, a few
 * font sizes) specifically on short screens so more of the game fits
 * without scrolling, while leaving the touch-friendly min-heights on
 * actual controls (buttons, tabs) alone — those stay >=40px everywhere.
 * Paired with the scroll-reset fix in app.js (render() now scrolls back
 * to the top on every screen change) so on the screens still taller than
 * the viewport, at least the topbar/board are what greets you, not a
 * scrolled-down mid-layout view.
 */
@media (max-height: 700px) {
  .topbar { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
  .topbar .title { font-size: 1rem; }
  .turn-indicator { font-size: 0.8rem; }
  .player-chip { padding: 6px 10px; min-height: 32px; }
  .activity-feed { padding: 4px 14px 3px; }
  .board-wrap { max-height: 56vh; margin-top: 4px; }
  .panel { padding: 8px 14px 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .action-btn { padding: 10px 8px; min-height: 44px; }
  .notebook-bubble { width: 48px; height: 48px; }
  .notebook-fab { height: 42px; padding: 0 13px 0 11px; font-size: 1.1rem; }
  .notebook-fab-label { font-size: 0.75rem; }
  .notebook-panel { max-height: 60vh; }
  .sheet { max-height: 32vh; }
  .modal.tutorial-tip { max-height: 90vh; }
}

/* Very narrow phones (older/small Androids, iPhone SE-class) — the setup
   HQ picker and opponent rows already wrap/stack via flexbox, this just
   tightens the outer setup-card padding so there's less wasted margin. */
@media (max-width: 360px) {
  .setup-card { padding: 16px 14px; }
  .brand-title { font-size: 1.9rem; }
  .splash-title { font-size: 2.3rem; }
}

/* Round 62: leading players to Credits — a tappable balance and a
   "what you were after" note at the top of the Shop. */
.credits-chip {
  background: var(--paper);
  border: 1.5px solid var(--accent-border);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
}
.home-credits-chip {
  margin-left: auto;
}
.campaign-stat-tap {
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.campaign-stat-tap .campaign-influence-label::after {
  content: " ›";
}
.credits-need-note {
  background: var(--paper);
  border: 1.5px dashed var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 12px;
  text-align: center;
}
.credits-need-note p {
  margin: 0 0 6px;
  font-weight: 600;
}
.credits-need-note .credits-need-sub {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-dim);
}
.credits-need-note .secondary-btn {
  width: auto;
  margin-top: 4px;
}
.shop-get-more {
  border-style: dashed;
}
.home-identity-row {
  flex-wrap: wrap;
}

/* Round 64: the Founding Agent award card on the home screen. */
.tester-award-card {
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 16px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.tester-award-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tester-award-medal { font-size: 1.6rem; }
.tester-award-title {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.tester-award-card p { margin: 0 0 8px; line-height: 1.45; }
.tester-award-sub { font-size: 0.88rem; color: var(--ink-dim); }
.tester-award-error { color: #a33; font-size: 0.85rem; }
.tester-award-btn { margin-top: 4px; }

/* Round 66: rankings — rating rows gain a win-rate column and a title line
   under the name; the monthly board; the pinned "your position" rows. */
.league-leaderboard-row {
  grid-template-columns: 2em 1fr auto auto auto;
}
.league-leaderboard-row.season-row {
  grid-template-columns: 2em 1fr auto;
}
.league-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.league-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-row-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-winrate {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  min-width: 2.6em;
  text-align: right;
}
.league-gap {
  text-align: center;
  color: var(--ink-dim);
  margin: 2px 0;
}
.league-my-position {
  margin-top: 0;
}
.league-show-more {
  display: block;
  margin: 8px auto 0;
}

/* Round 68: the wallet tag in the board's top-left corner (renderBoardWallet).
   Kept narrow (label stacked over the amount) so it clears the corner nodes
   on every board — Loop's Auckland, the Baltic's Uppsala, Yugoslavia's
   Washington HQ all sit just to its right. The −$/+$ change hangs below it. */
.board-wallet {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 3px 7px 4px;
  border-radius: 8px;
  border: 1.5px solid var(--accent-border);
  background: rgba(24, 17, 9, 0.86);
  color: #f6eed6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.board-wallet-label {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9b98f;
}
.board-wallet-amount {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f2c75c;
}
.board-wallet-delta {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(24, 17, 9, 0.86);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}
.board-wallet-delta.down { color: #ff9a8a; }
.board-wallet-delta.up { color: #8fe39a; }

/* Round 69: a city's name goes wherever it covers the fewest other cities
   and names (src/ui/labelPlacement.js) — below by default, else right,
   left, tucked under one side, or (last resort — a spy's map pin stands
   there) above. */
.node-btn .node-label.lbl-right { top: 50%; left: 100%; right: auto; transform: translateY(-50%); margin: 0 0 0 4px; }
.node-btn .node-label.lbl-left { top: 50%; left: auto; right: 100%; transform: translateY(-50%); margin: 0 4px 0 0; }
.node-btn .node-label.lbl-below-right { top: 100%; left: 70%; right: auto; transform: none; margin: 1px 0 0; }
.node-btn .node-label.lbl-below-left { top: 100%; left: auto; right: 70%; transform: none; margin: 1px 0 0; }
.node-btn .node-label.lbl-above { top: auto; bottom: 100%; left: 50%; right: auto; transform: translateX(-50%); margin: 0 0 3px; }

/* Round 69: the "which spy am I moving" tag, top-right of the board
   (renderBoardSelection) — the mirror of the cash tag. */
.board-selected {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 3px 8px 4px;
  border-radius: 8px;
  border: 1.5px solid #ffd54a;
  background: rgba(24, 17, 9, 0.88);
  color: #f6eed6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.15;
  box-shadow: 0 0 8px rgba(255, 213, 74, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.board-selected-who { display: flex; align-items: center; gap: 5px; }
.board-selected-name { font-size: 0.92rem; font-weight: 800; }
.board-selected-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--op-color, var(--accent-strong));
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}
.board-selected-hint { font-size: 0.62rem; font-weight: 700; color: #8fe39a; }
.board-selected-hint.blocked { color: #ffb4a8; }
.operative-token-swatch.op-sterling { --op-color: #e0b64e; }
.operative-token-swatch.op-franc { --op-color: #6fa8dc; }
.operative-token-swatch.op-ruble { --op-color: #e07a7a; }
.operative-token-swatch.op-yuan { --op-color: #f2a65a; }
.operative-token-swatch.op-peso { --op-color: #7fc97f; }
.operative-token-swatch.op-rand { --op-color: #b48ead; }
.operative-token-swatch.op-dinar { --op-color: #4fc3c9; }
.operative-token-swatch.op-yen { --op-color: #e893c0; }
/* Round 69: when your HQ's name has to go above it, HOME moves below. */
.my-hq-badge.badge-below { bottom: auto; top: 100%; margin: 3px 0 0; }

/* Round 78: a title/insignia rung you can't reach yet. */
.shop-item-card.shop-item-locked .shop-item-swatch,
.shop-item-card.shop-item-locked .shop-item-name { opacity: 0.55; }
.shop-item-status.shop-item-needs { font-size: 0.72rem; opacity: 0.85; }

/* Round 79: The Cold War Files side picker and the hub's side row. */
.cwf-side-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@media (min-width: 520px) { .cwf-side-grid { grid-template-columns: 1fr 1fr; } }
.cwf-side-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.cwf-side-card:hover, .cwf-side-card:focus-visible { border-color: var(--accent); }
.cwf-side-west { border-left: 6px solid #7a1f2b; }
.cwf-side-east { border-left: 6px solid #2f6f73; }
.cwf-side-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; }
.cwf-side-service { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.cwf-side-pitch { font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.35; }
.cwf-side-progress { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); margin-top: 4px; }
.cwf-side-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.cwf-side-now { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.03em; }
.cwf-side-row .cwf-side-switch { width: auto; padding: 6px 12px; min-height: 36px; }

/* iOS App Store build: Sign in with Apple, styled to Apple's black button
   (Human Interface Guidelines). Only rendered inside the iOS app. */
.apple-signin-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.apple-signin-btn:disabled {
  opacity: 0.6;
}

/* "Type DELETE to confirm" box in the delete-account modal. */
.delete-account-input {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 12px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper, #fff);
  color: var(--ink);
}

/* ---------- Rush Hour (Round 83, quieted in 83.1) ----------
   One slim line above "How do you want to play?" — Neal found the first
   card version too loud. Live: gold text and a thin gold edge, and the
   line opens Play Online. See renderRushHourBanner() in app.js. */
.rush-banner {
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  margin: 0;
  background: rgba(36, 27, 16, 0.55);
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  text-align: left;
}
.rush-banner-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--paper-dim);
}
.rush-countdown {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--paper-dim);
  white-space: nowrap;
}
.rush-banner.is-live { border-color: var(--accent-border); cursor: pointer; }
.rush-banner.is-live .rush-banner-title,
.rush-banner.is-live .rush-countdown { color: var(--accent-strong); }
.rush-line {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--accent);
  margin: 4px 0 0;
}
.rush-line.is-live { font-weight: 700; }
.agents-line { color: var(--ink-dim); }
