/* The fight pages' styles, ONE home: Skirmish (one on one) and Party Skirmish both link it (moved here unchanged
   from skirmish.html on 2026-10-20 so the party page shares them, not a copy). */
/* Tactics only */
.side { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.side b { color: var(--ink); }
.fightbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.speed { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.speed input { width: min(160px, 40vw); accent-color: var(--series-a); }
/* every choice in ONE two-column grid (owner, 2026-10-18: keep everything "lined up under Attack"): the left column
   holds the kind (ATTACK, OTHER, MOVE) and the row names ("Strikes" as a subheading, then the feats that change one
   Strike), the right one the cells, so every row's cells start at the same edge */
.choices { display: grid; grid-template-columns: fit-content(11em) minmax(0, 1fr); gap: 2px 8px; align-items: center; margin: 6px 0; }
.choices .kind { display: contents; --kind: var(--series-b); }
.choices .kind.other { --kind: var(--series-d); }
.choices .kind.move { --kind: var(--series-a); }
/* the two sides as plates, side by side, and the turn line's action diamonds and attack-penalty track */
.plates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 6px 0; }
.plate { border: 1px solid var(--line); border-top: 3px solid var(--side); border-radius: 6px; padding: 5px 8px 6px; min-width: 0; }
.plate .pl-top { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; }
.plate .pl-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate .pl-top .num { font-family: var(--mono); white-space: nowrap; }
.plate .track { display: block; height: 7px; margin: 3px 0 4px; background: var(--field); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.plate .fill { display: block; height: 100%; background: var(--side); transition: width 0.25s; }
.plate .pl-stats { font: 500 11px var(--mono); color: var(--ink-2); line-height: 1.45; }
.plate .pl-stats span { white-space: nowrap; }
.plate .conds { margin-top: 4px; }
.pips { display: inline-flex; gap: 5px; margin: 0 8px 0 6px; vertical-align: middle; }
.pips .pip { width: 9px; height: 9px; transform: rotate(45deg); background: var(--side); border: 1.5px solid var(--side); border-radius: 1px; }
.pips .pip.used { background: transparent; opacity: 0.45; }
.pips .rpip { width: 9px; height: 9px; border-radius: 50%; background: var(--side); border: 1.5px solid var(--side); margin-left: 4px; }
.pips .rpip.used { background: transparent; opacity: 0.45; }
/* the turn controls on Party Skirmish: End turn, Delay, Undo move */
.turnbtns { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.maptrack { display: inline-flex; align-items: center; gap: 0; font: 600 11px var(--mono); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.maptrack span { padding: 0 5px; border: 1px solid var(--line); margin-left: -1px; }
.maptrack span:first-child { margin-left: 5px; border-radius: 3px 0 0 3px; }
.maptrack span:last-child { border-radius: 0 3px 3px 0; }
.maptrack span.on { background: #f4c26b; border-color: #c88a1c; color: #1b1b1b; }
.luck-now { margin-left: 10px; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: help; }
.luck-now b { display: inline-block; min-width: 2.2em; text-align: center; border-radius: 4px; padding: 0 4px; font: 600 13px var(--mono); }
.choices .space { grid-column: 1 / -1; height: 1px; }
.choices .ck, .choices .sub, .choices .rh { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choices .ck { font: 600 11px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--kind); align-self: start; padding-top: 4px; }
.choices .sub { font: 600 13px var(--sans); color: var(--ink); }
.choices .rh { font: 500 13px var(--sans); color: var(--ink-2); padding-left: 0.6em; }
/* the Strikes as a grid (owner, 2026-10-18: "they need a grid"): a weapon per column, headed beside ATTACK */
.wcells { display: grid; gap: 2px 4px; grid-template-columns: repeat(var(--wcols), minmax(3.4em, 5.2em)); }
.wcells .ch { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 11px var(--sans); color: var(--ink-2); align-self: end; }
/* a phone: weapon cells just wide enough for "-5 23%", so the names keep their room */
@media (max-width: 600px) {
  .choices { grid-template-columns: fit-content(8.5em) minmax(0, 1fr); gap: 2px 5px; }
  .wcells { grid-template-columns: repeat(var(--wcols), minmax(3.4em, 4.4em)); }
  .wcells button { padding: 2px 4px 2px 5px; }
}
/* the rest of a kind: equal cells that wrap */
.cflow { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr)); gap: 2px 4px; }
/* the spells, both pages (FightUI.spellBar): a tile per spell (the owner, 2026-10-21, approving the playtester's seven;
   Skirmish too, 2026-10-22). Every tile the
   same size, every line one line (cut, never wrapped), so arming one, its outline or a redraw moves nothing; the number
   key in a corner; cantrips one compact row; the rest folded under "more (N)" */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5em, 1fr)); gap: 3px 4px; }
