/* Heron side panel.
   Two states, one system: house lights up (setup) and house lights down (a run).
   The hall is always dark: it is the one piece of the arena that shows before the lights go down. */

:root {
  --font-ui: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Leelawadee UI", sans-serif;
  --font-din: Bahnschrift, "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", "Segoe UI", sans-serif;

  /* type scale, fixed */
  --t-12: 0.75rem;
  --t-14: 0.875rem;
  --t-16: 1rem;
  --t-20: 1.25rem;
  --t-56: 3.5rem;

  /* space, 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;

  /* shape: containers 12, controls 8, lights round */
  --r-well: 12px;
  --r-control: 8px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* a small spring, for the playful looks: overshoots about 6 % and settles */
  --spring: linear(0, 0.21 6%, 0.6 14%, 0.92 23%, 1.05 32%, 1.07 38%, 1.04 47%, 1 60%, 0.995 75%, 1);

  /* the hall, the same in both states */
  --hall: oklch(0.16 0.075 283);
  --hall-ink: oklch(0.82 0.035 283);
  --seat-free: oklch(0.56 0.075 283);
  --seat-taken: oklch(0.36 0.075 283);
  --light: oklch(0.90 0.085 78);
}

:root[data-ocean="silver"] { --light: oklch(0.93 0.008 283); }
:root[data-ocean="aqua"]   { --light: oklch(0.87 0.10 190); }
:root[data-ocean="pink"]   { --light: oklch(0.84 0.11 355); }
:root[data-ocean="lime"]   { --light: oklch(0.91 0.14 125); }
:root[data-ocean="sky"]    { --light: oklch(0.84 0.10 240); }

:root[data-lights="up"] {
  color-scheme: light;
  --ground: oklch(0.965 0.008 283);
  --ground-2: oklch(0.925 0.014 283);
  --field: oklch(0.992 0.003 283);
  --ink: oklch(0.24 0.075 283);
  --ink-2: oklch(0.43 0.04 283);
  --ink-3: oklch(0.51 0.035 283);
  --line: oklch(0.87 0.016 283);
  --edge: oklch(0.60 0.03 283);
  --on-ink: oklch(0.975 0.006 283);
}

:root[data-lights="down"] {
  color-scheme: dark;
  --ground: oklch(0.205 0.078 283);
  --ground-2: oklch(0.25 0.085 283);
  --field: oklch(0.245 0.08 283);
  --ink: oklch(0.95 0.015 283);
  --ink-2: oklch(0.80 0.04 283);
  --ink-3: oklch(0.67 0.045 283);
  --line: oklch(0.32 0.075 283);
  --edge: oklch(0.56 0.07 283);
  --on-ink: oklch(0.19 0.07 283);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scrollbar-color: var(--edge) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--t-14) / 1.45 var(--font-ui);
  caret-color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--on-ink); }

h1, h2, h3, p, ul, ol, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.din {
  font-family: var(--font-din);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- top bar ---- */

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4) var(--s-2);
  background: var(--ground);
}

.mark {
  font: 600 var(--t-20) / 1 var(--font-din);
  font-stretch: 87%;
  letter-spacing: 0.01em;
}

.state {
  margin-left: auto;
  font-size: var(--t-14);
  color: var(--ink-2);
  text-align: right;
}

.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--s-4) var(--s-8);
}
/* in a run the page is as tall as the panel, so Stop sits at the bottom edge and never moves */
.wrap:has(#run:not([hidden])) { padding-bottom: 0; }
#run:not([hidden]) { flex: 1; display: flex; flex-direction: column; }

/* ---- the hall ---- */

.hall__well {
  position: relative;
  border-radius: var(--r-well);
  background: var(--hall);
  touch-action: none;
  cursor: crosshair;
  overflow: hidden;
}

.hall__well[data-live="true"] { cursor: default; }

.hall__well:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hall__svg { display: block; width: 100%; height: auto; }

.hall__stage { fill: var(--seat-free); }
.hall__stage-word {
  fill: var(--hall-ink);
  font: 400 9px var(--font-ui);
  letter-spacing: 0.02em;
}

.seat { fill: var(--seat-free); }
.seat--taken { fill: var(--seat-taken); }
.seat--failed { fill: none; stroke: var(--seat-free); stroke-width: 1; }
.seat--lit { fill: var(--light); }

.aim {
  fill: none;
  stroke: var(--light);
  stroke-width: 1;
  opacity: 0.65;
}

/* the one moment: every seat comes on, row by row outward from yours. Hard cuts, no fades. */
.hall__well[data-ocean-on="true"] .seat {
  animation: seat-on 1ms steps(1, end) both;
  animation-delay: calc(var(--d, 0) * 46ms);
}
/* no "from": until its own step a seat keeps the colour it had, so yours never blink off */
@keyframes seat-on { to { fill: var(--light); stroke-width: 0; } }

.hall__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-2);
  color: var(--ink-2);
  font-size: var(--t-12);
  min-height: 1.6rem;
}

