/* Direction B "Pelikenttä". Tokens come from ../tokens.css (generated). */
@font-face { font-family: 'Archivo'; src: url('./fonts/b/Archivo.woff') format('woff'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('./fonts/b/Archivo-Italic.woff') format('woff'); font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--color-base-200); }
body {
  margin: 0; min-height: 100dvh; background: var(--color-base-200); color: var(--color-base-content);
  font-family: var(--font-body); font-size: var(--text-md); line-height: 1.45; font-weight: 450;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--color-signal); color: var(--color-signal-content); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; hyphens: manual; }
p { text-wrap: pretty; }
a { color: var(--color-primary); text-underline-offset: 3px; }
.display { font-family: var(--font-display); font-stretch: 125%; font-weight: 850; font-style: italic; letter-spacing: -0.01em; line-height: 0.95; }
.muted { color: var(--color-muted); }

/* icons: authored 24px strokes */
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn {
  --lip: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--size-button);
  padding: 0 22px; border: 0; border-radius: var(--radius-md); font: inherit; font-stretch: 112%; font-weight: 750; font-size: var(--text-lg);
  text-decoration: none; cursor: pointer; user-select: none; touch-action: manipulation;
  border-bottom: var(--border-lip) solid var(--lip);
  transition: transform var(--dur-instant) var(--ease), border-bottom-width var(--dur-instant) var(--ease), filter var(--dur-quick) var(--ease);
}
.btn:active { transform: translateY(3px); border-bottom-width: 1px; }
.btn-signal { background: var(--color-signal); color: var(--color-signal-content); --lip: var(--color-signal-lip); }
.btn-signal:hover { filter: brightness(1.04) saturate(1.05); }
.btn-solid { background: var(--color-neutral); color: var(--color-neutral-content); --lip: color-mix(in oklab, var(--color-neutral) 70%, black); }
.btn-ghost { background: transparent; color: var(--color-base-content); border: 2px solid var(--color-border-strong); }
.btn-ghost:active { border-bottom-width: 2px; }
.btn-ghost:hover:not(:disabled) { background: var(--color-base-300); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:disabled:active { transform: none; }
.btn-sm { min-height: var(--size-target); padding: 0 14px; font-size: var(--text-sm); gap: 6px; }
.btn-sm .ic { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.icon-btn {
  display: grid; place-items: center; width: var(--size-target); height: var(--size-target); flex: none;
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-base-content); cursor: pointer;
}
.icon-btn:hover { background: var(--color-base-300); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn-lg { width: 52px; height: 52px; background: var(--color-base-100); border: 2px solid var(--color-base-300); }
.icon-btn-lg .ic { width: 26px; height: 26px; }
.link-btn { background: none; border: 0; padding: 12px 8px; min-height: var(--size-target); font: inherit; font-size: var(--text-sm); color: var(--color-muted); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* ---------- court (constant in both themes) ---------- */
.court { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--radius-lg); }
.c-free { fill: var(--color-court-free); }
.c-floor { fill: var(--color-court-floor); }
.c-line { fill: var(--color-court-line); }
.c-zones text { font-family: var(--font-display); font-weight: 800; font-stretch: 100%; font-size: 1.1px; fill: var(--color-court-line); opacity: 0.1; }
.c-net { fill: var(--color-court-line); opacity: 0.28; }
.c-post { fill: var(--color-court-line); }
/* Role discs (class .plate kept): exactly the engine's player across (D6), in the 2018 playbook colour
   code (passari black, hakkuri purple, keskipelaaja green, yleispelaaja orange-red) with the letter kept.
   Every disc has a white frame; receivers a thick one. The libero is not colour-coded: the white disc.
   States never repaint a disc: they ring it, concentric. */
.c-tabs { pointer-events: none; }
/* the disc's outer edge is the player's edge: frames are clipped to the circle (inner half shows, widths doubled) */
.plate-bg { fill: var(--color-court-floor); stroke: var(--color-court-line); stroke-width: 0.06; clip-path: circle(50%) fill-box; }
.plate { color: var(--color-court-line); }
.plate text { fill: currentColor; font-family: var(--font-display); font-style: italic; }
.plate-role { font-size: 0.4px; font-weight: 850; font-stretch: 112%; }
/* the place number: a small badge on the disc's top right, court-coloured like the floor */
.plate-tab { fill: var(--color-court-floor); stroke: var(--color-court-line); stroke-width: 0.025; }
.plate .plate-place { font-size: 0.2px; font-weight: 750; fill: var(--color-court-line); }
.plate-verdict-bg { stroke: var(--color-court-floor); stroke-width: 0.03; }
.pv-legal .plate-verdict-bg { fill: var(--color-court-correct); }
.pv-illegal .plate-verdict-bg { fill: var(--color-court-illegal); }
.plate.role-passari .plate-bg { fill: var(--color-court-role-passari); }
.plate.role-passari { color: var(--color-court-role-passari-ink); }
.plate.role-hakkuri .plate-bg { fill: var(--color-court-role-hakkuri); }
.plate.role-hakkuri { color: var(--color-court-role-hakkuri-ink); }
.plate.role-keskipelaaja .plate-bg { fill: var(--color-court-role-keskipelaaja); }
.plate.role-keskipelaaja { color: var(--color-court-role-keskipelaaja-ink); }
.plate.role-yleispelaaja .plate-bg { fill: var(--color-court-role-yleispelaaja); }
.plate.role-yleispelaaja { color: var(--color-court-role-yleispelaaja-ink); }
.plate.role-libero .plate-bg { fill: var(--color-court-plate); }
.plate.role-libero { color: var(--color-court-plate-ink); }
.plate.is-receiver .plate-bg { stroke-width: 0.15; }
.plate.is-selected .plate-bg, .plate.is-drag .plate-bg, .plate.is-level .plate-bg, .plate.is-you.v-legal .plate-bg { stroke: var(--color-court-correct); stroke-width: 0.15; }
.plate.is-fault .plate-bg, .plate.is-you.v-illegal .plate-bg { stroke: var(--color-court-illegal); stroke-width: 0.15; }
.fault-ring { fill: none; stroke: var(--color-court-illegal); stroke-width: 0.07; }
.legal-ring { fill: none; stroke: var(--color-court-correct); stroke-width: 0.05; }
.fault-badge-bg { fill: var(--color-court-illegal); stroke: var(--color-court-floor); stroke-width: 0.03; }
.fault-badge-x { fill: none; stroke: var(--color-court-plate-ink); stroke-width: 0.045; stroke-linecap: round; }
.sel-ring { fill: var(--color-court-correct); fill-opacity: 0.12; stroke: var(--color-court-correct); stroke-width: 0.035; }
.link { stroke-linecap: round; }
.link-pair { stroke: var(--color-court-correct); stroke-width: 0.06; }
.link-fault { stroke: var(--color-court-illegal); stroke-width: 0.07; stroke-dasharray: 0.16 0.1; }
.link-level { stroke: var(--color-court-correct); stroke-width: 0.07; stroke-dasharray: 0.16 0.1; }
.link-row { stroke: var(--color-court-line); stroke-width: 0.035; stroke-dasharray: 0.12 0.1; opacity: 0.8; }
/* the 2018 example spot: a dashed marker outline only, never filled like an answer */
.example-plate .plate-bg { fill: none; stroke: var(--color-court-legal); stroke-width: 0.07; stroke-dasharray: 0.09 0.06; opacity: 0.8; }
.plate-mark { fill: none; stroke: var(--color-court-plate-ink); stroke-width: 0.045; stroke-linecap: round; stroke-linejoin: round; }
.crosshair { fill: none; stroke: var(--color-court-correct); stroke-width: 0.05; }
.door-ping { fill: none; stroke: var(--color-court-correct); stroke-width: 0.07; }
.door-dot { fill: var(--color-court-correct); }

.stage { position: relative; border-radius: var(--radius-lg); }
.stage.is-asking .court { cursor: crosshair; }
.stage.shake { animation: shake var(--dur-shake) cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.stage.cross::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); pointer-events: none; box-shadow: inset 0 0 0 3px var(--color-court-illegal); animation: flash 420ms var(--ease) forwards; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-8px) rotate(-0.4deg); } 35% { transform: translateX(7px) rotate(0.3deg); } 55% { transform: translateX(-5px); } 75% { transform: translateX(3px); } 90% { transform: translateX(-1px); } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }


/* ---------- shell ---------- */
.place { min-height: 100dvh; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; height: var(--size-header);
  padding: 0 8px 0 4px; padding-top: env(safe-area-inset-top); background: color-mix(in oklab, var(--color-base-200) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bar-title { flex: 1; min-width: 0; font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: var(--text-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-right { display: flex; align-items: center; gap: 6px; }
.play { flex: 1; display: grid; gap: 12px; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); align-content: start; }
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* rotation bar */
.rot-bar { display: flex; align-items: center; gap: 10px; }
.rot-label { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rot-label.flip .rot-big { animation: flip var(--dur-base) var(--ease); }
@keyframes flip { from { opacity: 0; transform: translateY(8px) skewX(-8deg); } to { opacity: 1; transform: none; } }
.rot-name { display: flex; flex-direction: column; min-width: 0; }
.rot-big { font-size: var(--text-2xl); display: inline-block; }
.rot-sub { font-size: var(--text-xs); color: var(--color-muted); font-weight: 550; line-height: 1.2; }
.minimap { display: grid; grid-template-columns: repeat(3, 26px); grid-auto-rows: 22px; gap: 3px; flex: none; }
.mm { display: flex; align-items: baseline; justify-content: center; gap: 1px; border-radius: 4px; background: var(--color-base-300); color: var(--color-base-content); font-family: var(--font-display); font-style: italic; line-height: 22px; transform: skewX(-8deg); }
.mm b { font-weight: 850; font-size: 12px; }
.mm i { font-size: 9px; font-weight: 600; opacity: 0.75; }
.mm.is-hi { outline: 2.5px solid var(--color-primary); outline-offset: 1px; }

/* formation switch (Perusmuodostelma / Vaihtoehto): a segmented control, only where the slide has an alternative */
.mode { display: flex; flex-direction: column; gap: 10px; }
.mode[hidden], .alt-quote[hidden] { display: none; }
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); padding: 4px; border-radius: var(--radius-md); background: var(--color-base-300); }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: calc(var(--radius-md) - 3px);
  background: var(--color-base-100); box-shadow: 0 2px 0 var(--color-border-strong), 0 3px 10px -4px rgb(5 10 25 / 0.35);
  transition: transform var(--dur-base) var(--ease);
}
.seg .seg-thumb { width: calc((100% - 8px) / var(--n, 2)); transform: translateX(calc(100% * var(--i, 0))); }
.seg button {
  position: relative; z-index: 1; min-height: var(--size-target); padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: inherit; font-stretch: 106%; font-weight: 650; font-size: clamp(13px, 3.9vw, var(--text-sm)); color: var(--color-muted);
  white-space: nowrap; touch-action: manipulation; border-radius: calc(var(--radius-md) - 3px); transition: color var(--dur-quick) var(--ease);
}
.seg button[aria-checked="true"] { color: var(--color-base-content); font-weight: 800; }
.seg button { min-width: 0; }
.seg[style*="--n: 3"] button { white-space: normal; hyphens: manual; overflow-wrap: anywhere; line-height: 1.15; font-size: clamp(12px, 3.4vw, var(--text-sm)); }
.seg button:focus-visible { outline-offset: -3px; }
.alt-quote { margin: 0; padding: 2px 4px 2px 14px; border-left: 3px solid var(--color-border-strong); animation: quote-in var(--dur-base) var(--ease); }
.alt-quote blockquote { margin: 0; font-size: var(--text-sm); line-height: 1.4; hyphens: manual; }
.alt-quote figcaption { margin-top: 2px; font-size: var(--text-xs); font-weight: 650; color: var(--color-muted); }
@keyframes quote-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* panel */
.panel { background: var(--color-base-100); border-radius: var(--radius-lg); padding: 16px; min-height: 120px; display: flex; flex-direction: column; gap: 12px; }
.hint { color: var(--color-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--text-sm); color: var(--color-muted); }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.lg i { width: 18px; height: 18px; border-radius: 50%; }
.lg-rec i { background: var(--color-court-floor); box-shadow: inset 0 0 0 3.5px var(--color-court-line); }
.lg-other i { background: var(--color-court-floor); box-shadow: inset 0 0 0 1.5px var(--color-court-line); }
.who { display: flex; align-items: center; gap: 12px; }
.who-plate, .you-plate, .role-plate {
  display: inline-flex; align-items: baseline; gap: 3px; justify-content: center; min-width: 52px; padding: 6px 10px; border-radius: 6px; transform: skewX(-12deg);
  background: var(--color-court-floor); color: var(--color-court-line); font-family: var(--font-display); font-style: italic; font-weight: 850; font-stretch: 112%; font-size: var(--text-xl); line-height: 1;
}
.who-plate small, .you-plate small { font-size: 0.65em; font-weight: 650; opacity: 0.8; }
/* Role colour on every chip that stands for a player (chrome tokens, tuned to the card) */
.role-passari { background: var(--color-role-passari); color: var(--color-role-passari-ink); box-shadow: inset 0 0 0 1.5px var(--color-role-passari-edge); }
.role-hakkuri { background: var(--color-role-hakkuri); color: var(--color-role-hakkuri-ink); }
.role-keskipelaaja { background: var(--color-role-keskipelaaja); color: var(--color-role-keskipelaaja-ink); }
.role-yleispelaaja { background: var(--color-role-yleispelaaja); color: var(--color-role-yleispelaaja-ink); }
.role-libero { background: var(--color-court-plate); color: var(--color-court-plate-ink); box-shadow: inset 0 0 0 1.5px var(--color-border-strong); }
.who-role { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: var(--text-xl); line-height: 1.1; }
.who-meta { color: var(--color-muted); font-size: var(--text-sm); }
.reason { font-size: var(--text-md); max-width: 60ch; }
.reason-source { color: var(--color-muted); font-size: var(--text-xs); font-weight: 650; }

/* verdicts */
.verdict { display: flex; flex-direction: column; gap: 10px; container-type: inline-size; }
.verdict-top { display: flex; align-items: center; gap: 10px; }
.verdict-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; transform: skewX(-10deg); flex: none; }
.verdict-ic .ic { width: 24px; height: 24px; stroke-width: 3; transform: skewX(10deg); }
.verdict-head { font-family: var(--font-display); font-style: italic; font-stretch: 112%; font-weight: 850; font-size: clamp(17px, calc((100cqi - 56px) / 8.6), 24px); line-height: 1.05; min-width: 0; overflow-wrap: normal; }
.v-legal .verdict-ic, .v-level .verdict-ic { background: var(--color-court-correct); color: var(--color-court-plate-ink); }
.v-illegal .verdict-ic, .v-off .verdict-ic { background: var(--color-court-illegal); color: var(--color-court-plate-ink); }
.v-legal .verdict-head, .v-level .verdict-head { color: var(--color-success); }
.v-illegal .verdict-head, .v-off .verdict-head { color: var(--color-error); }
.verdict-body { display: flex; gap: 12px; align-items: flex-start; }
.verdict-lines { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.verdict-line { font-weight: 650; }
.verdict-reason { color: var(--color-muted); font-size: var(--text-sm); }
.rule { border-top: 1px solid var(--color-base-300); padding-top: 8px; font-size: var(--text-sm); }
.rule summary { display: inline-flex; align-items: center; gap: 8px; min-height: var(--size-target); cursor: pointer; font-weight: 650; color: var(--color-primary); list-style: none; }
.rule summary::-webkit-details-marker { display: none; }
.rule summary .ic { width: 18px; height: 18px; }
.rule p { margin-top: 6px; max-width: 62ch; }
.rule-q { margin: 8px 0 0; padding-left: 12px; border-left: 2px solid var(--color-base-300); max-width: 62ch; font-size: var(--text-sm); }
p.rule-cite { margin-top: 2px; padding-left: 14px; font-size: var(--text-xs, 13px); }
.sheet-in .rule-q + .rule-cite { margin-top: -8px; }

/* ---------- Where do I stand ---------- */
.pips { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pip { width: 22px; height: 22px; border-radius: 5px; transform: skewX(-12deg); background: var(--color-base-300); display: grid; place-items: center; }
.pip .ic { width: 15px; height: 15px; stroke-width: 3.2; transform: skewX(12deg); color: var(--color-court-plate-ink); }
.pip.is-now { box-shadow: inset 0 0 0 2px var(--color-base-content); }
.pip.v-legal { background: var(--color-court-correct); animation: pip var(--dur-snap) var(--ease); }
.pip.v-illegal { background: var(--color-court-illegal); animation: pip var(--dur-snap) var(--ease); }
@keyframes pip { from { transform: skewX(-12deg) scale(0.5); } 60% { transform: skewX(-12deg) scale(1.15); } to { transform: skewX(-12deg) scale(1); } }
.ask { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask-rot { display: flex; flex-direction: column; }
.ask-q { font-size: var(--text-2xl); }
.ask-you { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.you-plate { font-size: var(--text-lg); min-width: 46px; }
.ask-hint { color: var(--color-muted); font-size: var(--text-sm); }
.next-btn { margin-top: auto; }
.panel-stand { gap: 14px; }

/* role pick */
.pick { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 6px; max-width: 560px; width: 100%; margin: 0 auto; }
.pick-title { font-size: var(--text-3xl); margin-top: 8px; }
.pick-sub { color: var(--color-muted); margin-bottom: 14px; }
.roles { display: grid; gap: 10px; }
.role-tile {
  display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 10px 16px 10px 14px; border-radius: var(--radius-lg);
  background: var(--color-base-100); color: var(--color-base-content); text-decoration: none; border: 2px solid var(--color-base-300); border-bottom-width: 5px;
  transition: transform var(--dur-instant) var(--ease), border-color var(--dur-quick) var(--ease);
}
.role-tile:hover { border-color: var(--color-border-strong); }
.role-tile:active { transform: translateY(3px); border-bottom-width: 2px; }
.role-plate { min-width: 46px; font-size: var(--text-xl); }
.role-name { flex: 1; min-width: 0; font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: min(var(--text-xl), 6.2vw); }
.role-tile .ic { color: var(--color-muted); }

/* done */
.done { padding: 8px 16px 24px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; max-width: 480px; width: 100%; margin: 0 auto; }
.done-title { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: var(--text-xl); margin-top: 8px; }
.done-score { font-size: 112px; line-height: 0.9; display: flex; align-items: baseline; gap: 4px; animation: score-in 520ms var(--ease) both; }
.done-score small { font-size: 0.4em; color: var(--color-muted); }
@keyframes score-in { from { opacity: 0; transform: translateY(14px) skewX(-6deg); } to { opacity: 1; transform: none; } }
.done-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.done-list li { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--radius-md); background: var(--color-base-100); font-size: var(--text-sm); font-weight: 600; }
.done-rot { font-family: var(--font-display); font-style: italic; font-weight: 850; font-size: var(--text-lg); }
.done-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; margin-left: auto; color: var(--color-court-plate-ink); }
.done-ic .ic { width: 15px; height: 15px; stroke-width: 3.2; }
.done-list .v-legal .done-ic { background: var(--color-court-correct); }
.done-list .v-illegal .done-ic { background: var(--color-court-illegal); }
.done-list li > span:nth-child(3) { display: none; }
.done-tally { color: var(--color-muted); font-size: var(--text-sm); }
.done-actions { display: grid; gap: 10px; margin-top: 6px; }

/* ---------- Start ---------- */
.start { min-height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: calc(28px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }
.start-title { font-size: clamp(36px, 10.4vw, 96px); }
.start-lede { margin-top: 12px; color: var(--color-muted); font-size: var(--text-lg); max-width: 34ch; }
.doors { display: grid; gap: 14px; }
.door {
  display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 20px;
  background: var(--color-base-100); color: var(--color-base-content); text-decoration: none; border: 2px solid var(--color-base-300); border-bottom-width: 6px;
  transition: transform var(--dur-instant) var(--ease), border-color var(--dur-quick) var(--ease);
}
.door:hover { border-color: var(--color-border-strong); }
.door:active { transform: translateY(3px); border-bottom-width: 3px; }
.door-court .court { border-radius: 12px; }
.door-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.door-title { font-family: var(--font-display); font-style: italic; font-stretch: 118%; font-weight: 850; font-size: var(--text-xl); line-height: 1.05; }
.door-sub { color: var(--color-muted); font-size: var(--text-sm); }
.door-cta { min-height: 44px; font-size: var(--text-md); padding: 0 16px; margin-top: 4px; }
.door-cta .ic { width: 18px; height: 18px; }
.start-foot { margin-top: auto; }
.sheet { border: 0; border-radius: 20px; padding: 0; max-width: 520px; width: calc(100% - 24px); background: var(--color-base-100); color: var(--color-base-content); }
.sheet::backdrop { background: rgb(5 10 25 / 0.55); }
.sheet-in { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.sheet-title { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: var(--text-xl); }

/* ---------- desktop ---------- */
@media (min-width: 760px) {
  .doors { grid-template-columns: 1fr 1fr; gap: 20px; }
  .door { grid-template-columns: minmax(160px, 44%) 1fr; padding: 18px; gap: 22px; align-items: center; }
  .start-lede { max-width: 48ch; }
  .door-title { font-size: var(--text-2xl); }
  .door-sub { font-size: var(--text-md); }
  .door-cta { min-height: var(--size-button); font-size: var(--text-lg); }
  .start { gap: 36px; padding-top: 56px; }
}
@media (min-width: 960px) {
  .play { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 8px 24px 24px; max-width: 1240px; width: 100%; margin: 0 auto; align-items: start; }
  .field-col { display: flex; justify-content: center; }
  .stage { width: min(100%, calc(100dvh - 104px)); }
  .bar { padding: 0 16px; max-width: 1240px; width: 100%; margin: 0 auto; }
  .panel { padding: 20px; }
  .ask-q { font-size: var(--text-3xl); }
  .verdict-body { flex-direction: column; }
}
@media (max-width: 389px) {
  .bar-title { font-stretch: 100%; font-size: var(--text-md); }
  .pip { width: 18px; height: 20px; } .pips { gap: 3px; }
  .bar .btn-sm span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bar .btn-sm { padding: 0; width: var(--size-target); }
}
@media (max-width: 359px) {
  .minimap { grid-template-columns: repeat(3, 22px); grid-auto-rows: 20px; }
  .rot-big { font-size: var(--text-xl); }
  .door { grid-template-columns: 92px 1fr; }
  .pips { gap: 3px; } .pip { width: 18px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .stage.shake { animation: none; }
  .stage.shake::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); pointer-events: none; box-shadow: inset 0 0 0 4px var(--color-court-illegal); }
}

/* the example key under the verdict: a dashed marker swatch, the same mark as on the court */
.verdict-example { display: flex; align-items: center; gap: 8px; color: var(--color-muted); font-size: var(--text-sm); }
.ex-key { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px dashed var(--color-info); }

/* the answer: verdict and its line with the next action, one bar; the button goes under it when narrow */
.answer-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ic text" "btn btn"; align-items: center; gap: 12px 12px; }
.answer-bar .verdict-ic { grid-area: ic; }
.answer-bar .verdict-lines { grid-area: text; gap: 2px; }
.answer-bar .verdict-head { font-size: var(--text-lg); overflow-wrap: normal; }
.answer-bar .verdict-line { font-size: var(--text-sm); overflow-wrap: normal; hyphens: manual; }
.answer-bar .next-btn { grid-area: btn; width: 100%; min-height: var(--size-target); }
@container (min-width: 520px) {
  .answer-bar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic text btn"; }
  .answer-bar .next-btn { width: auto; }
}
.panel-stand { container-type: inline-size; }

/* Speech bubble: what the tapped player says (./directions/bubbles.js). In the side column, never on
   the court, so it never covers the players the rule compares; ./directions/bubble-tail.js points the
   tail at the selected plate ([data-tail], --tail). */
.say { position: relative; background: var(--color-base-200); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; max-width: 60ch; font-size: var(--text-md); line-height: 1.4; overflow-wrap: break-word; box-shadow: 0 2px 0 var(--color-base-300); }
.say p:first-child { font-weight: 700; }
.say[data-tail]::before { content: ''; position: absolute; width: 14px; height: 14px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.say[data-tail="top"]::before { top: -6px; left: calc(var(--tail) - 7px); }
.say[data-tail="left"]::before { left: -6px; top: calc(var(--tail) - 7px); }
.rule-src { border-top: 0; padding-top: 0; margin-top: -8px; }
/* A team choice (bubbleLines choice: true): quieter, under a hairline, so it never reads as a rule. */
.say p.choice { color: var(--color-muted); font-size: var(--text-sm); padding-top: 6px; border-top: 1px solid var(--color-base-300); }
.say p.choice + p.choice { border-top: 0; padding-top: 0; }
