/* The play page of the big game. One picture fills the screen behind everything: the place where
   the mission plays, where the seat shown works, what a question is about. On it, in boxes of the
   board's colour (text never stands on the picture itself): the line of missions with the mission
   chosen and its seats; the session's bar, the cast and the stage of the seat shown; the verdict.
   The numbers (tables, score, messages, flows, the report) are dialogs. Colours are the tokens of
   app/app.css only; what stands on the board takes its colours through the tokens. */
body { background: var(--board); }
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--board); }
.backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.backdrop img.on { opacity: 1; animation: drift 60s ease-in-out infinite alternate; }
/* live (live.js): the layout's world, running, over the still picture */
/* (a picture of another shape than the window, a photo of the lab or the camera's image, covers it: SOURCES.focus in live.js) */
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 80%; opacity: 0; transition: opacity .9s ease; }
.backdrop.live canvas { opacity: 1; }
/* the edges a little darker, for the bars on them; the middle stays the picture */
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--board) 50%, transparent), transparent 20%, transparent 58%, color-mix(in srgb, var(--board) 62%, transparent)); }
@keyframes drift { from { transform: scale(1.03); } to { transform: scale(1.1) translate(-1.2%, -.8%); } }
@media (prefers-reduced-motion: reduce) { .backdrop img { transition: none; } .backdrop img.on { animation: none; } }
.site-bar, main, .site-foot { position: relative; z-index: 1; }
.site-foot { background: var(--bg); margin-top: 0; }
/* (the page's bar stays on every screen, for the way to the other pages: the picture has the rest) */

main[data-screen] .play-layout {
  --surface: var(--board-2); --surface-2: var(--board); --text: var(--board-text); --text-2: var(--board-muted); --line: var(--board-line);
  --accent-ink: var(--overlay-ok); --danger: var(--board-warn); color: var(--board-text);
}
.play-screen[hidden], .play-seat[hidden] { display: none; }
.play-screen > *, .play-seat > * { min-width: 0; }
.play-layout [tabindex="-1"] { scroll-margin-top: 90px; }
.play-layout [tabindex="-1"]:focus { outline: none; }
.play-layout .de { color: var(--text-2); font-size: .9em; }
.play-layout input[type="radio"], .play-layout input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
/* (a key's name keeps the full colour of its button's text: fainter, it would not have the contrast) */
.play-layout kbd { font-family: var(--mono); font-size: .68em; font-weight: 500; line-height: 1; padding: 2px 5px; border: 1px solid currentColor; border-radius: 3px; }
.table-scroll { overflow-x: auto; }
/* a row's head reads as its cells do (app.css sets table heads small and in capitals) */
.play-layout tbody th { text-transform: none; letter-spacing: 0; font-size: inherit; font-weight: 600; color: var(--text); background: none; }
.stars { letter-spacing: .08em; color: var(--board-warn); white-space: nowrap; }
.stars i { font-style: normal; color: var(--board-line); }
.play-big { font-size: 1.15rem; font-weight: 800; padding: 12px 34px; letter-spacing: .03em; }
.play-go { margin-right: 8px; font-size: .8em; }
.play-hook { font-size: 1.1rem; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.play-no { font-family: var(--mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--overlay-ok); }
.play-no .stars { font-size: 1.1em; }

/* ------------------------------------------------------------------ 1: the line of missions, and the mission chosen */
.lv { min-height: calc(100vh - 62px); display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 14px clamp(12px, 3vw, 32px) 18px; }
.lv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lv-brand { font-family: var(--mono); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; background: var(--board); color: var(--overlay-ok); padding: 5px 12px; border-radius: 3px; }
.lv-rank { display: flex; align-items: center; gap: 10px; background: var(--board); color: var(--board-text); text-decoration: none; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1px solid var(--board-line); font-size: .9rem; }
.lv-rank .n { color: var(--board-warn); font-weight: 800; }
.lv-rank .go { background: var(--board-2); border-radius: 999px; padding: 2px 10px; font-size: .78rem; color: var(--board-muted); }
.lv-card { align-self: end; justify-self: start; width: min(100%, 620px); background: var(--board); border: 1px solid var(--board-line); border-top: 4px solid var(--overlay-ok); border-radius: 6px; padding: 18px 22px 16px; display: grid; gap: 10px; justify-items: start; animation: vn-say .3s ease-out; }
.lv-card > h2 { font-size: clamp(1.8rem, 4.2vw, 2.9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
.lv-card > form, .lv-card .play-more { width: 100%; }
.play-setup-form { display: grid; gap: 12px; }
.lv-seats { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lv-seats legend { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--board-muted); padding: 0; margin-bottom: 6px; }
/* a seat to take: a face and the role; taken, it is yours */
.lv-seat { position: relative; display: grid; grid-template-columns: 40px auto; column-gap: 9px; align-items: center; cursor: pointer; border: 1px solid var(--board-line); border-radius: 999px 10px 10px 999px; padding: 3px 14px 3px 3px; background: var(--board-2); max-width: 100%; }
.lv-seat input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.lv-seat .face { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--board); filter: grayscale(1) opacity(.55); }
.lv-seat .name { font-size: .88rem; font-weight: 600; line-height: 1.2; color: var(--board-muted); }
.lv-seat .who { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--board-muted); }
.lv-seat .who::after { content: "computer"; }
.lv-seat:has(input:checked) { border-color: var(--overlay-ok); box-shadow: 0 0 0 1px var(--overlay-ok); }
.lv-seat:has(input:checked) .face { filter: none; }
.lv-seat:has(input:checked) .name { color: var(--board-text); font-weight: 800; }
.lv-seat:has(input:checked) .who { color: var(--overlay-ok); }
.lv-seat:has(input:checked) .who::after { content: "you"; }
.lv-seat:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.play-more { font-size: .92rem; }
.play-more > * + * { margin-top: 10px; }
.play-wiring { display: grid; gap: 6px; margin-top: 14px; }
.play-wiring h3 { font-size: 1rem; }
.play-wiring ul { margin: 0; padding-left: 1.1em; }
.play-wiring td { white-space: normal; min-width: 12em; }

/* the line: the missions as its stops, in their order; the one chosen is the station you stand in */
.lv-line { background: var(--board); border: 1px solid var(--board-line); border-radius: 6px; padding: 8px 14px 10px; overflow-x: auto; }
.lv-line > h2 { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--board-muted); }
#missions { list-style: none; margin: 4px 0 0; padding: 0; display: flex; min-width: min-content; }
#missions li { flex: 1 1 0; min-width: 92px; position: relative; }
/* the rail between the stops */
#missions li::before { content: ""; position: absolute; left: 0; right: 0; top: 29px; height: 4px; background: var(--board-line); }
#missions li:first-child::before { left: 50%; }
#missions li:last-child::before { right: 50%; }
.lv-stop { position: relative; display: grid; justify-items: center; gap: 3px; padding: 2px 4px 4px; text-decoration: none; color: var(--board-muted); border-radius: 6px; text-align: center; }
.lv-stop .no { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; }
.lv-stop .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--board); border: 4px solid var(--board-muted); }
.lv-stop.done .dot { background: var(--overlay-ok); border-color: var(--overlay-ok); }
.lv-stop .name { font-size: .78rem; font-weight: 600; line-height: 1.2; max-width: 14ch; text-wrap: balance; }
.lv-stop .stars { font-size: .78rem; }
.lv-stop .tag { position: absolute; top: 14px; left: calc(50% + 14px); font-size: .62rem; padding: 0 6px; }
.lv-stop.on { color: var(--board-text); }
.lv-stop.on .dot { width: 22px; height: 22px; margin-block: -3px; border-color: var(--board-text); box-shadow: 0 0 0 4px var(--overlay-ok); }
.lv-stop.on .name { font-weight: 800; }
.lv-stop:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
/* the little train: it stands above the stop chosen, and runs to another */
.lv-line { position: relative; }
.lv-train { position: absolute; top: 34px; left: 0; width: 44px; height: 18px; margin-left: -58px; transition: left .7s cubic-bezier(.3, .1, .2, 1); cursor: pointer; overflow: visible; }
.lv-train.honk { animation: lv-honk .5s ease-out; }
@keyframes lv-honk { 30% { transform: translateY(-5px) rotate(-4deg); } 60% { transform: translateY(0) rotate(2deg); } }
.lv-train .body { fill: var(--overlay-ok); }
.lv-train .glass { fill: var(--board); }
.lv-train circle { fill: var(--board-text); }
@media (prefers-reduced-motion: reduce) { .lv-train { transition: none; } .lv-train.honk { animation: none; } }
@media (max-width: 700px) { .lv { min-height: 0; } .lv-card { padding: 14px 16px; } }

