@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-display: swap; src: url(../fonts/BarlowCondensed-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/BarlowCondensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(../fonts/BarlowCondensed-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url(../fonts/Barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url(../fonts/Barlow-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url(../fonts/Barlow-600.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  /* station hall + board */
  --hall: #0c0e10;
  --board: #15181c;
  --board-edge: #262b31;
  --flap-top: #23282e;
  --flap-bot: #1c2025;
  --flap-empty-top: #1b1f23;
  --flap-empty-bot: #171a1e;
  --hinge: #08090b;
  --ink: #f3efe4;
  --ink-2: #b9c0c8;
  --ink-3: #8b949e;
  /* signals */
  --amber: #ffc53d;
  --amber-dim: #8a6a1c;
  --red: #ff5d4a;
  --red-deep: #3a1512;
  --green: #3fd284;
  --gold: #ffc53d;
  --violet: #b995ff;
  --line: #ff7a2f;           /* the day's line colour, set from JS */
  --focus: #ffc53d;

  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);

  --gutter: 16px;
  --cell-w: 22px;            /* set by fit() */
  --cell-h: 31px;
  --cell-gap: 2px;
  --label-w: 36px;
  --vvh: 100dvh;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--hall);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--hall);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}
::selection { background: var(--amber); color: #1a1406; }
button, a, [role="button"] { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
button, .chip, .cell { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- app shell ---------- */
.app {
  min-height: var(--vvh);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top, 0px) max(var(--gutter), env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(var(--gutter), env(safe-area-inset-left, 0px));
}
.top {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px;
  flex: none;
}
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-word { font-family: var(--cond); font-weight: 700; font-size: 26px; letter-spacing: .14em; line-height: 1; padding-top: 2px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background-color 120ms, color 120ms, transform 120ms var(--ease-out);
}
.icon-btn:active { transform: scale(.94); background: #1c2025; }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: #1a1d21; color: var(--ink); }
}

.stage { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }

/* ---------- the board ---------- */
.board {
  position: relative;
  background: var(--board);
  border-radius: 14px;
  padding: 0 10px 12px;
  box-shadow: 0 1px 0 #2a2f35 inset, 0 0 0 1px #050607, 0 18px 40px -18px rgba(0, 0, 0, .9);
  overflow: hidden;
  cursor: text;
}
.board::before {             /* the line colour stripe along the top edge */
  content: ''; display: block; height: 5px; margin: 0 -10px 10px; background: var(--line);
}
.board-head {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber); padding: 0 2px 8px;
}
.board-head .no { color: var(--ink); }
.board-head .day { color: var(--ink-3); margin-left: auto; }
.mode-tag { color: #1a1406; background: var(--amber); padding: 1px 6px 0; border-radius: 3px; letter-spacing: .12em; }

/* fuse */
.fuse { display: grid; grid-template-columns: var(--label-w) 1fr auto auto; align-items: center; gap: 8px; height: 30px; }
.lbl { font-family: var(--cond); font-weight: 600; font-size: 11px; letter-spacing: .14em; color: var(--amber); text-transform: uppercase; line-height: 1; white-space: nowrap; }
.row .lbl.num { font-size: 17px; letter-spacing: 0; color: var(--ink-3); text-align: center; }
.row.active .lbl.num { color: var(--amber); }
.fuse-track { position: relative; height: 10px; border-radius: 5px; background: #0d0f11; box-shadow: 0 0 0 1px #24292e inset; overflow: hidden; }
.fuse-fill {
  position: absolute; inset: 0; transform-origin: left center; transform: scaleX(1);
  background: var(--green); border-radius: 5px;
}
.fuse-time { font-family: var(--cond); font-weight: 700; font-size: 20px; min-width: 3.1ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.board[data-urgency="warn"] .fuse-fill { background: var(--amber); }
.board[data-urgency="danger"] .fuse-fill { background: var(--red); animation: pulse 500ms steps(2, jump-none) infinite; }
.board[data-urgency="danger"] .fuse-time { color: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.lives { display: flex; gap: 4px; align-items: center; padding-left: 4px; }
.life { width: 9px; height: 14px; border-radius: 2px; background: var(--amber); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); transition: background-color 200ms; }
.life.out { background: #2a2e33; box-shadow: none; }

/* roadblocks */
.closed { display: grid; grid-template-columns: var(--label-w) 1fr; align-items: center; gap: 8px; min-height: 40px; margin: 6px 0 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  position: relative; font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px 2px; border-radius: 4px; color: var(--ink); background: var(--red-deep);
  box-shadow: 0 0 0 1px rgba(255, 93, 74, .55) inset; line-height: 1.35;
}
.chip::after { content: ''; position: absolute; left: 6px; right: 6px; top: 52%; height: 2px; background: var(--red); transform: rotate(-4deg); }
.chip.blank { background: #1a1d21; box-shadow: none; width: 72px; height: 27px; }
.chip.blank::after { display: none; }
.chip.hit { animation: chiphit 420ms var(--ease-out); }
@keyframes chiphit { 0% { transform: scale(1.18); background: var(--red); } 100% { transform: scale(1); } }

/* rows */
.rows { position: relative; display: flex; flex-direction: column; gap: 6px; }
.row { position: relative; display: grid; grid-template-columns: var(--label-w) 1fr 14px; align-items: center; gap: 8px; }
.row .lbl { text-align: left; }
.row.terminal .lbl { color: var(--ink); }
.cells { display: grid; grid-template-columns: repeat(12, var(--cell-w)); gap: var(--cell-gap); justify-content: start; }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: #262a2f; justify-self: center; transition: background-color 250ms, box-shadow 250ms; }
.lamp[data-tier="direct"] { background: var(--green); box-shadow: inset 0 2px 1px rgba(255, 255, 255, .45); }
.lamp[data-tier="scenic"] { background: var(--gold); box-shadow: inset 0 2px 1px rgba(255, 255, 255, .45); }
.lamp[data-tier="wild"] { background: var(--violet); box-shadow: inset 0 2px 1px rgba(255, 255, 255, .45); }
.lamp[data-tier="active"] { background: var(--amber); animation: pulse 900ms steps(2, jump-none) infinite; }
.lamp[data-tier="fail"] { background: var(--red); }
.tier-tag {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--cond); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; pointer-events: none;
}
.tier-tag[data-tier="direct"] { color: var(--green); }
.tier-tag[data-tier="scenic"] { color: var(--gold); }
.tier-tag[data-tier="wild"] { color: var(--violet); }

/* a split-flap cell */
.cell {
  position: relative; width: var(--cell-w); height: var(--cell-h); border-radius: 3px;
  font-family: var(--cond); font-weight: 600; font-size: calc(var(--cell-h) * .74); color: var(--ink);
  text-transform: uppercase; perspective: calc(var(--cell-h) * 6);
}
.cell > span { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; }
.cell > span > b { display: block; height: var(--cell-h); line-height: calc(var(--cell-h) * 1.04); text-align: center; font-weight: 600; }
.cell .t, .cell .ft { top: 0; border-radius: 3px 3px 0 0; background: var(--flap-top); }
.cell .b, .cell .fb { bottom: 0; border-radius: 0 0 3px 3px; background: var(--flap-bot); }
.cell .b > b, .cell .fb > b { transform: translateY(-50%); }
.cell .t { box-shadow: 0 -1px 0 rgba(255, 255, 255, .04) inset; }
.cell .b { box-shadow: 0 1px 0 var(--hinge) inset; }       /* the hinge */
.cell .ft { transform-origin: 50% 100%; z-index: 2; visibility: hidden; }
.cell .fb { transform-origin: 50% 0; z-index: 2; visibility: hidden; box-shadow: 0 1px 0 var(--hinge) inset; }
.cell.empty .t { background: var(--flap-empty-top); }
.cell.empty .b { background: var(--flap-empty-bot); }
.row.active .cell.empty .t, .row.active .cell.empty .b { background: #20252a; }
.row.active .cell.caret::after {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 3px; height: 2px; border-radius: 1px; background: var(--amber);
  animation: blink 1s steps(2, jump-none) infinite; z-index: 3;
}
@keyframes blink { 50% { opacity: 0; } }
.row.active .lbl { color: var(--amber); }
.row.typed .cell:not(.empty) b { color: #fffaf0; }

/* row states */
.row.shake .cells { animation: shake 360ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.row.flash .cell .t, .row.flash .cell .b { background: #4a1a15 !important; transition: background-color 0s; }
.row .cell .t, .row .cell .b { transition: background-color 420ms; }


.input {
  position: absolute; z-index: 5; left: 0; top: 0; width: 100%; height: var(--cell-h);
  font-size: 16px; color: transparent; caret-color: transparent; background: transparent;
  border: 0; outline: 0; padding: 0; margin: 0; opacity: .01; text-transform: lowercase;
}
.input::selection { background: transparent; color: transparent; }

/* ticker under the board */
.ticker {
  min-height: 24px; margin-top: 10px; padding: 0 2px;
  font-family: var(--cond); font-weight: 600; font-size: 16px; letter-spacing: .06em; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.ticker[data-tone="bad"] { color: var(--red); }
.ticker[data-tone="good"] { color: var(--green); }
.ticker[data-tone="info"] { color: var(--amber); }
.ticker .msg { animation: tick-in 260ms var(--ease-out); }
@keyframes tick-in { from { opacity: 0; transform: translateY(4px); } }

/* board-level hit */
.board.hit { animation: boardhit 420ms var(--ease-out); }
@keyframes boardhit { 0% { box-shadow: 0 0 0 2px var(--red), 0 18px 40px -18px rgba(0, 0, 0, .9); } 100% { box-shadow: 0 1px 0 #2a2f35 inset, 0 0 0 1px #050607, 0 18px 40px -18px rgba(0, 0, 0, .9); } }

/* paused cover */
.cover {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; text-align: center;
  background: rgba(13, 15, 17, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 24px;
}
.cover[hidden] { display: none; }
.cover h2 { font-family: var(--cond); font-size: 30px; letter-spacing: .12em; margin: 0 0 4px; text-transform: uppercase; }
.cover p { margin: 0 0 16px; color: var(--ink-2); }

/* ---------- actions ---------- */
.actions { display: flex; flex-direction: column; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 22px; border-radius: 12px; border: 0;
  font-family: var(--cond); font-weight: 700; font-size: 21px; letter-spacing: .08em; text-transform: uppercase;
  transition: transform 120ms var(--ease-out), background-color 150ms, opacity 150ms;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--amber); color: #1a1406; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 8px 18px -10px rgba(0, 0, 0, .8); }
.btn-primary:disabled { background: #3a3220; color: #8d826a; box-shadow: none; cursor: progress; }
.btn-ghost { background: #1a1d21; color: var(--ink); box-shadow: 0 0 0 1px #2a2f35 inset; }
.btn-small { height: 44px; font-size: 17px; padding: 0 16px; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover { background: #ffd261; }
  .btn-ghost:hover { background: #20242a; }
}
.btn .i { width: 20px; height: 20px; stroke-width: 2.2; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.hint { text-align: center; color: var(--ink-3); font-size: 14px; margin: 0; }
.hint kbd { font-family: var(--cond); font-weight: 600; letter-spacing: .06em; background: #1a1d21; border-radius: 4px; padding: 1px 6px; color: var(--ink-2); box-shadow: 0 0 0 1px #2a2f35 inset; }
.load-bar { height: 3px; border-radius: 2px; background: #1a1d21; overflow: hidden; }
.load-bar > i { display: block; height: 100%; width: 100%; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform 200ms; }

/* ---------- sheets (dialogs) ---------- */
dialog.sheet {
  width: min(100%, 520px); max-height: min(92dvh, 860px); margin: auto auto 0; padding: 0; border: 0;
  border-radius: 20px 20px 0 0; background: #14171a; color: var(--ink);
  box-shadow: 0 -1px 0 #2a2f35 inset, 0 -20px 60px rgba(0, 0, 0, .6);
  overscroll-behavior: contain;
}
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: 20px; box-shadow: 0 0 0 1px #2a2f35, 0 30px 80px rgba(0, 0, 0, .7); }
}
dialog.sheet::backdrop { background: rgba(5, 6, 7, .72); }
dialog.sheet[open] { animation: sheet-in 380ms var(--ease-out); }
dialog.sheet[open]::backdrop { animation: fade-in 300ms ease-out; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-inner { padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; max-height: inherit; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 12px 0 8px; background: #14171a; }
.sheet-head h2 { margin: 0; font-family: var(--cond); font-weight: 700; font-size: 26px; letter-spacing: .1em; text-transform: uppercase; }
.sheet p { margin: 0 0 12px; color: var(--ink-2); }
.sheet strong { color: var(--ink); font-weight: 600; }
.sheet h3 { font-family: var(--cond); font-weight: 600; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin: 22px 0 10px; }

.rules { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 12px; }
.rules li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; color: var(--ink-2); }
.rules .n { font-family: var(--cond); font-weight: 700; font-size: 18px; color: #1a1406; background: var(--amber); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; line-height: 1; padding-top: 1px; }
.tiers { display: grid; gap: 8px; margin: 4px 0 6px; }
.tier { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; }
.tier b { font-family: var(--cond); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; min-width: 62px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.direct { background: var(--green); } .dot.scenic { background: var(--gold); } .dot.wild { background: var(--violet); }
.tier .direct-t { color: var(--green); } .tier .scenic-t { color: var(--gold); } .tier .wild-t { color: var(--violet); }

/* mini example route in the help sheet */
.example { background: var(--board); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; margin: 4px 0 6px; }
.ex-row { display: grid; grid-template-columns: 40px 1fr 12px; align-items: center; gap: 10px; }
.ex-word { font-family: var(--cond); font-weight: 600; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; }
.ex-row .lbl { font-size: 11px; }

.sheet-cta { position: sticky; bottom: 0; padding: 12px 0 2px; background: linear-gradient(transparent, #14171a 30%); }
.sheet-cta .btn { width: 100%; }

/* results */
.result-hero { text-align: center; padding: 6px 0 4px; }
.result-title { font-family: var(--cond); font-weight: 700; font-size: 44px; letter-spacing: .12em; text-transform: uppercase; line-height: 1; margin: 0; }
.result-title.won { color: var(--green); }
.result-title.lost { color: var(--red); }
.result-sub { font-family: var(--cond); font-weight: 600; font-size: 18px; letter-spacing: .06em; color: var(--ink-2); margin-top: 8px; }
.result-big { font-family: var(--cond); font-weight: 700; font-size: 64px; line-height: 1; margin-top: 14px; font-variant-numeric: tabular-nums; }
.result-big small { font-size: 22px; letter-spacing: .08em; color: var(--ink-2); margin-left: 4px; }
.route { list-style: none; margin: 18px 0 6px; padding: 14px; background: var(--board); border-radius: 12px; display: grid; gap: 4px; }
.route li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; min-height: 30px; }
.route .w { font-family: var(--cond); font-weight: 600; font-size: 21px; letter-spacing: .1em; text-transform: uppercase; overflow-wrap: anywhere; }
.route .w.muted { color: var(--ink-3); }
.route .t { font-family: var(--cond); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.route .t.direct { color: var(--green); } .route .t.scenic { color: var(--gold); } .route .t.wild { color: var(--violet); } .route .t.fail { color: var(--red); }
.route .pin { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); justify-self: center; }
.route .pin.end { background: var(--ink); }
.share-preview { white-space: pre-wrap; font-family: var(--body); font-size: 14px; color: var(--ink-2); background: #0f1113; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; box-shadow: 0 0 0 1px #23272c inset; }
.next { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 0 2px; border-top: 1px solid #23272c; margin-top: 18px; }
.next .lbl { font-size: 12px; }
.next b { font-family: var(--cond); font-weight: 700; font-size: 28px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat b { display: block; font-family: var(--cond); font-weight: 700; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-3); line-height: 1.2; display: block; }
.dist { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; font-family: var(--cond); font-weight: 600; font-size: 14px; letter-spacing: .04em; color: var(--ink-2); }
.bar > i { display: block; height: 22px; min-width: 26px; border-radius: 4px; background: #262a2f; color: var(--ink); font-style: normal; text-align: right; padding: 0 7px; line-height: 22px; font-variant-numeric: tabular-nums; }
.bar.me > i { background: var(--green); color: #06170e; }
.bar.fail > i { background: #3a1a17; }
.bar.fail.me > i { background: var(--red); color: #1a0705; }

/* settings */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #23272c; }
.setting:last-of-type { border-bottom: 0; }
.setting p { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.setting label { font-weight: 600; color: var(--ink); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: #2a2f35; transition: background-color 180ms; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: transform 220ms var(--ease-out); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 3px; }
.switch input:disabled + i { opacity: .45; }
.credits { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.credits a { color: var(--ink-2); text-underline-offset: 3px; }

/* toast */
.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); z-index: 100; transform: translate(-50%, -12px);
  background: var(--ink); color: #121417; font-weight: 600; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity 180ms, transform 260ms var(--ease-out); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* compact layout when the keyboard eats the screen */
.app.compact .top { height: 0; overflow: hidden; }
.app.compact .board::before { margin-bottom: 6px; }
.app.compact .board-head { display: none; }
.app.compact .closed { margin: 2px 0 6px; min-height: 34px; }
.app.compact .chip { font-size: 14px; padding: 2px 7px 1px; }
.app.compact .rows { gap: 4px; }
.app.compact .stage { gap: 8px; }
.app.compact .hint { display: none; }

/* desktop: a bigger board, centred in the hall */
@media (min-width: 720px) and (min-height: 700px) {
  .top, .stage { max-width: 660px; }
  .stage { margin-block: auto; padding-bottom: 72px; }
  .board { padding: 0 16px 16px; border-radius: 18px; }
  .board::before { margin: 0 -16px 14px; height: 6px; }
  .board-head { font-size: 14px; }
  .lbl { font-size: 12px; }
  .chip { font-size: 19px; padding: 4px 11px 2px; }
  .ticker { font-size: 18px; }
  .rows { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
