/* ==========================================================================
   Thereabouts · Atlas Edition — design system
   Museum / cartographic atlas. Restrained ink palette + brass/verdigris.
   Multi-player (1–6) with per-player colors.
   ========================================================================== */

:root {
  /* Surfaces — deep ink, slight blue undertone */
  --ink-deepest: #07090d;
  --ink-deep:    #0a0d12;
  --ink:         #10141c;
  --card:        #161b25;
  --card-2:      #1c2330;
  --elev:        #232b3a;
  --rule:        #232c3a;
  --rule-lit:    #3a465c;

  /* Letterforms */
  --text:        #e5e2d6;
  --text-2:      #c8c4b3;
  --text-dim:    #8a8978;
  --text-faint:  #555548;

  /* Parchment accent */
  --paper:       #ede7d3;
  --paper-2:     #d9d2bb;

  /* Brass / ochre */
  --brass:       #d4a657;
  --brass-hi:    #f0c875;
  --brass-deep:  #8f6f30;
  --brass-soft:  rgba(212, 166, 87, 0.14);

  /* Verdigris (truth) */
  --verd:        #6dbfa3;
  --verd-deep:   #3a7a66;
  --verd-soft:   rgba(109, 191, 163, 0.16);

  /* Oxblood (error) */
  --ox:          #d35a4a;
  --ox-deep:     #8f3a2e;
  --ox-soft:     rgba(211, 90, 74, 0.16);

  /* Era band tints */
  --era-prehistory:  #2a2f33;
  --era-bronze:      #3a3325;
  --era-classical:   #4a3a26;
  --era-medieval:    #2e303f;
  --era-early-mod:   #2c3a30;
  --era-industrial:  #3a2f2c;
  --era-twentieth:   #2e353e;
  --era-modern:      #3a3a2e;

  /* Geometry */
  --r-card:   14px;
  --r-pill:   999px;
  --hair:    .5px;
  --gap:     20px;
  --pad:     22px;

  /* Density + scale */
  --density: 1;
  --scale: 1;

  /* Type */
  --font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-sans:    'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink-deepest);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: calc(14.5px * var(--scale));
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body { min-height: 100vh; }

body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1200px 800px at 20% -10%, rgba(212,166,87,0.05), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(109,191,163,0.04), transparent 65%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.9  0 0 0 0 0.8  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* ---------- typography utilities ---------- */
.display     { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.italic      { font-style: italic; }
.mono        { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.smallcaps   { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; font-weight: 600; }
.eyebrow     { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.22em; font-size: 10.5px; font-weight: 600; color: var(--text-dim); }
.dim         { color: var(--text-dim); }

/* ---------- layout shell ----------
   Flow content normally so reveal state can grow. Bottom bar is sticky. */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px 26px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shell.is-reveal { padding-bottom: 24px; }

/* ---------- top bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr minmax(280px, auto);
  align-items: center;
  gap: 24px;
  padding: 2px 2px 0;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand__type {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  color: var(--paper);
}
.brand__type .amp {
  font-style: normal;
  color: var(--brass);
  margin: 0 2px;
  font-size: 0.7em;
  vertical-align: 0.25em;
  letter-spacing: 0;
}
.brand__sub {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 9px;
  color: var(--text-dim);
}

.topbar__center { display: flex; justify-content: center; align-items: center; gap: 18px; }

/* HUD — game-state surface in the topbar center. Prominent; takes over
   on reveal to host the score + Next button so the action lives where
   the eye is already trained. */
.hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 280px;
}
.hud__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
  height: 18px;
}
.hud__mode {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--brass);
}
.hud__mode .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 8px var(--brass); }
.hud__timer {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.06em;
  padding: 2px 8px 2px 6px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
}
.hud__timer svg { color: var(--brass); }
.hud__timer.is-low {
  color: var(--ox);
  border-color: var(--ox-deep);
  background: var(--ox-soft);
  animation: timer-low-pulse 1s ease-in-out infinite;
}
.hud__timer.is-low svg { color: var(--ox); }

.hud__main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hud__round {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--paper);
  letter-spacing: -0.005em;
}
.hud__round-word {
  font-size: 14px;
  font-style: italic;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}
.hud__round-num {
  font-size: 38px;
  line-height: 1;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.hud__round-sep {
  font-size: 22px;
  color: var(--text-faint);
}
.hud__round-total {
  font-size: 22px;
  color: var(--text-dim);
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.hud__score {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding-right: 16px;
  border-right: 1px solid var(--rule);
}
.hud__score-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
}
.hud__score-delta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 1;
  color: var(--brass-hi);
  letter-spacing: -0.01em;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.hud__score-of {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.hud__next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 60%, var(--brass-deep) 100%);
  color: var(--ink-deepest);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.4),
    0 12px 30px -10px rgba(240,200,117,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform .15s ease;
}
.hud__next:hover { transform: translateY(-1px); }
.hud__next-arrow { font-size: 15px; line-height: 1; }
.mode-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 9px;
  border: 1px solid var(--rule-lit);
  border-radius: var(--r-pill);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
  background: rgba(212,166,87,0.05);
}
.mode-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 8px var(--brass); }
.round-counter { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 0.06em; }
.round-counter b { color: var(--text); font-weight: 500; }

/* roster — player chips in topbar */
.topbar__right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.topbar__menu {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  background: var(--brass-soft, rgba(212,166,87,0.08));
  border: 1px solid var(--brass-deep, rgba(212,166,87,0.35));
  border-radius: 8px;
  color: var(--brass, #d4a657);
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; flex-shrink: 0;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.topbar__menu:hover { background: var(--brass-deep, rgba(212,166,87,0.2)); color: var(--brass-hi, #e0b56b); }
.roster { display: flex; gap: 8px; flex-wrap: nowrap; }
.roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.012);
  transition: all .2s ease;
}
.roster-chip.is-current {
  border-color: var(--pc);
  background: color-mix(in oklab, var(--pc) 8%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--pc) 35%, transparent), 0 10px 30px -10px var(--pglow);
}
.roster-chip__avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pc);
  color: var(--pink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.2);
}
.roster-chip__body { display: flex; flex-direction: column; gap: 0; line-height: 1; }
.roster-chip__name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.roster-chip__score {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
}
.roster-chip.is-current .roster-chip__name { color: var(--paper); }
.roster-chip.is-current .roster-chip__score { color: var(--pc); }

/* ---------- topic header ---------- */
.topic-head {
  padding: 6px 2px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.topic-head__main { min-width: 0; display: flex; flex-direction: column; gap: 0; }

.topic-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(46px * var(--scale));
  /* line-height 1 was clipping descenders (j p g q y) — use 1.15 with
     matching padding so the overflow:hidden ellipsis still works. */
  line-height: 1.15;
  padding-bottom: 0.08em;
  color: var(--paper);
  letter-spacing: -0.005em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color .18s ease;
  -webkit-user-select: none;
  user-select: none;
}
.topic-title:hover { color: var(--brass-hi); }
.topic-title::after {
  content: "ⓘ";
  display: inline-block;
  margin-left: 12px;
  font-size: 0.4em;
  vertical-align: 0.5em;
  color: var(--brass);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .2s ease;
}
.topic-title:hover::after { opacity: 0.65; }