/* ------------------------------------------------------------------ 2: playing: a stage, not a dashboard */
/* the play screen fills the window and does not scroll: the line at the top, the stage, the band at the
   bottom and the rail at the side stay where they are; only a box whose content is longer scrolls in itself */
body[data-screen="play"] { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body[data-screen="play"] .site-foot { display: none; }
body[data-screen="play"] main { flex: 1 1 auto; min-height: 0; display: grid; }
body[data-screen="play"] .play-layout { min-height: 0; display: grid; }
#play:not([hidden]) {
  --pad: clamp(10px, 2vw, 22px); --rail: 52px;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--rail); grid-template-rows: auto minmax(0, 1fr);
  column-gap: 0; row-gap: 4px; padding: 0 0 0 var(--pad); min-height: 0; overflow: hidden; position: relative;
}

/* (the phase's name over the whole screen is fixed, and takes no row of the grid) */
#chapter { position: absolute; }
/* the line at the upper middle: what must be seen, without boxes. Behind it the board's blue fades out
   downwards across the whole width, which keeps it readable on any picture */
.play-hud {
  grid-column: 1; grid-row: 1; margin: 0 0 0 calc(-1 * var(--pad)); padding: 10px 18px 46px; position: relative;
  display: flex; flex-wrap: nowrap; align-items: baseline; justify-content: center; gap: 2px 18px; white-space: nowrap; overflow: hidden;
  /* (solid enough behind the message's line, then it fades out) */
  background: linear-gradient(to bottom, color-mix(in srgb, var(--board) 92%, transparent) 0%, color-mix(in srgb, var(--board) 82%, transparent) calc(100% - 16px), color-mix(in srgb, var(--board) 0%, transparent) 100%);
  font-size: .92rem;
}
/* (one line as long as it fits; a long one wraps between its parts rather than be cut) */
.play-hud > *, .vn-gauges > div { white-space: nowrap; }
/* a little tighter where the window is narrower; below 1200 px it may take a second line rather than cut a figure off */
@media (max-width: 1500px) {
  .play-hud, .vn-gauges { column-gap: 12px; }
  .play-hud { font-size: .86rem; }
  .play-clock { font-size: 1.15rem; }
  .vn-gauges dt { font-size: .72rem; }
  .vn-gauges dd { font-size: .94rem; }
}
/* (only what does not fit on one line takes a second: the page measures it, PlayPage.side) */
.play-hud.wrap, .play-hud.wrap .vn-gauges { flex-wrap: wrap; }
/* (the note: a few words; its whole sentence is for screen readers) */
.vn-note[data-short]:not([data-short=""])::before { content: attr(data-short); content: attr(data-short) / ""; }
.play-hud > [hidden] { display: none; }
/* the mission's name and where it stands, in the page's bar while a mission is played (not on a phone) */
.site-where { display: none; margin: 0 0 0 18px; min-width: 0; color: var(--bar-text); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-screen="play"] .site-where { display: block; }
.site-where #where { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; margin-left: 8px; }
@media (max-width: 860px) { body[data-screen="play"] .site-where { display: none; } }
.play-bar { display: flex; align-items: baseline; gap: 6px 12px; }
.play-bar .hint { color: var(--board-muted); }
.play-clock { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
/* the clock waits while somebody speaks to the person at the seat shown */
.held .play-clock { color: var(--board-muted); }
/* the speed: words to press; the one that holds is bright and underlined */
.hud-speed { display: flex; gap: 2px; }
.hud-speed button { all: unset; cursor: pointer; padding: 2px 6px; border-radius: 3px; font-size: .86rem; font-weight: 600; color: var(--board-muted); }
.hud-speed button[aria-pressed="true"] { color: var(--board-text); font-weight: 800; text-decoration: underline 2px var(--overlay-ok); text-underline-offset: 5px; }
.hud-speed button:hover { color: var(--board-text); }
.hud-speed button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* the time of the shift: a thin line right at the lower edge of the page's bar, across the whole window */
.play-progress { position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: 4px; background: color-mix(in srgb, var(--board) 85%, transparent); overflow: hidden; }
#play:has(#shiftBar[hidden]) .play-progress { display: none; }
.play-progress i { display: block; height: 100%; width: 0; background: linear-gradient(to right, var(--overlay-ok), #8fe3e7); box-shadow: 0 0 6px var(--overlay-ok); transition: width .25s linear; }
#turnNote { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the figures of the seat shown: a label and its value, side by side */
.hud-figures, .hud-notes { display: contents; }
.vn-gauges { display: flex; flex-wrap: nowrap; justify-content: center; gap: 2px 16px; margin: 0; }
.vn-gauges[hidden] { display: none; }
.vn-gauges > div { display: flex; align-items: baseline; gap: 6px; }
.vn-gauges dt { font-size: .76rem; color: var(--board-muted); }
.vn-gauges dd { margin: 0; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.vn-gauges > .tone-ok dd { color: #8fe8c0; }
.vn-gauges > .tone-warn dd { color: #ffbe73; }
.vn-gauges > .tone-bad dd { color: #ff98a8; }
.vn-gauges > .bump dd { animation: vn-bump 1.2s ease-out; }
@keyframes vn-bump { 0% { color: var(--overlay-ok); transform: scale(1.15); } }
/* a note on the seat's state (the computer plays it, it is not at work) */
.vn-note { color: #ffd7a8; font-size: .86rem; font-style: italic; }
.vn-note[hidden] { display: none; }

/* the rail at the side: everything else, as icons; three of them open a panel beside the rail */
.play-rail { grid-column: 2; grid-row: 1 / 3; min-height: 0; background: color-mix(in srgb, var(--board) 82%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-left: 1px solid var(--board-line); position: relative; z-index: 4; }
.rail-in { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.rail-tools { display: contents; }
.vn-tools { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-block: 1px solid var(--board-line); }
.vn-tools[hidden] { display: none; }
.rail-gap { flex: 1 1 8px; }
.rail-btn {
  all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 10px; color: var(--board-text); cursor: pointer;
}
.rail-btn:hover { background: var(--board-2); }
.rail-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rail-btn[aria-expanded="true"] { background: var(--overlay-ok); color: var(--board); }
.rail-btn[aria-pressed="false"] { color: var(--board-muted); }
.rail-btn[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 2px; background: currentColor; transform: rotate(-45deg); border-radius: 1px; }
.rail-btn .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn .tag { position: absolute; top: -2px; right: -4px; min-width: 18px; padding: 0 4px; font-size: .66rem; line-height: 16px; text-align: center; border-radius: 999px; background: var(--board-2); color: var(--board-text); border: 1px solid var(--board-line); }
.rail-btn .tag.warn { background: var(--board-warn); color: var(--board); border-color: var(--board-warn); }
.rail-btn .tag[hidden] { display: none; }
/* the seats as the cast: a face each (its name is its tooltip); the one shown is ringed */
.play-tabs { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.play-tabs [role="tab"] { all: unset; box-sizing: border-box; position: relative; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 2px solid var(--board-line); background: var(--board-2); }
.play-tabs [role="tab"][aria-selected="true"] { border-color: var(--overlay-ok); box-shadow: 0 0 0 2px var(--overlay-ok); }
.play-tabs [role="tab"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.play-tabs .face { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 12%; display: block; }
.play-tabs .theirs .face { filter: grayscale(1) opacity(.7); }
.play-tabs .tag { position: absolute; top: -4px; right: -6px; min-width: 16px; padding: 0 4px; font-size: .64rem; line-height: 15px; text-align: center; border-radius: 999px; }
.play-tabs .tag.warn { background: var(--board-warn); color: var(--board); }
/* one seat only: nothing to choose between */
.play-tabs:has([role="tab"]:only-child) { display: none; }
/* a panel beside the rail: the mission, where you work, the messages; long ones scroll in themselves */
.rail-panel {
  position: absolute; right: calc(100% + 6px); top: 8px; width: min(340px, calc(100vw - var(--rail) - 24px)); max-height: calc(100% - 16px); overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 8px; align-content: start; padding: 12px 14px; background: var(--board); color: var(--board-text);
  border: 1px solid var(--board-line); border-top: 3px solid var(--overlay-ok); border-radius: 8px; box-shadow: 0 12px 30px color-mix(in srgb, var(--board) 70%, transparent);
  animation: vn-say .18s ease-out;
}
.rail-panel[hidden] { display: none; }
.rail-panel:focus { outline: none; }
.rail-panel h3 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.rail-panel p { margin: 0; }
.rail-panel .play-where { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--overlay-ok); }
.play-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.play-phases li { border: 1px solid var(--board-line); border-radius: 999px; padding: 1px 10px; font-size: .76rem; color: var(--board-muted); }
.play-phases li[aria-current] { border-color: var(--overlay-ok); background: var(--overlay-ok); color: var(--board); font-weight: 700; }
.play-phases small { font-weight: 400; }
.vn-where { font-size: .95rem; line-height: 1.3; }
.place-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--overlay-ok); display: block; }
.play-log[hidden] { display: none; }
/* the messages: each on its own card, its time apart; the new ones marked */
.play-log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.play-log li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; font-size: .88rem; line-height: 1.35; background: var(--board-2); border: 1px solid var(--board-line); border-left: 4px solid var(--board-line); border-radius: 6px; padding: 7px 10px; }
.play-log li time { font-family: var(--mono); font-size: .76rem; font-weight: 600; color: var(--overlay-ok); }
.play-log li > span:only-child, .play-log li > span:first-child { grid-column: 1 / -1; }
.play-log li.new { border-left-color: var(--overlay-ok); }
.play-log li.new::after { content: "new"; grid-column: 2; justify-self: end; margin-top: 4px; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--board); background: var(--overlay-ok); border-radius: 999px; padding: 0 7px; }
.play-log li.k-violation, .play-log li.k-wrong, .play-log li.k-cut { border-left-color: var(--board-warn); }
.rail-bell .play-scroll { max-height: none; border: 0; padding: 0; }

/* a new message, one at a time: a line of the header, below its figures, never a box on the picture (the header keeps
   its room, so the stage does not move); pressed, it opens the messages */
.play-toast {
  all: unset; box-sizing: border-box; position: absolute; left: 18px; right: 18px; bottom: 18px; text-align: center; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--board-text); font-size: .88rem; line-height: 1.4; animation: vn-toast .3s ease-out;
}
/* (one line on a phone too, where the other parts of the header may wrap: it is cut off, never grows over the figures) */
.play-hud > .play-toast { white-space: nowrap; max-width: none; }
.play-toast::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; vertical-align: .1em; background: var(--overlay-ok); }
.play-toast[hidden] { display: none; }
.play-toast.k-violation, .play-toast.k-wrong, .play-toast.k-cut { color: #ffbe73; }
.play-toast.k-violation::before, .play-toast.k-wrong::before, .play-toast.k-cut::before { background: var(--board-warn); }
.play-toast:hover { text-decoration: underline; text-underline-offset: 3px; }
.play-toast:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@keyframes vn-toast { from { opacity: 0; transform: translateY(-4px); } }

/* the stage of the seat shown: the picture is the scene; the boxes keep to its edges */
.play-seats { grid-column: 1; grid-row: 2; display: grid; min-height: 0; }
#panels { display: grid; min-height: 0; }
.play-seat:not([hidden]) { display: grid; min-height: 0; }
.play-seat p:empty:not([role="status"]), .play-seat ul:empty, .play-seat dl:empty, .play-keyed:empty, .play-moves-note:empty, .play-plain:empty { display: none; }
.vn-stage { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; min-height: 0; color: var(--board-text); }
/* something in the picture that needs attention pulses in its colour (a problem red, a worry orange); chosen, it says what is known */
.play-board .pulse { fill: none; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: vn-pulse 1.4s ease-out infinite; pointer-events: none; }
.play-board .pulse-bad { stroke: #ff667e; }
.play-board .pulse-warn { stroke: var(--board-warn); animation-duration: 2.2s; }
@keyframes vn-pulse { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.play-asset { font-size: .92rem; }
.play-asset.tone-bad strong { color: #ff98a8; }
.play-asset.tone-warn strong { color: #ffbe73; }
@media (prefers-reduced-motion: reduce) { .play-board .pulse { animation: none; transform: none; opacity: 1; } }

/* the game's picture on the stage: a control desk in Dunkelblau (as the signaller's panel) */
.vn-stage .play-sketch { grid-row: 1; align-self: center; justify-self: center; width: 100%; max-width: 940px; display: grid; gap: 6px; background: var(--board); border: 1px solid var(--board-line); border-radius: 6px; padding: 8px 12px 10px; box-shadow: 0 10px 30px color-mix(in srgb, var(--board) 70%, transparent); }
.vn-stage .play-sketch h4 { font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--board-muted); }
.play-board { background: var(--board); border-radius: var(--radius); overflow: auto; }
.play-board:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.play-board svg { display: block; width: 100%; height: auto; }
/* the stage's picture takes the height that is left (the screen does not scroll): less while the band is up */
.vn-stage .play-board svg { max-height: max(160px, calc(100dvh - 250px)); }
.vn-stage:has(.vn-talk:not([hidden])) .play-board svg { max-height: max(130px, calc(100dvh - 560px)); }
@media (max-height: 860px) and (min-width: 1000px) { .vn-stage .play-sketch h4 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.play-board text { fill: var(--board-text); font-family: var(--font); font-size: 13px; font-weight: 600; }
.play-board text.small { font-size: 11px; }
.play-board text.t-muted { fill: var(--board-muted); font-weight: 500; }
.play-board text.t-warn { fill: var(--board-warn); }
.play-board text.t-ok { fill: var(--overlay-ok); }
.play-board line { stroke: var(--board-muted); stroke-width: 6; stroke-linecap: round; }
.play-board line.thin { stroke-width: 2; }
.play-board line.faint { opacity: .22; }
.play-board line.t-route { stroke: var(--overlay-ok); }
.play-board line.t-occupied { stroke: var(--overlay-bad); }
.play-board line.t-closed { stroke: var(--board-warn); stroke-dasharray: 10 7; }
.play-board line.t-warn { stroke: var(--board-warn); }
.play-board rect { fill: var(--board-muted); }
.play-board rect.t-muted { fill: var(--board-2); stroke: var(--board-line); }
.play-board rect.t-ok { fill: var(--overlay-ok); }
.play-board rect.t-warn { fill: var(--board-warn); }
.play-board rect.t-bad { fill: var(--overlay-bad); }
.play-board rect.t-train { fill: #ffffff; }
.play-board rect.t-closed { fill: none; stroke: var(--board-warn); stroke-width: 1.5; stroke-dasharray: 3 2; }
.play-board circle { fill: var(--board-muted); stroke: var(--board); stroke-width: 2; }
.play-board circle.t-ok { fill: #3ed37a; }
.play-board circle.t-bad { fill: #ff667e; }
.play-board circle.t-warn { fill: var(--board-warn); }
.play-board circle.t-route { fill: var(--overlay-ok); }
.play-board circle.t-failed { fill: var(--board-2); stroke: #ff667e; stroke-dasharray: 3 2; }
.play-board circle.t-zs1 { fill: #ffffff; }
.play-board circle.t-place { fill: var(--board); stroke: var(--board-text); stroke-width: 3; }
.play-board .tag rect { fill: #ffffff; stroke: var(--board); }
.play-board .tag text { fill: var(--board); font-size: 12px; font-weight: 700; }
.play-board .tag.t-warn rect { fill: var(--board-warn); }
.play-board .tag.t-ok rect { fill: var(--overlay-ok); }
.play-board .tag.t-bad rect { fill: var(--overlay-bad); }
.play-board .tag.t-idle rect { fill: var(--board-2); stroke: var(--board-muted); }
.play-board .tag.t-idle text { fill: var(--board-text); }
.play-board .pick { cursor: pointer; }
.play-board .pick .hit { fill: transparent; stroke: var(--board-line); stroke-width: 1; stroke-dasharray: 2 3; }
.play-board .pick:hover .hit { stroke: var(--board-text); stroke-dasharray: none; }
.play-board .pick[aria-pressed="true"] .hit { stroke: var(--board-warn); stroke-width: 3; stroke-dasharray: none; }
.play-board .pick:focus { outline: none; }
.play-board .pick:focus-visible .hit { stroke: var(--overlay-ok); stroke-width: 3; stroke-dasharray: none; }
.play-pick { display: grid; gap: 6px; }
.play-picked { font-weight: 600; }
.play-pick [aria-disabled="true"] { background: var(--surface-2); border: 1px dashed var(--line); color: var(--text-2); cursor: not-allowed; }
@media (forced-colors: active) { .play-board { forced-color-adjust: none; } }

/* windows of the stage a person places and sizes (windows.js): the game's picture and the tables it keeps in view (the
   timetable). A handle at the middle of the upper edge moves one, the grip in its lower right corner sizes it (both also
   with the arrow keys; a double-click or Home puts it back). Placed, a window stands where it was left; the talk stays above */
.vn-stage { position: relative; isolation: isolate; }
.vn-talk { z-index: 1000; }
.vn-sheets { display: contents; }
.play-window { position: relative; }
.play-window.placed { position: absolute; max-width: none !important; margin: 0 !important; display: flex; flex-direction: column; overflow: hidden; z-index: 2; }
.play-window.dragging { opacity: .92; }
.win-move, .win-grip { all: unset; box-sizing: border-box; position: absolute; z-index: 1; cursor: move; touch-action: none; }
.win-move { top: 0; left: 50%; width: 56px; height: 24px; margin-left: -28px; display: grid; place-items: start center; padding-top: 6px; border-radius: 0 0 8px 8px; }
.win-move span { width: 28px; height: 4px; border-radius: 2px; background: var(--board-muted); opacity: .7; }
.win-move:hover span, .win-move:focus-visible span { opacity: 1; background: var(--board-text); }
.win-grip { right: 0; bottom: 0; width: 24px; height: 24px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 62%, var(--board-muted) 62% 68%, transparent 68% 78%, var(--board-muted) 78% 84%, transparent 84%); opacity: .75; }
.win-grip:hover, .win-grip:focus-visible { opacity: 1; }
.win-move:focus-visible, .win-grip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* the game's picture, placed: it takes the window's size (as large as fits, its shape kept) */
.vn-stage .play-sketch.placed { padding-top: 14px; }
/* (with a table kept in view in the upper left, the picture stands at the foot of the stage, out of its way) */
.vn-stage:has(.play-sheet) .play-sketch:not(.placed) { align-self: end; }
.vn-stage .play-sketch.placed .play-board { flex: 1 1 0; min-height: 0; overflow: hidden; }
.vn-stage .play-sketch.placed .play-board svg { width: 100%; height: 100%; min-width: 0 !important; max-height: none; }
.vn-stage .play-sketch.placed .play-pick { flex: none; }
/* a table kept in view: a small window in the upper left of the stage, its rows scroll in it */
.play-sheet { position: absolute; top: 6px; left: 12px; z-index: 2; width: min(780px, 58%); max-height: min(42%, 340px); display: flex; flex-direction: column; color: var(--board-text);
  background: color-mix(in srgb, var(--board) 92%, transparent); border: 1px solid var(--board-line); border-radius: 6px; padding: 14px 10px 10px; box-shadow: 0 10px 30px color-mix(in srgb, var(--board) 70%, transparent); }
.play-sheet h4 { flex: none; margin: 0 0 4px; font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--board-muted); }
.play-sheet .sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.play-sheet .sheet-body:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.play-sheet .game-table { font-size: .8rem; }
.play-sheet .game-table th, .play-sheet .game-table td { border-bottom-color: var(--board-line); padding: 3px 6px; white-space: nowrap; }
.play-sheet .game-table th { color: var(--board-muted); }
.play-sheet .game-table tbody th { color: var(--board-text); }
.play-sheet .game-table thead th { position: sticky; top: 0; background: var(--board); }
.play-sheet .hint { color: var(--board-muted); }
/* (on the table it stands at the foot of the stage, left of the panel: the station keeps the middle) */
body.tabled .play-sheet:not(.placed) { top: auto; bottom: 0; width: min(600px, 44%); max-height: min(40%, 300px); }
/* a phone has no room for windows: the picture stays where the page has it, the timetable is in the desk */
@media (max-width: 640px) {
  .play-sheet, .win-move, .win-grip { display: none; }
  .vn-stage .play-window.placed { position: relative; display: grid; left: auto !important; top: auto !important; width: 100% !important; height: auto !important; }
  .vn-stage .play-sketch.placed .play-board svg { height: auto; }
}

/* the table (T): the signaller's game on the lab's layout (table.js). The picture is the game's own, so nothing
   shades it but the line at the top; the panel stands small in the lower right corner (the speaker stands at
   the left), with what is chosen below it; the table's controls are in the side bar, its note in the line at the top */
body.tabled .backdrop::after { background: linear-gradient(180deg, color-mix(in srgb, var(--board) 35%, transparent), transparent 14%); }
body.tabled .vn-stage { cursor: grab; touch-action: none; }
body.tabled .vn-stage .play-sketch { align-self: end; justify-self: end; margin-right: 12px; max-width: min(560px, 52%); padding: 6px 8px 8px; background: color-mix(in srgb, var(--board) 90%, transparent); cursor: auto; touch-action: auto; }
body.tabled .vn-stage .play-sketch h4 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.tabled .vn-stage .play-board svg { min-width: 0 !important; max-height: var(--beside, 132px); }
body.tabled .vn-talk { cursor: auto; touch-action: auto; }
/* the table's controls: in the side bar, behind its button */
.rail-table #tableBar { display: grid; gap: 10px; }
.table-group { display: flex; flex-wrap: wrap; gap: 6px; }
.table-group[hidden], .rail-table [hidden] { display: none; }
.rail-table .btn { background: var(--board-2); color: var(--board-text); border: 1px solid var(--board-line); font-weight: 600; }
.rail-table .btn:hover { border-color: var(--board-text); }
.rail-table .btn[aria-pressed="true"] { background: var(--overlay-ok); border-color: var(--overlay-ok); color: var(--board); }
.table-note:empty { display: none; }


/* the speaker's size, and how far they stand above the band */
.vn-stage { --face: clamp(220px, 23vw, 320px); --rise: 58px; --edge: color-mix(in srgb, var(--overlay-ok) 60%, var(--board)); }
/* buttons look like buttons: filled, with an edge below that gives way when pressed */
.vn-story .btn, .vn-term .btn { background: var(--board-2); color: var(--board-text); border: 1px solid var(--board-line); border-radius: 7px; font-weight: 700; box-shadow: 0 3px 0 var(--board); }
.vn-story .btn.primary { background: var(--overlay-ok); border-color: var(--overlay-ok); color: var(--board); font-weight: 800; box-shadow: 0 3px 0 var(--edge); }
.vn-story .btn:active, .vn-term .btn:active, .play-options-row .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.vn-story .btn kbd { margin-left: 8px; }

/* who speaks, and what they ask: a band across the bottom of the screen, from edge to edge, as a visual
   novel has it. It lets the picture through: the board's colour at 76 %, with its text a little lighter
   than elsewhere, which keeps the contrast above 4.5:1 even on a white picture. In it only who speaks, what
   they say or ask, and the choices. The speaker stands at its left, taller than the band: head and
   shoulders above its edge. It stays where it is (the screen does not scroll); a long text scrolls in it. */
.vn-talk { grid-row: 2; position: relative; margin-left: calc(-1 * var(--pad)); }
.vn-talk[hidden] { display: none; }
.vn-speaker { position: absolute; left: max(var(--pad), 12px); bottom: 0; width: var(--face); height: calc(100% + var(--rise)); margin: 0; z-index: 1; pointer-events: none; }
.vn-talk.telling .vn-speaker { display: none; }
.vn-speaker img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--board) 80%, transparent)); animation: vn-breathe 5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.vn-speaker.self { opacity: .8; }
@keyframes vn-breathe { from { transform: scale(1); } to { transform: scale(1.015); } }
.vn-box {
  --board-muted: #c8d5ec; --talk-accent: #8fe3e7;
  background: color-mix(in srgb, var(--board) 76%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 3px solid var(--overlay-ok); display: grid; gap: 8px; align-content: start; min-height: clamp(140px, 22vh, 220px);
  max-height: 48dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px max(var(--pad), 20px) 14px calc(max(var(--pad), 12px) + var(--face) + 18px);
}
.vn-talk.telling .vn-box { padding-left: max(var(--pad), 20px); }
.vn-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.vn-name strong { font-size: 1.1rem; font-weight: 800; }
.vn-name span { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--talk-accent); }
.vn-count:empty { display: none; }
/* what happened, a line at a time; its words come in one after the other */
.vn-story { display: grid; gap: 12px; justify-items: start; }
.vn-story[hidden] { display: none; }
.vn-line { font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.4; font-weight: 500; max-width: 60ch; text-wrap: pretty; }
.vn-line.k-wrong, .vn-line.k-violation, .vn-line.k-cut { border-left: 4px solid var(--board-warn); padding-left: 12px; }
.vn-story .btn { font-size: 1rem; padding: 9px 20px; }
.w { animation: vn-word .22s ease-out both; }
@keyframes vn-word { from { opacity: 0; } }
/* what is asked, in full; the decisions that wait are dots to press, below it */
.vn-decisions.play-keyed { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.vn-decisions[hidden] { display: none; }
.play-decision { display: grid; gap: 10px; flex: 1 1 100%; order: 1; animation: vn-say .28s ease-out; }
.play-decision.waiting { flex: 0 0 auto; order: 2; animation: none; }
.vn-decisions h5, .vn-decisions p { margin: 0; }
.vn-decisions h5 { font-size: clamp(1.15rem, 2.1vw, 1.4rem); font-weight: 700; line-height: 1.25; text-wrap: balance; }
.vn-decisions .text { font-size: 1rem; color: var(--board-muted); max-width: 70ch; }
.vn-decisions .hint { font-size: .8rem; color: var(--board-muted); }
/* the choices: filled buttons in the stage's own colour */
.play-options-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; padding-bottom: 4px; }
.play-options-row .btn { display: flex; align-items: baseline; gap: 10px; text-align: left; justify-content: flex-start; white-space: normal; font-size: 1.02rem; font-weight: 800; padding: 12px 16px; background: var(--overlay-ok); color: var(--board); border: 0; border-radius: 8px; box-shadow: 0 4px 0 var(--edge); }
.play-options-row .btn kbd { background: var(--board); color: var(--board-text); border-color: var(--board); }
.play-options-row .btn small { font-weight: 600; color: inherit; }
/* a decision that is a number: a slider between its ends, what it stands at, and the button that takes it */
.play-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 760px; }
.play-scale label { font-size: 1.02rem; font-weight: 800; }
.play-scale input[type="range"] { flex: 1 1 200px; min-width: 160px; width: auto; height: 28px; accent-color: var(--overlay-ok); cursor: pointer; }
.play-scale input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.play-scale-end { font-size: .8rem; color: var(--board-muted); white-space: nowrap; }
.play-scale output { min-width: 4.6em; text-align: center; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 6px; background: var(--board-2); border: 1px solid var(--board-line); }
.play-scale .btn { font-size: 1.02rem; font-weight: 800; padding: 10px 18px; background: var(--overlay-ok); color: var(--board); border: 0; border-radius: 8px; box-shadow: 0 4px 0 var(--edge); }
.play-scale .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.play-scale .btn kbd { background: var(--board); color: var(--board-text); border-color: var(--board); }
@media (prefers-reduced-motion: reduce) { .play-scale .btn:active { transform: none; } }
.play-options { margin: 0; padding-left: 1.2em; font-size: .9rem; }
.play-next { all: unset; box-sizing: border-box; display: grid; place-items: center; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; background: var(--board-2); border: 1px solid var(--board-line); }
.play-next::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--overlay-ok); }
.play-next:focus-visible, .play-why:focus-visible, .term:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.play-why { all: unset; cursor: pointer; color: var(--talk-accent, var(--overlay-ok)); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* a railway term in a text: tap it to read what it is */
.term { all: unset; cursor: help; color: inherit; text-decoration: underline dotted var(--overlay-ok); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.term.on { background: var(--board-2); box-shadow: 0 0 0 3px var(--board-2); border-radius: 2px; }
.vn-term { border-left: 4px solid var(--overlay-ok); background: var(--board-2); border-radius: 0 4px 4px 0; padding: 8px 12px 10px; display: grid; gap: 4px; justify-items: start; max-width: 70ch; font-size: .95rem; animation: vn-say .2s ease-out; }
.vn-term[hidden] { display: none; }
.vn-term p { margin: 0; }
.vn-term .btn { background: var(--board); }
/* (it slides in and does not fade: a text that fades in has no contrast for a moment) */
@keyframes vn-say { from { transform: translateY(10px); } }
/* a decision with a deadline: its time runs out as a bar */
.vn-countdown { height: 6px; border-radius: 3px; background: var(--board-2); overflow: hidden; max-width: 420px; }
.vn-countdown i { display: block; height: 100%; background: var(--overlay-ok); transition: width .25s linear; }
.vn-countdown.low i { background: var(--board-warn); }
/* little time left: the box says so */
.vn-box:has(.vn-countdown.low) { border-top-color: var(--board-warn); animation: vn-hurry .8s ease-in-out infinite alternate; }
@keyframes vn-hurry { to { box-shadow: inset 0 5px 0 var(--board-warn); } }
@media (prefers-reduced-motion: reduce) { .vn-box:has(.vn-countdown.low) { animation: none; } }
/* a narrower screen: the text needs the band's width, and the speaker stands on its edge */
@media (max-width: 999px) {
  .vn-stage { --face: 132px; }
  .vn-speaker { bottom: calc(100% - 14px); height: auto; aspect-ratio: 3 / 4; }
  .vn-box { padding-left: max(var(--pad), 20px); }
}
@media (max-width: 640px) {
  .vn-stage { --face: 96px; }
  #play:not([hidden]) { --rail: 46px; }
  .rail-btn, .play-tabs [role="tab"] { width: 36px; height: 36px; }
  .vn-box { padding: 16px 14px 14px; min-height: 0; }
  /* (the line at the top may take two lines here, so that it stays readable) */
  .play-hud { flex-wrap: wrap; white-space: normal; padding-inline: 8px; gap: 2px 12px; }
  .play-hud .vn-gauges { flex-wrap: wrap; }
  .vn-gauges { flex-wrap: wrap; justify-content: center; gap: 2px 12px; }
  .play-hud > *, .vn-gauges > div { white-space: normal; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .w, .play-decision, .lv-card, .vn-term, .vn-speaker img, .vn-gauges > .bump dd, .rail-panel, .play-toast { animation: none; }
  .vn-story .btn:active, .vn-term .btn:active, .play-options-row .btn:active { transform: none; }
}

/* only the picture (H): the game's interface out of the way (the stage's windows, the panel and the timetable, are in the seats) */
body.bare .play-hud, body.bare .play-seats, body.bare .play-rail, body.bare .play-toast { visibility: hidden; }
.bare-back { position: fixed; right: 14px; bottom: 14px; z-index: 5; }

/* a phase begins: its name over the whole screen for a moment */
.vn-chapter { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: var(--board); color: var(--board-text); animation: vn-chapter 2.3s ease forwards; }
.vn-chapter .over { font-family: var(--mono); font-size: .9rem; letter-spacing: .2em; text-transform: uppercase; color: var(--overlay-ok); }
.vn-chapter .title { font-size: clamp(2rem, 6vw, 4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-wrap: balance; }
.vn-chapter .title::after { content: ""; display: block; width: 90px; height: 4px; margin: 18px auto 0; background: var(--overlay-ok); }
.vn-chapter .under { color: var(--board-muted); font-size: 1.1rem; }
@keyframes vn-chapter { 0% { opacity: 0; } 12% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vn-chapter { display: none; } }

/* ------------------------------------------------------------------ the numbers: dialogs, for who wants them */
.play-dialog { width: min(1080px, calc(100vw - 24px)); max-height: calc(100vh - 32px); margin: auto; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); overflow-y: auto; }
.play-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.play-dialog::backdrop { background: color-mix(in srgb, var(--board) 72%, transparent); }
.play-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -16px; z-index: 2; background: var(--surface-2); padding-block: 6px; }
.play-dialog-head h2, .play-dialog-head h3 { font-size: 1.25rem; font-weight: 800; }
.play-dialog .game-card > h3 { font-size: 1.05rem; }
.play-dialog .game-card > h4 { font-size: 1.05rem; margin-bottom: 8px; }
.play-dialog.play-flows { width: min(640px, calc(100vw - 24px)); }
.play-tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.play-keyed { display: grid; gap: 10px; }
.play-move { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.play-move fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.play-move legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.play-move [aria-disabled="true"], .play-move .primary[aria-disabled="true"] { background: var(--surface-2); border: 1px dashed var(--line); color: var(--text-2); cursor: not-allowed; }
.play-refused { color: var(--danger); font-size: .88rem; font-weight: 600; }


/* messages and flows: lists that scroll in their frame */
.play-scroll { max-height: 280px; overflow-y: auto; }
.play-scroll ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .86rem; }
.play-log li { font-variant-numeric: tabular-nums; }
.play-log li.k-violation { color: var(--danger); font-weight: 600; }
.play-log li.k-end { font-weight: 600; }
.play-counts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .86rem; }
.play-flows .play-scroll { max-height: 560px; }
.play-flows li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.play-flows .when { font-family: var(--mono); font-size: .8rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.play-flows .who, .play-flows .what { grid-column: 1 / -1; overflow-wrap: anywhere; }
.play-flows .what { color: var(--text-2); }

/* ------------------------------------------------------------------ 3: the result: a verdict on the picture; the report is a dialog */
.play-result:not([hidden]) { min-height: calc(100vh - 62px); display: grid; padding: 14px clamp(12px, 3vw, 32px) 22px; }
.vn-verdict { display: grid; place-items: end start; }
.vn-verdict-box { background: var(--board); border: 1px solid var(--board-line); border-top: 4px solid var(--overlay-ok); border-radius: 6px; padding: 20px 24px; display: grid; gap: 12px; max-width: min(100%, 720px); animation: vn-say .35s ease-out; }
.vn-verdict.failed .vn-verdict-box { border-top-color: var(--board-warn); }
.vn-over { font-family: var(--mono); font-size: .86rem; letter-spacing: .18em; text-transform: uppercase; color: var(--overlay-ok); }
.vn-verdict.failed .vn-over { color: var(--board-warn); }
.vn-verdict h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 800; letter-spacing: -.015em; }
.vn-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.vn-score .stars { font-size: clamp(2rem, 5vw, 3rem); flex-basis: 100%; }
.vn-score .score-total { font-size: clamp(3.2rem, 8vw, 5rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.vn-score .of { color: var(--board-muted); }
.stars.pop b { display: inline-block; font-weight: inherit; animation: vn-star .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes vn-star { from { opacity: 0; transform: scale(2.6) rotate(-30deg); } }
@media (prefers-reduced-motion: reduce) { .stars.pop b { animation: none; } }
.vn-gained { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vn-gained li { border: 1px solid var(--board-warn); border-radius: 999px; padding: 2px 12px; font-size: .86rem; background: var(--board-2); }
.vn-cast { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.vn-cast li { display: grid; grid-template-columns: 38px auto; column-gap: 8px; align-items: center; border: 1px solid var(--board-line); border-left: 4px solid var(--overlay-ok); border-radius: 4px; padding: 4px 12px 4px 4px; background: var(--board-2); }
.vn-cast li.bad { border-left-color: var(--board-warn); }
.vn-cast .face { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--board); }
.vn-cast .name { font-size: .84rem; font-weight: 700; line-height: 1.2; }
.vn-cast .pts { font-size: .78rem; color: var(--board-muted); }
.vn-question { color: var(--board-muted); max-width: 62ch; }
.play-result-seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; }
.play-report .game-card > h4 { font-size: .95rem; margin-top: 14px; }
.play-debrief { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
/* what led to what: a time line per fault, its stretches in the colour of whose they were */
.play-chain { display: grid; gap: 10px; }
.play-chain .play-chain-phase { margin-top: 6px; }
.play-keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; }
.play-keys li { display: flex; align-items: center; gap: 6px; }
.play-chain .key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none; }
.play-thread { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.play-thread h4 { font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.play-line { position: relative; height: 18px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.play-line i { position: absolute; top: 0; bottom: 0; min-width: 2px; box-shadow: inset -1px 0 0 var(--surface); }
.play-line-ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .74rem; color: var(--text-2); margin-top: -4px; }
.play-chain .by-seat-0 { background: var(--accent); }
.play-chain .by-seat-1 { background: var(--warn); }
.play-chain .by-seat-2 { background: var(--danger); }
.play-chain .by-seat-3 { background: var(--board-line); }
.play-chain .by-road { background: repeating-linear-gradient(135deg, var(--text-2) 0 4px, transparent 4px 8px); }
.play-chain .by-team { background: var(--text-2); }
.play-chain .by-others { background: var(--board); }
.play-chain .held, .play-chain .by-none { background: none; border: 1px dashed var(--text-2); box-shadow: none; }
.play-stretches { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .9rem; }
.play-stretches li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0 8px; align-items: baseline; }
.play-stretches .when { font-family: var(--mono); font-size: .8rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.play-stretches .key { align-self: center; }
.play-stretches em { font-style: normal; font-weight: 600; }
.play-effects-title { font-weight: 600; margin-top: 4px; }
.play-effects { margin: 0; padding-left: 1.2em; font-size: .9rem; }
@media (forced-colors: active) { .play-line i, .play-chain .key { forced-color-adjust: none; } }
@media (forced-colors: active) { .play-progress i, .score-parts .meter i { forced-color-adjust: none; background: CanvasText; } }

