/* assets/css/tokens.css — Game-On design system. Canonical brand values; no page redefines a hex. */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --navy: #0D1B2A; --coral: #E8593C; --teal: #1ABFA0; --amber: #C9A84C;
  --parchment: #F7F6F2; --parchment-2: #E8E6E0; --ink: #0D1B2A; --ink-soft: #5a6a7a;
  --subject-maths: var(--navy); --subject-english: var(--coral);
  --subject-science: var(--teal); --subject-topic: var(--amber);
  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  /* whiteboard-distance type scale */
  --fs-question: clamp(2rem, 5vw, 4.5rem);
  --fs-h1: clamp(1.8rem, 4vw, 3rem);
  --fs-body: clamp(1rem, 1.4vw, 1.25rem);
  --touch: 56px;                 /* min hit target for imprecise whiteboards */
  --radius: 14px;
  --shadow: 0 6px 24px rgba(13,27,42,.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body); color: var(--ink);
  background: var(--parchment);
  /* subtle contour texture via layered radial gradients (placeholder for map art) */
  background-image: radial-gradient(circle at 20% 10%, rgba(26,191,160,.05), transparent 40%),
                    radial-gradient(circle at 85% 80%, rgba(201,168,76,.06), transparent 45%);
}
h1, h2, h3, .title { font-family: var(--font-title); color: var(--navy); }

.btn {
  /* inline-flex + centering so <a class="btn"> looks identical to <button> (no top-aligned text) */
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--touch); min-width: var(--touch);
  padding: 0 1.25rem; border: 0; border-radius: var(--radius);
  /* 700/1.2rem (≈19.2px) qualifies as WCAG large text so parchment-on-coral (3.28:1) clears AA, and reads better at whiteboard distance */
  font: 700 1.2rem var(--font-body); line-height: 1; text-decoration: none; cursor: pointer;
  background: var(--navy); color: var(--parchment);
}
.btn--coral { background: var(--coral); } .btn--teal { background: var(--teal); }
.btn--ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* MindMaps corner mark */
.mm-mark { position: fixed; bottom: 10px; right: 14px; font: 600 .8rem var(--font-body); color: var(--ink-soft); opacity: .8; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- print: A4 card sheets ---- */
@media print {
  @page { size: A4; margin: 15mm 9.75mm; }
  body { background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .no-print { display: none !important; }
}

/* ================================================================
   CARD ANATOMY
   Poker portrait ratio ~2.5:3.5 (63.5mm × 88.9mm).
   --card-colour / --card-ink are set inline by renderCard().
   ================================================================ */

.card {
  --card-colour: var(--navy);
  --card-ink: var(--parchment);
  display: flex;
  flex-direction: column;
  width: 220px;
  aspect-ratio: 63.5 / 88.9;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--parchment);
  font-family: var(--font-body);
  color: var(--ink);
  position: relative;
}

/* ---- Band (~12% of card height) ---- */
.card__band {
  flex: 0 0 12%;
  display: flex;
  align-items: center;
  gap: .35em;
  padding: 0 .55em;
  background: var(--card-colour);
  color: var(--card-ink);
  overflow: hidden;
  white-space: nowrap;
}

.card__subject {
  font: 700 .6em var(--font-body);
  text-transform: uppercase;
  letter-spacing: .08em;
  flex-shrink: 0;
}

.card__chip {
  font: 600 .55em var(--font-body);
  background: rgba(255,255,255,.18);
  border-radius: 4px;
  padding: 0 .4em;
  flex-shrink: 0;
}

.card__deck {
  font: 400 .55em var(--font-body);
  opacity: .85;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Body (flex-centred; font-size set by JS) ---- */
.card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .75em .65em;
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  text-align: center;
  font-family: var(--font-title);
}

/* ---- Answer reveal (qa cards, screen only) ---- */
.card__answer {
  margin-top: .6em;
  padding-top: .5em;
  border-top: 1.5px solid var(--teal);
  color: var(--teal);
  font: 500 .75em var(--font-body);
  text-align: center;
  width: 100%;
}

/* ---- Footer ---- */
.card__footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .3em .6em;
  background: var(--parchment-2);
  border-top: 1px solid rgba(13,27,42,.08);
  font: 500 .6em var(--font-body);
  color: var(--ink-soft);
}

.card__diff { font-size: 1.1em; color: var(--card-colour); }
.card__mark { font: 600 .9em var(--font-title); letter-spacing: .03em; opacity: .7; }
.card__num  { margin-left: .4em; font-variant-numeric: tabular-nums; }

/* ---- Print variant ---- */
.card--print {
  width: 63.5mm;
  height: 88.9mm;
  aspect-ratio: unset;
  box-shadow: none;
  border: 0.4mm solid var(--parchment-2);
}

/* ---- A4 3×3 sheet ---- */
.sheet {
  display: grid;
  grid-template-columns: repeat(3, 63.5mm);
  grid-template-rows: repeat(3, 88.9mm);
  gap: 0;
  width: fit-content;
}

.sheet .card {
  border: 0.5mm dashed var(--parchment-2); /* cut guides */
}

/* ================================================================
   PLAY ROUTE — header, launcher, board, shell, celebration
   Uses only the vars above. Reduced-motion handled globally.
   ================================================================ */

/* ---- header ---- */
.play-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--parchment-2);
}
.play-header__home { text-decoration: none; display: flex; align-items: center; gap: .4rem; }
.mm-logo-img {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 50%; object-fit: cover; background: #000;
  display: block;
}
.mm-logo { font: 800 1.4rem var(--font-title); color: var(--navy); }
.mm-logo__game { font: 700 .85rem var(--font-body); color: var(--coral); letter-spacing: .04em; text-transform: uppercase; }
.play-header__nav { display: flex; gap: .6rem; }

/* ---- launcher ---- */
.setup { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.setup__title { font-size: var(--fs-h1); margin: .25rem 0 1.25rem; }
.setup__group {
  border: 1px solid var(--parchment-2); border-radius: var(--radius);
  margin: 0 0 1.25rem; padding: 1rem 1.1rem 1.2rem; background: rgba(255,255,255,.4);
}
.setup__group legend {
  font: 700 1rem var(--font-body); color: var(--navy);
  padding: 0 .5rem; text-transform: none;
}
.setup__start { font-size: 1.25rem; padding: 0 2rem; }
.setup__start:disabled { opacity: .45; cursor: not-allowed; }
.setup__hint { color: var(--ink-soft); font-size: var(--fs-body); margin: .6rem 0 0; }

.deck-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem; margin-bottom: 1rem;
}
.deck-grid__empty { color: var(--ink-soft); grid-column: 1 / -1; }
.deck {
  display: flex; flex-direction: column; gap: .35rem; text-align: left;
  padding: 0; border: 2px solid var(--parchment-2); border-radius: var(--radius);
  background: var(--parchment); cursor: pointer; overflow: hidden;
  font-family: var(--font-body); color: var(--ink); min-height: var(--touch);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.deck:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.deck[aria-pressed="true"] { border-color: var(--deck-colour); box-shadow: var(--shadow); }
.deck[aria-pressed="true"]::after {
  content: "✓ selected"; font: 600 .7rem var(--font-body);
  color: var(--deck-colour); padding: 0 .65rem .5rem;
}
.deck__band { font: 700 .65rem var(--font-body); text-transform: uppercase; letter-spacing: .07em; padding: .3rem .65rem; }
.deck__title { font: 700 1rem var(--font-title); color: var(--navy); padding: .3rem .65rem 0; line-height: 1.2; }
.deck__meta { font-size: .8rem; color: var(--ink-soft); padding: 0 .65rem .25rem; }
.deck:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.import { display: block; margin-top: .5rem; }
.import__label { display: block; font: 600 .85rem var(--font-body); color: var(--ink-soft); margin-bottom: .3rem; }
.import__msg { font-size: .85rem; color: var(--teal); margin: .4rem 0 0; min-height: 1.1em; }
.import__msg--err { color: var(--coral); }

.game-grid { display: flex; gap: .75rem; flex-wrap: wrap; }
.game-card {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  width: 160px; padding: 1rem .75rem; border-radius: var(--radius);
  border: 2px solid var(--parchment-2); background: var(--parchment);
  cursor: pointer; font-family: var(--font-body); color: var(--ink); text-align: center;
}
.game-card__icon { font-size: 2rem; }
.game-card__name { font: 700 1.05rem var(--font-title); color: var(--navy); }
.game-card__desc { font-size: .78rem; color: var(--ink-soft); }
.game-card--active { border-color: var(--coral); box-shadow: var(--shadow); }
.game-card--soon { opacity: .5; cursor: not-allowed; }
.game-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.diff-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.diff {
  min-height: var(--touch); padding: 0 1.1rem; border-radius: var(--radius);
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 600 1rem var(--font-body); color: var(--ink); cursor: pointer;
}
.diff--on { border-color: var(--navy); background: var(--navy); color: var(--parchment); }
.diff:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.teams-count { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.teams-count__btn { font-size: 1.4rem; padding: 0; width: var(--touch); }
.teams-count__n { font: 800 1.6rem var(--font-title); color: var(--navy); min-width: 1.5ch; text-align: center; }
.teams-count__label { color: var(--ink-soft); }
.team-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.team-name { display: flex; align-items: center; gap: .5rem; }
.team-name__dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.team-name input {
  flex: 1; min-height: 44px; padding: 0 .65rem; border-radius: 10px;
  border: 2px solid var(--parchment-2); font: 500 1rem var(--font-body); color: var(--ink); background: var(--parchment);
}
.team-name input:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }

/* ================================================================
   SUMMIT v2 — full-screen board (left) + fixed control panel (right).
   Backdrop is a swappable theme layer (mountain shipped). Dice, question
   and scoreboard live ONLY in the right panel — never over the trail.
   Brand vars/fonts only (#fff and #FBFAF8 are non-brand neutrals).
   Reduced motion handled by the global guard; nothing is animation-only.
   ================================================================ */
.game-root { padding: 0; }
.summit {
  display: flex; align-items: stretch;
  width: 100%; height: calc(100vh - 64px); min-height: 540px;
  background: var(--parchment-2); overflow: hidden;
}

/* ---- board (left, flex:1) ---- */
.summit__board {
  position: relative; flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--parchment-2); overflow: hidden;
}
.summit__svg { display: block; width: 100%; height: 100%; }

/* node + label typography */
.summit__node-num { font: 700 inherit/1 var(--font-body); }
.summit__node-label {
  font: 700 9px var(--font-body); fill: var(--navy);
  text-anchor: middle; letter-spacing: .08em; text-transform: uppercase;
}
.summit__marker-letter { font: 700 8px var(--font-body); }
.summit__next-tag { font: 700 8px var(--font-body); fill: var(--coral); letter-spacing: .1em; }

/* NEXT ring pulses unless reduced motion */
.summit__next circle { animation: summit-next-pulse 1.4s ease-in-out infinite; transform-origin: center; }
@keyframes summit-next-pulse {
  0%,100% { opacity: .55; r: 19; } 50% { opacity: 1; r: 22; }
}

/* team markers — animated tween between nodes (one space at a time) */
.marker { cursor: default; }
.marker--moving { transition: transform .23s cubic-bezier(.34,.1,.36,1); }
.marker--climb { animation: marker-climb .9s ease; }
.marker--slide { animation: marker-slide .9s ease; }
.marker--flag { animation: marker-flag .9s ease; }
@keyframes marker-climb { 0%,100% { filter: none; } 30% { filter: drop-shadow(0 0 7px var(--teal)); } }
@keyframes marker-slide { 0%,100% { filter: none; } 30% { filter: drop-shadow(0 0 7px var(--coral)); } }
@keyframes marker-flag  { 0%,100% { filter: none; } 30% { filter: drop-shadow(0 0 8px var(--amber)); } }

/* wordmark (top-left) */
.summit__wordmark {
  position: absolute; top: 14px; left: 16px; display: flex; align-items: baseline; gap: .35rem;
  pointer-events: none;
}
.summit__wordmark-mm { font: 800 1.15rem var(--font-title); color: var(--navy); }
.summit__wordmark-game { font: 700 .7rem var(--font-body); color: var(--coral); text-transform: uppercase; letter-spacing: .08em; }

/* legend card (bottom-left) */
.summit__legend {
  position: absolute; bottom: 14px; left: 16px;
  background: rgba(255,255,255,.82); border: 1px solid var(--parchment-2);
  border-radius: 10px; padding: .55rem .7rem; box-shadow: var(--shadow);
  font: 500 .78rem var(--font-body); color: var(--ink); max-width: 230px;
}
.summit__legend-row { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.summit__legend-row b { font-weight: 700; }
.summit__legend-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.summit__legend-foot { margin-top: .25rem; color: var(--ink-soft); font-size: .72rem; }

/* transient flash banner over the board (bottom-centre) */
.summit__flash {
  position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%);
  padding: .5rem 1.1rem; border-radius: 999px;
  font: 700 1.1rem var(--font-title); color: var(--parchment);
  background: var(--navy); box-shadow: var(--shadow); white-space: nowrap; z-index: 4;
}
.summit__flash[data-kind="bridge"] { background: var(--teal); }
.summit__flash[data-kind="scree"] { background: var(--coral); }
.summit__flash[data-kind="flag"] { background: var(--amber); color: var(--navy); }
.summit__flash--show { animation: flash-pop 1.5s ease forwards; }
@keyframes flash-pop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.9); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  82% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(.98); }
}