/* two lines (the owner, 2026-10-22: the "x1" was "taking up an extra line"): the name, with the count as a small badge
   beside the actions; then the effect, with the coach's number */
.choices .tiles button.tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: repeat(2, 1.25em);
  align-items: baseline; gap: 0 6px; padding: 3px 18px 3px 6px; }
.tile > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tn { font-weight: 600; }
.tile .td, .tile .tp { text-align: right; font: 600 11px var(--mono); color: var(--ink-2); }
.tile .tl { font: 500 11px var(--mono); color: var(--muted); }
.tile .te { font-family: var(--sans); font-size: 12px; color: var(--ink-2); }
.tile .tk { position: absolute; top: 2px; right: 3px; font: 600 10px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; line-height: 1.3; }
.choices .tiles button.tile.cantrip { grid-template-rows: 1.25em; }
.choices .tiles button.tile.far { opacity: 0.6; }
.tiles .tile-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: 3px 4px; align-items: center; }
.tiles .tile-row .trh { grid-column: 1 / -1; font: 600 11px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.tiles .tile-more { grid-column: 1 / -1; }
.tiles .tile-more summary { cursor: pointer; font: 500 12px var(--sans); color: var(--muted); }
@media (hover: none) { .tile .tk { display: none; } }
@media (max-width: 600px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(7.6em, 1fr)); } }
/* the cast panel (the pick slot, armed): its switches and whom it catches, friendly fire in red */
.pick .sw { display: inline-flex; margin-right: 6px; vertical-align: baseline; }
.pick .sw button { margin: 0; padding: 0 7px; font: 600 12px var(--mono); border: 1px solid var(--line); background: var(--field); color: var(--ink-2); cursor: pointer; }
.pick .sw button + button { border-left: none; }
.pick .sw button:first-child { border-radius: 4px 0 0 4px; }
.pick .sw button:last-child { border-radius: 0 4px 4px 0; }
.pick .sw button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
/* line 1 one line, cut (its whole text on hover), so the switches on line 2 never fall below the slot's fold */
.pick .cp1, .pick .cp2 { display: block; }
.pick .cp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .ff { color: var(--bad); font-weight: 600; }
.choices button { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; min-width: 0; text-align: left; font: 500 13px var(--sans);
  border: 1px solid var(--line); border-left: 3px solid var(--kind); background: var(--field); color: var(--ink); border-radius: 4px; padding: 2px 6px; line-height: 1.25; cursor: pointer; }