.topic-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.topic-meta__era { color: var(--text-2); }

/* ---------- board ----------
   In empty/mid: cards fit viewport (1fr 1fr rows).
   In reveal: rows are auto-sized so cards grow with leaderboard + trivia. */
.board {
  display: grid;
  /* minmax(0, …): without the 0 floor, fr tracks fall back to each card's
     content min-width, so the map column gets squeezed by a different amount
     every round depending on the question/answer text length. Pinning the
     floor to 0 makes the 1.4 : 1 split content-independent — the map is the
     same size every round. */
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  padding: 0 2px;
  min-height: 0;
  flex: 1;
}
/* Grid children must be allowed to shrink below their intrinsic content size
   for the minmax(0,…) tracks above to hold (cards already clip with overflow). */
.board > .card { min-width: 0; }
.board.is-reveal {
  grid-template-rows: auto auto;
  align-items: start;
}
.board > .card-map  { grid-column: 1; grid-row: 1 / span 2; }
/* Shape (draw-on-map) rounds occupy the exact same cell as the pin-map, so the
   location card is a consistent size whether the round uses a map or a shape. */
.board > .card-shape { grid-column: 1; grid-row: 1 / span 2; }
.board > .card-year { grid-column: 2; grid-row: 1; }
.board > .card-cnt  { grid-column: 2; grid-row: 2; }

/* ---------- card chassis ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: calc(var(--pad) * var(--density));
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--r-card);
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}
.card[data-state="reveal-good"] { border-color: rgba(109,191,163,0.4); box-shadow: 0 0 0 1px rgba(109,191,163,0.1), 0 20px 60px -30px rgba(109,191,163,0.5); }
.card[data-state="reveal-ok"]   { border-color: rgba(212,166,87,0.4);  box-shadow: 0 0 0 1px rgba(212,166,87,0.1), 0 20px 60px -30px rgba(212,166,87,0.5); }
.card[data-state="reveal-bad"]  { border-color: rgba(211,90,74,0.4);   box-shadow: 0 0 0 1px rgba(211,90,74,0.1), 0 20px 60px -30px rgba(211,90,74,0.4); }
.card[data-state="skipped"]     { opacity: 0.55; }

.card__head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.card__eyebrow-icon {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--brass-soft);
  border: 1px solid var(--brass-deep);
  border-radius: 7px;
  color: var(--brass);
  flex-shrink: 0;
}
.card__eyebrow-num {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brass-hi);
  flex-shrink: 0;
  border-right: 1px solid var(--rule);
  padding-right: 14px;
  margin-right: 0;
}

.q-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: calc(24px * var(--scale));
  line-height: 1.18;
  color: var(--paper);
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: pretty;
  flex: 1;
  min-width: 0;
}
.q-text::before {
  content: "“";
  font-weight: 600;
  font-style: normal;
  color: var(--brass);
  margin-right: 4px;
  margin-left: -2px;
  display: inline-block;
  transform: translateY(2px);
}

.card__reveal {
  display: flex; flex-direction: column; gap: 12px;
}

/* ---------- map card ---------- */
.card-map { padding: 0; }
.card-map .card__head { padding: calc(var(--pad) * var(--density)) calc(var(--pad) * var(--density)) 0; }
.card-map .card__reveal { padding: 0 calc(var(--pad) * var(--density)) calc(var(--pad) * var(--density)); }
.card-map__surface {
  position: relative;
  flex: 1;
  min-height: 320px;
  margin: 0;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
  cursor: crosshair;
}

/* MapLibre attaches to .card-map__surface directly; the .map-stage carries
   the data-style attribute so we can scope per-style filters. */
.card-map__surface .maplibregl-map,
.card-map__surface .maplibregl-canvas-container,
.card-map__surface .maplibregl-canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.card-map__surface .maplibregl-canvas { filter: saturate(0.6) sepia(0.22) contrast(0.95) brightness(0.85) hue-rotate(-6deg); }
.card-map__surface[data-style] .maplibregl-canvas { /* per-style filter applied via parent attr */ }

.map-stage {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
.map-stage::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 60% at 50% 50%, transparent 50%, rgba(8,10,16,0.45) 100%),
    linear-gradient(180deg, rgba(8,10,16,0.18) 0%, rgba(8,10,16,0.05) 30%, transparent 60%);
}

/* per-mapStyle filters on the maplibre canvas */
.map-stage[data-style="atlas"]   ~ * + * + * + * .maplibregl-canvas { /* fallback no-op */ }
.card-map__surface:has([data-style="atlas"])   .maplibregl-canvas { filter: saturate(0.6) sepia(0.22) contrast(0.95) brightness(0.85) hue-rotate(-6deg); }
.card-map__surface:has([data-style="terrain"]) .maplibregl-canvas { filter: saturate(0.8) sepia(0.05) contrast(0.95) brightness(0.9); }
.card-map__surface:has([data-style="minimal"]) .maplibregl-canvas { filter: saturate(0)   contrast(0.9)  brightness(0.92); }
.card-map__surface:has([data-style="ink"])     .maplibregl-canvas { filter: saturate(0)   contrast(1.15) brightness(0.92); }

/* keep overlay UI above the map */
.map-compass,
.map-controls,
.map-tolerance,
.map-hint,
.map-pin,
.truth-pin,
.geo-line,
.map-dist,
.map-attrib {
  z-index: 5;
}
.map-controls .map-ctrl { cursor: pointer; }

/* map overlays */
.map-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  z-index: 4;
  transition: opacity .4s ease;
}
.map-hint__chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  background: rgba(8,10,16,0.78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--rule-lit);
  border-radius: var(--r-pill);
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.map-hint__chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 8px var(--brass); }

.map-controls { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-ctrl {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(8,10,16,0.75);
  border: 1px solid var(--rule-lit);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 16px;
  transition: all .18s ease;
}
.map-ctrl:hover { color: var(--brass-hi); border-color: var(--brass-deep); }

.map-compass {
  position: absolute; top: 14px; left: 14px;
  width: 38px; height: 38px;
  color: var(--paper);
  opacity: 0.55;
  pointer-events: none;
  z-index: 4;
}
.map-tolerance {
  position: absolute;
  left: 14px; top: 62px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--paper);
  background: rgba(8,10,16,0.75);
  border: 1px solid var(--rule-lit);
  border-radius: 6px;
  padding: 5px 10px 5px 8px;
  z-index: 4;
  display: flex; align-items: center; gap: 8px;
}
.map-tolerance .tol-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }

/* distance label riding each guess→answer arc on reveal — shows how far off */
.map-dist {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--paper);
  background: rgba(8,10,16,0.82);
  border: 1px solid color-mix(in srgb, var(--pc, var(--rule-lit)) 70%, transparent);
  border-radius: 6px;
  padding: 3px 7px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.45);
}
.map-attrib {
  position: absolute; right: 14px; bottom: 12px;
  font-family: var(--font-sans);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  background: rgba(8,10,16,0.5);
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 4;
}