/* visually-hidden live region */
.summit__live {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- control panel (right, fixed width) ---- */
.summit__panel {
  flex: 0 0 clamp(330px, 27vw, 418px); width: clamp(330px, 27vw, 418px);
  border-left: 3px solid var(--navy); background: var(--parchment);
  padding: 1rem 1.1rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: .9rem;
}
.summit__turn { display: flex; flex-direction: column; gap: .1rem; }
.summit__turn-kicker { font: 700 .68rem var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.summit__turn-name { font: 800 1.55rem var(--font-title); line-height: 1.1; }

/* question card */
.summit__qcard {
  border: 2px solid var(--navy); border-radius: var(--radius);
  padding: .85rem .9rem; background: rgba(255,255,255,.45);
  display: flex; flex-direction: column; gap: .65rem;
}
.summit__qcard--bonus { border-color: var(--amber); background: rgba(201,168,76,.12); }
.summit__qlabel { font: 700 .72rem var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--navy); }
.summit__qcard--bonus .summit__qlabel { color: var(--amber); }
.summit__qtext { font: 700 clamp(1.1rem, 1.6vw, 1.5rem) var(--font-title); color: var(--ink); line-height: 1.25; }
.summit__empty { color: var(--ink-soft); margin: 0; }

.summit__answer { display: flex; flex-direction: column; gap: .55rem; }
.summit__reveal { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.summit__reveal-answer {
  font: 700 1.15rem var(--font-title); color: var(--teal);
  padding: .4rem .6rem; border-radius: 10px; background: rgba(26,191,160,.1);
}
.summit__judge { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.summit__no, .summit__yes { min-height: 54px; font-size: 1.05rem; }
.summit__no { background: var(--coral); color: var(--parchment); }

/* multiple-choice chips */
.summit__mc { display: grid; gap: .45rem; }
.summit__mc-chip {
  display: flex; align-items: center; gap: .55rem; text-align: left;
  min-height: 50px; padding: .4rem .65rem; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 500 1rem var(--font-body); color: var(--ink); cursor: pointer;
}
.summit__mc-chip:hover:not(:disabled) { border-color: var(--navy); }
.summit__mc-chip:disabled { cursor: default; }
.summit__mc-key {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--parchment); font: 700 .85rem var(--font-body);
}
.summit__mc-chip--right { border-color: var(--teal); background: rgba(26,191,160,.15); }
.summit__mc-chip--right .summit__mc-key { background: var(--teal); color: var(--navy); }
.summit__mc-chip--wrong { border-color: var(--coral); background: rgba(232,89,60,.12); }
.summit__mc-chip--wrong .summit__mc-key { background: var(--coral); }
.summit__mc-chip:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }

/* dice card */
.summit__dice {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  border: 1px solid var(--parchment-2); border-radius: var(--radius);
  padding: .85rem; background: rgba(255,255,255,.45);
}
.summit__die {
  position: relative; width: 72px; height: 72px; border-radius: 14px;
  background: #fff; border: 3px solid var(--navy); box-shadow: var(--shadow);
}
.summit__pip {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: var(--navy); transform: translate(-50%, -50%);
}
.summit__die--rolling { animation: die-tumble .1s steps(1) infinite; }
@keyframes die-tumble {
  0% { transform: rotate(-12deg) scale(1.04); }
  50% { transform: rotate(10deg) scale(.95); }
  100% { transform: rotate(-6deg) scale(1.02); }
}
.summit__roll { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.summit__roll:disabled { opacity: .4; cursor: not-allowed; }
.summit__roll-key, .summit__reveal .summit__roll-key {
  font: 700 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  background: rgba(255,255,255,.25); border-radius: 5px; padding: .1rem .35rem;
}
.summit__dice-help { font: 500 .8rem var(--font-body); color: var(--ink-soft); text-align: center; margin: 0; }

/* scoreboard */
.summit__scores { display: flex; flex-direction: column; gap: .5rem; }
.summit__score {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .55rem; border-radius: 10px; border: 1px solid transparent;
}
.summit__score--turn { border-color: var(--navy); background: rgba(13,27,42,.05); }
.summit__score-dot {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font: 700 .85rem var(--font-body);
}
.summit__score-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.summit__score-top { display: flex; align-items: center; gap: .4rem; }
.summit__score-name { font: 700 .95rem var(--font-body); color: var(--ink); }
.summit__score-lead {
  font: 700 .58rem var(--font-body); text-transform: uppercase; letter-spacing: .06em;
  color: var(--navy); background: var(--teal); border-radius: 5px; padding: .08rem .35rem;
}
.summit__score-bar { height: 6px; border-radius: 4px; background: var(--parchment-2); overflow: hidden; }
.summit__score-bar i { display: block; height: 100%; border-radius: 4px; }
.summit__score-meta { display: flex; justify-content: space-between; font: 500 .72rem var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* panel footer */
.summit__panel-foot { margin-top: auto; display: flex; flex-direction: column; gap: .45rem; }
.summit__fs { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; align-self: flex-start; }
.summit__foot-note { font: 500 .72rem var(--font-body); color: var(--ink-soft); }

/* stack the panel under the board on narrow screens */
@media (max-width: 820px) {
  .summit { flex-direction: column; height: auto; }
  .summit__board { min-height: 60vh; }
  .summit__panel { flex-basis: auto; width: 100%; border-left: 0; border-top: 3px solid var(--navy); }
}

/* ---- winner celebration ---- */
.summit__win {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,27,42,.55); padding: 1rem;
}
.summit__win-card {
  --win-colour: var(--coral);
  position: relative; background: var(--parchment); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem 2.5rem; text-align: center;
  max-width: 460px; border-top: 8px solid var(--win-colour);
  animation: win-pop .5s cubic-bezier(.22,.61,.36,1);
}
@keyframes win-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.summit__win-flag { font-size: 3.5rem; }
.summit__win-title { font-size: var(--fs-h1); margin: .25rem 0 .25rem; }
.summit__win-sub { color: var(--ink-soft); margin: 0 0 1rem; }
.summit__win-scores { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 1.25rem; text-align: left; }
.summit__win-row { display: flex; align-items: center; gap: .5rem; font: 600 1rem var(--font-body); }
.summit__win-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.summit__win-dot { width: 14px; height: 14px; border-radius: 50%; }

/* ---- confetti (DOM bits) ---- */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti__bit {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation-name: confetti-fall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) translateX(0) rotate(0); opacity: 1; }
  100% { transform: translateY(70vh) translateX(var(--drift, 0)) rotate(540deg); opacity: 0; }
}

/* ================================================================
   MAKE ROUTE — deck maker. Reuses brand vars + .btn + .card.
   ================================================================ */
.make { max-width: 1500px; margin: 0 auto; padding: 1.25rem 1.25rem 5rem; }
.make__title { font-size: var(--fs-h1); margin: .25rem 0 1.25rem; }
.make__cols {
  display: grid; gap: 1.25rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .make__cols { grid-template-columns: 1fr; } }

.make__group {
  border: 1px solid var(--parchment-2); border-radius: var(--radius);
  margin: 0 0 1.25rem; padding: 1rem 1.1rem 1.2rem; background: rgba(255,255,255,.4);
}
.make__group legend {
  font: 700 1rem var(--font-body); color: var(--navy); padding: 0 .5rem;
}

.make__meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
@media (max-width: 560px) { .make__meta { grid-template-columns: 1fr; } }
.make__field { display: flex; flex-direction: column; gap: .35rem; }
.make__field--wide { grid-column: 1 / -1; }
.make__label { font: 600 .85rem var(--font-body); color: var(--ink-soft); }

.make__field input[type="text"],
.make__field select,
.make__textarea,
[data-set-all] {
  min-height: 44px; padding: .4rem .65rem; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 500 1rem var(--font-body); color: var(--ink); width: 100%;
}
.make__field input:focus-visible,
.make__field select:focus-visible,
.make__textarea:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 1px;
}

.make__subject-row { display: flex; align-items: center; gap: .5rem; }
.make__subject-row select { flex: 1; }
.make__swatch {
  flex-shrink: 0; min-width: 84px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font: 700 .75rem var(--font-body); text-transform: uppercase; letter-spacing: .05em;
}

.make__note {
  margin: .75rem 0 0; padding: .6rem .75rem; border-radius: 10px;
  background: rgba(201,168,76,.15); border: 1px solid var(--amber);
  font-size: .9rem; color: var(--ink);
}
.make__helper { font-size: .85rem; color: var(--ink-soft); margin: .4rem 0 .6rem; }

.make__qa-toggle {
  display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem;
  font: 600 .9rem var(--font-body); color: var(--navy); cursor: pointer;
}
.make__textarea { resize: vertical; line-height: 1.45; font-family: var(--font-body); }

.qa-table { width: 100%; border-collapse: collapse; }
.qa-table th {
  text-align: left; font: 700 .8rem var(--font-body); color: var(--ink-soft);
  padding: 0 .4rem .35rem; text-transform: uppercase; letter-spacing: .04em;
}
.qa-table td { padding: 0 .3rem .35rem 0; }
.qa-table td input {
  width: 100%; min-height: 40px; padding: .3rem .55rem; border-radius: 8px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 500 .95rem var(--font-body); color: var(--ink);
}
.qa-table td input:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }

.make__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1rem; }

.make__errors {
  border: 2px solid var(--coral); border-radius: var(--radius);
  background: rgba(232,89,60,.08); color: var(--ink);
  padding: .8rem 1rem; margin: 0 0 1rem;
}
.make__errors strong { color: var(--coral); display: block; margin-bottom: .4rem; }
.make__errors ul { margin: 0; padding-left: 1.2rem; }
.make__errors li { margin: .15rem 0; }

.make__success {
  border: 2px solid var(--teal); border-radius: var(--radius);
  background: rgba(26,191,160,.1); color: var(--ink);
  padding: .8rem 1rem; margin: 0 0 1rem; font: 600 1rem var(--font-body);
}
.make-success__link { color: var(--teal); font-weight: 700; text-decoration: none; }
.make-success__link:hover { text-decoration: underline; }

.make__preview-title { font-size: 1.4rem; margin: .25rem 0 .5rem; }
.preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem; align-items: start;
}
.preview-card { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.preview-card .card { width: 100%; max-width: 200px; }
.preview-card__reveal { min-height: 40px; font-size: .85rem; padding: 0 .9rem; }
.preview-card__reveal:disabled { opacity: .55; cursor: default; }

/* ================================================================
   WORD TREK — word-search route (/word-trek/)
   Layout: a fixed control panel beside the generated output.
   ================================================================ */
.wt {
  max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem;
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 2rem; align-items: start;
}
@media (max-width: 800px) { .wt { grid-template-columns: 1fr; } }

.wt__title { font-size: var(--fs-h1); margin: .25rem 0 .35rem; }
.wt__lead { color: var(--ink-soft); margin: 0 0 1.25rem; font-size: var(--fs-body); }

.wt__group {
  border: 2px solid var(--parchment-2); border-radius: var(--radius);
  padding: .9rem 1rem 1.1rem; margin: 0 0 1.1rem; background: var(--parchment);
}
.wt__group legend { font: 700 .85rem var(--font-body); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; padding: 0 .35rem; }

.wt__textarea {
  width: 100%; min-height: 9rem; resize: vertical;
  border: 2px solid var(--parchment-2); border-radius: 10px; background: var(--parchment);
  padding: .6rem .7rem; font: 500 1rem var(--font-body); color: var(--ink); line-height: 1.5;
}
.wt__textarea:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.wt__helper, .wt__hint { color: var(--ink-soft); font-size: .85rem; margin: .5rem 0 0; }

.wt__opts { display: flex; flex-direction: column; gap: .65rem; }
.wt__field { display: flex; align-items: center; gap: .6rem; }
.wt__label { font: 600 .95rem var(--font-body); color: var(--ink); min-width: 5.5rem; }
.wt__field select {
  flex: 1; min-height: 44px; border-radius: 10px; padding: 0 .6rem;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 600 1rem var(--font-body); color: var(--ink);
}
.wt__check { display: flex; align-items: center; gap: .55rem; font: 600 1rem var(--font-body); color: var(--ink); cursor: pointer; }
.wt__check input { width: 20px; height: 20px; accent-color: var(--teal); }

.wt__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 .5rem; }

/* ---- generated output ---- */
.wt__out { min-height: 4rem; }
.wt-puzzle { display: flex; flex-wrap: wrap; gap: 2rem; align-items: start; }

.wt-grid {
  display: grid; grid-template-columns: repeat(var(--wt-cols), 1fr);
  gap: 2px; background: var(--parchment-2); padding: 6px; border-radius: 12px;
  touch-action: none; user-select: none; -webkit-user-select: none;
  width: min(560px, 100%);
  /* off-white parchment frame — default dyslexia-friendly background, no toggle needed */
  border: 3px solid var(--parchment-2);
  box-shadow: 0 2px 12px rgba(13,27,42,.08);
}
.wt-cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: var(--parchment); color: var(--ink);
  font: 700 clamp(.8rem, 2.4vw, 1.25rem) var(--font-body); text-transform: uppercase;
  border-radius: 4px; cursor: pointer;
}
.wt-cell--sel { background: var(--amber); color: var(--navy); }
.wt-cell--found { background: var(--teal); color: var(--parchment); }
.wt-cell--answer { box-shadow: inset 0 0 0 3px var(--coral); border-radius: 50%; }
/* ring reveal: teal outline drawn when user clicks a bank word (answer aid) */
.wt-cell--ring { box-shadow: inset 0 0 0 3px var(--teal); background: rgba(26,191,160,.15); }

/* dyslexia-friendly spacing: looser letters + lines across grid and bank */
.wt-out--dyslexia .wt-cell { letter-spacing: .04em; }
.wt-out--dyslexia .wt-grid { gap: 5px; }
.wt-out--dyslexia .wt-bank__word { letter-spacing: .06em; line-height: 2; }

/* ---- word bank ---- */
.wt-bank { min-width: 200px; flex: 1; }
.wt-bank__title { font-size: 1.3rem; margin: 0 0 .25rem; }
.wt-bank__reveal-hint { font-size: .8rem; color: var(--ink-soft); margin: 0 0 .6rem; font-style: italic; }
.wt-bank__list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.5rem; }
.wt-bank__word { font: 600 1.05rem var(--font-body); color: var(--ink); padding: .15rem 0; break-inside: avoid; }
.wt-bank__word--found { color: var(--ink-soft); text-decoration: line-through; }
/* revealable: pointer cursor + underline hint; revealed: teal accent to match ring */
.wt-bank__word--revealable { cursor: pointer; }
.wt-bank__word--revealable:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.wt-bank__word--revealed { color: var(--teal); font-style: italic; }
.wt-bank__unplaced {
  margin: .8rem 0 0; padding: .6rem .8rem; border-radius: 10px;
  border: 2px solid var(--coral); background: rgba(232,89,60,.08);
  color: var(--ink); font: 600 .9rem var(--font-body); columns: auto;
}

/* ---- S/C/CH level pages + answer sheets ---- */
.wt-level { margin: 0 0 2rem; }
.wt-level__title { font-size: 1.3rem; margin: 0 0 .75rem; color: var(--navy); }
.wt-level .wt-bank { margin-top: 1rem; }
.wt-answers__head { font-size: 1.6rem; margin: 1.5rem 0 1rem; color: var(--coral); }

