/* Campfire Control Room (control.html): live control, the practice table and the OBS dock.
   Built on css/dash.css (its colours, fonts and parts: .card .btn .field .switch .seg .tabs .table .pill .stat .banner).
   This file only adds what the Control Room needs on top: the status card, the two-column layouts, the game preview,
   the test chat, and the dock's narrow single column. The game canvas is the one thing here drawn in the game's style. */
body.cr { --well: #12141a; }
body.cr.booting .cr-page { display: none; }   /* nothing shows until the frame is in place (js/control.js) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 60; background: var(--accent); color: var(--accent-ink) !important; padding: 8px 12px; font-weight: 700; border-radius: 6px; }
.skip:focus { top: 8px; }
body[data-role=remote] .local-only { display: none !important; }
body:not([data-role=remote]) .remote-only { display: none !important; }
body.cr fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
body.cr dl, body.cr dd { margin: 0; }
body.cr b { font-weight: 600; }

/* ---------- the page */
.cr-page { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
body.cr .main { gap: 14px; padding-top: 18px; }
body.cr .pagehead h1 { font-size: 22px; }
/* without the sidebar (the OBS dock, or a narrow window) the page is one bare column with its own small title bar */
.dockbar { display: none; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.dockbar b { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; }
.dockbar > span { color: var(--dim); font-size: 14px; }
.docklinks { margin-left: auto; display: flex; gap: 12px; font-size: 13.5px; }
.docklinks a { color: var(--dim) !important; } .docklinks a:hover { color: var(--text) !important; }
body.cr.dock .cr-page { padding: 12px; max-width: 760px; margin: 0 auto; }
body.cr.dock .dockbar { display: flex; }
@media (max-width: 720px) {
  body.cr .side, body.cr .pagehead { display: none; }
  body.cr .dockbar { display: flex; }
  body.cr .main { padding: 10px 10px 70px; }
  body.cr.dock .cr-page { padding: 10px 10px 70px; }
}

#errors { color: var(--bad); font: 12px/1.3 var(--mono); white-space: pre-wrap; }
#errors:empty { display: none; }

/* feedback for the last thing done: pinned to the bottom so it never pushes the controls around */
.flash { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: max-content; max-width: min(560px, calc(100vw - 24px));
  background: var(--raised); border: 1px solid var(--line2); border-left: 4px solid var(--good); border-radius: 6px; padding: 9px 14px; box-shadow: 0 8px 24px #0009; font-weight: 600; }
.flash:empty { display: none; }
body.cr .toasts { bottom: 74px; }   /* (the frame's toasts sit above the flash line, not on top of it) */
.flash.warn { border-left-color: var(--warn); color: #f6dfb0; }

/* ---------- what is happening: one big line, the alerts, the two hurry buttons, then the small lights.
   The left edge says the state at a glance: green camp, orange fight, blue rewards, red paused. */
body.cr .nowcard { gap: 10px; padding: 14px 18px; border-left: 4px solid var(--line2); }
body.cr .nowcard[data-state=camp] { border-left-color: var(--good); }
body.cr .nowcard[data-state=fight] { border-left-color: var(--accent); }
body.cr .nowcard[data-state=outro] { border-left-color: var(--info); }
body.cr .nowcard[data-state=paused] { border-left-color: var(--bad); }
.nowmain { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.nowtext { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nowmode { font-size: 24px; font-weight: 700; line-height: 1.2; }
.nowcard[data-state=paused] .nowmode { color: #ff9d94; }
.nowsub { color: var(--dim); font-size: 15.5px; overflow-wrap: anywhere; }
.nowsub:empty { display: none; }
body.cr fieldset.nowbtns { display: flex; flex-direction: row; gap: 8px; flex: 0 1 auto; }
.nowbtns .btn { min-height: 48px; min-width: 172px; font-size: 15.5px; }
.nowalert { display: flex; flex-direction: column; gap: 6px; }
.nowalert .al { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--warn); background: #e8b04a14; color: #f3d9a4; font-weight: 600; }
.nowalert .al.bad { border-color: var(--bad); background: #ef6a5e14; color: #ffc9c2; }
.nowalert .al.info { border-color: var(--info); background: #6aa7f514; color: #cfe2ff; }
.lights { display: flex; flex-wrap: wrap; gap: 6px 28px; padding-top: 10px; border-top: 1px solid var(--line); }
.lights > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lights dt { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lights dd { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.lights .pill { font-size: 13px; padding: 2px 10px; }
.lights .pill.good::before, .lights .pill.bad::before, .lights .pill.warn::before, .nolive .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
/* live control: the card stays in view while scrolling a long tab, so Pause is never more than one click away */
@media (min-width: 721px) and (min-height: 760px) {
  body[data-role=remote] .nowcard { position: sticky; top: 0; z-index: 5; box-shadow: 0 6px 18px #000a; }
}

/* live control with no overlay answering */
.nolive { border-color: #7a3a35; background: #ef6a5e0d; padding: 20px 22px; gap: 10px; align-items: flex-start; }
body.cr .nolive > h2 { font-size: 20px; }
body.cr .nolive.waiting { border-color: #7a5a1c; background: #e8b04a0a; }
.nolive p { color: var(--dim); max-width: 68ch; }
.nolive .row { margin-top: 4px; }
body.offline fieldset.needs:disabled { opacity: 0.55; }

/* ---------- layout: practice = game on the left with the chat under it, controls on the right;
              live = controls on the left, chat on the right */
.layout { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr) clamp(400px, 32%, 560px); }
.aside { grid-column: 1; grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
.deck { grid-column: 2; grid-row: 1; min-width: 0; container: deck / inline-size; display: flex; flex-direction: column; gap: 14px; }
body[data-role=remote] .layout { grid-template-columns: minmax(0, 1fr) clamp(320px, 24%, 520px); }
body[data-role=remote] .deck { grid-column: 1; } body[data-role=remote] .aside { grid-column: 2; }
.under { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@container (min-width: 860px) { .under { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); align-items: start; } }
@media (max-width: 1100px) {
  .layout, body[data-role=remote] .layout { grid-template-columns: minmax(0, 1fr); }
  .aside, .deck, body[data-role=remote] .deck, body[data-role=remote] .aside { grid-column: 1; grid-row: auto; }
  .aside { order: 1; } .deck { order: 2; }
  body[data-role=remote] .deck { order: 1; } body[data-role=remote] .aside { order: 2; }
}
@media (min-width: 1101px) and (min-height: 900px) { body:not([data-role=remote]) .aside { position: sticky; top: 12px; } }

/* ---------- the game preview */
.stage { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.screen { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #050507; border: 1px solid var(--line); border-radius: var(--r); }
.screen.checker { background: repeating-conic-gradient(#2c313b 0 25%, #1f232b 0 50%) 0 0 / 24px 24px; }
.screen canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#gameplayStandIn { display: none; }
body[data-layout=frame] #gameplayStandIn { display: flex; position: absolute; left: 0; top: 0; width: 80%; height: 80%; align-items: center; justify-content: center;
  background: #191c22; color: var(--faint); font: 600 clamp(12px, 1.5vw, 20px)/1 var(--font); letter-spacing: 0.22em; text-transform: uppercase; pointer-events: none; }
.screen.checker #gameplayStandIn { opacity: 0.55; }
body[data-layout=tall] .screen { aspect-ratio: 360 / 1000; width: auto; height: calc(100vh - 220px); min-height: 520px; }
body[data-layout=wide] .screen { background: linear-gradient(180deg, #9fade8 0%, #61536d 55%, #453d4f 56%, #251613 100%); }
.stagebar { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; justify-content: space-between; color: var(--dim); font-size: 13.5px; }
.stagebar b { color: var(--text); }

/* ---------- this stream so far (live control): read-only numbers at the top of the side column, beside every tab.
   Four numbers, the MVP, the fights in order, then first kills, deaths and new heroes. */
.tnbody { display: flex; flex-direction: column; gap: 12px; }
.tnnums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tnnums > div { background: var(--raised); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column-reverse; justify-content: flex-end; min-width: 0; }
.tnnums dd { font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tnnums dt { font-size: 12.5px; color: var(--dim); }
.tnnums .bad dd { color: #ff9d94; }
@container (min-width: 460px) { .tnnums { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tnmvp { color: var(--dim); } .tnmvp b { color: var(--text); }
.tnfights { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.tnfights li { width: 36px; height: 36px; border-radius: 6px; background: var(--raised); border-bottom: 3px solid var(--line2); display: grid; place-items: center; font-size: 13px; color: var(--dim); }
.tnfights li.w { border-bottom-color: var(--good); } .tnfights li.l { border-bottom-color: var(--bad); } .tnfights li.x { opacity: 0.55; }
.tnfeed { margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tnfeed li { padding-left: 15px; position: relative; overflow-wrap: anywhere; }
.tnfeed li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 2px; background: var(--line2); }
.tnfeed li.k::before { background: var(--accent); } .tnfeed li.d::before { background: var(--bad); } .tnfeed li.j::before { background: var(--good); }
.lights .linkbtn { font-size: 14.5px; color: var(--text); text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.lights .linkbtn:hover { color: var(--accent); text-decoration-color: currentColor; }
/* the boss's health during a fight, under the big line */
.hpbar { height: 8px; max-width: 420px; margin-top: 6px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.hpbar > i { display: block; height: 100%; background: var(--bad); border-radius: inherit; transition: width 0.4s; }

/* ---------- tabs and panels */
.deck .tabs { flex-wrap: nowrap; }
.deck .tabs button { padding: 10px 9px; font-size: 14px; white-space: nowrap; }
@container (min-width: 470px) { .deck .tabs button { padding: 10px 13px; font-size: 14.5px; } }
@container (max-width: 470px) {
  .deck .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-bottom: 0; }
  .deck .tabs button { margin: 0; padding: 9px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
  .deck .tabs button[aria-selected=true] { border-color: var(--accent); background: var(--raised); }
}
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* a wide deck (live control on a big monitor) lays each tab's cards side by side instead of stretching them */
@container deck (min-width: 1080px) {
  .panel:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); align-items: start; }
  .panel > fieldset.needs { display: contents; }
  .panel > .pad, .panel > details, .panel > p { grid-column: 1 / -1; }
  #p-players:not([hidden]) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } #p-players .herocard { grid-column: 2; grid-row: 1 / span 2; }
  .panel > ol.steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); align-items: start; }
  /* Now: the things to do on the left, the settings on the right */
  #p-now:not([hidden]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #p-now > fieldset.needs:first-of-type { display: flex; grid-column: 1; grid-row: 1 / span 2; }
  #p-now > section.card, #p-now > #speedBox { grid-column: 2; }
}
@container deck (min-width: 1600px) {   /* 2560 wide: fight, column and settings side by side */
  #p-now:not([hidden]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #p-now > fieldset.needs:first-of-type { display: contents; }
  #p-now > section.card, #p-now > #speedBox { grid-column: 3; grid-row: 1 / span 2; }
}
/* Players from a mid-size deck up: the gift box sits beside the list, so picking a hero never means scrolling to it */
@container deck (min-width: 760px) {
  #p-players:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); align-items: start; }
  #p-players > fieldset.needs { display: contents; }
  #p-players .herocard { grid-column: 2; grid-row: 1 / span 2; }
  #p-players .herocard .fields { grid-template-columns: minmax(0, 1fr); }
}
.panel:focus-visible { outline-offset: 4px; }
fieldset.needs { display: flex; flex-direction: column; gap: 14px; }
body.cr .card { padding: 14px 16px; }
body.cr .card > h2, .cardhead h2 { font-size: 16px; }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.more { font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; } .more:hover { text-decoration: underline; }
.pad { padding: 0 2px; }
.linkbtn { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* ---------- controls */
body.cr .btn { line-height: 1.15; min-height: 36px; white-space: normal; text-align: center; justify-content: center; }
.btn.solid { background: #c94a3e; border-color: #c94a3e; color: #fff; }
.btn.solid:hover:not(:disabled) { border-color: #fff; }
fieldset:disabled .btn, fieldset:disabled .seg button { opacity: 0.45; cursor: not-allowed; }
.seg button:disabled { cursor: not-allowed; }
/* the fight box: only what works now. Anything that cannot be taken back sits below a line, apart from the rest */
.fightbox { display: flex; flex-direction: column; gap: 12px; }
.apart { padding-top: 12px; border-top: 1px dashed var(--line2); }
.grudge { padding: 8px 10px; border-radius: 6px; background: var(--raised); }
.grudge .help { color: var(--text); flex: 1 1 200px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline > select, .inline > input[type=text] { flex: 1 1 140px; width: auto !important; }
.inline.end { justify-content: flex-end; } .inline.end .help { margin-right: auto; }
body.cr input[type=file] { width: 100%; color: var(--dim); font: inherit; }
body.cr input[type=file]::file-selector-button { font: 600 14px/1 var(--font); color: var(--text); background: var(--raised); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 12px; margin-right: 10px; cursor: pointer; }
body.cr textarea.code { font: 12.5px/1.4 var(--mono); word-break: break-all; min-height: 0; }
body.cr select[size] { padding: 3px; height: auto; }
body.cr select[size] option { padding: 4px 7px; border-radius: 4px; }
body.cr select[size] option:checked { background: var(--accent) linear-gradient(var(--accent), var(--accent)); color: var(--accent-ink); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin: 0; }
.switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; }
.switch [data-onoff] { color: var(--dim); min-width: 24px; font-weight: 600; }

/* the confirm step that replaces a dangerous button */
.confirm { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #ef6a5e14; border: 1px solid #7a3a35; border-radius: 6px; padding: 7px 9px; }
.confirm-q { font-weight: 600; color: #ffc9c2; }

/* small facts: label over value */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.facts dt { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.facts dd { font-weight: 600; }
@container (max-width: 470px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* quick settings: one row each, the label on the left and the control on the right */
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; min-height: 38px; }
.qrow + .qrow { border-top: 1px solid var(--line); padding-top: 10px; }
.qrow > label, .qrow > .label { font-size: 14.5px; font-weight: 600; display: flex; flex-direction: column; min-width: 0; flex: 1 1 150px; }
.qrow .help { font-weight: 400; font-size: 13px; }
.qrow input[type=number] { width: 84px !important; text-align: right; }
.vol { display: flex; align-items: center; gap: 8px; flex: 0 1 250px; min-width: 0; }
.vol input[type=number] { width: 70px !important; }
.unit { color: var(--dim); font-size: 13.5px; }

/* ---------- players */
/* a long camp scrolls inside its card, header pinned, so the gift box below stays close */
.tablewrap { overflow: auto; max-height: min(62vh, 640px); }
.roster thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.rostercard .cardhead input[type=search] { width: 220px; flex: 0 1 220px; }
.roster td { white-space: nowrap; }
.roster td.name { white-space: normal; overflow-wrap: break-word; }
.roster tbody tr { cursor: pointer; }
.roster tbody tr.sel td { background: #f2a23a1a; }
.roster tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.roster input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; vertical-align: -3px; }
.roster .name { font-weight: 600; }
.roster td.num::before { content: none; }
body.cr .empty { padding: 20px 14px; }
body.cr fieldset.card { border: 1px solid var(--line); }
body.cr .herocard.none { background: none; border: 1px dashed var(--line2); }
.herocard.none > h2 { color: var(--dim); font-weight: 400; font-size: 14.5px; }
.herocard.none .herobody { display: none; }
.herobody { display: flex; flex-direction: column; gap: 12px; }
/* in a narrow dock each hero is a two-line card: pick, name, level, gold / class, mode, status */
@container (max-width: 520px) {
  .roster, .roster tbody { display: block; }
  .roster thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .roster tbody tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; grid-template-areas: "pick name lvl gold" "pick cls status status"; gap: 2px 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .roster tbody tr:last-child { border-bottom: 0; }
  .roster td { padding: 0; border: 0; white-space: normal; }
  .roster td:nth-child(1) { grid-area: pick; } .roster td:nth-child(2) { grid-area: name; } .roster td:nth-child(3) { grid-area: cls; color: var(--dim); }
  .roster td:nth-child(4) { grid-area: lvl; } .roster td:nth-child(5) { grid-area: gold; } .roster td:nth-child(6) { grid-area: status; text-align: right; }
  .rostercard .cardhead input[type=search] { width: 100%; flex: 1 1 100%; }
  .roster td.num::before { content: attr(data-l) " "; color: var(--faint); font-size: 12px; }
  .roster tbody tr td, .roster tbody tr:hover td, .roster tbody tr.sel td { background: none; box-shadow: none; }
  .roster tbody tr.sel { background: #f2a23a1a; box-shadow: inset 3px 0 0 var(--accent); }
}

/* ---------- saves and OBS setup */
.dangerzone { border-color: #7a3a35; }
.dangerzone > h2 { color: #ffb3aa; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.steps > li { counter-increment: step; }
.steps > li > h2 { display: flex; align-items: center; gap: 10px; }
.steps > li > h2::before { content: counter(step); flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--raised); border: 1px solid var(--line2); color: var(--accent); font-size: 13px; font-weight: 700; }
.copyrow { display: flex; gap: 8px; align-items: stretch; } .copyrow textarea { flex: 1 1 auto; } .copyrow .btn { flex: none; }
@container (max-width: 520px) { .copyrow { flex-direction: column; } }
#keyBox { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
details.adv { border: 1px dashed var(--line2); border-radius: var(--r); padding: 12px 16px; }
details.adv[open] { display: flex; flex-direction: column; gap: 12px; }
details.adv > summary { cursor: pointer; font-weight: 600; color: var(--dim); }
details.adv > summary:hover { color: var(--text); }

/* ---------- test chat and bots */
.chat > summary, .bots > summary { display: flex; align-items: baseline; gap: 2px 12px; list-style: none; cursor: pointer; }
.chat > summary .help, .bots > summary .help { flex: 1 1 0; min-width: 0; }
.chat > summary h2, .bots > summary h2 { white-space: nowrap; }
.chat > summary::-webkit-details-marker, .bots > summary::-webkit-details-marker { display: none; }
.chat > summary h2, .bots > summary h2 { font-size: 16px; }
body[data-role=remote] .chat > summary::after, body[data-role=remote] .bots > summary::after { content: "Show"; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--dim); border: 1px solid var(--line2); border-radius: 99px; padding: 1px 10px; }
body[data-role=remote] .chat[open] > summary::after, body[data-role=remote] .bots[open] > summary::after { content: "Hide"; }
body:not([data-role=remote]) .chat > summary, body:not([data-role=remote]) .bots > summary { cursor: default; pointer-events: none; }
.chat, .bots { container-type: inline-size; }
body.cr details.card { display: block; }   /* older OBS browsers do not lay a <details> out as a flex column */
.chat[open] > summary, .bots[open] > summary { margin-bottom: 12px; }
.bots fieldset.needs { gap: 12px; }
.chatgrid { gap: 12px !important; }
.chatsend { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@container (min-width: 600px) { .chatgrid { display: grid !important; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; } .chatgrid #log { height: auto; min-height: 150px; max-height: 230px; } }
#log { height: 150px; overflow-y: auto; background: var(--well); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 14px; line-height: 1.4; display: flex; flex-direction: column; gap: 2px; }
.msg.bot { opacity: 0.75; } .msg.sys { color: var(--dim); font-style: italic; }
.msg.tw b::after { content: " (Twitch)"; color: var(--dim); font-weight: 400; font-size: 12px; }
#chatForm { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
#chatForm .field { flex: 1 1 84px; } #chatForm .field.grow { flex: 2.2 1 130px; }
#chatForm .btn { min-height: 38px; }
.chips, .quick { display: flex; flex-wrap: wrap; gap: 5px; }
.chips:empty { display: none; }
.chips button { font: 600 13px var(--font); color: var(--text); background: var(--well); border: 1px solid var(--line2); border-radius: 99px; padding: 2px 10px; cursor: pointer; }
.chips button.on { background: var(--raised); }
.quick button { font: 12px var(--mono); color: var(--dim); background: var(--raised); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; cursor: pointer; }
.quick button:hover, .chips button:hover { border-color: var(--dim); color: var(--text); }
fieldset:disabled .quick button, fieldset:disabled .chips button { cursor: not-allowed; }

.crfoot { color: var(--faint); font-size: 13px; }
.crfoot a { color: var(--dim) !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- narrow windows and the dock: tighter cards, the status lights as a short list */
@media (max-width: 560px) {
  .cr-page { gap: 10px; }
  body.cr .card { padding: 12px; }
  body.cr .nowcard { padding: 12px; }
  .nowmode { font-size: 21px; } .nowsub { font-size: 15px; }
  body.cr fieldset.nowbtns { flex: 1 1 100%; } .nowbtns .btn { flex: 1 1 0; min-width: 0; min-height: 52px; }
  .lights { flex-direction: column; gap: 4px; }
  .lights > div { justify-content: space-between; min-height: 32px; }
  .nolive { padding: 14px; } body.cr .nolive > h2 { font-size: 17px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flash { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; }
  /* phone and dock legibility: captions 13px+, values and labels 15-16px, links and keys big enough to tap */
  .lights dt, .facts dt, .crfoot, .roster td.num::before { font-size: 13px; }
  .lights .pill { font-size: 14px; }
  .stfix { min-height: 40px; }
  .stagebar, .unit, .check, .more, .qrow .help { font-size: 15px; }
  .docklinks { font-size: 15px; gap: 4px 14px; flex-wrap: wrap; } .docklinks a { display: inline-flex; align-items: center; min-height: 44px; }
  .chips button { font-size: 14px; min-height: 40px; padding: 4px 12px; }
  .check { min-height: 44px; }
  body.cr .btn, #chatForm .btn { min-height: 44px; }
  .quick button { font-size: 14px; min-height: 40px; padding: 4px 10px; }   /* the practice table's command keys: 12px mono was 4px-high type in a dock */
}

/* ---------- web pass (UX review): the Testing fold on live control, the chat log card, the chat light's fix link,
              the practice table's "Bigger" view and a stand-in game scene where the gameplay goes */
details.testing { border-color: #7a5a1c; background: #e8b04a0a; }
details.testing > summary { display: flex; align-items: baseline; gap: 2px 12px; list-style: none; cursor: pointer; }
details.testing > summary::-webkit-details-marker { display: none; }
details.testing > summary h2 { font-size: 16px; color: var(--warn); white-space: nowrap; }
details.testing > summary .help { flex: 1 1 0; min-width: 0; }
details.testing > summary::after { content: "Show"; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--dim); border: 1px solid var(--line2); border-radius: 99px; padding: 1px 10px; }
details.testing[open] > summary::after { content: "Hide"; }
details.testing[open] > summary { margin-bottom: 12px; }
details.testing[open] { display: flex !important; flex-direction: column; gap: 14px; }
.testing .card { border: 0; padding: 0 !important; background: none; }
.testing .card + .card, .testing fieldset + .card { border-top: 1px solid var(--line); padding-top: 12px !important; border-radius: 0; }
body[data-role=remote] .testing .chat > summary, body[data-role=remote] .testing .bots > summary { pointer-events: none; }
body[data-role=remote] .testing .chat > summary::after, body[data-role=remote] .testing .bots > summary::after { content: none; }
.testing .chatgrid { display: flex !important; }
.chatlog #log { height: 170px; }
.stfix { font-size: 13.5px; }
body.bigstage:not([data-role=remote]) .layout { grid-template-columns: minmax(0, 1fr); }
body.bigstage:not([data-role=remote]) .aside, body.bigstage:not([data-role=remote]) .deck { grid-column: 1; grid-row: 1; position: static; }
body.bigstage:not([data-role=remote]) .deck { grid-row: 2; }
body[data-layout=frame] #gameplayStandIn { width: 100%; height: 100%; align-items: flex-start; justify-content: flex-start; padding: 1.2% 1.5%; color: #ffffff59; font-size: clamp(10px, 1.1vw, 15px);
  background: linear-gradient(#0008, #0008), url(../assets/bg/forest5.png), url(../assets/bg/forest4.png), url(../assets/bg/forest3.png), url(../assets/bg/forest2.png), url(../assets/bg/forest1.png);
  background-size: cover; background-position: center bottom; image-rendering: pixelated; filter: saturate(0.7); }