.choices button .lb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* in the wrapping cells a long name takes a second line rather than being cut ("Double ...") */
.cflow button { align-items: center; }
.cflow button .lb { white-space: normal; line-height: 1.2; }
.choices button .nums { font: 600 11px var(--mono); color: var(--ink-2); white-space: nowrap; }
.choices button .nums small { color: var(--muted); margin-left: 5px; font: inherit; }
.choices button.best { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* a choice you cannot take now: greyed, its reason on hover (or in the coach line when tapped) */
.choices button.off { color: var(--muted); background: transparent; border-style: dashed; cursor: help; }
table.ref tr.crit td { font-weight: 600; color: var(--ink); }
table.ref tr.miss td { color: var(--muted); }
input.search { width: min(20em, 75vw); }
.hint-inline { color: var(--muted); font-size: 13px; }
/* the site keeps table text on one line (common.css th, td); here the action and the result may wrap, so the long
   ones ("Stride into reach (20 feet)", "crit success") stop pushing Dmg out of Workbench's narrow console */
#k-log td:nth-child(2), #k-log td:nth-child(4) { white-space: normal; }
#k-log td.roll { white-space: nowrap; }
#k-log td.roll b { font-weight: 700; }
/* the board (docs/grid_plan.md G2a): squares, the foe's reach shaded, tokens, your move choices as dots with their odds */
.board { margin: 10px 0 4px; max-width: 100%; overflow-x: auto; }
.board svg { display: block; touch-action: manipulation; }
.board .sq { fill: var(--field); stroke: var(--line); }
/* reach: yours green, its red (owner, 2026-10-18), so a square in both is in both */
.board { --reach-ours: #1f9d55; --reach-theirs: var(--bad); }
.board .reach-ours { fill: var(--reach-ours); fill-opacity: 0.16; }
.board .reach-theirs { fill: var(--reach-theirs); fill-opacity: 0.16; }
/* the board's key, folded behind "Key" until opened (FightUI.keyHtml; the owner, 2026-10-22: "fold away the text") */
.board-key { margin: 2px 0 0; }
.board-key > summary { cursor: pointer; font: 500 12px var(--sans); color: var(--muted); width: max-content; }
.reach-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); margin: 4px 0 0; }
.reach-key i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; opacity: 0.5; }
.reach-key i.key-prov { background: linear-gradient(135deg, var(--bad) 45%, transparent 46%); opacity: 0.8; }
.reach-key i.key-flank { background: var(--ink); border-radius: 50%; width: 8px; height: 8px; opacity: 0.8; }
.board .tok text { font: 600 12px var(--sans); fill: #fff; pointer-events: none; }
.board .tok text.small { font: 700 13px var(--sans); }      /* a phone's small token: no HP arc, a bolder label (the owner's option B) */
/* conditions on the board: badges (a code, the words on hover), a dashed red ring for off-guard, a tether for a grab */
.board .badge circle { fill: var(--ink); stroke: var(--card); stroke-width: 1.5; }
.board .badge text { font: 700 9px var(--sans) !important; fill: var(--card) !important; }
.board .offring { fill: none; stroke: var(--bad); stroke-width: 2.5; stroke-dasharray: 4 3; }
.board .tether { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; opacity: 0.55; }
/* the same conditions in words, under each HP bar */
.conds { display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 6px; }
.cond { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; background: var(--field); }
.cond b { font: 700 10px var(--sans); color: var(--ink); }
/* a sustained spell's condition that ends this turn unless its caster Sustains it, and the Sustain choice itself: red
   (the owner, 2026-10-22: "some sort of marker, like a highlight or shaded red"; FightUI.make's ending) */
.cond.ending { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--field)); color: var(--ink); }
.cond.ending b { color: var(--bad); }
.board .badge.ending circle { fill: var(--bad); }
.mplate .bd b.ending, .mplate .bd i.ending { background: var(--bad); }
.choices button.urgent { border-color: var(--bad); border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--field)); }
.count.init { margin: 8px 0 4px; font-size: 13px; }
.board .mark { cursor: pointer; }
.board .mark circle { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.board .mark.best circle { stroke-width: 3; }
.board .mark text { font: 500 10px var(--mono); fill: var(--ink); pointer-events: none; }
.feats { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; min-height: 36px; font-size: 14px; }
.feats label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
/* the end of a fight, announced (owner, 2026-10-18: "so we know the game is over") */
.over { margin: 8px 0; padding: 6px 0 6px 12px; border-left: 5px solid var(--ink); }
.over .big { font: 600 20px var(--sans); margin: 0 0 6px; color: var(--ink); }
.over.won { border-left-color: #1f9d55; }
.over.lost { border-left-color: var(--bad); }
.over p { margin: 0; color: var(--ink-2); }
/* the fight's review (Party Skirmish, end state E): your choices against the coach's */
.over .review { margin-top: 8px; font-size: 13px; }
.over .review ol, .over .review ul { margin: 4px 0 0; padding-left: 20px; color: var(--ink-2); }
.over .review p + p { margin-top: 4px; }
/* the fight's numbers and Rematch (end state F) */
.over .endstats { width: auto; margin: 8px 0 4px; font-size: 12px; }
.over .endstats th, .over .endstats td { padding: 3px 10px 3px 0; }
.over .rematch { margin-top: 6px; }
/* the fight's ratings: two tiles, deep red (0) through yellow to bright green (100) */
/* two tiles side by side, a short line each (owner, 2026-10-18: "two columns w/o as much verbiage"); the detail is the tile's tooltip */
.ratings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 4px; }
.rating { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; align-items: center; }
.rating .score { width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; font: 600 24px var(--mono); }
.rating .name { font: 600 14px var(--sans); color: var(--ink); }
.rating .why { font-size: 12px; color: var(--ink-2); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 0; font: 12px var(--mono); color: var(--muted); }
/* the battle area: one frame; on a wide screen it fits the window, the left side scrolls if it must, the log fills the right */
.battle { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); }
.battle .start { font-weight: 600; color: var(--ink); }
/* the pick slot stays while there are tiles to pick from, empty or not (so filling it moves nothing); it goes only
   with them, when nothing is yours to choose */