/* ---- print: each level/answer page on its own sheet + brand footer ---- */
@media print {
  .wt { display: block; max-width: none; padding: 0; }
  .wt-grid { width: 100%; max-width: 170mm; background: #fff; }
  .wt-cell { background: #fff; box-shadow: inset 0 0 0 1px var(--parchment-2); }
  .wt-cell--answer { box-shadow: inset 0 0 0 2px var(--coral); }
  .wt-cell--sel, .wt-cell--found, .wt-cell--ring { background: #fff !important; color: var(--ink) !important; box-shadow: none !important; }
  .wt-pagebreak { break-before: page; }
  .wt-puzzle { gap: 1rem; }
  .mm-mark { display: none; }
  /* brand footer on every printed page */
  .wt__out::after {
    content: "Made with MindMaps Game-On — mindmapscoaching.com";
    display: block; margin-top: 1.5rem; padding-top: .5rem;
    border-top: 1px solid var(--parchment-2);
    font: 600 .8rem var(--font-body); color: var(--ink-soft); text-align: center;
  }
}

/* ================================================================
   BASE CAMP BINGO — /bingo/
   Layout: a control panel beside the generated class set / call screen.
   One bingo card per A4 sheet (no cutting); whiteboard call screen.
   ================================================================ */
.bingo {
  max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem;
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 2rem; align-items: start;
}
@media (max-width: 800px) { .bingo { grid-template-columns: 1fr; } }

.bingo__title { font-size: var(--fs-h1); margin: .25rem 0 .35rem; }
.bingo__lead { color: var(--ink-soft); margin: 0 0 1.25rem; font-size: var(--fs-body); }

.bingo__group {
  border: 2px solid var(--parchment-2); border-radius: var(--radius);
  padding: .9rem 1rem 1.1rem; margin: 0 0 1.1rem; background: var(--parchment);
}
.bingo__group legend { font: 700 .85rem var(--font-body); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; padding: 0 .35rem; }
.bingo__label { display: block; font: 600 .85rem var(--font-body); color: var(--ink-soft); margin: .4rem 0 .3rem; }

.bingo__textarea {
  width: 100%; min-height: 9rem; resize: vertical;
  border: 2px solid var(--parchment-2); border-radius: 10px; background: var(--parchment);
  padding: .6rem .7rem; font: 500 1rem var(--font-body); color: var(--ink); line-height: 1.5;
}
.bingo__textarea:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.bingo__helper, .bingo__hint { color: var(--ink-soft); font-size: .85rem; margin: .5rem 0 0; }

.bingo__deck-row { display: flex; gap: .5rem; align-items: center; }
.bingo__deck-row select {
  flex: 1; min-height: 44px; border-radius: 10px; padding: 0 .6rem;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 600 .95rem var(--font-body); color: var(--ink);
}

.bingo__opts { display: flex; flex-direction: column; gap: .65rem; }
.bingo__field { display: flex; align-items: center; gap: .6rem; }
.bingo__opt-label { font: 600 .95rem var(--font-body); color: var(--ink); min-width: 5.5rem; }
.bingo__field select, .bingo__field input[type="number"] {
  flex: 1; min-height: 44px; border-radius: 10px; padding: 0 .6rem;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 600 1rem var(--font-body); color: var(--ink);
}
.bingo__check { display: flex; align-items: center; gap: .55rem; font: 600 1rem var(--font-body); color: var(--ink); cursor: pointer; }
.bingo__check input { width: 20px; height: 20px; accent-color: var(--teal); }

.bingo__wins { display: flex; flex-direction: column; gap: .5rem; }
.bingo__count { font: 600 .85rem var(--font-body); color: var(--teal); margin: .6rem 0 0; }
.bingo__count--short { color: var(--coral); }

.bingo__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 .5rem; }
.bingo__actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.bingo__out { min-height: 4rem; }

/* ---- on-screen preview (true-to-grid sample of the chosen set) ---- */
.bingo-preview__head { font: 600 1rem var(--font-body); color: var(--ink-soft); margin: 0 0 1rem; }
.bingo-preview__head strong { color: var(--coral); }
.bingo-preview__cards { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.bingo-preview__card { margin: 0; max-width: 360px; }
.bingo-preview__card figcaption { font: 700 1rem var(--font-body); color: var(--coral); margin: 0 0 .5rem; }

.bingo-call__mode {
  align-self: flex-start; font: 700 1rem var(--font-body); color: var(--parchment);
  background: var(--teal); border-radius: 8px; padding: .25rem .8rem;
  letter-spacing: .03em; text-transform: uppercase;
}
.bingo-call__end { font-size: 1.1rem; }

/* ---- printable card sheet: one card per A4 page ---- */
.bingo-sheet { margin: 0 0 2rem; }
.bingo-sheet__head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 1rem; }
.bingo-sheet__title { font: 800 1.8rem var(--font-title); color: var(--navy); }
.bingo-sheet__num { font: 700 1.1rem var(--font-body); color: var(--coral); }
.bingo-sheet__footer {
  margin-top: 1rem; padding-top: .5rem; border-top: 1px solid var(--parchment-2);
  font: 600 .85rem var(--font-title); color: var(--ink-soft); letter-spacing: .03em; text-align: center;
}

/* ---- bingo grid (shared by print + shared card) ---- */
.bingo-grid {
  display: grid; grid-template-columns: repeat(var(--bingo-cols), 1fr);
  gap: 6px; background: var(--parchment-2); padding: 6px; border-radius: 10px;
  width: min(560px, 100%);
}
.bingo-cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: .35rem;
  background: var(--parchment); color: var(--ink);
  font: 700 clamp(.85rem, 2.2vw, 1.3rem) var(--font-body);
  border-radius: 6px; overflow: hidden; word-break: break-word; line-height: 1.15;
}
.bingo-cell--free { background: var(--amber); color: var(--navy); font-family: var(--font-title); }
.bingo-cell--ticked { background: var(--teal); color: var(--parchment); }

/* ---- call screen (whiteboard) ---- */
.bingo-call { display: flex; flex-direction: column; gap: 1.25rem; }
.bingo-call__current {
  background: var(--navy); color: var(--parchment); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem; text-align: center;
}
.bingo-call__label { font: 600 .85rem var(--font-body); text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.bingo-call__value { font: 800 var(--fs-question) var(--font-title); line-height: 1.05; margin-top: .25rem; word-break: break-word; }
.bingo-call__controls { display: flex; gap: .6rem; flex-wrap: wrap; }
.bingo-call__next { font-size: 1.4rem; padding: 0 2rem; }
.bingo-call__next:disabled { opacity: .45; cursor: not-allowed; }

.bingo-call__history-title { font-size: 1.3rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .6rem; }
.bingo-history-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.bingo-history-grid__chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 .75rem;
  border-radius: 10px; background: var(--parchment-2); color: var(--ink);
  font: 600 1.05rem var(--font-body);
}
.bingo-call__line {
  font: 800 1rem var(--font-body); color: var(--parchment); background: var(--coral);
  border-radius: 8px; padding: .15rem .6rem; letter-spacing: .05em; text-transform: uppercase;
}

/* ---- print: each card on its own A4 sheet, no controls, brand mark ---- */
@media print {
  .bingo { display: block; max-width: none; padding: 0; }
  .bingo-sheet { break-after: page; margin: 0; }
  .bingo-sheet:last-child { break-after: auto; }
  .bingo-grid { width: 100%; max-width: 180mm; background: #fff; }
  .bingo-grid--print .bingo-cell { background: #fff; box-shadow: inset 0 0 0 1px var(--parchment-2); }
  .bingo-cell--free { background: #fff !important; box-shadow: inset 0 0 0 2px var(--amber); }
  .mm-mark { display: none; }
}

/* ================================================================
   PAIRS TRAIL (memory match)
   Setup panel (deck + teams) → face-down tile grid with turn flow.
   Card-back motif approximated with brand vars; assets/art/card-back.png
   layers on top as a background-image when present (CSS fallback below).
   ================================================================ */
.pairs {
  max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem;
}
.pairs__title { font-size: var(--fs-h1); margin: .25rem 0 .35rem; }
.pairs__lead { color: var(--ink-soft); margin: 0 0 1.25rem; font-size: var(--fs-body); max-width: 60ch; }

.pairs__panel { max-width: 560px; }
.pairs__group {
  border: 1px solid var(--parchment-2); border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem; margin: 0 0 1.1rem; background: var(--parchment);
}
.pairs__group legend { font: 700 .85rem var(--font-body); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; padding: 0 .35rem; }
.pairs__label { display: block; font: 600 .85rem var(--font-body); color: var(--ink-soft); margin: .2rem 0 .35rem; }
.pairs__helper, .pairs__hint { color: var(--ink-soft); font-size: .9rem; margin: .6rem 0 0; }

.pairs__deck-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pairs__deck-row select {
  flex: 1 1 auto; min-height: var(--touch); padding: 0 .6rem;
  border: 2px solid var(--parchment-2); border-radius: 10px;
  font: 600 1rem var(--font-body); background: var(--parchment); color: var(--ink);
}
.pairs__deck-row select:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }

.pairs__teams { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.pairs__team { display: flex; align-items: center; gap: .6rem; }
.pairs__team-dot { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto; }
.pairs__team-name { font: 600 1.05rem var(--font-body); color: var(--ink); flex: 1 1 auto; }
.pairs__team-remove {
  width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--parchment-2);
  background: transparent; color: var(--ink-soft); font: 700 1.2rem var(--font-body); cursor: pointer; line-height: 1;
}
.pairs__team-remove:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.pairs__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: .25rem 0 0; }

/* ---- play: status bar ---- */
.pairs__play { display: flex; flex-direction: column; gap: 1.25rem; }
.pairs-status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--navy); color: var(--parchment); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.25rem;
}
.pairs-status__turn { display: flex; align-items: center; gap: .55rem; }
.pairs-status__dot { width: 20px; height: 20px; border-radius: 50%; }
.pairs-status__turn-name { font: 800 1.6rem var(--font-title); }
.pairs-status__turn-tag { font: 600 1rem var(--font-body); opacity: .8; }
.pairs-status__scores { display: flex; flex-wrap: wrap; gap: .5rem; }
.pairs-status__score {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 .8rem;
  border-radius: 10px; background: rgba(247,246,242,.12); color: var(--parchment);
  font: 600 1.05rem var(--font-body); border: 2px solid transparent;
}
.pairs-status__score--active { border-color: var(--team-colour); background: rgba(247,246,242,.2); }

/* ---- play: tile grid ---- */
/* --pairs-cols is set by JS from the chosen preset (3–10).
   Grid width grows with column count so tiles stay roughly card-sized up to ~8 cols,
   then the viewport caps them. gap shrinks at 7+ cols to preserve tap targets. */
.pairs-grid {
  display: grid; grid-template-columns: repeat(var(--pairs-cols), 1fr);
  gap: clamp(4px, calc(12px - var(--pairs-cols, 3) * 0.7px), 10px);
  width: min(calc(var(--pairs-cols, 3) * 96px + 80px), 100%);
  margin: 0 auto;
}
.pairs-tile {
  aspect-ratio: 63.5 / 88.9; padding: 0; border: 0; background: transparent;
  cursor: pointer; perspective: 800px;
  /* min-height drops on large boards to keep the grid visible without scrolling */
  min-height: clamp(44px, calc(90px - var(--pairs-cols, 3) * 4px), var(--touch));
}
.pairs-tile:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: var(--radius); }
.pairs-tile__inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .35s ease; border-radius: var(--radius);
}
.pairs-tile--up .pairs-tile__inner, .pairs-tile--matched .pairs-tile__inner { transform: rotateY(180deg); }
.pairs-tile__back, .pairs-tile__front {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: .5rem; overflow: hidden; word-break: break-word; line-height: 1.15;
  box-shadow: var(--shadow);
}
/* face-down: navy + compass/brain motif approximated with brand-var gradients;
   card-back.png composites on top when the file exists (CSS fallback always present). */
.pairs-tile__back {
  background-color: var(--navy);
  background-image:
    url('../art/card-back.png'),
    radial-gradient(circle at 50% 38%, rgba(26,191,160,.35), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(201,168,76,.22) 0 1px, transparent 1px),
    repeating-radial-gradient(circle at 50% 38%, transparent 0 14px, rgba(247,246,242,.06) 14px 15px);
  background-size: cover, auto, auto, auto;
  background-position: center;
  background-repeat: no-repeat;
}
.pairs-tile__back::after {
  content: '🧭'; font-size: clamp(.7rem, calc(5vw / (var(--pairs-cols, 3) * 0.45)), 2.6rem); opacity: .85; transform: translateZ(1px);
}
.pairs-tile__front {
  transform: rotateY(180deg);
  background: var(--parchment); color: var(--ink);
  /* font shrinks as column count grows: 2.4vw at 3 cols → ~0.9vw at 10 cols */
  font: 700 clamp(.65rem, calc(3.2vw / (var(--pairs-cols, 3) * 0.45)), 1.5rem) var(--font-body);
  border: 3px solid var(--parchment-2);
}
.pairs-tile--matched .pairs-tile__front {
  border-color: var(--match-colour); box-shadow: inset 0 0 0 4px var(--match-colour), var(--shadow);
}
.pairs-tile--matched { cursor: default; opacity: .92; }

.pairs-controls { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---- winner banner ---- */
.pairs-winner {
  text-align: center; background: var(--navy); color: var(--parchment);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.25rem;
}
.pairs-winner__crest { font-size: clamp(2.5rem, 8vw, 4rem); display: block; }
.pairs-winner__head { font: 800 var(--fs-h1) var(--font-title); color: var(--amber); margin: .25rem 0 .35rem; }
.pairs-winner__sub { font: 600 1.1rem var(--font-body); margin: 0; opacity: .9; }

/* reduced motion: no flip — show/hide instantly (global guard kills the transition;
   we also skip the 3D rotate so faces swap without spin). */
@media (prefers-reduced-motion: reduce) {
  .pairs-tile__inner { transition: none; }
  .pairs-tile--up .pairs-tile__inner, .pairs-tile--matched .pairs-tile__inner { transform: none; }
  .pairs-tile__back, .pairs-tile__front { backface-visibility: visible; }
  .pairs-tile__front { transform: none; }
  .pairs-tile--up .pairs-tile__back, .pairs-tile--matched .pairs-tile__back { display: none; }
  .pairs-tile .pairs-tile__front { display: none; }
  .pairs-tile--up .pairs-tile__front, .pairs-tile--matched .pairs-tile__front { display: flex; }
}

/* ================================================================
   DECK PICKER — shared modal used by every game to pick/mix decks.
   Modal overlay (dim backdrop + panel) with a filter bar, a deck
   grid, and (in multi mode) a mix tray of % sliders. Brand vars
   only; #fff is a neutral. Big touch targets; Esc closes.
   ================================================================ */
.dp-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(13,27,42,.55);
}
.dp-panel {
  display: flex; flex-direction: column; gap: .9rem;
  width: min(960px, 100%); max-height: min(90vh, 900px);
  background: var(--parchment); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.25rem 1.25rem;
  overflow: hidden;
}

/* ---- header ---- */
.dp-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dp-title { font-size: var(--fs-h1); margin: 0; }
.dp-close {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  color: var(--ink); font: 700 1.1rem var(--font-body); cursor: pointer; line-height: 1;
}
.dp-close:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- filter bar ---- */
.dp-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.dp-search, .dp-select {
  min-height: var(--touch); padding: 0 .65rem; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 500 1rem var(--font-body); color: var(--ink);
}
.dp-search { flex: 1 1 220px; }
.dp-select { flex: 0 1 auto; }
.dp-search:focus-visible, .dp-select:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }

/* ---- deck grid ---- */
.dp-grid {
  flex: 1 1 auto; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .75rem; padding: .15rem; align-content: start;
}
.dp-empty { color: var(--ink-soft); grid-column: 1 / -1; padding: 1.5rem .25rem; }

.dp-card {
  --dp-band: var(--navy); --dp-band-ink: var(--parchment);
  display: flex; flex-direction: column; text-align: left;
  border: 2px solid var(--parchment-2); border-radius: var(--radius);
  background: var(--parchment); cursor: pointer; overflow: hidden;
  font-family: var(--font-body); color: var(--ink); padding: 0;
  min-height: var(--touch); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.dp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dp-card--on { border-color: var(--dp-band); box-shadow: var(--shadow); }
.dp-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.dp-card__band {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .35rem .65rem; background: var(--dp-band); color: var(--dp-band-ink);
}
.dp-card__subject { font: 700 .7rem var(--font-body); text-transform: uppercase; letter-spacing: .07em; }
.dp-card__mine {
  font: 700 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  background: rgba(255,255,255,.22); border-radius: 5px; padding: .1rem .4rem;
}
.dp-card__body { display: flex; flex-direction: column; gap: .3rem; padding: .5rem .65rem .65rem; }
.dp-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.dp-card__title { font: 700 1.05rem var(--font-title); color: var(--navy); margin: 0; line-height: 1.2; }
.dp-card__chip {
  flex: 0 0 auto; font: 600 .7rem var(--font-body); color: var(--ink-soft);
  background: var(--parchment-2); border-radius: 5px; padding: .12rem .4rem; white-space: nowrap;
}
.dp-card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.dp-card__badge {
  font: 700 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  color: var(--parchment); background: var(--teal); border-radius: 5px; padding: .1rem .4rem;
}
.dp-card__badge--fun { background: var(--amber); color: var(--navy); }
.dp-card__topic { font: 500 .75rem var(--font-body); color: var(--ink-soft); }
.dp-card__count { font: 600 .72rem var(--font-body); color: var(--ink-soft); margin-left: auto; font-variant-numeric: tabular-nums; }
.dp-card__desc { font: 400 .8rem var(--font-body); color: var(--ink-soft); margin: 0; line-height: 1.35; }

/* ---- mix tray (multi mode) ---- */
.dp-tray {
  flex: 0 0 auto; max-height: 34vh; overflow-y: auto;
  border: 1px solid var(--parchment-2); border-radius: var(--radius);
  background: rgba(255,255,255,.45); padding: .7rem .85rem;
}
.dp-tray__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.dp-tray__head strong { font: 700 1rem var(--font-body); color: var(--navy); }
.dp-tray__hint { font: 500 .8rem var(--font-body); color: var(--ink-soft); }
.dp-tray__row {
  --dp-band: var(--navy);
  display: flex; align-items: center; gap: .6rem; padding: .3rem 0;
}
.dp-tray__dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--dp-band); }
.dp-tray__name { flex: 0 1 200px; font: 600 .95rem var(--font-body); color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-slider { flex: 1 1 auto; min-width: 120px; accent-color: var(--dp-band); height: 28px; cursor: pointer; }
.dp-slider:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.dp-tray__pct { flex: 0 0 3.5ch; font: 700 .95rem var(--font-body); color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; }
.dp-tray__remove {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
  border: 2px solid var(--parchment-2); background: transparent; color: var(--ink-soft);
  font: 700 1.1rem var(--font-body); cursor: pointer; line-height: 1;
}
.dp-tray__remove:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- footer + error ---- */
.dp-footer { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: .6rem; }
.dp-confirm:disabled { opacity: .45; cursor: not-allowed; }
.dp-error {
  flex: 0 0 auto; margin: 0; padding: .6rem .8rem; border-radius: 10px;
  border: 2px solid var(--coral); background: rgba(232,89,60,.08);
  font: 600 .9rem var(--font-body); color: var(--ink);
}

@media (max-width: 560px) {
  .dp-panel { max-height: 95vh; padding: .9rem; }
  .dp-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   LIBRARY PAGE — /library/ standalone browse page.
   Filter bar + responsive deck grid, per-card actions (Preview /
   Add to My Decks / Play in ▸), a preview modal, a mix tray, and a
   toast. Brand vars only; #fff/rgba are neutral. Big touch targets.
   ================================================================ */
.lib { max-width: 1300px; margin: 0 auto; padding: 1.25rem 1.25rem 6rem; }
.lib__title { font-size: var(--fs-h1); margin: .25rem 0 .35rem; }
.lib__lead { color: var(--ink-soft); margin: 0 0 1.25rem; font-size: var(--fs-body); max-width: 70ch; }

/* ---- deck-type toggle (classroom / Don't Say It) ---- */
.lib__modes { margin: 0 0 1rem; }
.lib__party-note { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--coral) 10%, #fff); border: 1.5px solid color-mix(in srgb, var(--coral) 35%, #fff);
  color: var(--ink); font-size: .9rem; max-width: 70ch; }
.lib__party-note strong { color: var(--navy); }
/* In the Don't Say It section, the curriculum filters don't apply. */
.lib--party [data-cls-filter] { display: none; }

/* ---- filter bar ---- */
.lib__filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .75rem; }
.lib__search, .lib__select {
  min-height: var(--touch); padding: 0 .65rem; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 500 1rem var(--font-body); color: var(--ink);
}
.lib__search { flex: 1 1 240px; }
.lib__select { flex: 0 1 auto; }
.lib__search:focus-visible, .lib__select:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.lib__mixtoggle {
  display: inline-flex; align-items: center; gap: .45rem; min-height: var(--touch);
  padding: 0 .75rem; border-radius: 10px; border: 2px solid var(--parchment-2);
  font: 600 .95rem var(--font-body); color: var(--ink); cursor: pointer; background: var(--parchment);
}
.lib__mixtoggle input { width: 20px; height: 20px; accent-color: var(--teal); }
.lib__count { font: 600 .9rem var(--font-body); color: var(--ink-soft); margin: 0 0 1rem; font-variant-numeric: tabular-nums; }

