/* motion.css — THE MOTION TABLE. Three durations, one easing family; every animation the client plays is a row
   below, named, and nothing moves on a duration outside the three. A player who asked their OS for less motion gets
   the same states with no travel (the last rule). The Steam game's motion is the reference (game/ui/CLAUDE.md,
   the kit's motion table); this is the web's, on the same beats. */
:root {
  --dur-fast: 120ms;   /* a hover, a press, a pill's colour, a tip appearing */
  --dur-base: 220ms;   /* a card rising, a panel opening, a frontier redrawing, a seat row lighting */
  --dur-slow: 420ms;   /* a capture spreading through a hex, the stage's fade, a score counting */
  --dur-die:  600ms;   /* a die tumbling on the stage, then settling */
  --ease-out: cubic-bezier(.2, .7, .2, 1);    /* arrivals: a card rises, a panel opens */
  --ease-in:  cubic-bezier(.6, 0, .8, .2);    /* departures: a stage leaves, a card is spent */
  --ease-both: cubic-bezier(.45, 0, .2, 1);   /* travel: the frontier, the plan target moving */
}

/*  THE TABLE — what moves · duration · easing · the rule
    ------------------------------------------------------------------------------------------------------
    a card you can play now         —      —      glows the playable mint, takes the finger; NEVER moves (the owner's, w14: no card animation)
    hover on a button               fast   out    the stock lightens one step; the hard shadow stays put
    press on a button               fast   in     travels 2px into its hard shadow, then back
    a hex under the pointer         fast   out    the plan outline appears; no fill change
    a cell taken                    slow   out    the hatch grows in from the edge the taker's land is on; the frontier follows
    a frontier redrawn              slow   out    under a moment that took cells, ONLY the changed edges move: the old fade out, the new
                                                  fade in, as the hatch grows; the unchanged stand still; never blinks off and on (B7)
    a capital falls                 2000ms —      a MOMENT (the Steam game's hold): the old keep stays, dimmed, in the loser's colour on the
                                                  taker's hatch; the new capital's ring pulses once (slow, out); THE BANNER stands (B7)
    the banner                      base   out    rises 24px and fades in over the board's upper third, under IN PLAY's row where they would
                                                  meet (w51, B20): "<NAME>'S" on a small line over "CAPITAL FALLS", the taker,
                                                  the bounty; fades (base, in) as its moment ends (the owner's C)
    THE DIG'S MOMENTS (B12, w32; the Steam game's m62 and m63 at parity — its holds `re_anchor`, `knocked_out`, `last_round`):
    a fall's second beat            1200ms /2000ms at 2000 ms, in the banner's place, the fall's line goes (fast, in) as the second lands
                                                  (base, out): "<NAME>'S CAPITAL MOVES TO A HILL" (a structure razed there named under
                                                  it), the new capital's ring pulsing for its 1.2 s — or "YOU ARE OUT" / "AI 2 IS OUT"
                                                  for 2 s; the moment `fall` + it, one length (`stage()`); two `.beat`s under `--since`
    the last round opens            1500ms —      a MOMENT: "THE LAST ROUND" in gold in the banner's place; the Shop's sheet opens when
                                                  it ends; the top bar's ROUND reads LAST ROUND in danger for the whole round
    an objective taken              base   out    its gold OBJECTIVE tag rises 8px over the cell; gone at 1 s (base, in) — a state at
                                                  its time, so LESS holds it still and then it is gone
    a wall / an Arson               2.4×slow out  the cell flashes in the walling seat's colour / in danger (winning the cell over a
                                                  card banner's flash), as a card's cell flashes
    END TURN lit                    slow   both   at exactly nothing left: a gold ring breathing out and back; LESS holds it still
    THE REST OF THE DIG (B14, w43):
    a round's income                1200ms —      a MOMENT, STAGED: the Shop's sheet, the AI's Shop and every clock wait for it; under
                                                  it every seat's income and upkeep FLOAT under its capital (the last round's banner
                                                  carries its own); the `start` record's first Shop plays none
    a gold float                    base   out    a board tag on card stock under the cell — `+5` gold, `−2` danger — rising 8px; gone
                                                  at 1.2 s (base, in), a state at its time (LESS: held still, then gone); a toll's at
                                                  the cell and the owner's capital, a bounty's, ruins', a card's mint; never a seat's
                                                  own shop gold
    a lapse                         2.4×slow out  the cell flashes in danger, as an Arson's does
    the away banner                 base   out    WHILE YOU WERE AWAY, its own banner in the card banners' layer; stands 8 s or until a
                                                  click; card banners wait behind it; fades (base, in)
    the link down                   —      —      a STATE on the table: the plate's ask, no clock, nothing listed, every click refused,
                                                  until the VIEW after the link comes back
    a presence mark                 —      —      a STATE after a seat's name: "· away", "· AI plays"; a line in the history when it moves
    the shop's row lit              —      —      a redraw's new row, and the row the Shop dealt, glow in their kinds' colours for 2 s:
                                                  a state, no motion (no card moves, w14)
    the played chips' newest        —      —      a chip landing at the column's top glows in its kind's colour for 2 s (w44: from the
                                                  moment it first shows, a held one later): a state, no motion
    a redraw mid-moment             —      —      plays on, never again: every moment animation is delayed by the moment's age (--since)
    THE ROLL-OFF (B24, w60; the Steam game's `rolloff` stage, its stagger and `roll_off_hold`):
    the roll-off's dice             die×k  out    a MOMENT at the game's start, STAGED: every die tumbles from the start and lands one
                                                  after another — die k at `--dur-die` × (1 + 0.2 (k − 1)), so 600 ms, then 120 apart
                                                  (the Steam game's stagger) —; the verdict (a `.beat`) at the last landing; held
                                                  1800 ms, then it goes as every moment goes. LESS: every die landed at once (the
                                                  stagger is the die's own duration, zeroed), the verdict at its time
    THE TITLE'S GAMES (B23, w57; the owner's B — the Steam title's diorama, its `pan_s` 90 on a cosine):
    the title's sweep               45 s   both   the board's REEL, zoomed, travels from one edge of the map to the other and back,
                                                  45 s each way, for as long as the title stands; its steps redraw the board inside
                                                  it and never restart it; a step's take and frontier are the rows above. LESS: no
                                                  sweep, the board centred and zoomed, the steps' states as they land
    the turn plate changes seat     base   out    the name fades in in the new seat's colour; the ask rises 8px; the seat's row lights in
    the clock's bar                 1s     linear drains as the clock runs; drawn at the width it stands at, never refilled by a redraw
    the clock under 10 s            —      —      the digits go danger and pulse once a second, opacity 1 → .6 → 1
    a card played / committed       —      —      RETIRED (w14, the owner's: no card animations): it is simply gone, or shown face down
    the war stage opens             base   out    the dim fades in (fast); the stage rises 24px and fades in
    a stage goes                    base   in     fades out (w14: it vanished); a roll's die over the board fades as its moment ends
    a die on the stage              die    out    tumbles one whole turn, lands upright on its face (never a snap back); held, then fades
    the readout's number changes    slow   out    counts from the number on the screen to the new; the row lights once; a new turn,
                                                  phase or war SNAPS (B7)
    a tip                           —      —      the BROWSER's own (`title`, its delay): `.tip` is the kit sheet's (B7); but for the
                                                  short face IN PLAY's whole card (B8) and the two below (B11)
    THE PRICE UNDER THE POINTER, AND THE REFUSED CLICK (B11, w28; the owner's C1 and red flash):
    the cell's box                  fast   out    fades in beside the cell the pointer RESTED on 120 ms (a constant: a sweep raises
                                                  nothing, LESS too) on this seat's own spend: the price, its receipt, what is left
    a click refused                 420ms  —      a STATE, not an animation: a static danger fill on the cell, the button or the card
                                                  (a ring: no card moves), held 420 ms by the screen and gone — LESS keeps it; the
                                                  REFUSAL LINE (the box's danger line) under a button, above a card, or the box at
                                                  the cell, stands 2 s or until the next click
    a replay's seek bar             —      —      drawn at the place reached at every step: a replay's steps are its motion (B7)
    a toast                         —      —      RETIRED (w24): a card that acts is a card banner (B8, the owner's B1)
    a card banner                   base   out    rises 24px and fades in over the board's upper third, above a stage: the card's name,
                                                  whose and what it does; once its record's moment has played; stays 2 s (1 s when
                                                  another waits); fades (base, in); a click ends it and those waiting (B8)
    a card's cell flashing          2.4×slow out  its kind's colour pulses twice on the cell it acted at, under its banner's first second
    A WAR'S COUNT IN BEATS (B9, the owner's A1; its times are `film.js`'s BEAT: the Steam game's `count_beats`):
    a die change named              —      —      1000 ms before the dice tumble: the NEW die's outline dashed, the card's row in its
                                                  kind's colour where the rows will land; the dice wait (once per war)
    a war's row lands               base   out    fades in rising 6px, one every 333 ms from the dice landing; sized from the first frame
    a war's total counts            base   out    from the row before's value to the row's as each row lands
    the lead's band                 base   out    rises one row after the last; the trailing side's total and rows dim to .45; held 900 ms
    the reveal and the verdict      base   out    the window's cards land as rows under the dice's lead and the reveal's line; then the
                                                  VERDICT replaces the lead (green, red, the muted for a war not yours) and stands 2 s
    a click on the war's stage      —      —      the first lands the count (every row in, the band or the verdict up), the second ends it
    the compact count               base   out    rises over the board's top through a war's window, for every viewer not answering it
    the Expand's count              base   out    a counted roll of two rows or more: its die (tumbling, or at rest in a window's close,
                                                  turning at each reroll), the rows landing 333 ms apart, POINTS counting; held 900 ms
    the roll's dark pool            base   out/in a soft dark disc behind an Expand roll's die or count (w54, the Steam game's m66): grows
                                                  from its centre as the moment opens (out), shrinks back into it as the moment goes (in);
                                                  LESS: there and gone
    THE AI'S SPEND, SEEN (B10, the owner's W; the server holds the AI and the clocks while every moment above plays):
    an AI's pick                    —      —      its cell's outline heavy in the seat's colour and its tag `<NAME> · NEXT`, from its
                                                  AI_SELECT (queued behind the moments) until its capture is drawn: a state
    another seat's take flashing    5/3×slow out  the taker's colour at 45 % over the cell, fading out (700 ms), beside the hatch growing;
                                                  your own take never flashes
    the land you lost               —      —      your old border dashed in your colour inside the taker's frontier, LOST under the
                                                  newest, to the end of your next turn: a state
    a card landing IN PLAY          —      —      its short face glows in its kind's colour for 2 s: a state, no motion (no card moves)
    a chat line's bubble            base   out    slides 8px out of the rail's side, level with its seat; stays 4 s; fades (base, in)
    the table's chat chooser        base   out    rises 24px and fades in over the board's corner; Esc shuts it at once
    the palette changes             —      —      AT ONCE: no crossfade. A redraw builds new nodes with no colour to fade from, and a view
                                                  transition swallows every click for its length (measured, w21): a lost click is worse (B7)
    ------------------------------------------------------------------------------------------------------ */