#k-choices:empty + #k-pick:empty, #k-choices:empty, #k-coach:empty { display: none; }
/* the coach line under the choices: small, it repeats every turn (owner, 2026-10-20: "even MORE compact") */
.battle #k-coach { font-size: 12px; margin-top: 2px; }
.now .when { font: 600 12px var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
@container (min-width: 820px) {
  .battle .arena-grid { height: clamp(560px, calc(100vh - 110px), 880px); }
  /* in Party Skirmish's fight mode the page above it folds away to one line, so the fight takes nearly the whole window
     (the owner, 2026-10-22: "just a bit taller") */
  .page.fighting .battle .arena-grid { height: clamp(560px, calc(100vh - 82px), 1100px); }
  .battle .arena-main { overflow-y: auto; min-height: 0; padding-right: 4px; }
  .battle .console { position: static; align-self: stretch; display: flex; flex-direction: column; min-height: 0; }
  .battle .console .tablebox { flex: 1 1 auto; max-height: none; min-height: 0; }
}
td.chip-score { font: 600 13px var(--mono); text-align: center; border-radius: 4px; }
/* your reaction: a question that pulses until you answer, so you know it is your move (owner: "the reactions need to
   blink"); steady, not pulsing, for readers who ask for less motion */
.pick.ask { border-color: var(--focus); animation: askpulse 1s ease-in-out infinite; }
@keyframes askpulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 6px var(--focus); } }
@media (prefers-reduced-motion: reduce) { .pick.ask { animation: none; box-shadow: 0 0 0 4px var(--focus); } }
.board .go { fill: transparent; cursor: pointer; }
.board .go:hover { stroke: var(--ink-2); stroke-width: 1.5; }
.board .picked { fill: none; stroke: var(--ink); stroke-width: 2.5; pointer-events: none; }
/* the pick line's slot (playtest 2026-10-21: every tile dropped 58 px when a spell's line filled it above them): below
   the tiles, one fixed height whatever it holds (a reaction's question, an aim, a move, nothing), its own scroll when
   the words run longer; in Party Skirmish's scrolling bar it stays at the bottom in view, so Go is always in one place */
.pick { box-sizing: border-box; height: calc(3 * 1.45em + 16px); overflow-y: auto; margin: 6px 0 0; padding: 6px 10px; border: 2px solid transparent;
  border-radius: 6px; font-size: 14px; line-height: 1.45; color: var(--ink-2); background: var(--card); }
/* empty, it is one line, so it covers less of the tiles in the bar (the owner, 2026-10-22: "a bit taller window so we
   can see all the actions available to us"); it sits below the tiles (and over them when it sticks at the bottom), so
   its height changing never moves a tile, and anything it holds gets the full three lines, Go in one place */
.pick:empty { height: calc(1.45em + 16px); }
.pick:empty::before { content: 'Pick an action.'; color: var(--muted); }
/* its buttons in a column of their own (FightUI.pickSlot), the words scrolling beside them */
.pick:has(.pk-acts) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); gap: 8px; align-items: center; overflow: hidden; }
.pick .pk-words { align-self: stretch; overflow-y: auto; }
.pick .pk-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 15em; }
.pick .pk-acts button { margin-left: 0; }
/* and it stays in view at the bottom: of Party Skirmish's scrolling bar, and of the window on Skirmish, whose page
   scrolls as a whole (2026-10-22: Skirmish's Cast sat below the fold of an 800-pixel window) */
.battle .pick { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -4px 6px -4px var(--rule, rgba(0, 0, 0, 0.15)); }
.pick b { color: var(--ink); }
.pick button { margin-left: 8px; }
.board .trail { fill: none; stroke-width: 3; stroke-dasharray: 6 4; stroke-linecap: round; pointer-events: none; }
/* a spell's burst, while its message is on show: the radius around the intersection it was aimed at */
.board .burst { fill-opacity: 0.1; stroke-width: 2.5; stroke-dasharray: 5 3; pointer-events: none; }
.board .burst-at { pointer-events: none; }
/* a spell being aimed (your turn): a dotted circle, and a ring on each creature it would reach */
.board .burst.aiming { stroke-dasharray: 2 4; }
.board .aimring { fill: none; stroke: var(--focus); stroke-width: 3; pointer-events: none; }
.board .aimcell { fill-opacity: 0.18; pointer-events: none; }
/* board help (Party Skirmish, end state C): a square that sets off a Reactive Strike, one that flanks the target, the hovered
   route, how much HP a token has left (a white arc inside its edge) and its dying pips */