/* ---- deck grid ---- */
.lib-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; align-items: start;
}
.lib-grid__empty { color: var(--ink-soft); grid-column: 1 / -1; padding: 1.5rem .25rem; }

.lib-card {
  --lib-band: var(--navy); --lib-band-ink: var(--parchment);
  display: flex; flex-direction: column; text-align: left;
  border: 2px solid var(--parchment-2); border-radius: var(--radius);
  background: var(--parchment); overflow: hidden;
  font-family: var(--font-body); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.lib-card--on { border-color: var(--lib-band); box-shadow: var(--shadow); }
.lib-card__band {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .4rem .7rem; background: var(--lib-band); color: var(--lib-band-ink);
}
.lib-card__subject { font: 700 .72rem var(--font-body); text-transform: uppercase; letter-spacing: .07em; }
.lib-card__badge {
  font: 700 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  color: var(--navy); background: var(--parchment); border-radius: 5px; padding: .12rem .45rem;
}
.lib-card__badge--fun { background: var(--amber); color: var(--navy); }
.lib-card__body { display: flex; flex-direction: column; gap: .4rem; padding: .65rem .75rem .8rem; }
.lib-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.lib-card__title { font: 700 1.15rem var(--font-title); color: var(--navy); margin: 0; line-height: 1.2; }
.lib-card__chip {
  flex: 0 0 auto; font: 600 .72rem var(--font-body); color: var(--ink-soft);
  background: var(--parchment-2); border-radius: 5px; padding: .14rem .45rem; white-space: nowrap;
}
.lib-card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.lib-card__topic { font: 500 .8rem var(--font-body); color: var(--ink-soft); }
.lib-card__count { font: 600 .75rem var(--font-body); color: var(--ink-soft); margin-left: auto; font-variant-numeric: tabular-nums; }
.lib-card__desc { font: 400 .85rem var(--font-body); color: var(--ink-soft); margin: 0; line-height: 1.4; }

.lib-card__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0 0; }
.lib-card__btn { min-height: 44px; padding: 0 .8rem; font-size: .9rem; }
.lib-card__play { min-height: 44px; padding: 0 .8rem; font-size: .9rem; background: var(--teal); color: var(--navy); }
.lib-card__mix {
  display: inline-flex; align-items: center; gap: .45rem; margin: .15rem 0 0;
  font: 600 .85rem var(--font-body); color: var(--navy); cursor: pointer;
}
.lib-card__mix input { width: 18px; height: 18px; accent-color: var(--teal); }
.lib-card__note { min-height: 1.1em; font: 600 .8rem var(--font-body); color: var(--teal); }

/* ---- play-in popover menu (per card + mix tray) ---- */
.lib-menu { position: relative; }
.lib-menu__btn { cursor: pointer; }
.lib-menu__list {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 160px;
  display: flex; flex-direction: column; gap: .15rem; padding: .35rem;
  background: var(--parchment); border: 2px solid var(--parchment-2); border-radius: 10px;
  box-shadow: var(--shadow);
}
.lib-menu__item {
  display: flex; align-items: center; min-height: 40px; padding: 0 .65rem; border-radius: 8px;
  font: 600 .95rem var(--font-body); color: var(--ink); text-decoration: none;
}
.lib-menu__item:hover, .lib-menu__item:focus-visible { background: var(--parchment-2); outline: none; }
.lib-menu__empty { margin: 0; padding: .3rem .5rem; font: 500 .85rem var(--font-body); color: var(--ink-soft); }

/* ---- mix tray (fixed bottom strip) ---- */
.lib-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-height: 45vh; overflow-y: auto;
  background: var(--parchment); border-top: 3px solid var(--navy);
  box-shadow: 0 -6px 24px rgba(13,27,42,.14);
  padding: .8rem 1.25rem 1rem;
}
.lib-tray__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.lib-tray__head strong { font: 700 1.05rem var(--font-title); color: var(--navy); }
.lib-tray__hint { font: 500 .82rem var(--font-body); color: var(--ink-soft); }
.lib-tray__rows { display: flex; flex-direction: column; gap: .35rem; max-width: 900px; }
.lib-tray__row { --lib-band: var(--navy); display: flex; align-items: center; gap: .6rem; }
.lib-tray__dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--lib-band); }
.lib-tray__name { flex: 0 1 220px; font: 600 .95rem var(--font-body); color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-slider { flex: 1 1 140px; min-width: 120px; accent-color: var(--lib-band); height: 28px; cursor: pointer; }
.lib-slider:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.lib-tray__pct { flex: 0 0 3.5ch; font: 700 .95rem var(--font-body); color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; }
.lib-tray__remove {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
  border: 2px solid var(--parchment-2); background: transparent; color: var(--ink-soft);
  font: 700 1.1rem var(--font-body); cursor: pointer; line-height: 1;
}
.lib-tray__remove:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.lib-tray__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .65rem; }
.lib-tray__menu-label { font: 600 .85rem var(--font-body); color: var(--ink-soft); }
.lib-tray__foot .lib-menu__list { top: auto; bottom: calc(100% + 4px); }

/* leave room for the fixed tray when it's open */
body.lib--mix .lib { padding-bottom: 16rem; }

/* ---- preview modal ---- */
.lib-preview {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(13,27,42,.55);
}
.lib-preview[hidden] { display: none; }
.lib-preview__panel {
  display: flex; flex-direction: column; gap: .75rem;
  width: min(880px, 100%); max-height: min(90vh, 860px);
  background: var(--parchment); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.25rem 1.25rem; overflow: hidden;
}
.lib-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lib-preview__title { font-size: var(--fs-h1); margin: 0; }
.lib-preview__close {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  color: var(--ink); font: 700 1.1rem var(--font-body); cursor: pointer; line-height: 1;
}
.lib-preview__close:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.lib-preview__meta { font: 600 .9rem var(--font-body); color: var(--ink-soft); margin: 0; }
.lib-preview .preview-grid { overflow-y: auto; padding: .25rem; }
.lib-preview__loading, .lib-preview__more { color: var(--ink-soft); grid-column: 1 / -1; align-self: center; }
.lib-preview__more { text-align: center; font: 600 .9rem var(--font-body); }

/* ---- toast ---- */
.lib-toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  z-index: 70; max-width: min(420px, 92vw);
  background: var(--navy); color: var(--parchment); border-radius: 10px;
  box-shadow: var(--shadow); padding: .7rem 1.1rem;
  font: 600 .95rem var(--font-body); opacity: 0; transition: opacity .2s;
}
.lib-toast[hidden] { display: none; }
.lib-toast--show { opacity: 1; }

@media (max-width: 560px) {
  .lib-grid { grid-template-columns: 1fr; }
  .lib-tray__name { flex-basis: 130px; }
}

/* ============================================================================
   FOUR FLAGS — valley grid, deck-gated line-of-four.
   Original theme: parchment board ruled with navy gridlines; teams plant coloured
   FLAG pins that drop down columns. Deliberately NOT Connect 4 (no peg-board, no
   red/yellow disc frame). Brand vars only; #fff used as a neutral.
   ============================================================================ */
.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;
}

/* ---- launcher ---- */
.ff-main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.ff-setup__title { font-size: var(--fs-h1, 2.2rem); margin: .25rem 0 .5rem; }
.ff-setup__lead { color: var(--ink-soft); margin: 0 0 1.5rem; line-height: 1.5; }
.ff-setup__group { border: 1.5px solid var(--parchment-2); border-radius: var(--radius);
  margin: 0 0 1.1rem; padding: 1rem 1.1rem 1.2rem; }
.ff-setup__group legend { font: 700 .95rem var(--font-body); color: var(--navy);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 .4rem; }
.ff-setup__hint { color: var(--ink-soft); font-size: .85rem; margin: .6rem 0 0; }
.ff-setup__deck-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.ff-setup__deck-note { color: var(--ink-soft); font-size: .9rem; }
.ff-setup__field { display: flex; flex-direction: column; gap: .35rem; max-width: 280px; }
.ff-setup__label { font: 600 .85rem var(--font-body); color: var(--navy); }
.ff-setup__field select { padding: .55rem .7rem; border: 1.5px solid var(--parchment-2);
  border-radius: 10px; font: 600 1rem var(--font-body); background: #fff; color: var(--ink); }
.ff-setup__start { margin: .5rem 0 .25rem; }
.ff-setup__start:disabled { opacity: .5; cursor: not-allowed; }

/* team setup rows */
.ff-teams { display: flex; flex-direction: column; gap: .8rem; }
.ff-team { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  border-left: 4px solid var(--ff-team, var(--navy)); padding-left: .65rem; }
.ff-team__swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--navy); flex: none; }
.ff-team__name { flex: 1 1 160px; min-width: 140px; padding: .5rem .65rem;
  border: 1.5px solid var(--parchment-2); border-radius: 10px; font: 600 1rem var(--font-body);
  background: #fff; color: var(--ink); }
.ff-team__palette { display: flex; gap: .35rem; }
.ff-team__dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; }
.ff-team__dot--on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--parchment); }
.ff-team__dot:disabled { opacity: .25; cursor: not-allowed; }
.ff-team__dot:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- game layout: board left, turn panel right ---- */
.ff { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1rem 1.25rem 3rem;
  max-width: 1200px; margin: 0 auto; position: relative; }
.ff:fullscreen { background: var(--parchment); max-width: none; height: 100%;
  align-items: center; justify-content: center; }
.ff__board { flex: 1 1 auto; min-width: 0; position: relative; }
.ff__wordmark { font-family: var(--font-title); margin: 0 0 .6rem; line-height: 1; }
.ff__wordmark-mm { color: var(--navy); font-weight: 800; font-size: 1.35rem; }
.ff__wordmark-game { color: var(--coral); font-weight: 800; font-size: 1.35rem; margin-left: .3rem; }
.ff__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- the valley grid ---- */
.ff-grid__cols { display: grid; grid-template-columns: repeat(var(--ff-cols), 1fr);
  gap: 6px; margin: 0 0 6px; }
.ff-col { display: flex; align-items: center; justify-content: center; min-height: 44px;
  border: 1.5px dashed var(--parchment-2); border-radius: 8px; background: transparent;
  color: var(--ink-soft); cursor: pointer; font-size: 1.4rem; transition: background .12s, color .12s, border-color .12s; }
.ff-col:disabled { opacity: .35; cursor: not-allowed; }
.ff-grid--live ~ * .ff-col, .ff-col { }
.ff-col:not(:disabled):hover, .ff-col:not(:disabled):focus-visible {
  background: var(--coral); color: #fff; border-color: var(--coral); border-style: solid; }
.ff-col:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.ff-col__arrow { line-height: 1; }

.ff-grid { display: grid; grid-template-columns: repeat(var(--ff-cols), 1fr);
  gap: 6px; padding: 10px; border-radius: var(--radius);
  background: var(--parchment);
  /* navy ruled lines drawn as a subtle grid behind the cells */
  background-image:
    linear-gradient(var(--ink-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-soft) 1px, transparent 1px);
  background-size: 14px 14px; background-position: -1px -1px;
  border: 2.5px solid var(--navy); box-shadow: var(--shadow); }
.ff-cell { position: relative; aspect-ratio: 1 / 1; border-radius: 8px;
  background: var(--parchment); box-shadow: inset 0 0 0 1.5px var(--navy);
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ff-cell--win { background: var(--amber); box-shadow: inset 0 0 0 2.5px var(--navy); }

/* a hovered column tints its cells faintly so teams see where the flag lands */
.ff-grid[data-hover="0"] .ff-cell[data-c="0"],
.ff-grid[data-hover="1"] .ff-cell[data-c="1"],
.ff-grid[data-hover="2"] .ff-cell[data-c="2"],
.ff-grid[data-hover="3"] .ff-cell[data-c="3"],
.ff-grid[data-hover="4"] .ff-cell[data-c="4"],
.ff-grid[data-hover="5"] .ff-cell[data-c="5"],
.ff-grid[data-hover="6"] .ff-cell[data-c="6"] { background: #fffdf4; box-shadow: inset 0 0 0 1.5px var(--coral); }

/* ---- flag pins ---- */
.ff-flag { position: relative; width: 78%; height: 78%; display: flex;
  align-items: center; justify-content: center; }
.ff-flag__svg { width: 100%; height: 100%; }
.ff-flag__letter { position: absolute; left: 22%; top: 14%; transform: translate(-50%, -50%);
  font: 800 .55rem var(--font-body); color: #fff; pointer-events: none; }
.ff-flag--falling { transform: translateY(var(--ff-fall, 0%));
  transition: transform .42s cubic-bezier(.34, .9, .4, 1); }

/* ---- turn panel ---- */
.ff__panel { flex: 0 0 320px; max-width: 360px; display: flex; flex-direction: column;
  gap: .9rem; background: #fff; border: 1.5px solid var(--parchment-2);
  border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow); }
.ff__turn { display: flex; flex-direction: column; gap: .15rem; }
.ff__turn-kicker { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-soft); }
.ff__turn-name { font: 800 1.3rem var(--font-title); color: var(--navy); }
.ff__qcard { border: 1.5px solid var(--parchment-2); border-radius: 12px; padding: .85rem .9rem; }
.ff__qlabel { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--coral); margin: 0 0 .4rem; }
.ff__qtext { font: 600 1.1rem var(--font-body); color: var(--ink); line-height: 1.35; margin: 0 0 .65rem; min-height: 1.5em; }
.ff__answer { display: flex; flex-direction: column; gap: .55rem; }
.ff__reveal-answer { font: 700 1.05rem var(--font-body); color: var(--teal);
  background: var(--parchment); border-radius: 8px; padding: .5rem .65rem; }
.ff__empty { color: var(--ink-soft); font-size: .9rem; }
.ff__key { display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4em; height: 1.4em; padding: 0 .3em; margin-right: .4em; border-radius: 5px;
  background: rgba(13,27,42,.12); font: 700 .7em var(--font-body); }

.ff__judge { display: flex; gap: .5rem; }
.ff__judge .btn { flex: 1; padding: 0 .6rem; height: 3rem; font-size: 1rem; }
.ff__no { background: var(--parchment-2); color: var(--navy); }

/* multiple-choice chips */
.ff__mc { display: grid; gap: .5rem; }
.ff__mc-chip { display: flex; align-items: center; gap: .55rem; text-align: left;
  padding: .65rem .7rem; border: 1.5px solid var(--parchment-2); border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer; font: 600 .98rem var(--font-body); }
.ff__mc-chip:hover:not(:disabled) { border-color: var(--navy); }
.ff__mc-chip:disabled { cursor: default; }
.ff__mc-key { display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--navy); color: #fff;
  font-weight: 800; flex: none; }
