/* Matchklockan — trainer shell, console drawing, arena board.
   The page is the sports hall: floor colour, a white sideline, and a match
   protocol sheet for the exercises. The console and its screens follow the
   manual's figures, not taste. No external resources. */

:root {
  --floor: #1b5565;
  --floor-deep: #143f4b;
  --line: #f3f6f4;
  --paper: #fbfaf6;
  --rule: #dcd8ca;
  --ink: #15262c;
  --ink-soft: #4a5d64;
  --green: #1c7a41;
  --yellow: #f2c417;
  --red: #c9342a;
  --narrow: "Arial Narrow", "Liberation Sans Narrow", "Nimbus Sans Narrow", "Roboto Condensed", "HelveticaNeue-CondensedBold", "Helvetica Neue Condensed", sans-serif-condensed, "DejaVu Sans Condensed", Arial, Helvetica, sans-serif;
  --body: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", "Noto Sans", sans-serif;
  --head: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", "Liberation Sans Narrow", "HelveticaNeue-CondensedBold", sans-serif-condensed, var(--body);
  --u: calc(100cqw / 320);     /* one console-screen pixel, inside .scr */
  --cu: calc(100cqw / 1000);   /* one console unit, on the console face */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--floor); color: var(--line); font: 1rem/1.5 var(--body); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ink); }