.board .provmark { fill: var(--bad); opacity: 0.75; pointer-events: none; }
.board .flankmark { fill: var(--ink); stroke: var(--card); stroke-width: 1.5; opacity: 0.8; pointer-events: none; }
.board .trail.hover { opacity: 0.45; }
.board .hparc { fill: none; stroke: #fff; stroke-width: 2.5; opacity: 0.9; pointer-events: none; }
.board .dpip { fill: var(--card); stroke: var(--bad); stroke-width: 1.2; pointer-events: none; }
.board .dpip.on { fill: var(--bad); }
/* the spell chip being aimed (party.html showAim) */
.choices button[aria-pressed="true"] { outline: 2px dashed var(--focus); outline-offset: 1px; }
/* the action that just happened, large (owner, 2026-10-18: "the current line of action to have its own area") */
.now { min-height: 104px; padding: 2px 0 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.now .head { font: 600 20px var(--sans); color: var(--ink); margin: 0 0 4px; }
.now .roll { font: 15px var(--mono); color: var(--ink-2); margin: 0 0 4px; }
.now .res { font: 600 18px var(--sans); color: var(--ink); margin: 0; }
/* an area's saves, one row a creature (FightUI.nowHtml), in the roll line's own type */
.now table.saves { border-collapse: collapse; font: 15px var(--mono); color: var(--ink-2); }
.now table.saves td { padding: 0 12px 1px 0; white-space: nowrap; }
.now table.saves td:last-child { white-space: normal; color: var(--ink); }
.now .res.miss { color: var(--muted); }
.now .res .dmg { font-family: var(--mono); }
.now .who-you { color: var(--series-a); }
.now .who-it { color: var(--series-b); }
/* the dice box (owner, 2026-10-18): the cobalt d20 and the damage dice thrown together; on a miss the damage dice go grey.
   Each die an SVG shape for its size; a short tumble (CSS) while its face flickers, then the real face (drawDice) */
.dicebox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; margin: 0 0 8px; }
.dicebox .die { width: 44px; height: 44px; display: block; transition: filter 0.35s, opacity 0.35s; }
.dicebox .die text { font: 700 15px var(--mono); }
.dicebox .d20 { width: 52px; height: 52px; }
.dicebox .d20 text { font-size: 17px; }
.dicebox .roll { animation: tumble 0.7s cubic-bezier(.2,.8,.3,1) both; }
.dicebox .dud { filter: grayscale(1); opacity: 0.45; }
.dicebox .plus { font: 600 15px var(--mono); color: var(--ink-2); }
@keyframes tumble { 0% { transform: translate(-60px, -18px) rotate(-540deg) scale(0.6); opacity: 0; } 60% { opacity: 1; } 80% { transform: translate(3px, 2px) rotate(12deg) scale(1.04); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .dicebox .roll { animation: none; } }
/* narrow (the console under the fight): what just happened goes right above the board and your choices, the
   status, HP and log after them, so a phone reads the action next to the board */
@container (max-width: 819px) {
  .arena-main, .console { display: contents; }
  .now { order: 1; }
  #k-strip, #k-board, #k-over, #k-turn, #k-pick, #k-choices, #k-coach { order: 2; }
  .console > :not(.now) { order: 3; }
  #k-status { border-top: 1px solid var(--line); padding-top: 10px; }
}

/* ---------- Party Skirmish only (party.html) */
/* the board: whose turn it is (a solid ring) and the target picked (a dashed one) */
.board .acting { fill: none; stroke: var(--ink); stroke-width: 3; pointer-events: none; }
.board .picked-ring { fill: none; stroke: var(--focus); stroke-width: 3; stroke-dasharray: 5 3; pointer-events: none; }
.board .tok { cursor: pointer; }
.roster .lv { color: var(--muted); font-size: 13px; }
.roster .seg button { padding: 2px 8px; font-size: 12px; }
.roster .n { font: 500 13px var(--mono); min-width: 2em; text-align: center; }
.mini { padding: 2px 8px; font-size: 13px; }
/* the turn order: a chip per combatant in initiative order, the one acting outlined, the fallen faded; a tap picks it
   as the target */
.strip { display: flex; flex-wrap: nowrap; gap: 3px; margin: 6px 0 2px; overflow-x: auto; padding: 2px; }
.strip button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink); padding: 1px 7px 1px 2px; font: 500 12px var(--sans); cursor: pointer; flex: none; }
.strip button .hp { font: 500 11px var(--mono); color: var(--ink-2); }
.strip button.cur { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.strip button.picked { outline: 2px dashed var(--focus); outline-offset: 1px; }
.strip button.down { opacity: 0.45; }
/* the acting one's turn line, over the action bar */
.turnhead { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.turnhead b { color: var(--ink); }
/* the compact plates (FightUI miniPlate): a line each, rolled open on a tap for the defences and the conditions in words */
.mplates { display: grid; gap: 2px; margin: 6px 0; }
.mplate { border-left: 3px solid var(--side); border-radius: 3px; background: var(--field); }
.mplate > summary { display: flex; align-items: center; gap: 6px; padding: 2px 6px 2px 3px; cursor: pointer; list-style: none; font-size: 12px; min-width: 0; }
.mplate > summary::-webkit-details-marker { display: none; }
.mplate .tag { display: inline-grid; place-items: center; min-width: 2.2em; height: 1.5em; border-radius: 999px; font: 600 11px var(--sans); color: #fff; background: var(--side); padding: 0 3px; flex: none; }
.mplate .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.mplate .bar { flex: none; width: 48px; height: 6px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--card); }
.mplate .bar .fill { display: block; height: 100%; background: var(--side); }
.mplate .num, .mplate .ac { flex: none; font: 500 11px var(--mono); color: var(--ink-2); white-space: nowrap; }
.mplate .bd { flex: none; display: inline-flex; gap: 2px; }
.mplate .bd b, .mplate .bd i { font: 700 9px var(--sans); font-style: normal; color: var(--card); background: var(--ink); border-radius: 999px; padding: 1px 4px; cursor: help; }
.mplate .mp-body { padding: 0 6px 4px 8px; }
.mplate .mp-body .conds { margin: 2px 0 0; }
/* the action bar under the board, scrolling on its own (owner, 2026-10-20: "Moving the action bar out of the scrolling
   area is fine"): on a wide screen the fight's left side is a column, the board and the turn order fixed at its top and
   the action bar filling the rest; narrow, it simply follows the board */
@container (min-width: 820px) {
  .battle.party .arena-main { overflow: hidden; display: flex; flex-direction: column; padding-right: 0; }
  .battle.party .arena-main > * { flex: none; }
  .battle.party .arena-main > .actionbar { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
}
@container (max-width: 819px) { .actionbar { order: 2; } }
/* on a phone the armed cast panel is a sheet along the bottom of the screen, over the page, so the board stays in view
   while you aim (item 6); out of the flow, so nothing on the page moves when it opens */
@media (max-width: 600px) {
  .battle .pick.armed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: auto; min-height: calc(3 * 1.45em + 16px);
    max-height: 45vh; margin: 0; border-radius: 10px 10px 0 0; border-color: var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.25); }
}
/* a rule note beside a log row (FightUI.ruleNote): small and quiet, its words on hover or tap */
.rule-note { font: 600 9px var(--sans); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; margin-left: 2px; }
.rule-note:hover, .rule-note:focus { color: var(--ink); }

/* fight mode (Party Skirmish, playtest end state A): once a fight starts the setup, the page's heading and the long
   hints fold away, the fight takes the page's whole width and one line says who fights whom, with a Setup button */
:root[data-layout] .page.fighting:has(> .controls), .page.fighting { grid-template-columns: minmax(0, 1fr); }
.page.fighting > .controls, .fighting .hero, .page.fighting .results > .part > .hint, .fighting #rules-credit { display: none; }
.page.fighting.fighting .results { padding-left: 0; }
.fightline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font-size: 13px; }
.fightline .fl-side { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.fightline .vs { color: var(--muted); }
.fightline #k-setup { margin-left: auto; }
.fightline[hidden] { display: none; }
/* narrow, in fight mode: the coach and stats switches and Start another go under the action bar, so the board and your
   choices fit a phone's screen */
@container (max-width: 819px) { .page.fighting .arena-main > .bar { order: 3; } }