/* great-circle arcs (one per player, colored) */
.geo-line { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.geo-line path {
  fill: none;
  stroke: var(--pc);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  filter: drop-shadow(0 0 6px var(--pglow));
  opacity: 0.7;
}

/* map pins */
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
  width: 26px; height: 26px;
}
.map-pin.is-current { z-index: 7; }
.map-pin__disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in oklab, white 25%, var(--pc)), var(--pc) 65%);
  display: grid; place-items: center;
  box-shadow:
    0 0 0 2px rgba(8,10,16,0.55),
    0 0 14px var(--pglow),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.3);
}
.map-pin__letter {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  color: var(--pink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.15);
}
.map-pin__ring {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--pc);
  opacity: 0;
}
.map-pin.is-current .map-pin__ring,
.map-pin--truth .map-pin__ring {
  opacity: 0.5;
  animation: ring-pulse 2.4s ease-out infinite;
}
@keyframes ring-pulse {
  0%   { transform: scale(0.75); opacity: 0.6; }
  100% { transform: scale(2.1);  opacity: 0;   }
}

.map-pin--truth { color: var(--verd); --pc: var(--verd); --pglow: var(--verd-soft); --pink: #0d1814; z-index: 8; width: 30px; height: 30px; animation: pin-arrive 0.6s ease-out both; }
.map-pin--truth .map-pin__disc {
  background: radial-gradient(circle at 30% 30%, #b6f0d8, var(--verd) 65%);
  box-shadow: 0 0 0 2px rgba(8,10,16,0.55), 0 0 22px rgba(109,191,163,0.7), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* TRUTH PIN — a distinct star marker, larger than player pins so it stands
   out even when overlapping. Two pulsing halos extend well beyond any disc. */
.truth-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  width: 44px; height: 44px;
}
.truth-pin__star {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 14px rgba(109,191,163,0.8));
}
.truth-pin__halo {
  position: absolute;
  left: 50%; top: 50%;
  width: 60px; height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid var(--verd);
  opacity: 0.6;
  /* Use halo-pulse (not ring-pulse) — the shared ring-pulse keyframe sets
     `transform: scale(...)` which clobbers the centering translate above,
     dragging the rings down-right of the truth point. halo-pulse keeps
     the translate so the rings stay centered on the answer. */
  animation: halo-pulse 2.6s ease-out infinite;
}
.truth-pin__halo--2 { animation-delay: 1.3s; }
@keyframes halo-pulse {
  0%   { transform: translate(-50%, -50%) scale(0.75); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(2.1);  opacity: 0;   }
}
@keyframes pin-arrive {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

/* ---------- truth strip ---------- */
.truth-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--verd-soft) 0%, transparent 60%);
  border: 1px solid rgba(109,191,163,0.25);
  border-radius: 8px;
  flex-wrap: wrap;
}
.truth-strip__label {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 10px;
  font-weight: 700;
  color: var(--verd);
  padding: 3px 10px;
  background: rgba(109,191,163,0.18);
  border-radius: var(--r-pill);
  border: 1px solid rgba(109,191,163,0.35);
  white-space: nowrap;
}
.truth-strip__value {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  color: var(--paper);
  flex: 1; min-width: 0;
}
.truth-strip__meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ---------- scale cards ---------- */
.scale-card { padding: calc(var(--pad) * var(--density)); }
.scale-readout {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 2px;
  min-height: 56px;
  flex-shrink: 0;
}
.scale-readout__value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(50px * var(--scale));
  line-height: 1;
  color: var(--paper);
  letter-spacing: -0.005em;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.scale-readout__value.is-truth { color: var(--verd); }
.scale-readout__placeholder {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--text-faint);
  font-weight: 500;
  white-space: nowrap;
}
.scale-readout__unit {
  font-family: var(--font-sans);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}
.scale-readout__unit sup { font-family: var(--font-mono); font-size: 0.75em; }

/* ---------- scale track ---------- */
.scale-track-wrap {
  position: relative;
  margin-top: 8px;
  height: 90px;
  flex-shrink: 0;
}
.scale-bands {
  position: absolute;
  left: 0; right: 0;
  top: 22px;
  height: 28px;
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.scale-band {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 10.5px;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
}
.scale-band + .scale-band { border-left: 1px solid rgba(8,10,16,0.55); }
.scale-band > span { padding: 0 4px; opacity: 0.85; }

.log-decades {
  position: absolute;
  left: 0; right: 0;
  top: 22px;
  height: 28px;
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.log-decade {
  position: relative;
  flex: 1;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
  background: linear-gradient(180deg, rgba(255,255,255,0.012) 0%, rgba(0,0,0,0.18) 100%);
}
.log-decade + .log-decade { border-left: 1px solid var(--rule); }
.log-decade--lit { color: var(--brass); background: linear-gradient(180deg, rgba(212,166,87,0.08) 0%, rgba(212,166,87,0.14) 100%); }
.log-decade__ticks { position: absolute; inset: 0; pointer-events: none; }
.log-decade__ticks span {
  position: absolute; top: 0; width: 1px; height: 6px;
  background: rgba(255,255,255,0.1);
}

.scale-rail-wrap {
  position: absolute;
  left: 0; right: 0;
  top: 16px;
  height: 40px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.scale-rail {
  position: absolute;
  left: 0; right: 0;
  top: 14px; height: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  pointer-events: none;
}

.scale-needle {
  position: absolute;
  width: 1px;
  top: 0; bottom: 0;
  background: var(--brass);
  opacity: 0.4;
  pointer-events: none;
}
.scale-needle.is-truth { background: var(--verd); opacity: 0.9; box-shadow: 0 0 6px var(--verd-soft); }

/* player handles (multi-player) — staggered vertically via --py so multiple
   handles can co-exist around the truth without occluding it. */
.player-handle {
  position: absolute;
  top: 18px;
  transform: translate(-50%, calc(-50% + var(--py, 0px)));
  pointer-events: none;
  z-index: 5;
}
.player-handle__stem {
  /* Hairline from disc to the rail so handles offset above/below stay anchored. */
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--pc);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}
.player-handle[style*="--py: -"] .player-handle__stem { top: 50%; height: calc(-1 * var(--py, 0px)); transform: translateX(-50%); }
.player-handle:not([style*="--py: -"]) .player-handle__stem { bottom: 50%; height: var(--py, 0px); transform: translateX(-50%); }
.player-handle__disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in oklab, white 25%, var(--pc)), var(--pc) 65%);
  box-shadow:
    0 0 0 2px rgba(8,10,16,0.6),
    0 0 12px var(--pglow),
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.25);
}
.player-handle__letter {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  color: var(--pink);
  letter-spacing: 0;
}
.player-handle.is-active .player-handle__disc {
  box-shadow:
    0 0 0 2px rgba(8,10,16,0.6),
    0 0 18px var(--pglow),
    inset 0 1px 0 rgba(255,255,255,0.55);
  animation: handle-shimmer 3.4s ease-in-out infinite;
}
@keyframes handle-shimmer {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.18); }
}
.player-handle.is-current:not(.is-active) {
  /* on reveal, slight emphasis ring */
}
.player-handle.is-current:not(.is-active) .player-handle__disc {
  box-shadow:
    0 0 0 2.5px var(--pc),
    0 0 0 4px rgba(8,10,16,0.7),
    0 0 18px var(--pglow);
}