/* ---------- header: the sideline */
.top { border-bottom: 5px solid var(--line); }
.top-in { max-width: 1500px; margin: 0 auto; padding: 14px 20px 11px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
h1 { margin: 0; font: 800 1.9rem/1 var(--head); font-stretch: condensed; letter-spacing: .01em; }
.tagline { margin: 0; color: #cfe1e4; }
.top-acts { margin-left: auto; display: flex; gap: 8px; }
.quiet { background: transparent; border: 2px solid rgba(243, 246, 244, .75); border-radius: 6px; padding: 5px 13px; cursor: pointer; font-weight: 600; }
.quiet:hover { background: rgba(255, 255, 255, .12); }
.quiet[aria-pressed="true"] { background: var(--line); color: var(--ink); }

/* ---------- layout */
.layout { max-width: 1500px; margin: 0 auto; padding: 18px 20px 26px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.hall { display: grid; gap: 14px; min-width: 0; justify-items: center; }
.hall > * { width: 100%; }
@media (min-width: 1160px) {
  .layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .sheet { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
}

/* ---------- arena board (generic) */
.board-wrap { max-width: 660px; }
.board { container-type: inline-size; background: #0a0a0b; border: 3px solid #2b2e33; border-radius: 10px; padding: 2.4% 3.2% 2%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6cqw; }
.board.stale { filter: saturate(.25) brightness(.75); }
.seg { display: block; height: 100%; width: auto; fill: currentColor; }
.seg .g { opacity: .08; }
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 2.5cqw; }
.bd-name { min-height: 1em; font: 700 3.5cqw/1 var(--narrow); font-stretch: condensed; letter-spacing: .05em; color: #ffb21a; white-space: nowrap; overflow: hidden; }
.bd-name.r { text-align: right; }
.bd-per { display: flex; align-items: center; gap: 1.4cqw; font: 600 2.1cqw/1 var(--body); color: #a3a8ad; }
.bd-per b { display: block; height: 5.4cqw; color: #3bd765; }
.bd-score { height: 13.5cqw; color: #ff3b2f; }
.bd-score:last-child { justify-self: end; }
.bd-clock { display: grid; justify-items: center; gap: .8cqw; }
.bd-time { height: 11cqw; color: #ffd526; }
.bd-label { min-height: 1.2em; font: 600 2.1cqw/1.2 var(--body); color: #a3a8ad; }
.bd-side { display: flex; align-items: flex-end; gap: 3.4cqw; }
.bd-side.r { justify-content: flex-end; }
.bd-grp { display: grid; justify-items: center; gap: 1cqw; }
.bd-to, .bd-sus { display: flex; align-items: center; gap: 1.2cqw; height: 3.4cqw; }
.lab { font: 600 1.75cqw/1 var(--body); color: #8e9499; }
.bd-to i { width: 1.9cqw; height: 1.9cqw; border-radius: 50%; background: #2c1513; }
.bd-to i.on { background: #ff3b2f; box-shadow: 0 0 1cqw #ff3b2f; }
.bd-sus .s { height: 100%; color: #ff3b2f; }
.bd-sus .s.idle { opacity: .28; }
.bd-sus .more { font: 700 2cqw/1 var(--body); color: #ff3b2f; }
.bd-horn span { display: block; font: 700 1.8cqw/1 var(--body); color: #4a4e54; border: 2px solid #3a3d42; border-radius: 99px; padding: .45em 1em; }
.bd-horn span.on { color: #0a0a0b; background: #ffd526; border-color: #ffd526; }
.board-note { margin: 8px 0 0; padding: 8px 12px; background: var(--paper); color: var(--ink); border-left: 6px solid var(--yellow); border-radius: 2px; font-size: .95rem; }

/* ---------- coach strip: the referee's call, on protocol paper */
.coach { background: var(--paper); color: var(--ink); border-radius: 3px; padding: 11px 16px 12px; border-left: 8px solid var(--floor-deep); }
.coach p { margin: 0; max-width: 68ch; }
.coach-step { font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.coach-step.done { color: var(--green); }
.coach-intro { color: var(--ink-soft); }
.coach-say { font-size: 1.12rem; line-height: 1.38; font-weight: 600; }
.coach-hint { margin-top: 7px !important; padding: 6px 10px; background: #fff4c2; border-left: 5px solid var(--yellow); font-size: .97rem; }
.coach-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.coach-acts button, .danger { background: transparent; border: 2px solid var(--ink); border-radius: 6px; padding: 4px 12px; font-weight: 600; cursor: pointer; }
.coach-acts button:hover { background: #ece9dd; }
.coach-acts .primary { background: var(--ink); color: var(--paper); }
.coach-acts .primary:hover { background: #24404a; }

.rotate { display: none; margin: 0; }
.coach-acts .zoom-btn { display: none; }
.zoom { position: fixed; inset: 0; z-index: 15; display: grid; grid-template-rows: auto 1fr; background: #0c2a33; }
.zoom-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; padding: 5px 10px; min-height: 44px; }
.zoom-bar p { margin: 0; flex: 1 1 16em; font-weight: 600; line-height: 1.25; }
.zoom-bar button { flex: none; }
.zoom-stage { display: grid; place-items: start center; min-height: 0; }
.zoom-stage .scr { position: relative; left: auto; top: auto; width: min(100vw, (100dvh - 54px) * 4 / 3); height: auto; aspect-ratio: 4 / 3; border-radius: 0; }

/* ---------- console */
.console-scroll { overflow-x: auto; display: grid; justify-items: center; padding: 2px 0 4px; }
.console {
  position: relative; container-type: inline-size; aspect-ratio: 2 / 1;
  width: min(100%, max(620px, (100dvh - 290px) * 2)); min-width: 620px;
  border-radius: calc(100% / 90) / calc(100% / 45);
  background: linear-gradient(#e6e8ea, #a9adb2 3.5%, #d4d6d9 7%, #2f3237 7.2%, #2f3237 92.8%, #c9ccd0 93%, #9da1a6 96.5%, #dfe1e3);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
.face { position: absolute; left: 0; top: 7.2%; width: 100%; height: 85.6%; }
.brand { position: absolute; left: 4.2%; top: 11%; font: 700 calc(var(--cu) * 13)/1 var(--narrow); letter-spacing: .08em; color: #e7e9eb; }
.brand small { display: block; margin-top: .35em; font-weight: 400; font-size: .68em; letter-spacing: .04em; color: #b9bdc2; }
.radio { position: absolute; left: 14%; top: 14%; width: calc(var(--cu) * 34); color: #d7dadd; }
.radio svg { display: block; }
.hg { position: absolute; transform: translate(-50%, -50%); font: 800 calc(var(--cu) * 46)/1 var(--body); color: #f4f5f6; }
.hg.g { color: #f1e533; }
.lead { position: absolute; height: 1px; width: 1%; background: #eceeef; opacity: .8; }
.lead.y { background: #f1e533; }
.lead.v { width: 1px; height: 4%; background: #cfd2d5; }
.bezel { position: absolute; left: 29.3%; top: 17.9%; width: 41.4%; height: 62.6%; background: #101113; border-radius: calc(var(--cu) * 10); }
.scr { position: absolute; left: 30%; top: 19.2%; width: 40%; height: 60%; container-type: size; overflow: hidden; background: #a9cbd6; border-radius: calc(var(--cu) * 6); filter: brightness(var(--bl, 1)); }
.scr[data-power="off"], .scr[data-power="boot"] { background: #060708; }

.kb {
  position: absolute; transform: translate(-50%, -50%); width: calc(var(--cu) * 56); height: calc(var(--cu) * 56);
  display: grid; place-content: center; justify-items: center; gap: calc(var(--cu) * 1); padding: 0; margin: 0;
  border: calc(var(--cu) * 1.7) solid #eef0f1; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #5b6068, #3b3e44 72%);
  color: #fff; font: 700 calc(var(--cu) * 11.5)/1.05 var(--narrow); letter-spacing: .02em; text-align: center;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.kb::after { content: ""; position: absolute; inset: calc(var(--cu) * -5); border-radius: 50%; }   /* larger hit area */
.kb svg { display: block; width: calc(var(--cu) * 26); }
.kb[data-k="power"] svg, .kb[data-k="horn"] svg { width: calc(var(--cu) * 34); }
.kb:active, .kb.held { transform: translate(-50%, -50%) scale(.93); filter: brightness(1.3); }
.kb.pm { font: 400 calc(var(--cu) * 34)/1 var(--body); }
.kb.white { background: #f6f7f8; border-color: #fff; color: #8a8f95; }
.kb.yellow { background: #f1e533; border-color: #f6ef74; color: #8f8713; }
.kb.num { background: rgba(255, 255, 255, .06); font-size: calc(var(--cu) * 13); }
.kb.num.white { color: #f6f7f8; border-color: #f6f7f8; }
.kb.num.yellow { color: #f1e533; border-color: #f1e533; }
.kb.abc { background: rgba(0, 0, 0, .12); }
.kb.go { background: #1f9e45; border-color: #bfeccd; font-size: calc(var(--cu) * 12.5); }
.kb.halt { background: #df2a21; border-color: #f7c2be; font-size: calc(var(--cu) * 12.5); }

/* ---------- the touch screen (320 × 240 console pixels) */
.scr-in { position: absolute; inset: 0; font-family: var(--narrow); font-stretch: condensed; color: #111; }
.scr-in > * { position: absolute; }
.scr-off { inset: 0; background: #060708; }
.scr-boot { inset: 0; padding: calc(var(--u) * 14) calc(var(--u) * 12); background: #060708; color: #e9eef0; font: 400 calc(var(--u) * 10.5)/1.55 var(--narrow); letter-spacing: .04em; }
.ln { display: inline-block; white-space: nowrap; }

.tb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 0;
  border: calc(var(--u) * .9) solid #fff; border-radius: calc(var(--u) * 5.5);
  background: linear-gradient(#1c2333, #4b5a7b 20%, #8090b1 50%, #4b5a7b 80%, #1a2130);
  box-shadow: 0 calc(var(--u) * .9) 0 calc(var(--u) * .5) rgba(13, 16, 22, .85);
  color: #fff; font: 400 calc(var(--u) * 11.6)/1.02 var(--narrow); font-stretch: condensed; letter-spacing: .01em;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.tb:active { filter: brightness(1.35); }
.tb.home { border-color: #62d2e8; }
.tb.guest { border-color: #f1ea3a; }
.tb.sub { background: linear-gradient(#140606, #3d0c0d 24%, #9a1b1d 50%, #3d0c0d 76%, #120505); }
.tb.side::after { content: ""; position: absolute; inset: calc(var(--u) * -7) 0; }   /* taller hit area between the rows */
.tb.bot { border-radius: calc(var(--u) * 6); font-size: calc(var(--u) * 11.2); background: linear-gradient(#090d16, #1a2540 30%, #4c5d82 50%, #1a2540 70%, #080b13); }
.tb.row { font-size: calc(var(--u) * 10.8); line-height: 1.04; border-radius: calc(var(--u) * 5); }
.tb.l3 { font-size: calc(var(--u) * 8.9); line-height: 1.02; }
.tb.bot.sub { background: linear-gradient(#140606, #3d0c0d 24%, #9a1b1d 50%, #3d0c0d 76%, #120505); }
.tb.row.ro { cursor: default; }
.tb.bar { font-size: calc(var(--u) * 10); line-height: 1.02; border-radius: calc(var(--u) * 4.5); background: linear-gradient(#0c1220, #1c2a48 30%, #44587f 50%, #1c2a48 70%, #0b101c); }
.tb.red { background: linear-gradient(#150506, #4b0e10 30%, #a31c1f 50%, #4b0e10 70%, #130405); }
.tb.green { background: linear-gradient(#04150a, #0c4a22 30%, #1e8f43 50%, #0c4a22 70%, #031208); }
.tb.big { font-size: calc(var(--u) * 12); }

.t-sport { font: 400 calc(var(--u) * 8.6)/1.1 var(--narrow); color: #111; }
.t-title { display: flex; justify-content: center; align-items: center; font: 400 calc(var(--u) * 7.4)/1 var(--narrow); letter-spacing: .03em; color: #111; }
.t-ver { font: 400 calc(var(--u) * 5.6)/1.4 var(--narrow); color: #111; }
.ic-horn svg { display: block; height: 100%; }
.ic-zone { display: flex; justify-content: center; align-items: center; gap: .1em; background: #a9cbd6; font: 700 calc(var(--u) * 7.2)/1 var(--narrow); color: #111; }
.ic-zone i { font-style: normal; color: #e9f4f7; letter-spacing: -.12em; }
.ic-batt { border: calc(var(--u) * 1) solid #111; padding: calc(var(--u) * .6); }
.ic-batt::after { content: ""; position: absolute; right: calc(var(--u) * -2); top: 22%; width: calc(var(--u) * 1.2); height: 56%; background: #111; }
.ic-batt i { display: block; height: 100%; background: #6cc22a; }

.ctr { background: #121212; border: calc(var(--u) * .8) solid #62d2e8; color: #f1231d; }
.ctr.guest { border-color: #f1ea3a; }
.ctr .v { display: flex; height: 100%; align-items: center; justify-content: center; }
.ctr .seg { height: 74%; }

.pv { background: #151515; }
.pv-name { font: 700 calc(var(--u) * 8.2)/1.1 var(--narrow); letter-spacing: .05em; color: #f1231d; white-space: nowrap; overflow: hidden; }
.pv-name.r { text-align: right; }
.pv-box { border: calc(var(--u) * 1.5) solid #cfeef5; color: #f1231d; }
.pv-box.guest { border-color: #eee83c; }
.pv-box.clock { border-color: #fff; }
.pv-box .v { display: flex; height: 100%; align-items: center; justify-content: flex-end; padding: 0 calc(var(--u) * 3); }
.pv-box.clock .v { justify-content: center; padding-bottom: calc(var(--u) * 2); }
.pv-box .seg { height: 76%; }
.pv-hg { display: flex; align-items: center; font: 700 calc(var(--u) * 10)/1 var(--narrow); color: #cfeef5; background: #151515; }
.pv-hg.guest { color: #eee83c; justify-content: flex-end; }
.pv-per { color: #f1231d; }
.pv-per .v { display: flex; height: 100%; justify-content: center; }
.pv-time { display: flex; justify-content: center; align-items: center; background: #151515; font: 700 calc(var(--u) * 7)/1 var(--narrow); letter-spacing: .12em; color: #fff; }

.list { background: #151515; color: #d9f3f8; font: 700 calc(var(--u) * 7.5)/1 var(--narrow); padding-top: calc(var(--u) * 2.4); overflow: hidden; }
.list.guest { color: #eee83c; }
.list .v { display: block; position: relative; height: 100%; }
.lr { display: grid; grid-template-columns: 16% 9% 21% 5.5% 5.5% 1fr; column-gap: 1.2%; align-items: center; height: calc(var(--u) * 7.7); padding: 0 6% 0 1%; }
.lr b { grid-column: 1; text-align: right; font-weight: 700; }
.lr i { grid-column: 3; font-style: normal; letter-spacing: .06em; white-space: nowrap; }
.lr u:nth-of-type(1) { grid-column: 4; }
.lr u:nth-of-type(2) { grid-column: 5; }
.lr em { grid-column: 6; }
.lr i.run { letter-spacing: 0; }
.lr u { display: block; height: 76%; text-decoration: none; }
.lr u.y { background: #f3e23a; }
.lr u.r { background: #f1231d; }
.lr em { font-style: normal; text-align: right; }
.lr.hd { color: #eee83c; }
/* running suspension clocks (A2 — placement is a reconstruction, see screen.js) */
.sus { position: absolute; right: 5%; top: calc(var(--u) * 8.6); display: grid; gap: calc(var(--u) * 1.6); text-align: right; font: 700 calc(var(--u) * 11.5)/1 var(--narrow); color: #ff4a40; }
.sus.low { top: auto; bottom: calc(var(--u) * 3); font-size: calc(var(--u) * 7.5); }

.val { display: flex; align-items: center; justify-content: center; overflow: hidden; background: #131313; border: calc(var(--u) * .8) solid #62d2e8; color: #8fdc45; font: 400 calc(var(--u) * 14.6)/1 var(--narrow); }
.val svg { display: block; height: calc(var(--u) * 13); fill: currentColor; }
.val.guest { border-color: #f1ea3a; }
.val.chg { color: #ff4a40; }

.sportb { flex-direction: row; justify-content: flex-start; gap: 4%; padding: 0 3%; font-weight: 700; font-size: calc(var(--u) * 13); letter-spacing: .04em; border-radius: calc(var(--u) * 4); background: linear-gradient(#0d0f14, #252a35 30%, #6d7381 50%, #252a35 70%, #0b0d11); }
.sportb.guest { flex-direction: row-reverse; }
.sportb .pic { flex: none; width: 22%; aspect-ratio: 1; display: grid; place-items: center; background: #fff; border: calc(var(--u) * .7) solid #111; }
.sportb .pic svg { width: 78%; fill: #111; }
.sportb .ln { flex: none; margin: 0 auto; transform-origin: left center; }
.sportb.guest .ln { transform-origin: right center; }
.badge { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #2c7a55; color: #fff; font: 700 calc(var(--u) * 8.4)/1.1 var(--narrow); letter-spacing: .08em; }

.panel { background: #26272b; border: calc(var(--u) * 1.4) solid #a9cbd6; }
.t-bar { display: flex; align-items: center; justify-content: center; background: #26272b; border: calc(var(--u) * 1.4) solid #a9cbd6; color: #fff; font: 400 calc(var(--u) * 12.4)/1 var(--narrow); letter-spacing: .05em; }
.hr { height: 0 !important; border-top: calc(var(--u) * 1.4) solid #a9cbd6; }
.t-lab { display: flex; align-items: center; color: #fff; font: 400 calc(var(--u) * 10)/1 var(--narrow); }
.t-lab.home { color: #cfeef5; }
.t-lab.guest { color: #eee83c; }
.t-lab.bench { color: #c5c8cc; font-size: calc(var(--u) * 6.4); }
.field { background: #d7eef4; color: #111; border-color: #fff; font: 400 calc(var(--u) * 10.4)/1 var(--narrow); border-radius: calc(var(--u) * 3); box-shadow: none; }
.field.no { font-size: calc(var(--u) * 10); }
.pname { background: linear-gradient(#1a1a1c, #4a4b50 50%, #161618); border-color: #101012; color: #cfeef5; font: 400 calc(var(--u) * 10.6)/1 var(--narrow); border-radius: calc(var(--u) * 4); box-shadow: none; }
.pname.big { font: 700 calc(var(--u) * 11.5)/1 var(--narrow); color: #fff; }
.pname.out { background: linear-gradient(#3d0c0d, #c22226 50%, #3d0c0d); }
.pname.in { background: linear-gradient(#0c4a22, #25a550 50%, #0c4a22); }
.redline { background: #f1231d; }
.key { background: linear-gradient(#5d5e62, #2a2b2f 45%, #17181a); border-color: #0d0d0f; color: #fff; font: 700 calc(var(--u) * 13.6)/1 Arial, Helvetica, sans-serif; border-radius: calc(var(--u) * 4.5); box-shadow: none; }
.kb-text { display: flex; align-items: center; justify-content: center; overflow: hidden; color: #f1231d; font: 700 calc(var(--u) * 13.6)/1 Arial, Helvetica, sans-serif; }
.cur { display: inline-block; width: calc(var(--u) * .9); height: 1em; margin: 0 calc(var(--u) * .4); vertical-align: -12%; background: #f1231d; }
.q-text { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25em; color: #fff; font: 700 calc(var(--u) * 14)/1.1 var(--narrow); letter-spacing: .03em; }

/* ---------- trainer aids */
.aids { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.speed { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 4px; }
.speed legend { float: left; padding: 0; margin-right: 10px; font-weight: 600; }
.speed label { cursor: pointer; }
.speed input { position: absolute; opacity: 0; }
.speed span { display: block; min-width: 46px; text-align: center; padding: 4px 10px; border: 2px solid rgba(243, 246, 244, .75); border-radius: 6px; font-weight: 600; }
.speed input:checked + span { background: var(--line); color: var(--ink); }
.speed input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ink); }
.aid-note { margin: 0; color: #cfe1e4; font-size: .93rem; max-width: 60ch; }

/* ---------- the protocol sheet: exercises and log */
.sheet { background: var(--paper); color: var(--ink); border-radius: 3px; padding: 16px 18px 12px; }
.sheet h2 { margin: 0; font: 800 1.5rem/1.1 var(--head); font-stretch: condensed; }
.sheet-lead { margin: 2px 0 6px; color: var(--ink-soft); }
.sheet h3 { margin: 14px 0 0; padding-bottom: 3px; border-bottom: 2px solid var(--ink); font: 700 1.02rem/1.2 var(--body); }
.sheet ul { list-style: none; margin: 0; padding: 0; }
.sheet li { border-bottom: 1px solid var(--rule); }
.ex { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 6px 4px; background: none; border: 0; text-align: left; cursor: pointer; }
.ex:hover { background: #f0eee4; }
.ex.on { background: #fff1b0; font-weight: 700; }
.tick { flex: none; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 2px; display: grid; place-items: center; }
.ex.done .tick { background: var(--green); border-color: var(--green); }
.ex.done .tick::after { content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 3px 3px; transform: translateY(-1px) rotate(-45deg); }
.sheet-foot { margin: 10px 0 0; color: var(--ink-soft); font-size: .9rem; }
.log { margin-top: 14px; border-top: 2px solid var(--ink); padding-top: 6px; }
.log summary { cursor: pointer; font-weight: 700; padding: 5px 0; }
.log ol { list-style: none; margin: 4px 0 0; padding: 0; max-height: 300px; overflow: auto; font-size: .92rem; }
.log li { display: grid; grid-template-columns: 5.2em 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.lt, .ls { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.log-empty { margin: 4px 0; color: var(--ink-soft); }

/* ---------- footer, notices, dialog */
.foot { border-top: 3px dashed rgba(243, 246, 244, .55); }
.foot p { max-width: 1500px; margin: 0 auto; padding: 14px 20px 26px; color: #cfe1e4; font-size: .93rem; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--line); }
.toasts { position: fixed; z-index: 20; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); display: grid; gap: 6px; pointer-events: none; }
.toast { margin: 0; padding: 9px 14px; background: var(--paper); color: var(--ink); border-left: 7px solid var(--yellow); border-radius: 2px; box-shadow: 0 6px 22px rgba(0, 0, 0, .4); font-weight: 600; }
dialog { width: min(720px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); padding: 20px 24px 22px; border: 0; border-radius: 3px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(8, 26, 32, .72); }
dialog h2 { margin: 0 0 6px; font: 800 1.7rem/1.1 var(--head); font-stretch: condensed; }
dialog h3 { margin: 18px 0 4px; font: 700 1.06rem/1.25 var(--body); }
dialog p, dialog li { max-width: 68ch; }
dialog ul, dialog ol { margin: 4px 0; padding-left: 1.3em; }
dialog li { margin: 4px 0; }
.assume { padding-left: 2.6em; }
.assume li::marker { content: "A" counter(list-item) "  "; font-weight: 700; }
.about-close { float: right; margin: 0 0 6px 12px; }
.quiet-dark { background: none; border: 2px solid var(--ink); border-radius: 6px; padding: 4px 12px; font-weight: 600; cursor: pointer; }
.danger { border-color: var(--red); color: var(--red); }
.danger:hover { background: #fbe6e3; }
.noscript { margin: 20px; padding: 12px; background: var(--paper); color: var(--ink); }

/* ---------- small screens */
@media (max-width: 900px), (max-height: 540px) {
  .coach-acts .zoom-btn { display: block; }
}
@media (max-width: 700px) {
  .top-in { padding: 10px 12px 8px; }
  h1 { font-size: 1.5rem; }
  .layout { padding: 12px 10px 20px; gap: 16px; }
  .coach-say { font-size: 1.02rem; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .rotate { display: block; }
  .console-scroll { justify-items: start; }
}
/* phone on its side: the coach strip and the whole console share one screenful */
@media (max-height: 540px) and (orientation: landscape) {
  .top-in { padding: 6px 12px 5px; }
  h1 { font-size: 1.25rem; }
  .tagline { display: none; }
  .layout { padding: 10px 8px 16px; gap: 12px; }
  .board-wrap { max-width: 470px; }
  .coach { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 4px 10px 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
  .coach-txt { flex: 1; }
  .coach-step { font-size: .76rem; }
  .coach-say { font-size: .95rem; line-height: 1.22; }
  .coach-acts { flex: none; flex-direction: column; gap: 4px; margin: 0; }
  .coach-acts button { padding: 0 10px; font-size: .86rem; }
  .console { width: min(100%, (100dvh - 66px) * 2); min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