.ff__mc-chip--right { border-color: var(--teal); background: rgba(26,191,160,.14); }
.ff__mc-chip--wrong { border-color: var(--coral); background: rgba(232,89,60,.12); }
.ff__mc-chip:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* place prompt */
.ff__place { border: 1.5px dashed var(--coral); border-radius: 10px; padding: .6rem .75rem;
  background: rgba(232,89,60,.07); }
.ff__place-msg { margin: 0; font: 700 .95rem var(--font-body); color: var(--coral); }

/* scoreboard */
.ff__scores { display: flex; flex-direction: column; gap: .45rem; }
.ff__score { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem;
  border-radius: 10px; }
.ff__score--turn { background: var(--parchment); box-shadow: inset 0 0 0 2px var(--amber); }
.ff__score-dot { width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font: 800 .8rem var(--font-body);
  flex: none; border: 2px solid var(--navy); }
.ff__score-main { display: flex; flex-direction: column; }
.ff__score-name { font: 700 1rem var(--font-body); color: var(--navy); }
.ff__score-meta { font: 500 .8rem var(--font-body); color: var(--ink-soft); }

.ff__panel-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: auto; padding-top: .4rem; }
.ff__panel-foot .btn { height: 2.5rem; font-size: .9rem; }
.ff__foot-note { font-size: .78rem; color: var(--ink-soft); }

/* ---- win / draw overlay (reuses confetti) ---- */
.ff__win { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(13,27,42,.55); z-index: 20; overflow: hidden; }
.ff__win-card { background: var(--parchment); border-radius: var(--radius); padding: 2rem 2.25rem;
  text-align: center; box-shadow: var(--shadow); border-top: 6px solid var(--win-colour, var(--coral));
  max-width: 380px; }
.ff__win-flag { font-size: 3.2rem; }
.ff__win-title { font-size: var(--fs-h1, 2rem); margin: .25rem 0; }
.ff__win-sub { color: var(--ink-soft); margin: 0 0 1rem; }
.ff__win-scores { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 1.25rem; text-align: left; }
.ff__win-row { display: flex; align-items: center; gap: .5rem; font: 600 1rem var(--font-body); }
.ff__win-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.ff__win-dot { width: 14px; height: 14px; border-radius: 50%; }

@media (max-width: 820px) {
  .ff { flex-direction: column; }
  .ff__panel { flex: 1 1 auto; max-width: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-flag--falling { transition: none; }
  .ff-col { transition: none; }
}

/* ============================================================================
   TRAIL QUEST v2 — Ludo cross, deck-per-region, race to the centre Summit.
   Four subject territories ring a central Summit; each team starts at a corner,
   ANSWERS TO MOVE around the shared ring, then peels into its colour home-lane.
   Layers: Supplies + boosts, Fortune/Hazard squares, collision Challenge duels,
   and the rare Rally send-back. First to the Summit wins. Brand vars; #fff neutral.
   ============================================================================ */
/* ---- launcher ---- */
.tq-main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.tq-setup__title { font-size: var(--fs-h1, 2.2rem); margin: .25rem 0 .5rem; }
.tq-setup__lead { color: var(--ink-soft); margin: 0 0 1.5rem; line-height: 1.5; }
.tq-setup__group { border: 1.5px solid var(--parchment-2); border-radius: var(--radius);
  margin: 0 0 1.1rem; padding: 1rem 1.1rem 1.2rem; }
.tq-setup__group legend { font: 700 .95rem var(--font-body); color: var(--navy);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 .4rem; }
.tq-setup__hint { color: var(--ink-soft); font-size: .85rem; margin: .6rem 0 0; }
.tq-setup__deck-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.tq-setup__deck-note { color: var(--ink-soft); font-size: .9rem; }
.tq-setup__field { display: flex; flex-direction: column; gap: .35rem; max-width: 280px; }
.tq-setup__label { font: 600 .85rem var(--font-body); color: var(--navy); }
.tq-setup__field select { padding: .55rem .7rem; border: 1.5px solid var(--parchment-2);
  border-radius: 10px; font: 600 1rem var(--font-body); background: #fff; color: var(--ink); }
.tq-setup__start { margin: .5rem 0 .25rem; }
.tq-setup__start:disabled { opacity: .5; cursor: not-allowed; }

/* region coverage chips */
.tq-regions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.tq-region-chip { display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .65rem; border-radius: 999px; border: 1.5px solid var(--parchment-2);
  font: 600 .85rem var(--font-body); color: var(--ink-soft); background: #fff; opacity: .6; }
.tq-region-chip--on { opacity: 1; color: var(--navy); border-color: var(--tq-region); }
.tq-region-chip__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tq-region);
  border: 1.5px solid var(--navy); flex: none; }
.tq-region-chip__meta { font-weight: 500; font-size: .78rem; color: var(--ink-soft); }

/* team setup rows */
.tq-teams { display: flex; flex-direction: column; gap: .8rem; margin-top: .5rem; }
.tq-team { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  border-left: 4px solid var(--tq-team, var(--navy)); padding-left: .65rem; }
.tq-team__swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--navy); flex: none; }
.tq-team__name { flex: 1 1 160px; min-width: 140px; padding: .5rem .65rem;
  border: 1.5px solid var(--parchment-2); border-radius: 10px; font: 600 1rem var(--font-body);
  background: #fff; color: var(--ink); }
.tq-team__palette { display: flex; gap: .35rem; }
.tq-team__dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; }
.tq-team__dot--on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--parchment); }
.tq-team__dot:disabled { opacity: .25; cursor: not-allowed; }
.tq-team__dot:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- game layout: board left, turn panel right ---- */
.tq { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1rem 1.25rem 3rem;
  max-width: 1200px; margin: 0 auto; position: relative; }
.tq:fullscreen { background: var(--parchment); max-width: none; height: 100%;
  align-items: center; justify-content: center; }
.tq__board { flex: 1 1 auto; min-width: 0; position: relative; }
.tq__wordmark { font-family: var(--font-title); margin: 0 0 .6rem; line-height: 1; }
.tq__wordmark-mm { color: var(--navy); font-weight: 800; font-size: 1.35rem; }
.tq__wordmark-game { color: var(--coral); font-weight: 800; font-size: 1.35rem; margin-left: .3rem; }
.tq__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- the loop board ---- */
.tq-board { position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 620px;
  margin: 0 auto; border-radius: var(--radius); background: var(--parchment);
  background-image:
    linear-gradient(var(--ink-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-soft) 1px, transparent 1px);
  background-size: 22px 22px; background-position: -1px -1px;
  border: 2.5px solid var(--navy); box-shadow: var(--shadow); }
.tq-board::before { content: ''; position: absolute; inset: 8%;
  border: 2px dashed var(--ink-soft); border-radius: 18px; opacity: .5; }

.tq-space { position: absolute; width: 9%; height: 9%; transform: translate(-50%, -50%);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--navy); background: #fff; box-shadow: 0 1px 0 rgba(13,27,42,.25); }
.tq-space--region { background: color-mix(in srgb, var(--tq-space) 75%, #fff); }
.tq-space--camp { background: var(--tq-space); border-width: 3px; }
.tq-space--fortune { background: var(--amber); border-radius: 50%; }
.tq-space--hazard { background: var(--coral); color: #fff; border-radius: 50%; }
.tq-space--home { width: 7%; height: 7%; border-radius: 8px;
  background: color-mix(in srgb, var(--tq-space, var(--navy)) 28%, #fff); border-color: var(--tq-space, var(--navy)); }
.tq-space--summit { width: 15%; height: 15%; border-radius: 50%; border-width: 3px; z-index: 2;
  background: radial-gradient(circle at 50% 38%, var(--amber), var(--coral));
  box-shadow: 0 3px 12px rgba(13,27,42,.4); }
.tq-space__icon { font-size: clamp(.7rem, 1.9vw, 1.15rem); line-height: 1; }
.tq-space--summit .tq-space__icon { font-size: clamp(1.1rem, 3vw, 1.9rem); }

/* ---- tokens ---- */
.tq-tokens { position: absolute; inset: 0; pointer-events: none; }
.tq-token { position: absolute; width: 6%; height: 6%; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--tq-token); border: 2px solid var(--navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(13,27,42,.35);
  transition: left .45s cubic-bezier(.34,.9,.4,1), top .45s cubic-bezier(.34,.9,.4,1); }
.tq-token__letter { font: 800 .72rem var(--font-body); color: #fff;
  text-shadow: 0 1px 1px rgba(13,27,42,.6); }

/* ---- turn panel ---- */
.tq__panel { flex: 0 0 330px; max-width: 370px; display: flex; flex-direction: column;
  gap: .9rem; background: #fff; border: 1.5px solid var(--parchment-2);
  border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow); }
.tq__turn { display: flex; flex-direction: column; gap: .15rem; }
.tq__turn-kicker { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-soft); }
.tq__turn-name { font: 800 1.3rem var(--font-title); color: var(--navy); }

/* roll / die */
.tq__roll { display: flex; align-items: center; gap: .9rem; }
.tq-die { width: 64px; height: 64px; flex: none; border-radius: 14px;
  background: var(--parchment); border: 2.5px solid var(--navy);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--navy); }
.tq-die__pips { font: 800 1.8rem var(--font-title); color: var(--navy); }
.tq-die--rolling { animation: tq-die-shake .35s linear infinite; }
@keyframes tq-die-shake {
  0%,100% { transform: rotate(-7deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-3px); }
}
.tq__roll-btn { flex: 1; height: 3rem; }

/* question card (mirrors Four Flags) */
.tq__qcard { border: 1.5px solid var(--parchment-2); border-left: 5px solid var(--tq-qcard, var(--coral));
  border-radius: 12px; padding: .85rem .9rem; }
.tq__qlabel { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--coral); margin: 0 0 .4rem; }
.tq__qtext { font: 600 1.1rem var(--font-body); color: var(--ink); line-height: 1.35;
  margin: 0 0 .65rem; min-height: 1.5em; }
.tq__answer { display: flex; flex-direction: column; gap: .55rem; }
.tq__reveal-answer { font: 700 1.05rem var(--font-body); color: var(--teal);
  background: var(--parchment); border-radius: 8px; padding: .5rem .65rem; }
.tq__empty { color: var(--ink-soft); font-size: .9rem; }
.tq__event { margin: 0; font: 600 1rem var(--font-body); color: var(--ink); line-height: 1.4; }
.tq__event-detail { color: var(--teal); font-weight: 700; }

.tq__judge { display: flex; gap: .5rem; }
.tq__judge .btn { flex: 1; padding: 0 .6rem; height: 3rem; font-size: 1rem; }
.tq__no { background: var(--parchment-2); color: var(--navy); }
.tq__continue { width: 100%; height: 3rem; }

/* multiple-choice chips */
.tq__mc { display: grid; gap: .5rem; }
.tq__mc-chip { display: flex; align-items: center; gap: .55rem; text-align: left;
  padding: .65rem .7rem; border: 1.5px solid var(--parchment-2); border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer; font: 600 .98rem var(--font-body); }
.tq__mc-chip:hover:not(:disabled) { border-color: var(--navy); }
.tq__mc-chip:disabled { cursor: default; }
.tq__mc-key { display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--navy); color: #fff;
  font-weight: 800; flex: none; }
.tq__mc-chip--right { border-color: var(--teal); background: rgba(26,191,160,.14); }
.tq__mc-chip--wrong { border-color: var(--coral); background: rgba(232,89,60,.12); }
.tq__mc-chip:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* scoreboard + stamp trays */
.tq__scores { display: flex; flex-direction: column; gap: .45rem; }
.tq__score { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 10px; }
.tq__score--turn { background: var(--parchment); box-shadow: inset 0 0 0 2px var(--amber); }
.tq__score-dot { width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font: 800 .8rem var(--font-body);
  flex: none; border: 2px solid var(--navy); }
.tq__score-main { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.tq__score-name { font: 700 .95rem var(--font-body); color: var(--navy); }
.tq__score-bar { display: block; height: 8px; border-radius: 5px; background: var(--parchment-2); overflow: hidden; }
.tq__score-fill { display: block; height: 100%; border-radius: 5px; transition: width .4s ease; }
.tq__score-supplies { font: 800 .95rem var(--font-title); color: var(--navy);
  flex: none; font-variant-numeric: tabular-nums; }

.tq__panel-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: auto; padding-top: .4rem; }
.tq__panel-foot .btn { height: 2.5rem; font-size: .9rem; }
.tq__foot-note { font-size: .78rem; color: var(--ink-soft); margin: 0; }

/* win overlay (reuses confetti) */
.tq__win { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(13,27,42,.55); z-index: 20; overflow: hidden; }
.tq__win-card { background: var(--parchment); border-radius: var(--radius); padding: 2rem 2.25rem;
  text-align: center; box-shadow: var(--shadow); border-top: 6px solid var(--win-colour, var(--coral));
  max-width: 380px; }
.tq__win-mark { font-size: 3.2rem; }
.tq__win-title { font-size: var(--fs-h1, 2rem); margin: .25rem 0; }
.tq__win-sub { color: var(--ink-soft); margin: 0 0 1rem; }
.tq__win-scores { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 1.25rem; text-align: left; }
.tq__win-row { display: flex; align-items: center; gap: .5rem; font: 600 1rem var(--font-body); }
.tq__win-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.tq__win-dot { width: 14px; height: 14px; border-radius: 50%; }

@media (max-width: 820px) {
  .tq { flex-direction: column; }
  .tq__panel { flex: 1 1 auto; max-width: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tq-token { transition: none; }
  .tq-die--rolling { animation: none; }
}

/* ---- v2: start-corner chooser (team setup) ---- */
.tq-team__corners { display: flex; gap: .3rem; }
.tq-team__corner { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--parchment-2);
  background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.tq-team__corner--on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--parchment); }