/* truth disc */
.scale-handle.is-truth {
  position: absolute;
  top: 18px;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: 28px; height: 28px;
  pointer-events: none;
  color: var(--verd);
  animation: pin-arrive 0.7s ease-out 0.3s both;
}
.scale-handle.is-truth .scale-handle__disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #b6f0d8, var(--verd) 65%);
  box-shadow:
    0 0 0 2px rgba(8,10,16,0.65),
    0 0 24px rgba(109,191,163,0.6),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

/* tolerance bracket */
.scale-bracket {
  position: absolute;
  top: 16px;
  height: 6px;
  pointer-events: none;
  z-index: 3;
}
.scale-bracket__bar {
  position: absolute;
  inset: 4px 0 0 0;
  background: var(--verd-soft);
  border-left: 1px solid var(--verd);
  border-right: 1px solid var(--verd);
}
.scale-bracket__cap-l, .scale-bracket__cap-r {
  position: absolute;
  width: 6px;
  border: 1px solid var(--verd);
  border-bottom: 0;
  top: 0; height: 5px;
}
.scale-bracket__cap-l { left: 0; border-right: 0; }
.scale-bracket__cap-r { right: 0; border-left: 0; }

/* axis */
.scale-axis {
  position: absolute;
  left: 0; right: 0;
  top: 56px;
  height: 22px;
  pointer-events: none;
}
.scale-tick {
  position: absolute;
  top: 0; width: 1px;
  background: var(--rule-lit);
}
.scale-tick.major  { height: 8px; background: var(--text-dim); }
.scale-tick.decade { height: 10px; background: var(--brass-deep); }
.scale-tick-label {
  position: absolute;
  top: 12px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ---------- leaderboard ---------- */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.lb-row {
  display: grid;
  grid-template-columns: 26px minmax(80px, 1fr) minmax(120px, 1.6fr) minmax(80px, 1fr) 50px;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.012);
  border: 1px solid transparent;
  transition: all .2s ease;
}
.lb-row.is-current {
  border-color: rgba(212,166,87,0.25);
  background: rgba(212,166,87,0.04);
}
.lb-row.tone-perfect { background: rgba(109,191,163,0.08); }
.lb-row.tone-good    { background: rgba(109,191,163,0.05); }
.lb-row.tone-ok      { background: rgba(212,166,87,0.05); }
.lb-row.tone-bad     { background: rgba(211,90,74,0.04); }
.lb-row.tone-skip    { opacity: 0.55; }

.lb-row__chip {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  flex-shrink: 0;
}
.lb-row__name {
  font-size: 12.5px;
  color: var(--text);
  display: flex; align-items: center; gap: 7px;
  font-weight: 500;
}
.lb-row__you {
  font-family: var(--font-sans);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--brass-soft);
  color: var(--brass-hi);
  border: 1px solid var(--brass-deep);
}
.lb-row__guess {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}
.lb-row__bar {
  height: 5px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}
.lb-row__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass-hi));
  border-radius: 3px;
  transition: width .8s cubic-bezier(0.2,0.7,0.3,1);
}
.lb-row.tone-perfect .lb-row__bar-fill,
.lb-row.tone-good    .lb-row__bar-fill { background: linear-gradient(90deg, var(--verd-deep), var(--verd)); }
.lb-row.tone-bad     .lb-row__bar-fill { background: linear-gradient(90deg, var(--ox-deep), var(--ox)); }

.lb-row__pts {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--brass);
  text-align: right;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.lb-row.tone-perfect .lb-row__pts,
.lb-row.tone-good    .lb-row__pts { color: var(--verd); }
.lb-row.tone-bad     .lb-row__pts { color: var(--ox); }
.lb-row.tone-skip    .lb-row__pts { color: var(--text-faint); }

/* ---------- trivia ---------- */
.trivia {
  margin-top: 4px;
  padding: 13px 16px 13px 18px;
  background:
    linear-gradient(90deg, var(--brass) 0%, var(--brass) 2px, transparent 2px),
    linear-gradient(180deg, rgba(212,166,87,0.05) 0%, rgba(212,166,87,0.02) 100%);
  border: 1px solid var(--rule);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.trivia__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1;
  color: var(--brass);
  flex-shrink: 0;
  margin-top: -3px;
}
.trivia__body {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.trivia__label {
  font-family: var(--font-sans);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 9px;
  color: var(--brass);
  font-weight: 700;
  margin-right: 10px;
}

/* ---------- bottom bar ---------- */
.bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 0;
  /* Reserve the footer height for the whole guessing phase so the board (and the
     map) don't shrink the moment the "Reveal round" button appears. */
  min-height: 72px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--ink-deepest) 30%);
  z-index: 30;
  margin-top: auto;
}
.submit {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 60%, var(--brass-deep) 100%);
  color: var(--ink-deepest);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.4),
    0 18px 50px -16px rgba(240,200,117,0.5),
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  transition: transform .18s ease;
}
.submit:hover { transform: translateY(-1px); }
.submit__arrow { font-size: 16px; line-height: 1; }
.submit.is-disabled {
  background: var(--card);
  color: var(--text-faint);
  box-shadow: 0 0 0 1px var(--rule);
  cursor: not-allowed;
  padding: 14px 32px;
}
.submit.is-disabled:hover { transform: none; }

/* Reveal bar — per-player score on left, Next-round button on right */
.reveal-bar {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 6px 6px 6px 22px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--rule-lit);
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.18),
    0 20px 60px -20px rgba(8,10,16,0.6);
}
.reveal-bar__score {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 18px;
  border-right: 1px solid var(--rule);
  margin-right: 16px;
}
.reveal-bar__score-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.reveal-bar__score-label span { color: inherit; }
.reveal-bar__score-delta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1;
  color: var(--brass-hi);
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: -0.01em;
}
.reveal-bar__score-of {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}
.reveal-bar .submit { padding: 14px 26px; }

/* ---------- transition plate ---------- */
.transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: radial-gradient(800px 600px at 50% 45%, rgba(20,24,32,0.92) 0%, rgba(8,10,14,0.98) 80%);
  backdrop-filter: blur(4px);
  pointer-events: none;
  animation: trans-in .5s ease both, trans-out .5s ease 1.85s both;
}
@keyframes trans-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes trans-out { from { opacity: 1; } to { opacity: 0; } }

.transition__plate {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 40px 80px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  max-width: 80vw;
}
.transition__plate::before, .transition__plate::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 60px; height: 1px;
  background: var(--brass);
}
.transition__plate::before { top: -3px; }
.transition__plate::after  { bottom: -3px; }
.transition__round {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
}
.transition__cat {
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
}
.transition__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 84px;
  line-height: 1.18;
  padding-bottom: 0.05em;
  color: var(--paper);
  letter-spacing: -0.01em;
  text-shadow: 0 4px 40px rgba(0,0,0,0.5);
}
.transition__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--text-dim);
}
.transition__tags { display: flex; gap: 10px; margin-top: 4px; }