.hall__foot b {
  font: 600 var(--t-14) / 1 var(--font-din);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ---- buttons ---- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: 0 var(--s-3);
  border: 1px solid var(--edge);
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  font: 500 var(--t-14) / 1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, border-color 140ms ease;
}

/* every button presses down 3 % for 140 ms (board 13) */
.btn:active { transform: scale(0.97); }
.btn:disabled { color: var(--ink-3); border-color: var(--line); cursor: not-allowed; transform: none; }

.btn--primary {
  width: 100%;
  min-height: 48px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  font-size: var(--t-16);
  font-weight: 600;
}

.btn--primary:disabled { background: var(--ground-2); border-color: var(--line); color: var(--ink-3); }

.btn--stop {
  width: 100%;
  min-height: 52px;
  border-color: var(--ink);
  font-size: var(--t-16);
  font-weight: 600;
}

.btn kbd {
  font: 400 var(--t-12) / 1 var(--font-ui);
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 5px;
}

.btn--small { min-height: 30px; padding: 0 10px; font-size: var(--t-12); }

.link {
  appearance: none;
  border: 0;
  padding: 2px 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--t-12);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { background: var(--ground-2); }
  .btn--primary:not(:disabled):hover { background: var(--ink-2); border-color: var(--ink-2); }
  .link:hover { color: var(--ink); text-decoration-color: var(--ink); }
  .chip:hover { border-color: var(--ink); }
}

/* ---- go: start, blockers, test only, rehearse ---- */

.go { padding-top: var(--s-4); }

.blockers {
  margin-top: var(--s-2);
  color: var(--ink-2);
  font-size: var(--t-12);
}

.blockers li + li { margin-top: 2px; }

.go__note { margin-top: var(--s-3); font-size: var(--t-12); font-weight: 600; color: var(--ink); }

/* the three practice scenes: ruled rows, like every other list here */
.scenes { margin-top: var(--s-3); }
.scenes p { color: var(--ink-2); font-size: var(--t-12); padding-bottom: var(--s-2); }
.scene {
  appearance: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  min-height: 44px;
  padding: var(--s-3) 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.scene:last-child { border-bottom: 1px solid var(--line); }
.scene b { font-weight: 600; }
.scene span { color: var(--ink-2); font-size: var(--t-12); text-align: right; }
@media (hover: hover) and (pointer: fine) { .scene:hover b { text-decoration: underline; text-underline-offset: 3px; } }

/* ---- form ---- */

.part { padding-top: var(--s-8); }
.part > h2 {
  font-size: var(--t-16);
  font-weight: 600;
  line-height: 1.2;
  padding-bottom: var(--s-3);
}

.field + .field { margin-top: var(--s-4); }

.field > label, .field > .label, legend.label {
  display: block;
  padding-bottom: 6px;
  font-size: var(--t-14);
  font-weight: 500;
}

.help {
  padding-top: 6px;
  color: var(--ink-2);
  font-size: var(--t-12);
}

.error { padding-top: 6px; color: var(--ink); font-size: var(--t-12); font-weight: 600; }

input[type="text"], input[type="url"], input[type="number"], input[type="tel"], input[type="email"],
input[type="datetime-local"], select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: var(--r-control);
  background: var(--field);
  color: var(--ink);
  font: 400 var(--t-14) / 1.2 var(--font-ui);
}

input::placeholder { color: var(--ink-3); opacity: 1; }
input[aria-invalid="true"] { border-color: var(--ink); border-width: 2px; }

.row { display: flex; gap: var(--s-2); align-items: stretch; }
.row > :first-child { flex: 1 1 auto; min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

.check, .field > label.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding-bottom: 0;
  font-size: var(--t-14);
  font-weight: 400;
  cursor: pointer;
}