.m-fast { transition-duration: var(--dur-fast); transition-timing-function: var(--ease-out); }
.m-base { transition-duration: var(--dur-base); transition-timing-function: var(--ease-out); }
.m-slow { transition-duration: var(--dur-slow); transition-timing-function: var(--ease-out); }

@keyframes pulse-danger { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes leave-up { to { opacity: 0; transform: translateY(-24px); } }
@keyframes take { from { transform: scale(0); } to { transform: none; } }
@keyframes bubble-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes cell-flash { 0% { opacity: .75; } 30% { opacity: .15; } 55% { opacity: .6; } 100% { opacity: 0; } }
@keyframes take-flash { from { opacity: .45; } to { opacity: 0; } }   /* another seat's take, in its colour (B10) */
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes ask-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes light-in { from { background: transparent; } }
@keyframes row-light { from { background: color-mix(in srgb, var(--accent) 24%, transparent); } to { background: transparent; } }
@keyframes ring-pulse { from { stroke-opacity: 0; stroke-width: 12; } to { stroke-opacity: 1; stroke-width: 4; } }
@keyframes tag-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tag-gone { to { opacity: 0; visibility: hidden; } }
@keyframes lit-breathe { to { outline-color: transparent; } }
@keyframes tumble { 0% { transform: rotate(0) scale(.7); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(360deg) scale(1); } }   /* a whole turn: it lands upright, nothing to snap back (w14) */

/* a beat's own times never inherit (a row inside a band that goes would go with it) */
@property --at { syntax: '<time>'; inherits: false; initial-value: 0ms; }
@property --until { syntax: '<time>'; inherits: false; initial-value: 100000000ms; }
/* A WAR'S BEAT (B9): it lands at `--at` and goes at `--until`, each delayed by its time less its segment's age (`--since`),
   so a sheet rebuilt mid-film lands where its clock stands — and LESS, zeroing the durations alone, keeps every beat */
.beat { animation: beat-in var(--dur-base) var(--ease-out) both, beat-out var(--dur-fast) var(--ease-in) both;
  animation-delay: calc(var(--at, 0ms) - var(--since, 0ms)), calc(var(--until, 100000000ms) - var(--since, 0ms)); }
.war-die .face.is-tumbling { animation: tumble var(--dur-die) var(--ease-out) both; animation-delay: calc(var(--at, 0ms) - var(--since, 0ms)); }
.war-col.has-dim .dims { animation: dim-in var(--dur-base) var(--ease-out) both, dim-out var(--dur-base) var(--ease-out) both;
  animation-delay: calc(var(--dim-at, 0ms) - var(--since, 0ms)), calc(var(--dim-until, 100000000ms) - var(--since, 0ms)); }
@keyframes beat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes beat-out { to { opacity: 0; visibility: hidden; } }
@keyframes dim-in { from { opacity: 1; } to { opacity: .45; } }
@keyframes dim-out { to { opacity: 1; } }
@keyframes pool-in { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }   /* THE ROUND DARK POOL (w54) */
@keyframes sweep { from { translate: var(--sweep, 0px) 0; } to { translate: calc(-1 * var(--sweep, 0px)) 0; } }   /* THE TITLE'S SWEEP (w57) */

/* the last rule: less motion asked for → no travel, the same states. LESS is the system asking for it while the player
   did not choose FULL in SETTINGS, or the player choosing LESS there (`data-motion` on <html>, w20) */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-die: 0ms; }
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; }
}
:root[data-motion="less"] { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-die: 0ms; }
:root[data-motion="less"] *, :root[data-motion="less"] *::before, :root[data-motion="less"] *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; }