/* ---------- tweaks ---------- */
[data-density="compact"]  { --gap: 14px; --pad: 16px; }
[data-density="spacious"] { --gap: 26px; --pad: 28px; }

/* hide default MapLibre controls */
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right { display: none !important; }

/* ---------- TopicPicker — pick 1 of 3 cards ---------- */
.picker {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 40px 40px;
  background: radial-gradient(900px 700px at 50% 50%, rgba(20,24,32,0.92) 0%, rgba(8,10,14,0.99) 75%);
  animation: art-overlay-fade 0.4s ease both;
}
.picker__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}
.picker__eyebrow {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
}
.picker__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 38px;
  line-height: 1.1;
  color: var(--paper);
  letter-spacing: -0.005em;
  text-align: center;
}
.picker__timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule-lit);
  background: rgba(8,10,16,0.6);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.06em;
}
.picker__timer.is-low {
  color: var(--ox);
  border-color: var(--ox-deep);
  background: var(--ox-soft);
  animation: timer-low-pulse 1s ease-in-out infinite;
}
.picker__timer-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass);
}
.picker__timer.is-low .picker__timer-dot { background: var(--ox); box-shadow: 0 0 8px var(--ox); }

.picker__deck {
  display: flex;
  gap: 32px;
  align-items: center;
  perspective: 1600px;
}

.picker-card {
  width: 280px;
  aspect-ratio: 3/4;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--rule-lit);
  cursor: pointer;
  transform: rotateZ(var(--fan, 0deg)) translateY(0);
  transition:
    transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.4s ease,
    opacity 0.4s ease;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.08),
    0 30px 80px -30px rgba(0,0,0,0.7),
    inset 0 0 0 6px rgba(8,10,16,0.55),
    inset 0 0 0 7px rgba(212,166,87,0.18);
  padding: 0;
  font: inherit;
  color: inherit;
}
.picker-card:nth-child(2) {
  width: 308px;  /* slightly bigger center card */
}
.picker-card.is-hovered {
  transform: rotateZ(0deg) translateY(-12px);
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.4),
    0 50px 120px -30px rgba(212,166,87,0.4),
    inset 0 0 0 6px rgba(8,10,16,0.55),
    inset 0 0 0 7px rgba(212,166,87,0.5);
}
.picker-card.is-picked {
  transform: rotateZ(0deg) translateY(-20px) scale(1.18);
  z-index: 5;
  box-shadow:
    0 0 0 1.5px var(--brass),
    0 70px 160px -30px rgba(240,200,117,0.6),
    inset 0 0 0 6px rgba(8,10,16,0.55),
    inset 0 0 0 7px rgba(240,200,117,0.6);
}
.picker-card.is-rejected {
  opacity: 0.18;
  transform: rotateZ(var(--fan, 0deg)) translateY(60px) scale(0.92);
  filter: blur(2px);
}
.picker-card__art {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 1;
}
.picker-card__art svg { width: 100%; height: 100%; }

.picker-card__band {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
  background: linear-gradient(180deg, transparent 0%, rgba(8,10,16,0.85) 60%, rgba(8,10,16,0.95) 100%);
}
.picker-card__eyebrow {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
}
.picker-card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.08;
  color: var(--paper);
  letter-spacing: -0.005em;
}
.picker-card__corner {
  position: absolute;
  top: 14px; right: 16px;
  z-index: 3;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: var(--brass);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  opacity: 0.7;
}

.picker__hint {
  margin-top: 36px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--text-faint);
}

@media (max-width: 1100px) {
  .picker__deck { gap: 18px; }
  .picker-card { width: 220px; }
  .picker-card:nth-child(2) { width: 240px; }
  .picker__title { font-size: 28px; }
}

/* ---------- art-card round intro ---------- */
.art-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  perspective: 2000px;
  pointer-events: auto;
  cursor: pointer;
  background: radial-gradient(900px 700px at 50% 45%, rgba(20,24,32,0.94) 0%, rgba(8,10,14,0.99) 75%);
  opacity: 0;
  animation: art-overlay-fade 0.45s ease both;
}
.art-overlay.phase-flip,
.art-overlay.phase-gone {
  animation: art-overlay-out 0.7s ease forwards;
  pointer-events: none;
}
@keyframes art-overlay-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes art-overlay-out {
  0%   { opacity: 1; }
  100% { opacity: 0; backdrop-filter: blur(0px); }
}

.art-overlay__skip {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0.6;
  pointer-events: none;
}

.art-card {
  width: min(420px, 70vw);
  aspect-ratio: 3 / 4;
  transform-style: preserve-3d;
  transform: rotateY(0deg) scale(1);
  transition: transform 0.7s cubic-bezier(0.6, 0.05, 0.3, 0.95);
}
.art-overlay.phase-flip .art-card,
.art-overlay.phase-gone .art-card {
  transform: rotateY(-180deg) scale(0.92);
}
.art-overlay.phase-enter .art-card {
  animation: art-card-enter 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes art-card-enter {
  from { transform: rotateY(0deg) scale(0.7); opacity: 0; }
  to   { transform: rotateY(0deg) scale(1);   opacity: 1; }
}

.art-card__inner {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--rule-lit);
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.18),
    0 60px 160px -40px rgba(0,0,0,0.85),
    0 30px 80px -30px rgba(212,166,87,0.18),
    inset 0 0 0 8px rgba(8,10,16,0.5),
    inset 0 0 0 9px rgba(212,166,87,0.25);
  backface-visibility: hidden;
}

.art-card__round {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass-hi);
  padding: 4px 14px;
  background: rgba(8,10,16,0.6);
  border: 1px solid var(--brass-deep);
  border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.art-card__art {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.art-card__svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* Real watercolor images — fill the slot like the SVG placeholder did */
.art-card__art .topic-art-img,
.picker-card__art .topic-art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.art-card__title-band {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 24px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(8,10,16,0.85) 70%, rgba(8,10,16,0.92) 100%);
}
.art-card__eyebrow {
  font-family: var(--font-sans);
  font-size: 9.5px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
}
.art-card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.02;
  color: var(--paper);
  letter-spacing: -0.005em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.art-card__narrating {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.art-card__wave {
  display: inline-flex; align-items: center; gap: 2px;
}
.art-card__wave span {
  display: inline-block;
  width: 2px; height: 8px;
  background: var(--brass);
  border-radius: 1px;
  animation: art-wave 1.2s ease-in-out infinite;
}
.art-card__wave span:nth-child(2) { animation-delay: 0.15s; }
.art-card__wave span:nth-child(3) { animation-delay: 0.30s; height: 14px; }
.art-card__wave span:nth-child(4) { animation-delay: 0.45s; }
.art-card__wave span:nth-child(5) { animation-delay: 0.60s; }
@keyframes art-wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  50%      { transform: scaleY(1);   opacity: 1; }
}
.timer-bar {
  position: sticky;
  top: 0;
  left: 0; right: 0;
  height: 3px;
  background: rgba(212,166,87,0.08);
  z-index: 50;
  margin: -18px -26px 0 -26px;
}
.timer-bar__fill {
  height: 100%;
  width: var(--pct, 100%);
  background: linear-gradient(90deg, var(--brass-deep), var(--brass-hi));
  transition: width 1s linear;
  box-shadow: 0 0 12px var(--brass-soft);
}
.timer-bar.is-low .timer-bar__fill {
  background: linear-gradient(90deg, var(--ox-deep), var(--ox));
  animation: timer-low-pulse 1s ease-in-out infinite;
}
@keyframes timer-low-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* timer readout in topbar center */
.timer-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.012);
}
.timer-readout svg { color: var(--brass); flex-shrink: 0; }
.timer-readout.is-low {
  color: var(--ox);
  border-color: var(--ox-deep);
  background: var(--ox-soft);
  animation: timer-low-pulse 1s ease-in-out infinite;
}
.timer-readout.is-low svg { color: var(--ox); }