.pair > .field { margin-top: 0; }
.pair + .field, .pair + fieldset { margin-top: var(--s-4); }
.gap-top { margin-top: var(--s-3); }
.gap-small { margin-top: var(--s-2); }
.mini { display: grid; gap: var(--s-1); min-width: 0; font-size: var(--t-12); color: var(--ink-2); }
.sub-label { display: block; padding-bottom: 6px; font-size: var(--t-14); font-weight: 500; }

.check input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  flex: none;
}

/* stepper */
.stepper { display: inline-grid; grid-template-columns: 36px 52px 36px; }
.stepper .btn { padding: 0; font-size: var(--t-16); border-radius: 0; }
.stepper .btn:first-child { border-radius: var(--r-control) 0 0 var(--r-control); }
.stepper .btn:last-child { border-radius: 0 var(--r-control) var(--r-control) 0; }
.stepper output {
  display: grid;
  place-items: center;
  border-block: 1px solid var(--edge);
  background: var(--field);
  font: 600 var(--t-16) / 1 var(--font-din);
  font-variant-numeric: tabular-nums;
}

/* segmented: three radios */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.seg label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 var(--s-2);
  border: 1px solid var(--edge);
  margin-left: -1px;
  font-size: var(--t-12);
  text-align: center;
  cursor: pointer;
}
.seg label:first-of-type { border-radius: var(--r-control) 0 0 var(--r-control); margin-left: 0; }
.seg label:last-of-type { border-radius: 0 var(--r-control) var(--r-control) 0; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); z-index: 1; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 2; }

/* chips: things read off the page, offered as buttons */
.offer { padding-top: var(--s-2); }
.offer p { color: var(--ink-2); font-size: var(--t-12); padding-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  font: 500 var(--t-12) / 1 var(--font-ui);
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip b { font: 600 var(--t-14) / 1 var(--font-din); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* the zone roster: ranked, finite */
.roster li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  border-top: 1px solid var(--line);
}
.roster li:last-child { border-bottom: 1px solid var(--line); }
.roster .rank { font: 600 var(--t-14) / 1 var(--font-din); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.roster .name { font: 600 var(--t-16) / 1 var(--font-din); letter-spacing: 0.01em; overflow-wrap: anywhere; }
.roster .acts { display: flex; gap: var(--s-3); }
.roster[data-empty="true"] li { display: block; min-height: 0; padding: var(--s-3) 0; color: var(--ink-2); font-size: var(--t-12); }

/* folded groups */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  font-size: var(--t-14);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary .sum { color: var(--ink-2); font-weight: 400; font-size: var(--t-12); text-align: right; }
details > .fold { padding-bottom: var(--s-4); }
.person { padding-top: var(--s-3); }
.person + .person { margin-top: var(--s-3); border-top: 1px solid var(--line); }
.person__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: var(--s-2); color: var(--ink-2); font-size: var(--t-12); }

/* light colour */
.oceans { display: flex; gap: var(--s-2); }
.oceans label { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-control); background: var(--hall); cursor: pointer; }
.oceans input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.oceans i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.oceans label:has(input:checked) { outline: 2px solid var(--ink); outline-offset: 2px; }
.oceans label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }

/* check page results, last runs */
.report { margin-top: var(--s-3); font-size: var(--t-12); }
.report li { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); padding: 6px 0; border-top: 1px solid var(--line); }
.report code { font: 400 var(--t-12) / 1.3 var(--font-ui); color: var(--ink-2); overflow-wrap: anywhere; }
.report .miss { font-weight: 600; }
.tools { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---- the run ---- */

.count {
  padding-top: var(--s-6);
  font: 600 var(--t-56) / 1 var(--font-din);
  font-variant-numeric: tabular-nums;
  font-stretch: 87%;
  letter-spacing: -0.01em;
}
.count + p { color: var(--ink-2); padding-top: var(--s-1); }

/* the one line that asks for the owner: no box, the largest text in the run */
.note {
  padding-top: var(--s-4);
  font-size: var(--t-16);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: pretty;
}
.note[data-you="true"] { font-size: var(--t-20); line-height: 1.25; }

/* the Zone row of a run holds the whole ranked list: a spent zone greys out, it does not vanish */
.sheet .fact .z { margin-right: 10px; color: var(--ink-2); }
.sheet .fact .z[data-s="now"] { color: var(--ink); }
.sheet .fact .z[data-s="spent"] { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.sheet .fact .lap { font: 400 var(--t-12) / 1 var(--font-ui); letter-spacing: 0; color: var(--ink-2); white-space: nowrap; }

.sheet { padding-top: var(--s-6); }
.sheet h3 { font-size: var(--t-12); font-weight: 500; color: var(--ink-2); padding-bottom: var(--s-1); }
.sheet ol + h3 { padding-top: var(--s-4); }
.sheet li {
  display: grid;
  grid-template-columns: 14px 6.5rem 1fr auto;
  align-items: baseline;
  gap: var(--s-2);
  min-height: 34px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.sheet li:last-child { border-bottom: 1px solid var(--line); }
.sheet .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--seat-taken); align-self: center; }
.sheet .fact { font-weight: 600; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
/* DIN is for codes only: zone names and seat numbers */
.sheet li[data-k="zone"] .fact, .sheet li[data-k="seats"] .fact { font-family: var(--font-din); letter-spacing: 0.01em; }
.sheet li[data-s="wait"] { color: var(--ink-3); }
.sheet .time { font: 400 var(--t-12) / 1 var(--font-din); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sheet li[data-s="now"], .sheet li[data-s="done"], .sheet li[data-s="you"] { color: var(--ink); }
.sheet li[data-s="now"] .lamp, .sheet li[data-s="done"] .lamp { background: var(--light); }
.sheet li[data-s="now"] .step { font-weight: 600; }
.sheet li[data-s="you"] .lamp { background: var(--light); animation: lamp-call 1.2s steps(1, end) infinite; }
.sheet li[data-s="fail"] .lamp { background: none; box-shadow: inset 0 0 0 1px var(--ink-3); }
.sheet li[data-s="fail"] .fact { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
@keyframes lamp-call { 0% { opacity: 1; } 50% { opacity: 0.25; } }

.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--s-3); color: var(--ink-2); font-size: var(--t-12); }
.total b { font: 600 var(--t-20) / 1 var(--font-din); font-variant-numeric: tabular-nums; color: var(--ink); }

.dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: var(--s-6) 0 var(--s-4);
  background: var(--ground);
  display: grid;
  gap: var(--s-2);
}

/* ---- house lights: the dark grows out of the hall ---- */

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

:root[data-turn="down"]::view-transition-new(root) {
  animation: lights-down 480ms var(--ease-out) both;
}
:root[data-turn="up"]::view-transition-old(root) {
  z-index: 2;
  animation: lights-up 380ms var(--ease-out) both;
}

@keyframes lights-down {
  from { clip-path: inset(var(--vt-t) var(--vt-r) var(--vt-b) var(--vt-l) round 12px); }
  to { clip-path: inset(0 0 0 0 round 0px); }
}
@keyframes lights-up {
  from { clip-path: inset(0 0 0 0 round 0px); }
  to { clip-path: inset(var(--vt-t) var(--vt-r) var(--vt-b) var(--vt-l) round 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .chip { transition: none; }
  .btn:active, .chip:active { transform: none; }
  .hall__well[data-ocean-on="true"] .seat { animation-delay: 0ms; }
  .sheet li[data-s="you"] .lamp { animation: none; }
  :root[data-turn]::view-transition-new(root), :root[data-turn]::view-transition-old(root) { animation: none; }
}

/* ---- the bar's extras: a clock (Departures only) and the gear ---- */

.clock { display: none; }

/* the gear: settings. It turns a little toward you on hover, and a quarter turn while the sheet is open. */
.gear {
  appearance: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px -6px -6px 0;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), color 160ms ease, background-color 160ms ease;
}
.gear svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform 420ms var(--ease-out); }
.gear:active { transform: scale(0.97); }
.gear[aria-expanded="true"] svg { transform: rotate(90deg); }
@media (hover: hover) and (pointer: fine) {
  .gear:hover { color: var(--ink); background: var(--ground-2); }
  .gear:hover svg { transform: rotate(45deg); }
  .gear[aria-expanded="true"]:hover svg { transform: rotate(90deg); }
}

/* ---- the run's two big moments ---- */

.hunt { padding-top: var(--s-6); }
.hunt__n {
  display: flex;
  font: 600 var(--t-56) / 1 var(--font-din);
  font-stretch: 87%;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
/* each digit is a window: a new digit rolls up into it from below while the old one leaves upward */
.hunt__n .d { position: relative; display: inline-block; overflow: hidden; height: 1em; line-height: 1; }
.hunt__n .d > span { display: block; }
.hunt__n .d > span + span { position: absolute; left: 0; top: 0; }
.hunt__n .d[data-lead="true"] { display: none; }
.hunt__label { color: var(--ink-2); padding-top: var(--s-1); }
.hunt__sub { color: var(--ink-2); font-size: var(--t-12); padding-top: 2px; }

.won { padding-top: var(--s-6); position: relative; }
.won__label { color: var(--ink-2); font-size: var(--t-12); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.won__seats { font: 600 2.75rem / 1.05 var(--font-din); font-stretch: 87%; letter-spacing: -0.01em; padding-top: var(--s-1); overflow-wrap: anywhere; }
.won__sub { color: var(--ink-2); font-size: var(--t-12); padding-top: var(--s-1); }

/* ---- settings: a sheet that rises from the bottom ---- */

.settings {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--ground);
  color: var(--ink);
  box-shadow: 0 -18px 40px -18px rgb(0 0 0 / 0.45);
  overflow: auto;
  overscroll-behavior: contain;
  /* closing is quicker than opening: the system answers, the person decided */
  transform: translateY(100%);
  transition: transform 180ms var(--ease-out), display 180ms allow-discrete, overlay 180ms allow-discrete;
}
.settings[open] {
  transform: translateY(0);
  transition: transform 380ms var(--ease-drawer), display 380ms allow-discrete, overlay 380ms allow-discrete;
}
@starting-style { .settings[open] { transform: translateY(100%); } }
.settings::backdrop {
  background: rgb(0 0 0 / 0);
  transition: background-color 180ms ease, display 180ms allow-discrete, overlay 180ms allow-discrete;
}
.settings[open]::backdrop { background: rgb(0 0 0 / 0.38); }
@starting-style { .settings[open]::backdrop { background: rgb(0 0 0 / 0); } }

.settings__in { padding: var(--s-2) var(--s-4) var(--s-6); }
.settings__grip { display: block; width: 36px; height: 4px; margin: 0 auto var(--s-1); border-radius: 2px; background: var(--line); }
.settings__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) 0 var(--s-3); }
.settings__head h2 { font-size: var(--t-16); font-weight: 600; }
.set { padding: var(--s-4) 0; box-shadow: inset 0 1px 0 var(--line); }
.set__row .check { flex: 1; }
.set__row .link { white-space: nowrap; }
.set legend, .set__title { display: block; font-size: var(--t-14); font-weight: 600; padding-bottom: var(--s-2); }
/* a floated legend sits inside the box, below the rule, not on it */
.set legend { float: left; width: 100%; }
.set legend + * { clear: both; }
.set__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.key { font: 600 var(--t-14) / 1 var(--font-din); padding: 6px 8px; border: 1px solid var(--edge); border-radius: 6px; letter-spacing: 0.02em; }