.tq-team__corner:disabled { opacity: .3; cursor: not-allowed; }
.tq-team__corner:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- v2: supply boosts shop ---- */
.tq__shop { display: flex; gap: .4rem; flex-wrap: wrap; }
.tq-boost { flex: 1 1 auto; padding: .45rem .5rem; border-radius: 9px; border: 1.5px solid var(--parchment-2);
  background: #fff; color: var(--navy); cursor: pointer; font: 700 .82rem var(--font-body); }
.tq-boost:hover:not(:disabled) { border-color: var(--navy); }
.tq-boost--on { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, #fff); }
.tq-boost:disabled { opacity: .45; cursor: not-allowed; }
.tq-boost__cost { color: var(--coral); font-weight: 800; }

/* ---- v2: board key ---- */
.tq__legend { font-size: .8rem; color: var(--ink-soft); }
.tq__legend summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.tq__legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .6rem; margin-top: .4rem; }
.tq__legend-item { display: flex; align-items: center; gap: .3rem; }

/* ---- v2: collision challenge panel ---- */
.tq__challenge-opt { margin: .3rem 0 0; font: 600 .92rem var(--font-body); color: var(--ink); }
.tq__challenge-pick { margin: .5rem 0 0; font: 700 .9rem var(--font-body); color: var(--navy); }
.tq__winbtn { flex: 1; height: 3rem; font-size: 1rem; color: #fff; border: 2px solid var(--navy);
  background: var(--tq-team, var(--navy)); }

/* ---- v2: onboarding — setup tools, rules modal, coach popups ---- */
.tq-setup__tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.tq-setup__tips { display: inline-flex; align-items: center; gap: .4rem; font: 600 .9rem var(--font-body); color: var(--navy); }
.tq__how { height: 2.5rem; font-size: .9rem; }

.tq-rules { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(13,27,42,.55); padding: 1rem; }
.tq-rules__card { background: var(--parchment); border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 6px solid var(--coral); max-width: 560px; width: 100%; max-height: 88vh; overflow: auto; padding: 1.5rem 1.6rem; }
.tq-rules__title { font-size: var(--fs-h2, 1.5rem); margin: 0 0 .8rem; color: var(--navy); }
.tq-rules__list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.tq-rules__list li { font: 500 .95rem/1.45 var(--font-body); color: var(--ink); }
.tq-rules__list b { color: var(--navy); }
.tq-rules__controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem;
  padding-top: 1rem; border-top: 1.5px solid var(--parchment-2); }
.tq-rules__toggle { display: inline-flex; align-items: center; gap: .4rem; font: 600 .9rem var(--font-body);
  color: var(--navy); margin-right: auto; }

.tq-coach { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 25;
  max-width: 340px; width: calc(100% - 2rem); background: #fff; border: 2px solid var(--navy);
  border-left: 6px solid var(--amber); border-radius: 12px; padding: .8rem .9rem; box-shadow: var(--shadow); }
.tq-coach__head { font: 800 1rem var(--font-title); color: var(--navy); margin-bottom: .2rem; }
.tq-coach__text { margin: 0 0 .6rem; font: 500 .9rem/1.4 var(--font-body); color: var(--ink); }
.tq-coach__btn { height: 2.3rem; font-size: .9rem; width: 100%; }

/* ============================================================================
   LOST ISLANDS (v2) — Battleship-style fleet hunt on a sea chart.
   Original theme: a parchment sea chart ruled with navy gridlines, lettered
   columns (A..) and numbered rows (1..). A FLEET of straight islands is hidden;
   players answer to earn a SHOT, then call a coordinate. Hits flag a camp,
   sinking an island reveals it, and a fleet key tracks the hunt. Two modes:
   Class-vs-Board and 2-player pass-and-play. Brand vars; #fff neutral.
   ============================================================================ */
/* ---- launcher ---- */
.li-main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.li-root { position: relative; min-height: 60vh; }
.li-setup__title { font-size: var(--fs-h1, 2.2rem); margin: .25rem 0 .5rem; }
.li-setup__lead { color: var(--ink-soft); margin: 0 0 1.5rem; line-height: 1.5; }
.li-setup__group { border: 1.5px solid var(--parchment-2); border-radius: var(--radius);
  margin: 0 0 1.1rem; padding: 1rem 1.1rem 1.2rem; }
.li-setup__group legend { font: 700 .95rem var(--font-body); color: var(--navy);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 .4rem; }
.li-setup__hint { color: var(--ink-soft); font-size: .85rem; margin: .6rem 0 0; }
.li-setup__deck-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.li-setup__deck-note { color: var(--ink-soft); font-size: .9rem; }
.li-setup__chart { display: flex; gap: 1rem; flex-wrap: wrap; }
.li-setup__field { display: flex; flex-direction: column; gap: .35rem; max-width: 280px; }
.li-setup__label { font: 600 .85rem var(--font-body); color: var(--navy); }
.li-setup__field select { padding: .55rem .7rem; border: 1.5px solid var(--parchment-2);
  border-radius: 10px; font: 600 1rem var(--font-body); background: #fff; color: var(--ink); }
.li-setup__start { margin: .5rem 0 .25rem; }
.li-setup__start:disabled { opacity: .5; cursor: not-allowed; }

/* fleet counts stepper (size → count) */
.li-fleet { display: flex; flex-direction: column; gap: .55rem; margin: .9rem 0 0; }
.li-fleet__row { display: flex; align-items: center; gap: .6rem; }
.li-fleet__label { display: flex; align-items: center; gap: .55rem; flex: 1 1 auto; min-width: 0; }
.li-fleet__pips { letter-spacing: .12em; color: var(--teal); font-size: .8rem; line-height: 1; }
.li-fleet__size { font: 700 .92rem var(--font-body); color: var(--navy); }
.li-fleet__num { font: 800 1rem var(--font-body); color: var(--navy); min-width: 1.4em;
  text-align: center; font-variant-numeric: tabular-nums; }

/* team count stepper */
.li-setup__team-count { display: flex; align-items: center; gap: .75rem; margin: 0 0 .9rem; }
.li-count__btn { min-width: 44px; height: 44px; padding: 0; font-size: 1.5rem; border-radius: 12px; }
.li-count__btn:disabled { opacity: .35; cursor: not-allowed; }
.li-count__val { font: 700 1rem var(--font-body); color: var(--navy); min-width: 5.5em; text-align: center; }

/* team / player setup rows */
.li-teams, .li-players { display: flex; flex-direction: column; gap: .8rem; }
.li-team { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  border-left: 4px solid var(--li-team, var(--navy)); padding-left: .65rem; }
.li-team__swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--navy); flex: none; }
.li-team__name { flex: 1 1 160px; min-width: 140px; padding: .5rem .65rem;
  border: 1.5px solid var(--parchment-2); border-radius: 10px; font: 600 1rem var(--font-body);
  background: #fff; color: var(--ink); }
.li-team__palette { display: flex; gap: .35rem; }
.li-team__dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; }
.li-team__dot--on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--parchment); }
.li-team__dot:disabled { opacity: .25; cursor: not-allowed; }
.li-team__dot:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- game layout: chart left, turn panel right ---- */
.li { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1rem 1.25rem 3rem;
  max-width: 1200px; margin: 0 auto; position: relative; }
.li:fullscreen { background: var(--parchment); max-width: none; height: 100%;
  align-items: center; justify-content: center; }
.li__board { flex: 1 1 auto; min-width: 0; position: relative; }
.li__wordmark { font-family: var(--font-title); margin: 0 0 .6rem; line-height: 1; }
.li__wordmark-mm { color: var(--navy); font-weight: 800; font-size: 1.35rem; }
.li__wordmark-game { color: var(--coral); font-weight: 800; font-size: 1.35rem; margin-left: .3rem; }
.li__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- the sea chart: a label gutter (top + left) wrapping the cell grid ---- */
.li-chart { display: grid;
  grid-template-columns: 1.6rem repeat(var(--li-size), 1fr);
  gap: 4px; padding: 10px; border-radius: var(--radius);
  background: var(--parchment);
  /* faint navy ruling behind the chart */
  background-image:
    linear-gradient(var(--ink-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-soft) 1px, transparent 1px);
  background-size: 16px 16px; background-position: -1px -1px;
  border: 2.5px solid var(--navy); box-shadow: var(--shadow);
  max-width: 660px; }
.li-chart__corner { display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 1rem; }
.li-chart__col-label, .li-chart__row-label { display: flex; align-items: center;
  justify-content: center; font: 800 .85rem var(--font-body); color: var(--navy); }

.li-cell { position: relative; aspect-ratio: 1 / 1; border-radius: 7px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--navy);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  cursor: pointer; padding: 0; transition: background .12s, transform .12s; }
.li-cell:disabled { cursor: default; }
.li-chart--live .li-cell:not(:disabled):hover,
.li-chart--live .li-cell:not(:disabled):focus-visible {
  background: var(--coral); transform: scale(1.04); }
.li-cell:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; z-index: 2; }

/* miss = a ripple ring on open water */
.li-cell--miss { background: var(--parchment-2); cursor: default; }
.li-cell__miss { width: 42%; height: 42%; border-radius: 50%;
  border: 2.5px solid var(--ink-soft); opacity: .7; }

/* hit = a camp marker in the team colour */
.li-cell--hit { background: var(--parchment); box-shadow: inset 0 0 0 2.5px var(--li-cell, var(--coral)); }
.li-cell__camp { position: relative; width: 86%; height: 86%; display: flex;
  align-items: center; justify-content: center; }
.li-cell__svg { width: 100%; height: 100%; }
.li-cell__letter { position: absolute; left: 50%; top: 64%; transform: translate(-50%, -50%);
  font: 800 .6rem var(--font-body); color: #fff; pointer-events: none;
  text-shadow: 0 1px 1px rgba(13,27,42,.6); }
.li-cell--pop { animation: li-hit-pop .55s cubic-bezier(.3,1.4,.5,1); }
@keyframes li-hit-pop {
  0% { transform: scale(.3) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1.18) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* a small dot used when re-painting a known hit on a duel board (no re-animation) */
.li-cell__camp-dot { width: 44%; height: 44%; border-radius: 50%;
  background: var(--li-cell, var(--coral)); border: 2px solid var(--navy); }

/* sunk = the whole island revealed, washed in the sinker's colour */
.li-cell--sunk { background: var(--li-cell, var(--coral)); box-shadow: inset 0 0 0 2.5px var(--navy); }
.li-cell--sunk .li-cell__camp-dot { background: var(--navy); border-color: #fff; }

/* ---- placement phase: a setup chart where islands are draggable ---- */
.li-place { max-width: 760px; margin: 0 auto; padding: 1rem 1.25rem 3rem;
  display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.li-place__head { text-align: center; }
.li-place__title { font-size: var(--fs-h1, 2rem); margin: .2rem 0 .35rem; }
.li-place__intro { color: var(--ink-soft); margin: 0; max-width: 46ch; }
.li-place__stage { width: 100%; display: flex; justify-content: center; touch-action: none; }
.li-place__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.li-place__actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.li-place__tip { color: var(--ink-soft); font-size: .85rem; margin: 0; text-align: center; }
.li-chart--setup { touch-action: none; }
.li-cell--setup { cursor: default; }
.li-cell--isl { background: var(--li-cell, var(--teal)); box-shadow: inset 0 0 0 1.5px var(--navy);
  cursor: grab; touch-action: none; }
.li-cell--isl:active { cursor: grabbing; }
.li-cell--isl-head { border-top-left-radius: 11px; border-bottom-left-radius: 11px; }
.li-cell--isl-tail { border-top-right-radius: 11px; border-bottom-right-radius: 11px; }
.li-cell--drop-ok { filter: brightness(1.08); }

/* ---- privacy / hand-off screen (between 2-player turns + class start) ---- */
.li-privacy { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: var(--navy); z-index: 30; padding: 1.5rem; }
.li-privacy__card { background: var(--parchment); border-radius: var(--radius);
  padding: 2.25rem 2rem; text-align: center; max-width: 420px; box-shadow: var(--shadow); }
.li-privacy__mark { font-size: 3rem; }
.li-privacy__title { font-size: var(--fs-h1, 2rem); margin: .3rem 0; }
.li-privacy__sub { color: var(--ink-soft); margin: 0 0 1.25rem; line-height: 1.5; }

/* ---- turn panel ---- */
.li__panel { flex: 0 0 320px; max-width: 360px; display: flex; flex-direction: column;
  gap: .9rem; background: #fff; border: 1.5px solid var(--parchment-2);
  border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow); }
.li__turn { display: flex; flex-direction: column; gap: .15rem; }
.li__turn-kicker { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-soft); }
.li__turn-name { font: 800 1.3rem var(--font-title); color: var(--navy); }
.li__qcard { border: 1.5px solid var(--parchment-2); border-left: 5px solid var(--coral);
  border-radius: 12px; padding: .85rem .9rem; }
.li__qlabel { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--coral); margin: 0 0 .4rem; }
.li__qtext { font: 600 1.1rem var(--font-body); color: var(--ink); line-height: 1.35; margin: 0 0 .65rem; min-height: 1.5em; }
.li__answer { display: flex; flex-direction: column; gap: .55rem; }
.li__reveal-answer { font: 700 1.05rem var(--font-body); color: var(--teal);
  background: var(--parchment); border-radius: 8px; padding: .5rem .65rem; }
.li__empty { color: var(--ink-soft); font-size: .9rem; }
.li__key { display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4em; height: 1.4em; padding: 0 .3em; margin-right: .4em; border-radius: 5px;
  background: rgba(13,27,42,.12); font: 700 .7em var(--font-body); }

.li__judge { display: flex; gap: .5rem; }
.li__judge .btn { flex: 1; padding: 0 .6rem; height: 3rem; font-size: 1rem; }
.li__no { background: var(--parchment-2); color: var(--navy); }

/* multiple-choice chips */
.li__mc { display: grid; gap: .5rem; }
.li__mc-chip { display: flex; align-items: center; gap: .55rem; text-align: left;
  padding: .65rem .7rem; border: 1.5px solid var(--parchment-2); border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer; font: 600 .98rem var(--font-body); }
.li__mc-chip:hover:not(:disabled) { border-color: var(--navy); }
.li__mc-chip:disabled { cursor: default; }
.li__mc-key { display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--navy); color: #fff;
  font-weight: 800; flex: none; }
.li__mc-chip--right { border-color: var(--teal); background: rgba(26,191,160,.14); }
.li__mc-chip--wrong { border-color: var(--coral); background: rgba(232,89,60,.12); }
.li__mc-chip:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* shot prompt */
.li__shot { border: 1.5px dashed var(--coral); border-radius: 10px; padding: .6rem .75rem;
  background: rgba(232,89,60,.07); }
.li__shot-msg { margin: 0; font: 700 .95rem var(--font-body); color: var(--coral); }

/* fleet key — the islands to find, with sunk ones crossed off */
.li__fleetkey { display: flex; flex-direction: column; gap: .5rem; }
.li__fleet-head { display: flex; align-items: baseline; justify-content: space-between; }
.li__fleet-title { font: 700 .7rem var(--font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-soft); }
.li__fleet-count { font: 800 .95rem var(--font-body); color: var(--navy); font-variant-numeric: tabular-nums; }
.li__fleet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.li__fleet-chip { display: flex; align-items: center; gap: .4rem; padding: .3rem .55rem;
  border: 1.5px solid var(--parchment-2); border-radius: 999px; background: #fff;
  font: 600 .82rem var(--font-body); color: var(--navy); }
.li__fleet-pips { letter-spacing: .1em; color: var(--teal); font-size: .72rem; line-height: 1; }
.li__fleet-chip--sunk { background: var(--parchment-2); color: var(--ink-soft); text-decoration: line-through; }
.li__fleet-chip--sunk .li__fleet-pips { color: var(--ink-soft); }
.li__fleet-tag { font: 800 .62rem var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  color: var(--coral); text-decoration: none; }
.li__chart-host { display: flex; justify-content: center; }

/* scoreboard */
.li__scores { display: flex; flex-direction: column; gap: .45rem; }
.li__score { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 10px; }
.li__score--turn { background: var(--parchment); box-shadow: inset 0 0 0 2px var(--amber); }
.li__score--lead { box-shadow: inset 0 0 0 2px var(--teal); }
.li__score-dot { width: 26px; height: 26px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font: 800 .8rem var(--font-body);
  flex: none; border: 2px solid var(--navy); }