/* roster chip — pick-progress indicator */
.roster-chip__progress {
  display: inline-flex;
  flex-direction: column;
  gap: 2.5px;
  margin-left: 6px;
}
.roster-pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rule);
  transition: background .2s ease, transform .2s ease;
}
.roster-pip.is-on {
  background: var(--pc);
  transform: scale(1.15);
  box-shadow: 0 0 6px var(--pglow);
}
.roster-chip[data-picks="2"] .roster-pip,
.roster-chip__progress[data-picks="2"] .roster-pip { /* both filled */ }

/* ---------- setup screen ---------- */
.setup {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
}
.setup__backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(900px 700px at 50% 30%, rgba(20,24,32,0.94), rgba(8,10,14,0.98));
  backdrop-filter: blur(4px);
}
.setup__card {
  position: relative;
  width: min(540px, 92vw);
  max-height: 92vh;
  overflow: auto;
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--rule-lit);
  border-radius: 18px;
  padding: 28px 32px 24px;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.18),
    0 60px 160px -40px rgba(0,0,0,0.8),
    0 30px 80px -30px rgba(212,166,87,0.18);
}
.setup__head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.setup__lede {
  position: relative;
  margin: 0 0 18px;
  padding-left: 18px;
  font-family: var(--font-sans);
}
.setup__how {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brass);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.setup__how::before {
  content: "ⓘ";
  font-size: 12px;
  font-weight: 400;
  color: var(--brass);
}
.setup__how-body {
  display: block;
  max-height: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  opacity: 0;
  transition: max-height .3s ease, opacity .25s ease, margin-top .25s ease;
}
.setup__lede:hover .setup__how-body,
.setup__lede:focus-within .setup__how-body,
.setup__lede.is-open .setup__how-body {
  max-height: 200px;
  margin-top: 10px;
  opacity: 1;
}
.setup__lede::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 2px;
  height: 14px;
  background: var(--brass);
  border-radius: 1px;
  transition: height .3s ease;
}
.setup__lede:hover::before,
.setup__lede:focus-within::before,
.setup__lede.is-open::before {
  height: calc(100% - 4px);
}
.setup__brand {
  display: flex; flex-direction: column; gap: 2px;
  margin-left: 2px;
}
.setup__brand-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--paper);
}
.setup__brand-mark .amp {
  font-style: normal;
  color: var(--brass);
  margin: 0 2px;
  font-size: 0.7em;
  vertical-align: 0.25em;
  letter-spacing: 0;
}
.setup__brand-sub {
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.setup__close {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.02);
  transition: all .18s ease;
}
.setup__close:hover { color: var(--text); background: var(--elev); }

.setup__title { display: none; }

.setup__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.setup__label {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  white-space: nowrap;
}
.setup__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--brass);
}
.setup__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* segmented control */
.seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  padding: 3px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.seg__btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  transition: all .15s ease;
}
.seg__btn:hover { color: var(--text); background: var(--elev); }
.seg__btn.is-on {
  background: var(--brass-soft);
  color: var(--brass-hi);
  box-shadow: inset 0 0 0 1px var(--brass-deep);
}
.seg__lbl { font-weight: 600; }
.seg__sub {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.55;
}
.seg__btn.is-on .seg__sub { opacity: 0.8; }
.seg + .seg { margin-top: 6px; }

/* slider with letterform ticks */
.slider-field { padding-top: 4px; }
.slider-field__input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(212,166,87,0.18);
  border-radius: 2px;
  outline: none;
  margin-bottom: 8px;
}
.slider-field__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brass-hi), var(--brass) 60%);
  box-shadow: 0 0 0 2px rgba(212,166,87,0.18), 0 0 12px var(--brass-soft);
  cursor: pointer;
}
.slider-field__input::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brass);
  border: 0;
  box-shadow: 0 0 12px var(--brass-soft);
  cursor: pointer;
}
.slider-field__ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}
.slider-field__tick.is-on { color: var(--brass-hi); }

.setup__begin {
  margin-top: 24px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 32px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 60%, var(--brass-deep) 100%);
  color: var(--ink-deepest);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.4),
    0 18px 50px -16px rgba(240,200,117,0.5),
    inset 0 1px 0 rgba(255,255,255,0.45);
  transition: transform .18s ease;
}
.setup__begin:hover { transform: translateY(-1px); }
.setup__begin-arrow { font-size: 16px; line-height: 1; }

/* ==========================================================================
   Cartographer's Journal — expedition mode
   ========================================================================== */

/* ---------- ExpeditionPicker in the setup screen ---------- */
.setup__field--xp { padding-top: 6px; }

.xp-picker__head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.xp-picker__eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 10px;
  font-weight: 700;
  color: var(--brass);
}
.xp-picker__sub {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
}
.xp-picker__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.xp-picker__track::-webkit-scrollbar { height: 6px; }
.xp-picker__track::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.xp-card {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  font: inherit; color: inherit;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.xp-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--brass-deep);
  box-shadow: 0 18px 40px -20px rgba(212,166,87,0.4);
}
.xp-card.is-selected {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px var(--brass-deep), 0 24px 50px -20px rgba(240,200,117,0.5);
}
.xp-card.is-locked  { opacity: 0.45; cursor: not-allowed; }
.xp-card.is-completed { border-color: var(--verd-deep); }

.xp-card__emblem-frame {
  position: relative;
  background: #07090d;
  aspect-ratio: 3 / 4;
  border-bottom: 1px solid var(--rule);
}
.xp-card__emblem { width: 100%; height: 100%; display: block; }
.xp-card__locked, .xp-card__completed {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(8,10,16,0.78);
}
.xp-card__locked { color: var(--text-dim); }
.xp-card__completed {
  background: var(--verd-deep);
  color: #0d1814;
}

.xp-card__meta {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px 12px;
}
.xp-card__rounds {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.xp-card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--paper);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.xp-card__sub {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}
.xp-card__score {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--verd);
}
.xp-card__perfect { margin-left: 6px; color: var(--brass-hi); }