/* the sheet's rows come in one after another as it rises */
.settings[open] .settings__in > * {
  animation: set-in 380ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms + 70ms);
}
@keyframes set-in { from { opacity: 0; transform: translateY(12px); } }

/* the looks: one tile each, with a small painting of the look */
.looks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-2); }
.look {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
.look:active { transform: scale(0.97); }
.look input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.look[aria-disabled="true"] { cursor: default; }
.look[aria-disabled="true"]:active { transform: none; }
.look[aria-disabled="true"] input { cursor: default; }
.look__art { position: relative; height: 64px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08); transition: transform 220ms var(--ease-out); }
.look__name { font-size: var(--t-12); font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 4px; padding: 0 2px; }
.look__name small { font-weight: 400; color: var(--ink-2); }
/* the chosen tile: a ring that closes in on it */
.look::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--ink);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 160ms ease, transform 260ms var(--ease-out);
  pointer-events: none;
}
.look:has(input:checked)::after { opacity: 1; transform: scale(1); }
.look:has(input:focus-visible)::after { opacity: 1; transform: scale(1); box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--line); }
@media (hover: hover) and (pointer: fine) { .look:not([aria-disabled="true"]):hover .look__art { transform: translateY(-2px); } }

/* paintings of each look, made of gradients and text only */
.art--programme { background: #f3efe6; }
.art--programme::before { content: "214"; position: absolute; left: 8px; top: 5px; font: 600 40px/1 "Bahnschrift Condensed", Bahnschrift, sans-serif; color: #e0341f; letter-spacing: -0.03em; }
.art--programme::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 10px; height: 2px; background: #151412; }
.art--sticker { background: #ffe94d radial-gradient(rgb(18 18 18 / 0.16) 1px, transparent 1.3px) 0 0 / 8px 8px; }
.art--sticker::before { content: "214"; position: absolute; left: 8px; top: 10px; padding: 3px 8px; font: 900 24px/1 "Arial Black", sans-serif; color: #fff; background: #3b5bff; border: 2.5px solid #121212; border-radius: 6px; box-shadow: 3px 3px 0 #121212; }
.art--sticker::after { content: "STILL LOOKING!"; position: absolute; right: 4px; top: 36px; padding: 3px 5px; font: 900 8px/1 "Arial Black", sans-serif; color: #121212; background: #fff; border: 2px solid #121212; border-radius: 5px; transform: rotate(6deg); box-shadow: 2px 2px 0 #121212; }
.art--departures { background: #17181c; }
.art--departures::before { content: "0214"; position: absolute; left: 8px; top: 12px; width: 94px; padding-left: 5px; font: 700 28px/40px "Bahnschrift Condensed", Bahnschrift, sans-serif; letter-spacing: 11.5px; color: #ffb43d;
  background: repeating-linear-gradient(90deg, #0d0e11 0 21px, transparent 21px 24px); }
.art--departures::after { content: ""; position: absolute; left: 8px; top: 31px; width: 94px; height: 1px; background: #000; }
.art--house { background: oklch(0.205 0.078 283); }
.art--house::before { content: ""; position: absolute; inset: 10px 10px 16px; border-radius: 6px; background: radial-gradient(circle, oklch(0.56 0.075 283) 1.6px, transparent 2px) 0 0 / 8px 8px; }
.art--house::after { content: ""; position: absolute; left: 44%; top: 26px; width: 15px; height: 6px; background: radial-gradient(circle, oklch(0.90 0.085 78) 2.6px, transparent 3px) 0 0 / 7.5px 6px; }
.art--lily { background: linear-gradient(180deg, #bfe3ff 0 52%, #a6e0f7 52% 100%); }
.art--lily::before { content: ""; position: absolute; right: 8px; top: 16px; width: 26px; height: 14px; border-radius: 13px 13px 2px 2px; background: #93d67c; box-shadow: 0 0 0 2px #3a2b45, 0 6px 0 -1px #d9b88f; }
.art--lily::after { content: ""; position: absolute; left: 12px; top: 28px; width: 34px; height: 8px; border-radius: 0 0 10px 10px; background: #a786f0; box-shadow: 10px -11px 0 -1px #f6a45c; }

/* ---- motion ---- */

/* the setup page settles in once, when the panel opens */
.hall, #setup > .go, #setup .part {
  animation: rise 460ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* the two big moments come in, then their small lines follow */
.hunt:not([hidden]) .hunt__n, .won:not([hidden]) .won__seats { animation: hero-in 460ms var(--ease-out) both; }
.hunt:not([hidden]) .hunt__label, .hunt:not([hidden]) .hunt__sub, .won:not([hidden]) .won__sub { animation: rise 380ms var(--ease-out) both; animation-delay: 100ms; }
.won:not([hidden]) .won__label { animation: rise 320ms var(--ease-out) both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(4px); } }

.note:not([hidden]) { animation: rise 300ms var(--ease-out) both; }

/* a step's lamp pops when its state changes; its words slide in */
.sheet li[data-pop="true"] .lamp { animation: lamp-pop 360ms var(--spring) both; }
.sheet li[data-pop="true"] .fact { animation: fact-in 280ms var(--ease-out) both; }
@keyframes lamp-pop { from { transform: scale(0.3); } }
@keyframes fact-in { from { opacity: 0; transform: translateX(-6px); } }

/* seats change colour softly */
.seat { transition: fill 240ms ease; }

/* changing the look: the old one dissolves with a little blur, the new one settles in */
:root[data-turn="look"]::view-transition-old(root) { animation: look-out 200ms ease both; }
:root[data-turn="look"]::view-transition-new(root) { animation: look-in 340ms var(--ease-out) both; }
@keyframes look-out { to { opacity: 0; filter: blur(6px); } }
@keyframes look-in { from { opacity: 0; filter: blur(6px); transform: scale(0.985); } }

/* less motion, chosen in settings: movement goes, the change itself stays */
:root[data-motion="less"] *, :root[data-motion="less"] *::before, :root[data-motion="less"] *::after,
:root[data-motion="less"] .settings::backdrop {
  animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important;
}
:root[data-motion="less"]::view-transition-old(root), :root[data-motion="less"]::view-transition-new(root) { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .hall, #setup > .go, #setup .part, .hunt__n, .won__seats, .settings[open] .settings__in > * { animation: none !important; }
  .sheet li[data-pop="true"] .lamp, .sheet li[data-pop="true"] .fact { animation: none; }
  .settings, .settings[open] { transform: none; transition: opacity 160ms ease, display 160ms allow-discrete, overlay 160ms allow-discrete; }
  .gear svg, .look::after, .look__art { transition: none; }
  :root[data-turn="look"]::view-transition-old(root), :root[data-turn="look"]::view-transition-new(root) { animation: none; }
}
/* less motion, either way: a press still shows (colour, border), but nothing shrinks */
@media (prefers-reduced-motion: reduce) { .btn:active, .chip:active, .gear:active, .look:active { transform: none; } }
:root[data-motion="less"] .btn:active, :root[data-motion="less"] .chip:active, :root[data-motion="less"] .gear:active, :root[data-motion="less"] .look:active { transform: none; }

/* ---- the account: the pass strip, its messages and the sign-in drawer (board 12) ----
   The structure is shared by every look. A look's file only gives these tokens its own colours. */

:root {
  --acct-card: var(--field);
  --acct-ring: var(--line);
  --water-a: var(--light);
  --water-b: var(--light);
  --mini-ring: var(--ink);
  --mini-bg: var(--ground-2);
  --drawer-bg: var(--ground);
  --drawer-ring: var(--line);
  --drawer-shade: rgb(0 0 0 / 0.38);
  --r-sheet: 20px;
  --hold-fill: var(--light);
  --hold-ink: var(--ink);
  --focus-halo: color-mix(in oklch, var(--ink) 22%, transparent);
}
:root[data-lights="up"] {
  --info-bg: oklch(0.955 0.022 290); --info-line: oklch(0.80 0.06 290);
  --warn-bg: oklch(0.965 0.055 95); --warn-line: oklch(0.80 0.12 88);
  --stop-bg: oklch(0.955 0.03 5); --stop-line: oklch(0.72 0.12 5);
}
:root[data-lights="down"] {
  --info-bg: oklch(0.27 0.07 290); --info-line: oklch(0.47 0.09 290);
  --warn-bg: oklch(0.28 0.05 80); --warn-line: oklch(0.64 0.11 82);
  --stop-bg: oklch(0.27 0.06 10); --stop-line: oklch(0.62 0.13 10);
}

/* the strip: a tiny water line, time left, the pass, and this profile's slot */
.strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-3);
  padding: 10px 12px;
  border-radius: var(--r-well);
  background: var(--acct-card);
  box-shadow: inset 0 0 0 1.5px var(--acct-ring);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.2;
}
.strip__mini {
  position: relative;
  flex: none;
  width: 56px;
  height: 10px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--mini-bg);
  box-shadow: inset 0 0 0 1.5px var(--mini-ring);
}
.strip__mini i {
  position: absolute;
  inset: 1.5px auto 1.5px 1.5px;
  max-width: calc(100% - 3px);
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--water-a), var(--water-b));
  transition: width 600ms var(--ease-out);
}
.strip__time { font: 700 14px / 1 var(--font-din); letter-spacing: 0.02em; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip__what { white-space: nowrap; }
.strip__right { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.strip[data-grey="true"] .strip__time { color: var(--ink-3); }

/* one message at a time, under the strip */
.msg {
  margin-top: var(--s-3);
  padding: 12px 14px;
  border-radius: var(--r-well);
  background: var(--info-bg);
  box-shadow: inset 0 0 0 1.5px var(--info-line);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  text-wrap: pretty;
}
.msg[data-tone="warn"] { background: var(--warn-bg); box-shadow: inset 0 0 0 1.5px var(--warn-line); }
.msg[data-tone="stop"] { background: var(--stop-bg); box-shadow: inset 0 0 0 1.5px var(--stop-line); }
.msg[data-tone="quiet"] { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.msg__title { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 700; color: var(--ink); }
.msg__body { display: block; }
.msg .msg__go { width: 100%; min-height: 38px; margin-top: 10px; font-size: 13px; }
.msg + .hall, .strip + .hall { margin-top: var(--s-3); }

/* signed in, Sign out sits in the header */
.signout { white-space: nowrap; }

/* a pass waiting: Start becomes a hold. The fill runs left to right; let go early and it springs back. */
:root[data-look] .btn.btn--hold, :root[data-look] .btn.btn--hold:not(:disabled):hover {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--acct-card);
  color: var(--hold-ink);
  text-shadow: none;
}
/* no look adds its own mark to the hold or to a message's button (their words already end in one) */
:root[data-look] .btn.btn--hold::after, :root[data-look] .btn.msg__go::after { content: none; }
.hold__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hold-fill);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 200ms var(--ease-out);
}
.btn--hold[data-holding="true"] .hold__fill { transition: none; }
.btn--hold > span { position: relative; }
.later { display: block; margin: 10px auto 0; color: var(--ink); font-size: 13px; font-weight: 600; }

/* busy: an account action waits on the worker */
.btn[aria-busy="true"] { cursor: progress; animation: busy 900ms ease-in-out infinite alternate; }
@keyframes busy { to { opacity: 0.55; } }

/* signed out: the form stays where it is, blurred, behind the drawer, and still scrolls */
.wrap { transition: filter 220ms var(--ease-out), opacity 220ms var(--ease-out); }
:root[data-acct="out"] .wrap { filter: blur(2.5px); opacity: 0.45; padding-bottom: calc(var(--drawer-h, 0px) + var(--s-6)); }

.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  margin: 0 auto;
  padding: 18px 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--drawer-bg);
  color: var(--ink);
  box-shadow: 0 -20px 40px -20px var(--drawer-shade), 0 0 0 1px var(--drawer-ring);
  /* it drops away faster than it rises */
  transform: translateY(105%);
  transition: transform 200ms var(--ease-drawer);
}
.drawer[data-open="true"] { transform: none; transition: transform 320ms var(--ease-drawer); }
.drawer:focus { outline: none; }
.drawer__grab { display: block; width: 36px; height: 4px; margin: -6px auto 14px; border-radius: 4px; background: var(--edge); opacity: 0.55; }
.drawer__title { font: 700 18px / 1.3 var(--font-ui); letter-spacing: 0; text-transform: none; }
.drawer__lede { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.drawer__reason { margin: 0 0 12px; }
.drawer .msg { margin-top: 0; }
.drawer__form { display: grid; gap: 10px; margin-top: 12px; }
.drawer__form input { min-height: 42px; }
.drawer__form .btn--primary, .drawer__google { min-height: 44px; }
.drawer__or { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--ink-3); font-size: 12px; }
.drawer__or::before, .drawer__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.drawer__google { width: 100%; margin-top: 10px; gap: 10px; }
.gmark { flex: none; }
.drawer__error { margin-top: 10px; color: var(--ink); font-size: 13px; font-weight: 600; }
.drawer__wait { margin-top: 8px; color: var(--ink-2); font-size: 12px; }
.drawer__foot { margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.drawer__foot .link { font-size: 13px; }
.drawer__strong { color: var(--ink); font-weight: 600; }

/* the code: one input, drawn as six boxes (a pasted code fills them all) */
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; }
.otp__box {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: var(--r-control);
  background: var(--field);
  box-shadow: inset 0 0 0 1.5px var(--edge);
  color: var(--ink);
  font: 700 22px / 1 var(--font-din);
  font-variant-numeric: tabular-nums;
  transition: box-shadow 140ms ease;
}
.otp__box[data-on="true"] { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 4px var(--focus-halo); }
.drawer .otp__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: text;
}

/* less motion: the drawer fades, nothing rises or blurs in */
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer[data-open="true"] { transform: none; opacity: 0; transition: opacity 150ms ease; }
  .drawer[data-open="true"] { opacity: 1; }
  .wrap { transition: opacity 150ms ease; }
  .btn[aria-busy="true"] { animation: none; opacity: 0.7; }
  .strip__mini i, .hold__fill { transition: none; }
}
:root[data-motion="less"] .drawer, :root[data-motion="less"] .drawer[data-open="true"] { transform: none !important; transition: opacity 150ms ease !important; }
:root[data-motion="less"] .drawer { opacity: 0; }
:root[data-motion="less"] .drawer[data-open="true"] { opacity: 1; }
:root[data-motion="less"] .wrap { transition: opacity 150ms ease !important; }
/* less motion: a busy button holds still, half-lit (the blanket 1 ms rule would make the pulse strobe) */
:root[data-motion="less"] .btn[aria-busy="true"] { animation: none !important; opacity: 0.7; }