.li__score-main { display: flex; flex-direction: column; }
.li__score-name { font: 700 1rem var(--font-body); color: var(--navy); }
.li__score-meta { font: 500 .8rem var(--font-body); color: var(--ink-soft); }

.li__panel-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: auto; padding-top: .4rem; }
.li__panel-foot .btn { height: 2.5rem; font-size: .9rem; }
.li__foot-note { font-size: .78rem; color: var(--ink-soft); }

/* ---- win / tie overlay (reuses confetti) ---- */
.li__win { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(13,27,42,.55); z-index: 20; overflow: hidden; }
.li__win-card { background: var(--parchment); border-radius: var(--radius); padding: 2rem 2.25rem;
  text-align: center; box-shadow: var(--shadow); border-top: 6px solid var(--win-colour, var(--coral));
  max-width: 380px; }
.li__win-mark { font-size: 3.2rem; }
.li__win-title { font-size: var(--fs-h1, 2rem); margin: .25rem 0; }
.li__win-sub { color: var(--ink-soft); margin: 0 0 1rem; }
.li__win-scores { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 1.25rem; text-align: left; }
.li__win-row { display: flex; align-items: center; gap: .5rem; font: 600 1rem var(--font-body); }
.li__win-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.li__win-dot { width: 14px; height: 14px; border-radius: 50%; }