.xp-open-atlas {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule-lit);
  background: rgba(255,255,255,0.018);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: all .18s ease;
  align-self: flex-start;
}
.xp-open-atlas:hover { color: var(--brass-hi); border-color: var(--brass-deep); }
.xp-open-atlas span { color: var(--brass); }

/* ---------- ExpeditionTitleCard ---------- */
.xp-title {
  position: fixed; inset: 0;
  z-index: 96;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 700px at 50% 50%, rgba(20,24,32,0.94) 0%, rgba(8,10,14,0.99) 75%),
    repeating-linear-gradient(45deg, rgba(212,166,87,0.02) 0 2px, transparent 2px 8px);
  opacity: 0;
  animation: xp-overlay-in 0.5s ease both;
  cursor: pointer;
}
.xp-title.phase-out { animation: xp-overlay-out 0.55s ease forwards; pointer-events: none; }
@keyframes xp-overlay-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes xp-overlay-out { from { opacity: 1; } to { opacity: 0; } }

.xp-title__plate {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 32px 80px 40px;
  max-width: min(640px, 80vw);
  position: relative;
}
.xp-title__plate::before, .xp-title__plate::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass) 30%, var(--brass) 70%, transparent);
}
.xp-title__plate::before { top: 0; }
.xp-title__plate::after  { bottom: 0; }

.xp-title__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brass);
}
.xp-title__emblem { width: 140px; height: 182px; }
.xp-title__emblem svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
.xp-title__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 64px;
  line-height: 1;
  color: var(--paper);
  letter-spacing: -0.005em;
  text-shadow: 0 6px 40px rgba(0,0,0,0.5);
  text-align: center;
}
.xp-title__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--text-2);
  text-align: center;
  max-width: 520px;
}
.xp-title__narr {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* ---------- InterstitialCard ---------- */
.xp-intr {
  position: fixed; inset: 0;
  z-index: 94;
  display: grid; place-items: center;
  background: radial-gradient(700px 500px at 50% 50%, rgba(20,24,32,0.92) 0%, rgba(8,10,14,0.97) 70%);
  opacity: 0;
  animation: xp-overlay-in 0.4s ease both;
  cursor: pointer;
}
.xp-intr.phase-out { animation: xp-overlay-out 0.5s ease forwards; pointer-events: none; }

.xp-intr__plate {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 28px 48px 28px;
  max-width: min(720px, 86vw);
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--rule-lit);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.18),
    0 40px 80px -30px rgba(0,0,0,0.8);
  position: relative;
}
.xp-intr__progress {
  display: flex; gap: 10px;
}
.xp-intr__pip {
  width: 24px; height: 4px;
  border-radius: 2px;
  background: var(--rule-lit);
  transition: background .25s ease;
}
.xp-intr__pip.is-on { background: var(--brass); box-shadow: 0 0 8px var(--brass-soft); }

.xp-intr__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.35;
  color: var(--paper);
  letter-spacing: -0.005em;
  text-align: center;
  text-wrap: pretty;
}
.xp-intr__quote { color: var(--brass); font-style: normal; }
.xp-intr__narr {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* ---------- AtlasUnlockCard ---------- */
.xp-unlock {
  position: fixed; inset: 0;
  z-index: 97;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 700px at 50% 50%, rgba(28,24,16,0.97) 0%, rgba(8,10,14,0.99) 75%);
  opacity: 0;
  animation: xp-overlay-in 0.5s ease both;
  overflow: auto;
}

.xp-unlock__plate {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 34px 60px;
  max-width: min(560px, 92vw);
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--brass-deep);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.32),
    0 60px 120px -30px rgba(212,166,87,0.4),
    0 30px 80px -30px rgba(0,0,0,0.8);
  position: relative;
}

.xp-unlock__eyebrow {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brass);
}
.xp-unlock__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 38px;
  line-height: 1;
  color: var(--paper);
  letter-spacing: -0.005em;
  text-align: center;
}
.xp-unlock__emblem {
  width: 160px; height: 208px;
  margin-top: 8px;
  animation: xp-unlock-emblem 1.1s cubic-bezier(0.2,0.7,0.3,1) both;
  filter: drop-shadow(0 0 30px rgba(212,166,87,0.4));
}
.xp-unlock__emblem svg { width: 100%; height: 100%; display: block; border-radius: 8px; }
@keyframes xp-unlock-emblem {
  0%   { opacity: 0; transform: scale(0.6) rotateY(-30deg); }
  60%  { opacity: 1; transform: scale(1.05) rotateY(0deg); }
  100% { opacity: 1; transform: scale(1)    rotateY(0deg); }
}

.xp-unlock__score {
  margin-top: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.xp-unlock__score-line {
  display: inline-flex; align-items: baseline; gap: 10px;
}
.xp-unlock__score-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
}
.xp-unlock__score-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  color: var(--brass-hi);
  letter-spacing: -0.01em;
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.xp-unlock__score-of {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}
.xp-unlock__perfect {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--verd);
}

.xp-unlock__copy {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--text-2);
  text-align: center;
  max-width: 420px;
  line-height: 1.5;
  margin-top: 4px;
}

.xp-unlock__actions {
  display: flex; gap: 12px;
  margin-top: 12px;
}
.xp-unlock__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--rule-lit);
  background: rgba(255,255,255,0.018);
  color: var(--text-2);
  transition: all .15s ease;
}
.xp-unlock__btn:hover { color: var(--text); border-color: var(--brass-deep); }
.xp-unlock__btn--primary {
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 60%, var(--brass-deep) 100%);
  color: var(--ink-deepest);
  border-color: var(--brass-deep);
  box-shadow:
    0 0 0 1px rgba(212,166,87,0.4),
    0 14px 30px -10px rgba(240,200,117,0.5);
}
.xp-unlock__btn--primary:hover { color: var(--ink-deepest); transform: translateY(-1px); }
.xp-unlock__btn--primary span { font-size: 14px; }

/* ---------- AtlasOverview ---------- */
.xp-atlas {
  position: fixed; inset: 0;
  z-index: 98;
  display: flex; flex-direction: column;
  background: radial-gradient(1200px 800px at 50% 30%, rgba(20,24,32,0.97) 0%, rgba(8,10,14,0.99) 75%);
  padding: 22px 32px 32px;
}
.xp-atlas__head {
  display: flex; align-items: center; gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}
.xp-atlas__eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  color: var(--paper);
}
.xp-atlas__count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}
.xp-atlas__close {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.02);
  transition: all .18s ease;
  cursor: pointer;
}
.xp-atlas__close:hover { color: var(--text); background: var(--elev); }

.xp-atlas__sheet {
  position: relative;
  flex: 1;
  background:
    radial-gradient(900px 600px at 50% 50%, rgba(212,166,87,0.04), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.9  0 0 0 0 0.8  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  color: var(--paper);
}
.xp-atlas__world {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.xp-atlas__pin {
  position: absolute;
  width: 56px;
  height: 72px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.xp-atlas__pin-emblem {
  width: 100%; height: 100%;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--rule-lit);
}
.xp-atlas__pin-emblem svg { width: 100%; height: 100%; display: block; }
.xp-atlas__pin.is-locked .xp-atlas__pin-emblem { opacity: 0.25; filter: grayscale(0.7); }
.xp-atlas__pin.is-open .xp-atlas__pin-emblem { box-shadow: 0 0 0 1px var(--brass-deep), 0 0 16px var(--brass-soft); }
.xp-atlas__pin.is-done .xp-atlas__pin-emblem { box-shadow: 0 0 0 1.5px var(--brass), 0 0 22px rgba(240,200,117,0.5); }
.xp-atlas__pin:hover:not(.is-locked) { transform: translate(-50%, -54%); }

.xp-atlas__pin-tip {
  position: absolute;
  left: 50%; top: 100%;
  transform: translate(-50%, 4px);
  white-space: nowrap;
  max-width: 240px;
  padding: 10px 12px;
  background: rgba(8,10,16,0.92);
  border: 1px solid var(--rule-lit);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-2);
  display: flex; flex-direction: column; gap: 2px;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.7);
}
.xp-atlas__pin-title { color: var(--paper); font-weight: 600; }
.xp-atlas__pin-sub {
  white-space: normal;
  font-size: 11.5px;
  color: var(--text-dim);
  max-width: 240px;
}
.xp-atlas__pin-stats {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--brass);
  letter-spacing: 0.06em;
}
.xp-atlas__pin-stats b { color: var(--brass-hi); }
@media (max-width: 1300px) {
  .topic-title { font-size: 44px !important; }
  .roster-chip__name { display: none; }
  .roster-chip { padding: 4px; }
  .roster-chip__body { display: none; }
}
@media (max-width: 1100px) {
  .board { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .board > .card-map  { grid-column: 1; grid-row: 1; min-height: 360px; }
  .board > .card-year { grid-column: 1; grid-row: 2; }
  .board > .card-cnt  { grid-column: 1; grid-row: 3; }
  .topic-title { font-size: 36px !important; }
  .transition__title { font-size: 56px !important; }
  .lb-row { grid-template-columns: 26px 1fr 1fr 50px; }
  .lb-row__bar { display: none; }
}

/* ============ Bug-report flag ============
   Renders only during the reveal state (after the player has scored), sits
   on the same line as the topic title. Always visible when present — the
   user previously found the hover-reveal pattern unselectable because the
   mouse path from title to flag broke the hover state. */
.topic-title-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: flex-start;
  max-width: 100%;
}
.bug-flag-wrap {
  position: relative;
  flex: 0 0 auto;
  z-index: 12;
}
.bug-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%;
  background: rgba(20,16,12,0.55); color: rgba(212,166,87,0.85);
  border: 1px solid rgba(196,85,74,0.40);
  cursor: pointer; transition: all 0.18s ease;
}
.bug-flag:hover { background: rgba(196,85,74,0.22); color: #d4a657; border-color: rgba(196,85,74,0.70); box-shadow: 0 0 12px rgba(196,85,74,0.35); }
.bug-flag svg { color: #c4554a; }
.bug-popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
  width: 320px; padding: 14px 14px 12px;
  background: #161b24; border: 1px solid rgba(212,166,87,0.30);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.20);
  font-family: "Inter Tight", system-ui, sans-serif;
}
.bug-popover__title { font: 600 13px/1.3 "Inter Tight", sans-serif; color: #ede7d3; margin-bottom: 10px; }
.bug-popover__kinds { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.bug-kind { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: rgba(237,231,211,0.78); font-size: 12px; }
.bug-kind:hover { background: rgba(212,166,87,0.06); color: #ede7d3; }
.bug-kind.is-on { background: rgba(212,166,87,0.12); color: #d4a657; }
.bug-kind input { accent-color: #d4a657; }
.bug-popover__notes {
  width: 100%; padding: 8px; border-radius: 6px;
  background: rgba(0,0,0,0.30); color: #ede7d3;
  border: 1px solid rgba(212,166,87,0.18);
  font: 400 12px/1.35 "Inter Tight", sans-serif; resize: vertical;
  margin-bottom: 10px;
}
.bug-popover__row { display: flex; gap: 6px; justify-content: flex-end; }
.bug-popover__cancel, .bug-popover__submit {
  padding: 6px 12px; border-radius: 999px; font: 500 12px/1 "Inter Tight", sans-serif;
  cursor: pointer; border: 1px solid transparent;
}
.bug-popover__cancel { background: transparent; color: rgba(237,231,211,0.65); }
.bug-popover__cancel:hover { color: #ede7d3; }
.bug-popover__submit { background: #d4a657; color: #1a1408; border-color: #d4a657; }
.bug-popover__submit:hover { background: #e0b56b; }
.bug-popover__sent { color: #6dbfa3; font-size: 13px; padding: 8px 4px; text-align: center; }

/* ============ Count-scale unit label ============
   Tells the player what units the decade ticks represent. */
.scale-unit-label {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin-top: 10px; padding: 4px 0;
  font-family: var(--font-ui);
}
.scale-unit-label__lbl {
  font: 600 9px/1 var(--font-ui); letter-spacing: 0.30em; text-transform: uppercase;
  color: var(--paper-3, rgba(237,231,211,0.45));
}
.scale-unit-label__val {
  font: 500 italic 14px/1 var(--font-display, "Cormorant Garamond", serif);
  color: var(--brass, #d4a657);
}
.scale-readout__unit {
  font: 400 italic 14px/1 var(--font-display, "Cormorant Garamond", serif);
  color: var(--paper-2, rgba(237,231,211,0.74));
  margin-left: 10px;
}
.scale-readout__unit.dim { color: var(--paper-3, rgba(237,231,211,0.45)); }

/* ============ Narrate buttons (Stephen Fry audio) ============
   Small inline play-toggle. Sits inside QHead beside the question text and
   in the truth-strip on reveal. Brass when playing. */
.narrate-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  background: rgba(212,166,87,0.10);
  color: var(--brass, #d4a657);
  border: 1px solid var(--brass-soft, rgba(212,166,87,0.40));
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.14s ease;
  flex-shrink: 0;
}
.narrate-btn:hover {
  background: rgba(212,166,87,0.22);
  color: var(--brass-hi, #e0b56b);
  border-color: var(--brass, #d4a657);
  transform: scale(1.06);
}
.narrate-btn.is-playing {
  background: var(--brass, #d4a657);
  color: #1a1408;
  border-color: var(--brass, #d4a657);
  box-shadow: 0 0 10px var(--brass-soft, rgba(212,166,87,0.55));
}
.narrate-btn svg { display: block; }

/* Topic title is clickable for subject narration — add a faint hint */
.topic-title { cursor: pointer; }
.topic-title:hover { color: var(--brass-hi, #e0b56b); }

/* card head needs to flex so narrate sits next to icon/eyebrow */
.card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card__head .q-text { flex-basis: 100%; margin-top: 4px; }
.truth-strip .narrate-btn { margin-left: 8px; }