@media (max-width: 820px) {
  .li { flex-direction: column; }
  .li__panel { flex: 1 1 auto; max-width: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .li-cell { transition: none; }
  .li-cell--pop { animation: none; }
  .li__progress-fill { transition: none; }
}

/* ============================================================================
   DONT SAY IT
   ============================================================================ */

/* ---- main layout ---- */
.dsi-main { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- launcher ---- */
.dsi-setup {
  max-width: 640px; margin: 0 auto; padding: 2rem 1.25rem 4rem;
}
.dsi-setup__title {
  font: 800 clamp(2rem,5vw,3rem) var(--font-title);
  color: var(--navy); margin: 0 0 .5rem;
}
.dsi-setup__lead { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 2rem; }
.dsi-setup__group {
  border: none; padding: 0; margin: 0 0 1.75rem;
}
.dsi-setup__group legend {
  font: 700 1rem var(--font-body); color: var(--ink); margin-bottom: .75rem;
}
.dsi-setup__deck-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.dsi-setup__deck-note { color: var(--ink-soft); font-size: .9rem; }
.dsi-setup__deck-hint { font-size: .9rem; color: var(--ink-soft); margin: .5rem 0 0; }
.dsi-link { color: var(--coral); font-weight: 700; text-decoration: none; }
.dsi-link:hover { text-decoration: underline; }
.dsi-setup__row { display: flex; align-items: center; gap: .75rem; }
.dsi-setup__select {
  min-height: 44px; border-radius: 8px; border: 2px solid var(--parchment-2);
  background: var(--parchment); color: var(--ink); font: 600 .95rem var(--font-body);
  padding: 0 .6rem; cursor: pointer;
}
.dsi-setup__team-hd {
  display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem;
}
.dsi-setup__team-n { font: 700 1rem var(--font-body); color: var(--ink); }
.dsi-setup__stepper {
  min-width: 44px; min-height: 44px; font-size: 1.25rem; font-weight: 800; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.dsi-setup__foot { margin-top: 1rem; }
.dsi-setup__start { min-width: 160px; }
.dsi-setup__hint { color: var(--ink-soft); font-size: .9rem; margin: .5rem 0 0; }

/* ---- team row ---- */
.dsi-team {
  display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem;
  padding: .5rem .75rem; background: var(--parchment); border-radius: 10px;
  border-left: 4px solid var(--dsi-team, var(--parchment-2));
}
.dsi-team__swatch {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(13,27,42,.2);
}
.dsi-team__name {
  flex: 1; border: none; background: transparent; font: 600 1rem var(--font-body);
  color: var(--ink); min-width: 0; padding: .25rem 0;
}
.dsi-team__name:focus { outline: 3px solid var(--amber); border-radius: 4px; }
.dsi-team__palette { display: flex; gap: .3rem; flex-wrap: wrap; }
.dsi-team__dot {
  width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid transparent;
  cursor: pointer; padding: 0; transition: border-color .15s;
}
.dsi-team__dot--on { border-color: var(--navy); }
.dsi-team__dot:disabled { opacity: .35; cursor: not-allowed; }

/* ---- game root ---- */
.dsi-game { flex: 1; display: flex; flex-direction: column; }
.dsi { flex: 1; display: flex; flex-direction: column; }
.dsi__live { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- hand-off screen ---- */
.dsi-handoff {
  max-width: 480px; margin: 2rem auto; padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: 1.25rem; align-items: center; text-align: center;
}
.dsi-handoff__team {
  font: 800 1.5rem var(--font-title); color: #fff; padding: .6rem 1.75rem;
  border-radius: 999px; width: 100%; box-sizing: border-box;
  box-shadow: var(--shadow);
}
.dsi-handoff__hint {
  background: var(--parchment); border-radius: 12px; padding: 1rem 1.25rem;
  border: 2px dashed var(--parchment-2); font-size: 1rem; color: var(--ink);
}
.dsi-handoff__icon { font-size: 2rem; display: block; margin-bottom: .4rem; }
.dsi-handoff__go { min-width: 200px; min-height: 56px; font-size: 1.1rem; }
.dsi-handoff__end { min-height: 44px; }

/* ---- play view ---- */
.dsi-play {
  display: flex; flex-direction: column; flex: 1;
  padding: 1rem 1rem 1.5rem; gap: 1rem; max-width: 640px;
  margin: 0 auto; width: 100%; box-sizing: border-box;
}

/* header row */
.dsi-play__hd {
  display: flex; align-items: center; gap: .75rem;
  background: var(--parchment); border-radius: 12px;
  padding: .6rem 1rem; box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,.08));
}
.dsi-play__team-badge {
  flex: 1; font: 700 1rem var(--font-title); color: #fff;
  border-radius: 999px; padding: .35rem 1rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.dsi-play__round-score {
  font: 600 .95rem var(--font-body); color: var(--ink-soft); white-space: nowrap;
}
.dsi-play__round-score strong { color: var(--coral); font-size: 1.1rem; }

/* timer ring */
.dsi-play__timer {
  position: relative; width: 56px; height: 56px; flex-shrink: 0;
}
.dsi-play__timer-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 800 1.15rem var(--font-title); color: var(--navy); tabular-nums: auto;
}
.dsi-play__timer-ring {
  width: 56px; height: 56px; transform: rotate(-90deg);
}
.dsi-play__ring-track { fill: none; stroke: var(--parchment-2); stroke-width: 3; }
.dsi-play__ring-fill {
  fill: none; stroke: var(--teal); stroke-width: 3.5;
  stroke-linecap: round; transition: stroke-dashoffset .9s linear, stroke .3s;
}
.dsi-play__ring-fill--warn { stroke: var(--coral); }

/* describer card */
.dsi-play__card {
  background: var(--parchment); border-radius: 16px;
  padding: 1.5rem 1.5rem 1.25rem; box-shadow: var(--shadow);
  border-top: 5px solid var(--navy); flex: 1; display: flex; flex-direction: column;
  gap: .75rem; min-height: 200px;
}
.dsi-play__term {
  font: 800 clamp(2rem,7vw,3.5rem) var(--font-title); color: var(--navy);
  text-align: center; line-height: 1.1; word-break: break-word;
}
.dsi-play__banned-label {
  font: 700 .8rem var(--font-body); color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: .06em;
}
.dsi-play__banned {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.dsi-play__ban-word {
  background: rgba(232,89,60,.12); color: var(--coral); border: 1.5px solid var(--coral);
  border-radius: 6px; padding: .3rem .75rem; font: 700 1.15rem var(--font-body);
  text-transform: uppercase; letter-spacing: .02em;
}

/* action buttons */
.dsi-play__btns {
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: .5rem;
}
.dsi-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; min-height: 80px; border-radius: 14px; padding: .5rem .5rem;
  font-family: var(--font-body); cursor: pointer; border: none;
  transition: transform .1s;
}
.dsi-btn:active { transform: scale(.97); }
.dsi-btn__label { font: 800 1rem var(--font-body); line-height: 1.1; }
.dsi-btn__sub { font: 500 .7rem var(--font-body); opacity: .75; }

.dsi-btn--got-it {
  background: var(--teal); color: #fff;
  box-shadow: 0 3px 10px rgba(26,191,160,.35);
}
.dsi-btn--pass {
  background: var(--parchment-2); color: var(--ink);
}
.dsi-btn--foul {
  background: rgba(232,89,60,.12); color: var(--coral);
  border: 2px solid var(--coral);
}

/* scores bar in play */
.dsi-play__scores-bar {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
}

/* score row (shared) */
.dsi-score {
  display: flex; align-items: center; gap: .4rem;
  background: var(--parchment); border-radius: 8px; padding: .35rem .7rem;
  font: 600 .9rem var(--font-body);
}
.dsi-score--turn { background: var(--parchment-2); font-weight: 700; }
.dsi-score__dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.dsi-score__name { color: var(--ink); }
.dsi-score__pts { margin-left: .25rem; font-variant-numeric: tabular-nums; color: var(--navy); }

/* ---- round-over screen ---- */
.dsi-roundover {
  max-width: 480px; margin: 2rem auto; padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: 1.25rem; align-items: center; text-align: center;
}
@keyframes dsi-pop {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.dsi-roundover--pop { animation: dsi-pop .35s cubic-bezier(.22,.61,.36,1); }
.dsi-roundover__team {
  font: 800 1.4rem var(--font-title); color: #fff; padding: .6rem 1.75rem;
  border-radius: 999px; width: 100%; box-sizing: border-box; box-shadow: var(--shadow);
  line-height: 1.3;
}
.dsi-roundover__team-name { font-size: 1.1rem; }
.dsi-roundover__score-row {
  display: flex; flex-direction: column; align-items: center;
}
.dsi-roundover__score-num {
  font: 800 3.5rem var(--font-title); color: var(--coral); line-height: 1;
}
.dsi-roundover__score-label { font: 600 .9rem var(--font-body); color: var(--ink-soft); }
.dsi-roundover__scores { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.dsi-roundover__actions { display: flex; flex-direction: column; gap: .5rem; width: 100%; }
.dsi-roundover__next { min-height: 56px; font-size: 1.05rem; width: 100%; }
.dsi-roundover__end { min-height: 44px; width: 100%; }

/* ---- winner overlay ---- */
.dsi-win {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(13,27,42,.6); z-index: 200; padding: 1rem;
}
.dsi-win__card {
  --win-colour: var(--coral);
  background: var(--parchment); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem 2.5rem; text-align: center;
  max-width: 460px; width: 100%; border-top: 8px solid var(--win-colour);
  animation: dsi-pop .45s cubic-bezier(.22,.61,.36,1); position: relative;
}
.dsi-win__icon { font-size: 3rem; margin-bottom: .4rem; }
.dsi-win__title { font: 800 clamp(1.5rem,4vw,2.25rem) var(--font-title); color: var(--navy); margin: 0 0 1rem; }
.dsi-win__scores { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.5rem; }
.dsi-win__again { min-width: 180px; min-height: 52px; }

/* ---- responsive ---- */
@media (max-width: 480px) {
  .dsi-play__btns { grid-template-columns: 1fr; }
  .dsi-btn--got-it { order: -1; }
  .dsi-play__term { font-size: clamp(1.75rem, 10vw, 2.5rem); }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .dsi-play__ring-fill { transition: none; }
  .dsi-roundover--pop { animation: none; }
  .dsi-win__card { animation: none; }
  .dsi-btn { transition: none; }
}

/* ============================================================================
   TREASURE COORDS — teacher caller console (whiteboard). Brand vars; #fff cells.
   The printable pupil pack carries its own scoped CSS in the print window.
   ============================================================================ */
.tc-main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.tc-setup__title { font-size: var(--fs-h1, 2.2rem); margin: .25rem 0 .5rem; }
.tc-setup__lead { color: var(--ink-soft); margin: 0 0 1.5rem; line-height: 1.5; }
.tc-setup__group { border: 1.5px solid var(--parchment-2); border-radius: var(--radius);
  margin: 0 0 1.1rem; padding: 1rem 1.1rem 1.2rem; }
.tc-setup__group legend { font: 700 .95rem var(--font-body); color: var(--navy);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 .4rem; }
.tc-setup__hint { color: var(--ink-soft); font-size: .85rem; margin: .6rem 0 0; }
.tc-setup__deck-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.tc-setup__deck-note { color: var(--ink-soft); font-size: .9rem; }
.tc-setup__field { display: flex; flex-direction: column; gap: .35rem; max-width: 320px; }
.tc-setup__label { font: 600 .85rem var(--font-body); color: var(--navy); }
.tc-setup__field select { padding: .55rem .6rem; border: 1.5px solid var(--parchment-2);
  border-radius: 8px; font: 600 .95rem var(--font-body); background: #fff; color: var(--ink); }
.tc-setup__print { margin-top: .4rem; }
.tc-setup__start { margin-top: .6rem; min-height: 56px; font-size: 1.1rem; }

/* ---- objects-in-play checklist (toggle chips) ---- */
.tc-objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-top: .6rem; }
.tc-object { display: flex; align-items: center; gap: .5rem; text-align: left; cursor: pointer;
  padding: .55rem .65rem; border: 1.5px solid var(--parchment-2); border-radius: 10px;
  background: #fff; color: var(--ink-soft); font: 700 .9rem var(--font-body); }
.tc-object:hover { border-color: var(--navy); }
.tc-object__icon { font-size: 1.3rem; line-height: 1; flex: 0 0 auto; filter: grayscale(.6); opacity: .55; }
.tc-object__name { min-width: 0; }
.tc-object--on { border-color: var(--teal); color: var(--navy);
  background: color-mix(in srgb, var(--teal) 12%, #fff); }
.tc-object--on .tc-object__icon { filter: none; opacity: 1; }

/* ---- console layout ---- */
.tc { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start;
  max-width: 1180px; margin: 0 auto; padding: 1rem 1.25rem 4rem; }
.tc__board { flex: 1 1 auto; min-width: 0; }
.tc__panel { flex: 0 0 340px; max-width: 380px; display: flex; flex-direction: column; gap: 1rem; }
.tc__wordmark { display: flex; flex-direction: column; line-height: 1; margin-bottom: .5rem; }
.tc__wordmark-mm { font: 800 1.3rem var(--font-title); color: var(--navy); }
.tc__wordmark-game { font: 700 .7rem var(--font-body); color: var(--coral);
  text-transform: uppercase; letter-spacing: .08em; }

/* ---- current call banner ---- */
.tc__current { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap;
  background: var(--navy); color: var(--parchment); border-radius: var(--radius);
  padding: .8rem 1.2rem; margin-bottom: 1rem; }
.tc__current-label { font: 600 .8rem var(--font-body); text-transform: uppercase;
  letter-spacing: .08em; opacity: .85; }
.tc__current-value { font: 800 clamp(2rem, 7vw, 3.2rem) var(--font-title); line-height: 1; color: var(--amber); }
.tc__current-remaining { margin-left: auto; font: 600 .85rem var(--font-body); opacity: .85; }
.tc__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- the 10×10 calling grid (corner + labels + cells) ---- */
.tc-grid { display: grid; grid-template-columns: 2rem repeat(10, 1fr);
  gap: 3px; background: var(--navy); padding: 3px; border-radius: var(--radius); }
.tc-grid__corner, .tc-grid__col-label, .tc-grid__row-label {
  display: flex; align-items: center; justify-content: center;
  font: 800 .9rem var(--font-title); color: var(--parchment); }
.tc-grid__corner { color: var(--amber); }
.tc-cell { aspect-ratio: 1/1; background: #fff; border: none; border-radius: 5px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font: 700 .8rem var(--font-body); color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--parchment-2); transition: background .12s, transform .12s; }
.tc-cell:not(:disabled):hover, .tc-cell:not(:disabled):focus-visible {
  background: var(--parchment-2); outline: 2px solid var(--amber); outline-offset: -2px; }
.tc-cell--called { background: var(--coral); color: var(--parchment);
  box-shadow: inset 0 0 0 2px var(--navy); cursor: default; }
.tc-cell--called::after { content: '✦'; font-size: 1rem; }
.tc-cell--pop { animation: tc-pop .3s cubic-bezier(.22,.61,.36,1); }
@keyframes tc-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---- panel: controls ---- */
.tc__controls { display: flex; flex-direction: column; gap: .5rem; }
.tc__next { min-height: 56px; font-size: 1.05rem; }
.tc__reset { min-height: 44px; }

/* ---- panel: question card (curriculum mode) ---- */
.tc__qcard { border: 1.5px solid var(--parchment-2); border-radius: var(--radius);
  padding: 1rem; background: #fff; }
.tc__qlabel { font: 700 .75rem var(--font-body); color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.tc__qtext { font: 700 1.15rem var(--font-title); color: var(--navy); margin-bottom: .75rem; }
.tc__answer { display: flex; flex-direction: column; gap: .5rem; }
.tc__reveal-answer { font: 700 1.1rem var(--font-title); color: var(--teal); }
.tc__judge { display: flex; gap: .5rem; }
.tc__no { background: var(--coral); color: var(--parchment); flex: 1; }
.tc__yes { flex: 1; }
.tc__judged { font: 700 1rem var(--font-body); margin: 0; }
.tc__judged--yes { color: var(--teal); }
.tc__judged--no { color: var(--coral); }
.tc__empty { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.tc__mc { display: grid; gap: .5rem; }
.tc__mc-chip { display: flex; gap: .6rem; align-items: center; text-align: left;
  padding: .65rem .8rem; border: 1.5px solid var(--parchment-2); border-radius: 10px;
  background: #fff; cursor: pointer; font: 600 .95rem var(--font-body); color: var(--ink); }
.tc__mc-chip:hover:not(:disabled) { border-color: var(--navy); }
.tc__mc-key { font: 800 .9rem var(--font-title); color: var(--coral);
  width: 1.4rem; flex: 0 0 auto; text-align: center; }
.tc__mc-chip--right { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, #fff); }
.tc__mc-chip--wrong { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 12%, #fff); }

/* ---- panel: object key ---- */
.tc__key { border: 1.5px solid var(--parchment-2); border-radius: var(--radius); padding: 1rem; background: #fff; }
.tc__key-title, .tc__tally-title { font: 800 1.05rem var(--font-title); color: var(--navy); margin: 0 0 .6rem; }
.tc__key-grid { display: flex; flex-direction: column; gap: .5rem; }
.tc__key-item { display: flex; gap: .6rem; align-items: flex-start; }
.tc__key-icon { font-size: 1.4rem; line-height: 1; flex: 0 0 auto; }
.tc__key-body { display: flex; flex-direction: column; }
.tc__key-name { font: 700 .9rem var(--font-body); color: var(--navy); }
.tc__key-blurb { font: 400 .82rem var(--font-body); color: var(--ink-soft); }

/* ---- panel: mark-dead + fullscreen controls ---- */
.tc__controls-row { display: flex; gap: .5rem; }
.tc__controls-row > .btn { flex: 1; min-height: 44px; }
.tc__dead { min-height: 44px; }
.tc__dead--on { background: var(--navy); color: var(--parchment); border-color: var(--navy); }
.tc__fskey { display: inline-block; min-width: 1.2em; padding: 0 .25em; margin-right: .3em;
  border-radius: 4px; background: var(--parchment-2); color: var(--navy); font: 800 .8em var(--font-title); }

/* dead-square annotation (cannon / storm) — distinct from a called square */
.tc-cell--dead { background: repeating-linear-gradient(45deg, var(--ink-soft) 0 6px, #8a8276 6px 12px);
  color: var(--parchment); box-shadow: inset 0 0 0 2px var(--ink); }
.tc-cell--dead::after { content: '☠'; font-size: 1rem; }
.tc-cell--called.tc-cell--dead { background: var(--ink-soft); }
.tc-grid--marking .tc-cell:not(:disabled) { cursor: crosshair; }

@media (max-width: 760px) {
  .tc__panel { flex: 1 1 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-cell { transition: none; }
  .tc-cell--pop { animation: none; }
}

/* ---- fullscreen: drop the width cap and let the grid fill the playable area ---- */
.tc:fullscreen { background: var(--parchment); max-width: none; width: 100%; height: 100%;
  padding: 1.5rem; box-sizing: border-box; align-items: stretch; overflow: auto; }
.tc:fullscreen .tc__board { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* Square grid bounded by the smaller of available width / height so all 100 cells grow. */
.tc:fullscreen .tc-grid { width: min(100%, calc(100vh - 11rem)); margin: 0 auto; }
.tc:fullscreen .tc-cell { font-size: clamp(.8rem, 1.4vw, 1.4rem); }
/* Make the way out obvious while in fullscreen. */
.tc:fullscreen .tc__fs { background: var(--coral); color: var(--parchment); border-color: var(--coral); }
.tc:fullscreen .tc__fs .tc__fskey { background: color-mix(in srgb, #000 18%, var(--coral)); color: var(--parchment); }

/* ================================================================
   SHARE — the "from your teacher" student start screen (share-boot.js)
   + the broken-link error panel. Brand vars only (#fff neutral ok).
   Reduced-motion safe (the gentle pop-in is suppressed globally).
   ================================================================ */
.share-start, .share-error {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 64px); padding: 1.5rem 1.25rem;
}
.share-start__card, .share-error__card {
  width: 100%; max-width: 560px; text-align: center;
  background: #fff; border: 1px solid var(--parchment-2); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem 2rem 1.75rem;
  border-top: 8px solid var(--coral);
  animation: share-pop .4s cubic-bezier(.22,.61,.36,1);
}
@keyframes share-pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.share-start__kicker {
  font: 700 .8rem var(--font-body); text-transform: uppercase; letter-spacing: .12em;
  color: var(--coral); margin: 0 0 .35rem;
}
.share-start__title { font-size: var(--fs-h1); margin: 0 0 .9rem; }
.share-start__note {
  margin: 0 0 1.1rem; padding: .85rem 1rem; border-radius: 10px; text-align: left;
  background: rgba(201,168,76,.15); border: 1px solid var(--amber);
  font: 500 var(--fs-body) var(--font-body); color: var(--ink); line-height: 1.5;
}
.share-start__meta { margin: 0 0 1.1rem; text-align: left; display: flex; flex-direction: column; gap: .5rem; }
.share-start__row { display: flex; gap: .75rem; align-items: baseline; }
.share-start__row dt {
  flex: 0 0 4.5rem; font: 700 .72rem var(--font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-soft);
}
.share-start__row dd { margin: 0; font: 600 1.05rem var(--font-body); color: var(--ink); }
.share-start__badge {
  display: inline-block; margin: 0 0 1.2rem;
  font: 700 .85rem var(--font-body); color: var(--navy);
  background: var(--teal); border-radius: 999px; padding: .3rem .9rem;
}
.share-start__actions { display: flex; justify-content: center; margin: .25rem 0 .6rem; }
.share-start__start { font-size: 1.35rem; padding: 0 2.5rem; }
.share-start__start:disabled { opacity: .45; cursor: not-allowed; }
.share-start__hint { font: 500 .9rem var(--font-body); color: var(--ink-soft); margin: 0; }

.share-error__icon { font-size: 2.75rem; margin: 0 0 .35rem; }
.share-error__title { font-size: var(--fs-h1); margin: 0 0 .6rem; }
.share-error__msg { color: var(--ink-soft); font-size: var(--fs-body); margin: 0 0 1.25rem; line-height: 1.5; }

/* ================================================================
   SHARE BUILDER — teacher tool at share/index.html
   Brand vars only. No hex values outside this file.
   ================================================================ */
.sb-layout {
  display: flex; gap: 2rem; align-items: flex-start;
  max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 5rem;
}
.sb-builder { flex: 0 0 440px; min-width: 0; }
.sb-preview { flex: 1; min-width: 0; position: sticky; top: 1.5rem; }

.sb-title { font-size: var(--fs-h1); margin: 0 0 .35rem; }
.sb-subtitle { color: var(--ink-soft); margin: 0 0 1.75rem; font: 500 var(--fs-body) var(--font-body); }

.sb-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.sb-group--inline { flex-direction: row; align-items: center; gap: .75rem; }
.sb-group--inline .sb-label { flex: 0 0 auto; margin: 0; }
.sb-label {
  font: 700 .78rem var(--font-body); text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-soft);
}
.sb-select, .sb-textarea, .sb-input-num {
  font: 500 1rem var(--font-body); color: var(--ink);
  background: #fff; border: 1.5px solid var(--parchment-2); border-radius: var(--radius);
  padding: .55rem .7rem; transition: border-color .15s;
}
.sb-select:focus, .sb-textarea:focus, .sb-input-num:focus {
  outline: 3px solid var(--amber); outline-offset: 2px; border-color: var(--amber);
}
.sb-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6a7a'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; }
.sb-textarea { resize: vertical; min-height: 4.5rem; }
.sb-input-num { width: 6rem; }
.sb-deck-btn { align-self: flex-start; min-height: var(--touch); }
.sb-deck-summary { display: flex; flex-wrap: wrap; gap: .4rem; }
.sb-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  font: 600 .82rem var(--font-body); color: var(--ink);
  background: var(--parchment); border: 1px solid var(--parchment-2);
  border-radius: 999px; padding: .2rem .7rem;
}
.sb-chip__pct { color: var(--ink-soft); font-weight: 500; }

.sb-hint {
  font: 500 .88rem var(--font-body); color: var(--ink-soft);
  margin: 0 0 1rem; min-height: 1.25rem;
}
.sb-copy-btn { min-height: var(--touch); font-size: 1.1rem; margin-bottom: 1.1rem; }
.sb-copy-btn:disabled { opacity: .45; cursor: not-allowed; }

.sb-url-row { display: flex; flex-direction: column; gap: .4rem; }
.sb-url-field {
  font: 400 .85rem var(--font-body); color: var(--ink-soft);
  background: var(--parchment); border: 1px solid var(--parchment-2);
  border-radius: var(--radius); padding: .45rem .65rem;
  word-break: break-all; cursor: text;
}
.sb-url-hint { margin: 0; font: 500 .83rem var(--font-body); color: var(--ink-soft); }

.sb-toast {
  margin-top: .75rem;
  font: 700 .9rem var(--font-body); color: var(--navy);
  background: var(--teal); border-radius: var(--radius);
  padding: .55rem .9rem;
}

/* Preview panel */
.sb-preview__label {
  font: 700 .78rem var(--font-body); text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-soft); margin: 0 0 .75rem;
}
.sb-preview__placeholder {
  border: 2px dashed var(--parchment-2); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center;
  font: 500 .95rem var(--font-body); color: var(--ink-soft);
}
/* Override the min-height when the share-start card is inside the preview panel */
.sb-preview__screen { min-height: unset; padding: 0; }
.sb-preview__screen .share-start__card { animation: none; }

@media (max-width: 820px) {
  .sb-layout { flex-direction: column; }
  .sb-builder { flex: none; width: 100%; }
  .sb-preview { position: static; width: 100%; }
}

/* ================================================================
   PREMIUM — register-interest waitlist (/premium/)
   Honest "coming soon" hero + a Netlify Forms opt-in. Brand vars only
   (#fff is a neutral, allowed). Reduced motion handled by the global guard.
   ================================================================ */
.premium {
  max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem;
  display: flex; flex-direction: column; gap: 2.25rem;
}

.premium__hero { display: flex; flex-direction: column; gap: 1rem; }
.premium__kicker {
  font: 700 .8rem var(--font-body); text-transform: uppercase; letter-spacing: .1em;
  color: var(--coral); margin: 0;
}
.premium__title {
  font-family: var(--font-title); font-weight: 800; color: var(--navy);
  font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.12; margin: 0;
}
.premium__title em { font-style: normal; color: var(--coral); }
.premium__lead {
  font: 400 var(--fs-body) var(--font-body); color: var(--ink-soft);
  margin: 0; max-width: 56ch; line-height: 1.55;
}
.premium__lead strong { color: var(--teal); }

.premium__list {
  list-style: none; margin: .25rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem .9rem;
}
@media (max-width: 520px) { .premium__list { grid-template-columns: 1fr; } }
.premium__item {
  position: relative; padding-left: 1.6rem;
  font: 600 .95rem var(--font-body); color: var(--ink);
}
.premium__item::before {
  content: "\2713"; position: absolute; left: 0; top: 0;
  color: var(--teal); font-weight: 700;
}

/* ---- signup card ---- */
.premium__signup {
  border: 2px solid var(--parchment-2); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem 1.6rem;
}
.premium__form-title { font-size: 1.5rem; margin: 0 0 1.1rem; }

.premium__form { display: flex; flex-direction: column; gap: 1rem; }
.premium__field { display: flex; flex-direction: column; gap: .35rem; }
.premium__label { font: 600 .85rem var(--font-body); color: var(--ink-soft); }
.premium__req { color: var(--coral); }
.premium__opt { color: var(--ink-soft); font-weight: 400; }

.premium__field input[type="email"],
.premium__field input[type="text"],
.premium__field select {
  min-height: 48px; padding: .4rem .7rem; border-radius: 10px;
  border: 2px solid var(--parchment-2); background: var(--parchment);
  font: 500 1rem var(--font-body); color: var(--ink); width: 100%;
}
.premium__field input:focus-visible,
.premium__field select:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 1px;
}

.premium__consent {
  margin: 0; font: 500 .82rem var(--font-body); color: var(--ink-soft);
  line-height: 1.5; padding: .65rem .8rem; border-radius: 10px;
  background: var(--parchment-2);
}
.premium__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .25rem; }

.premium__formnote {
  margin: 0; font: 600 .9rem var(--font-body); color: var(--coral);
}

/* ---- inline thank-you ---- */
.premium__thanks {
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: .65rem;
}
.premium__thanks-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #fff; font-size: 1.8rem; font-weight: 700;
}
.premium__thanks-title { font-size: 1.5rem; margin: 0; }
.premium__thanks-body { margin: 0 0 .75rem; color: var(--ink-soft); max-width: 46ch; }

/* ── Post-game signup nudge (assets/js/post-game-nudge.js) ───────────── */
.mm-nudge {
  position: fixed; z-index: 60;
  right: 1rem; bottom: 1rem; width: min(20rem, calc(100vw - 2rem));
  background: var(--parchment);
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(13, 27, 42, .25);
  padding: 1rem 1.1rem 1.1rem;
  font-family: var(--font-body);
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
.mm-nudge--in { opacity: 1; transform: translateY(0); }
.mm-nudge__close {
  position: absolute; top: .35rem; right: .5rem;
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--ink-soft);
  padding: .2rem .35rem; border-radius: 6px;
}
.mm-nudge__close:hover { background: var(--parchment-2); color: var(--navy); }
.mm-nudge__title { font: 800 1.1rem var(--font-title); color: var(--navy); margin: 0 .75rem .25rem 0; }
.mm-nudge__sub { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .75rem; }
.mm-nudge__form { display: flex; flex-direction: column; gap: .5rem; }
.mm-nudge__input {
  font: 400 .95rem var(--font-body);
  padding: .55rem .7rem;
  border: 2px solid var(--parchment-2); border-radius: var(--radius);
  background: #fff; color: var(--navy); width: 100%;
}
.mm-nudge__input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.mm-nudge__submit { width: 100%; justify-content: center; }
.mm-nudge__note { margin: 0; font: 600 .8rem var(--font-body); color: var(--coral); }
.mm-nudge__msg { margin: .25rem 0 0; font: 700 .95rem var(--font-body); color: var(--navy); }
@media print { .mm-nudge { display: none !important; } }
