/* frontend/flood.css — SPILLOVER (id `flood`) board, both layouts.
 *
 * ⛔ ITS OWN FILE, NOT A BLOCK IN style.css — the Swarm / Ladybug Lanes precedent.
 *
 * ── Colour is data ──────────────────────────────────────────────────────────
 * Every colour is lifted from the mock (docs/design/batch8/Flood.dc.html vars(), l.319–352): CLASSIC by default,
 * ARCADE (its Blue scheme) when GameTheme puts `gm-arcade` on the screen — recolour only: same box, same sizes.
 * ⛔ THE SCREEN CARRIES THE PALETTE, NOT ONLY THE BOARD: the setup card sits outside `.fl-root`.
 * Seats are SHAPE first — ● you, ▲ the bot — colour only repeats it. Faces are SHAPE + a lightness ramp (the six
 * backplates: circle · rounded square · hexagon · octagon · cut corner · notched slab, L .90 → .42), so the board
 * reads in greyscale. Ownership reads three ways: the die's skin, the gutter texture (you stripes, the bot dots)
 * and the border (you solid, the bot dashed). The owner is colourblind.
 *
 * ── Geometry is the mock's ──────────────────────────────────────────────────
 * geom() l.444–465: the desktop design box is 1280 × 553 (the mock's 637 less its 84px chat strip) — rails 236 and
 * 250 either side of a centre column of announce 40 · board · picker 84; die cell 50, gutter 5, die 0.6 of the
 * cell. The phone is rows players 66 · tide 8 · announce 40 · board · feed 54 · picker 80, the cell set by
 * flFitPhone() (FL-M4: 8 × 7 always). Cells, tiles and edges are absolutely placed in board px by flood.js.
 *
 * ── ⭐ LOCKED LAYOUT ────────────────────────────────────────────────────────
 * ONE DOM, two arrangements. Every row is a FIXED size except the board's (it takes what is left). Every text box is
 * a fixed width or fills its slot and truncates. Feedback changes colour, glow or a 1–2px transform — never size.
 */

#flood-game-screen, .fl-root {
  --fl-bg: radial-gradient(125% 120% at 50% -10%, #1c1e24 0%, #141519 58%, #0d0e11 100%);
  --fl-panel: rgba(255, 255, 255, .04); --fl-panel2: rgba(255, 255, 255, .08); --fl-line: rgba(255, 255, 255, .1);
  --fl-txt: #e9e8e4; --fl-dim: #9a9ca2;
  --fl-you: oklch(.78 .12 240); --fl-you-ink: #06182a; --fl-rival: oklch(.79 .14 62); --fl-rival-ink: #2a1400;
  --fl-hi: #ecebe6; --fl-hi-ink: #121316; --fl-die-bd: rgba(0, 0, 0, .45);
  /* the six plates: inner p (L .90 → .42) and rim r (L − .17), hue per face (mock LR / HUE, l.325–326) */
  --fl-p1: oklch(.90 .055 95);  --fl-r1: oklch(.73 .075 95);
  --fl-p2: oklch(.81 .055 152); --fl-r2: oklch(.64 .075 152);
  --fl-p3: oklch(.72 .055 212); --fl-r3: oklch(.55 .075 212);
  --fl-p4: oklch(.62 .055 292); --fl-r4: oklch(.45 .075 292);
  --fl-p5: oklch(.52 .055 28);  --fl-r5: oklch(.35 .075 28);
  --fl-p6: oklch(.42 .055 265); --fl-r6: oklch(.25 .075 265);
  --fl-ui: 'Outfit', 'Avenir Next', system-ui, -apple-system, sans-serif; --fl-R: 12px; --fl-bd: 1px; --fl-ls: .01em; --fl-caps: none;
}
/* ARCADE — recolour only (GameTheme: `gm-arcade` on the screen). The mock's arcade vars() on its Blue scheme. */
#flood-game-screen.gm-arcade, .gm-arcade .fl-root {
  --fl-bg: radial-gradient(135% 120% at 50% -10%, #0c1a3a 0%, #14285e 45%, #1e3a8a 100%);
  --fl-panel: rgba(255, 255, 255, .08); --fl-panel2: rgba(255, 255, 255, .14); --fl-line: color-mix(in oklch, #60a5fa 38%, transparent);
  --fl-txt: #ffffff; --fl-dim: rgba(255, 255, 255, .7);
  --fl-you: #60a5fa; --fl-you-ink: #07080c; --fl-rival: #fb923c; --fl-rival-ink: #07080c;
  --fl-hi: #fff6d8; --fl-hi-ink: #191204; --fl-die-bd: rgba(0, 0, 0, .5);
  --fl-p1: oklch(.90 .115 95);  --fl-r1: oklch(.73 .135 95);
  --fl-p2: oklch(.81 .115 152); --fl-r2: oklch(.64 .135 152);
  --fl-p3: oklch(.72 .115 212); --fl-r3: oklch(.55 .135 212);
  --fl-p4: oklch(.62 .115 292); --fl-r4: oklch(.45 .135 292);
  --fl-p5: oklch(.52 .115 28);  --fl-r5: oklch(.35 .135 28);
  --fl-p6: oklch(.42 .115 265); --fl-r6: oklch(.25 .135 265);
  --fl-ui: 'Poppins', 'Futura', 'Avenir Next', system-ui, sans-serif; --fl-R: 14px; --fl-bd: 2px; --fl-ls: .04em; --fl-caps: uppercase;
}

/* the face code: a SHAPE per face (mock SHAPES, l.358–365) + that face's two tones */
[data-f="1"] { --fl-sh: circle(50% at 50% 50%); --fl-pr: var(--fl-r1); --fl-pp: var(--fl-p1); }
[data-f="2"] { --fl-sh: inset(0% round 26%); --fl-pr: var(--fl-r2); --fl-pp: var(--fl-p2); }
[data-f="3"] { --fl-sh: polygon(50% 0%, 100% 26%, 100% 74%, 50% 100%, 0% 74%, 0% 26%); --fl-pr: var(--fl-r3); --fl-pp: var(--fl-p3); }
[data-f="4"] { --fl-sh: polygon(22% 0%, 78% 0%, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0% 78%, 0% 22%); --fl-pr: var(--fl-r4); --fl-pp: var(--fl-p4); }
[data-f="5"] { --fl-sh: polygon(30% 0%, 100% 0%, 100% 70%, 70% 100%, 0% 100%, 0% 30%); --fl-pr: var(--fl-r5); --fl-pp: var(--fl-p5); }
[data-f="6"] { --fl-sh: polygon(0% 0%, 38% 0%, 50% 11%, 62% 0%, 100% 0%, 100% 100%, 62% 100%, 50% 89%, 38% 100%, 0% 100%); --fl-pr: var(--fl-r6); --fl-pp: var(--fl-p6); }

/* seat glyphs: shape first, colour repeats it */
.fl-root [data-o="0"].fl-glyph, .fl-anng[data-o="0"], .fl-fsym[data-o="0"], .fl-fgain[data-o="0"], .fl-segsub[data-o="0"], .fl-eg[data-o="0"] { color: var(--fl-you); }
.fl-root [data-o="1"].fl-glyph, .fl-anng[data-o="1"], .fl-fsym[data-o="1"], .fl-fgain[data-o="1"], .fl-segsub[data-o="1"], .fl-eg[data-o="1"] { color: var(--fl-rival); }

/* ── setup card (on the screen's palette) ───────────────────────────────── */
#flood-game-screen { background: var(--fl-bg); color: var(--fl-txt); }
.fl-setup-card { max-width: 560px; margin: 24px auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; font-family: var(--fl-ui); background: var(--fl-panel); color: var(--fl-txt); border: 1px solid var(--fl-line); }
.fl-setup-eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fl-dim); font-weight: 700; }
.fl-setup-title { margin: 0; font-size: 30px; }
.fl-setup-blurb, .fl-setup-hint { margin: 0; line-height: 1.55; font-size: 14px; }
.fl-setup-hint { color: var(--fl-dim); font-size: 12.5px; }
.fl-setup-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0; }
.fl-setup-lab { font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--fl-dim); min-width: 70px; }
.fl-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.fl-opt { min-width: 84px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--fl-line); background: var(--fl-panel); color: var(--fl-txt); font: 800 14px var(--fl-ui); cursor: pointer; transition: background .15s, box-shadow .15s, transform .1s; }
.fl-opt-w { min-width: 220px; }
.fl-opt[data-on="1"] { background: var(--fl-you); color: var(--fl-you-ink); border-color: var(--fl-you); }
.fl-opt:active { transform: translateY(1px); }
.fl-start { height: 48px; margin-top: 6px; border: 0; border-radius: 12px; background: var(--fl-you); color: var(--fl-you-ink); font: 800 16px var(--fl-ui); letter-spacing: .04em; cursor: pointer; transition: filter .15s, transform .1s; }
.fl-start:active { transform: translateY(2px); filter: brightness(.9); }
@media (hover: hover) { .fl-start:hover { filter: brightness(1.1); } .fl-opt:hover { box-shadow: 0 0 0 2px var(--fl-you); } }

/* ── the board root (phone first) ─────────────────────────────────────── */
.fl-root {
  --fl-c: 40px; --fl-d: 24px; --fl-bw: 355px; --fl-bh: 310px; --fl-pin: 3px; --fl-bsz: 12px;
  position: relative; box-sizing: border-box; overflow: hidden;
  width: 100%; height: var(--fl-phone-h, 740px); padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--fl-bg); color: var(--fl-txt); font-family: var(--fl-ui);
  border-radius: 18px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.fl-root * { box-sizing: border-box; }

/* left rail = the phone's top block: card ● · leg box · card ▲, then the tide bar across */
.fl-railA { order: 1; flex: none; display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.fl-center, .fl-railB { display: contents; }
.fl-ann { order: 2; }
.fl-boardout { order: 3; }
.fl-feed { order: 4; }
.fl-picker { order: 5; }
.fl-feedlbl { display: none; }

/* the leg box */
.fl-leg { order: 1; flex: none; width: 80px; height: 66px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px;
  background: var(--fl-panel); border: var(--fl-bd) solid var(--fl-line); border-radius: var(--fl-R); }
.fl-leghead { display: flex; align-items: center; justify-content: center; gap: 4px; height: 20px; }
.fl-legt { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; text-transform: var(--fl-caps); }
.fl-legm { display: none; font-size: 11px; color: var(--fl-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fl-menu { flex: none; width: 22px; height: 20px; padding: 0; border: 1px solid var(--fl-line); border-radius: 999px; background: var(--fl-panel); color: var(--fl-txt); font-size: 11px; line-height: 1; cursor: pointer; }
.fl-menu:active { transform: translateY(1px); }
@media (hover: hover) { .fl-menu:hover { box-shadow: 0 0 0 2px var(--fl-you); } }
.fl-segs { display: flex; gap: 3px; }
.fl-seg { flex: 1 1 0; min-width: 0; height: 18px; display: flex; flex-direction: column; justify-content: center; padding: 0 1px; border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--fl-line); opacity: .6; }
.fl-seg[data-cur="1"] { background: var(--fl-panel2); box-shadow: inset 0 0 0 1.5px var(--fl-txt); opacity: 1; }
.fl-seg[data-done="1"] { opacity: 1; }
.fl-seglbl { display: none; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fl-dim); }
/* ⚠️ sized for "28–28" in an 80px box (the mock's 4px padding truncated it) */
.fl-segsub { font-size: 9.5px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: center; overflow: hidden; }
.fl-segsub[data-o=""] { color: var(--fl-txt); }

/* the player cards */
.fl-card { position: relative; flex: 1 1 0; min-width: 0; height: 66px; overflow: hidden;
  display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; grid-template-areas: "av info" "av mt";
  column-gap: 7px; align-content: center; padding: 0 8px 0 10px;
  background: var(--fl-panel); border: var(--fl-bd) solid var(--fl-line); border-radius: var(--fl-R);
  transition: background .2s, box-shadow .2s; }
.fl-card[data-o="0"] { order: 0; --fl-pc: var(--fl-you); --fl-pink: var(--fl-you-ink); }
.fl-card[data-o="1"] { order: 2; --fl-pc: var(--fl-rival); --fl-pink: var(--fl-rival-ink); }
.fl-card[data-on="1"] { background: var(--fl-panel2); box-shadow: inset 0 0 0 1.5px var(--fl-pc); }
.fl-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--fl-pc); opacity: 0; transition: opacity .2s; }
.fl-card[data-on="1"] .fl-bar { opacity: 1; }
.fl-av { grid-area: av; align-self: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fl-panel2); border: 1px solid var(--fl-line); display: flex; align-items: center; justify-content: center; }
.fl-card[data-on="1"] .fl-av { animation: fl-glow 2.4s ease-in-out infinite; }
.fl-glyph { font-size: 12px; line-height: 1; }
.fl-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fl-namerow { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding-right: 14px; }
.fl-name { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: var(--fl-ls); }
.fl-tag { display: none; flex: none; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fl-dim); border: 1px solid var(--fl-line); border-radius: 4px; padding: 1px 5px; }
.fl-tag[data-hi="1"] { color: var(--fl-hi-ink); background: var(--fl-hi); }
.fl-countrow { display: flex; align-items: baseline; gap: 6px; }
.fl-count { flex: none; min-width: 25px; font-size: 20px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.fl-card[data-on="1"] .fl-count { color: var(--fl-pc); }
.fl-clbl { font-size: 9.5px; color: var(--fl-dim); white-space: nowrap; }
.fl-match { grid-area: mt; min-width: 0; font-size: 9.5px; color: var(--fl-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.fl-now { position: absolute; bottom: 5px; right: 6px; padding: 2px 4px; font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fl-pink); background: var(--fl-pc); border-radius: 4px; opacity: 0; transition: opacity .2s; }
.fl-card[data-on="1"] .fl-now { opacity: 1; }
.fl-sw { position: absolute; right: 6px; top: 6px; width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--fl-pc); }
.fl-sw[data-o="0"] { background-image: var(--fl-tex-you), linear-gradient(var(--fl-tint-you), var(--fl-tint-you)); background-size: 8px 8px, auto; }
.fl-sw[data-o="1"] { background-image: var(--fl-tex-rival), linear-gradient(var(--fl-tint-rival), var(--fl-tint-rival)); background-size: 7px 7px, auto; outline: 1px dashed var(--fl-rival); outline-offset: 1px; }

/* the territory textures (mock pattern(), l.374–381): yours diagonal stripes, the bot's dot grid, each over a tint */
#flood-game-screen, .fl-root {
  --fl-tex-you: linear-gradient(135deg, color-mix(in oklch, var(--fl-you) 44%, transparent) 25%, transparent 25% 50%, color-mix(in oklch, var(--fl-you) 44%, transparent) 50% 75%, transparent 75%);
  --fl-tint-you: color-mix(in oklch, var(--fl-you) 17%, transparent);
  --fl-tex-rival: radial-gradient(circle, color-mix(in oklch, var(--fl-rival) 62%, transparent) 0 1.4px, transparent 2px);
  --fl-tint-rival: color-mix(in oklch, var(--fl-rival) 17%, transparent);
}

/* the tide bar */
.fl-tide { order: 3; flex: none; width: 100%; height: 8px; display: flex; }
.fl-tidelbl { display: none; }
.fl-tidebar { position: relative; flex: none; width: 100%; height: 8px; border-radius: 999px; background: var(--fl-panel2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--fl-line); }
.fl-tsegA, .fl-tsegB { position: absolute; top: 0; bottom: 0; width: 0; transition: width .5s cubic-bezier(.3, .8, .3, 1); }
.fl-tsegA { left: 0; background-image: var(--fl-tex-you), linear-gradient(var(--fl-tint-you), var(--fl-tint-you)), linear-gradient(color-mix(in oklch, var(--fl-you) 30%, transparent), color-mix(in oklch, var(--fl-you) 30%, transparent)); background-size: 8px 8px, auto, auto; box-shadow: inset -2px 0 0 var(--fl-you); }
.fl-tsegB { right: 0; background-image: var(--fl-tex-rival), linear-gradient(var(--fl-tint-rival), var(--fl-tint-rival)), linear-gradient(color-mix(in oklch, var(--fl-rival) 30%, transparent), color-mix(in oklch, var(--fl-rival) 30%, transparent)); background-size: 7px 7px, auto, auto; box-shadow: inset 2px 0 0 var(--fl-rival); }
.fl-ttick { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--fl-txt); opacity: .55; }

/* the announce strip — always reserved; a banner fills it, it never grows */
.fl-ann { flex: none; height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 10px; overflow: hidden;
  border-radius: var(--fl-R); border: var(--fl-bd) solid var(--fl-line); background: var(--fl-panel); }
.fl-anng { flex: none; width: 16px; text-align: center; font-size: 13px; line-height: 1; color: var(--fl-dim); }
.fl-annt { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: var(--fl-ls); }
.fl-annm { flex: none; font-size: 10.5px; font-weight: 600; color: var(--fl-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fl-ann:not([data-ban=""]) { background: var(--fl-hi); border-color: var(--fl-hi); }
.fl-ann:not([data-ban=""]) .fl-anng, .fl-ann:not([data-ban=""]) .fl-annt, .fl-ann:not([data-ban=""]) .fl-annm { color: var(--fl-hi-ink); }
.fl-ann:not([data-ban=""]) .fl-annt { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.fl-ann.fl-banin { animation: fl-ban .4s cubic-bezier(.34, 1.56, .64, 1); }

/* ── the board — DISPLAY-ONLY (FL-M3): nothing on it can be pressed ──── */
.fl-boardout { position: relative; flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.fl-board { position: relative; flex: none; width: var(--fl-bw); height: var(--fl-bh); pointer-events: none; }
.fl-tiles, .fl-cells, .fl-edges { position: absolute; inset: 0; }
.fl-tiles { z-index: 1; } .fl-cells { z-index: 2; } .fl-edges { z-index: 3; }
.fl-tile { position: absolute; opacity: 0; }
.fl-tile[data-o="1"], .fl-tile[data-o="pv"] { opacity: 1; background-image: var(--fl-tex-you), linear-gradient(var(--fl-tint-you), var(--fl-tint-you)); background-size: 8px 8px, auto; }
.fl-tile[data-o="pv"] { opacity: .55; }
.fl-tile[data-o="pv2"] { opacity: .55; background-image: var(--fl-tex-rival), linear-gradient(var(--fl-tint-rival), var(--fl-tint-rival)); background-size: 7px 7px, auto; }
.fl-tile[data-o="2"] { opacity: 1; background-image: var(--fl-tex-rival), linear-gradient(var(--fl-tint-rival), var(--fl-tint-rival)); background-size: 7px 7px, auto; }
.fl-tile.fl-tin[data-o="1"], .fl-tile.fl-tin[data-o="2"] { animation: fl-tin .3s ease both; }
.fl-edge { position: absolute; display: none; }
.fl-edge[data-o="1"] { display: block; background: var(--fl-you); }
.fl-edge[data-o="2"] { display: block; }
.fl-edge[data-o="2"][data-s="t"], .fl-edge[data-o="2"][data-s="b"] { background-image: repeating-linear-gradient(90deg, var(--fl-rival) 0 6px, transparent 6px 10px); }
.fl-edge[data-o="2"][data-s="l"], .fl-edge[data-o="2"][data-s="r"] { background-image: repeating-linear-gradient(180deg, var(--fl-rival) 0 6px, transparent 6px 10px); }
.fl-cell { position: absolute; width: var(--fl-c); height: var(--fl-c); }
.fl-cell.fl-pop { animation: fl-pop .34s ease-out both; }
.fl-ring { position: absolute; inset: -4px; clip-path: var(--fl-sh); background: transparent; }
.fl-cell[data-st="pv"] .fl-ring { background: var(--fl-you); animation: fl-pulse 1.3s ease-in-out infinite; }
/* the sealed beat (owner ruling 2026-09-24): the pocket pulses in its OWNER's colour, quicker than the preview */
.fl-cell[data-st="seal"] .fl-ring { inset: -5px; background: var(--fl-you); animation: fl-pulse .5s ease-in-out infinite; }
.fl-cell[data-st="seal"][data-so="1"] .fl-ring { background: var(--fl-rival); }
.fl-cell[data-st="flip"] .fl-ring { inset: -5px; background: #fff; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .8)); }
.fl-plate { position: absolute; inset: 0; clip-path: var(--fl-sh); background: var(--fl-pr); }
.fl-inner { position: absolute; inset: var(--fl-pin); clip-path: var(--fl-sh); background: var(--fl-pp); }
.fl-die { position: absolute; left: 50%; top: 50%; width: var(--fl-d); height: var(--fl-d); margin: calc(var(--fl-d) / -2) 0 0 calc(var(--fl-d) / -2);
  display: flex; align-items: center; justify-content: center; }
.fl-die.fl-flip { animation: fl-flip .38s cubic-bezier(.45, 0, .3, 1) both; }
.fl-num { font-weight: 800; }
.fl-badge { position: absolute; right: calc(var(--fl-bsz) * -.25); bottom: calc(var(--fl-bsz) * -.25); width: var(--fl-bsz); height: var(--fl-bsz); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--fl-bsz) * .6); font-weight: 800; line-height: 1; z-index: 4;
  opacity: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.fl-badge[data-o="0"] { opacity: 1; background: var(--fl-you); color: var(--fl-you-ink); }
.fl-badge[data-o="1"] { opacity: 1; background: var(--fl-rival); color: var(--fl-rival-ink); }

/* FL-M1 — the big-gulp moment, over the board's centre; pointer-events none, never in the layout */
.fl-celeb { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 60; opacity: 0; transition: opacity .25s; }
.fl-celeb[data-on="1"] { opacity: 1; }
.fl-celeb[data-o="0"] { --fl-pc: var(--fl-you); } .fl-celeb[data-o="1"] { --fl-pc: var(--fl-rival); }
.fl-cring { position: absolute; left: 0; top: 0; width: calc(var(--fl-bw) * .9); height: calc(var(--fl-bw) * .9); border-radius: 50%; border: 6px solid var(--fl-pc); opacity: 0; transform: translate(-50%, -50%); }
.fl-cring.fl-go { animation: fl-burst 1.1s ease-out forwards; }
.fl-ccard { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 26px; border-radius: 22px;
  background: rgba(0, 0, 0, .62); box-shadow: 0 0 0 2px var(--fl-pc), 0 10px 40px rgba(0, 0, 0, .5); transform: translate(-50%, -50%); }
.fl-ccard.fl-go { animation: fl-popin .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.fl-cbig { font-size: 44px; font-weight: 900; line-height: 1; color: var(--fl-pc); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fl-csub { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #fff; white-space: nowrap; }

/* ⚖️ THE BETWEEN-LEGS CARD (owner 2026-09-25) — over the board's centre while leg 1's result sinks in (FL_FX.legBanner,
   4.5 s). An absolute layer with pointer-events none, like the big-gulp moment: it never moves the layout. Every line is
   one line (nowrap + ellipsis) so a long name cannot grow the card. */
.fl-legcard { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 70;
  opacity: 0; transition: opacity .3s; }
.fl-legcard[data-on="1"], .fl-legcard[data-on="out"] { opacity: 1; background: rgba(0, 0, 0, .35); }
.fl-legcard[data-on="out"] { background: rgba(0, 0, 0, 0); transition: background .42s; }
.fl-lcin { width: min(92%, 380px); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 18px 20px 16px; border-radius: 20px;
  background: rgba(10, 12, 16, .9); box-shadow: 0 0 0 2px var(--fl-hi), 0 12px 44px rgba(0, 0, 0, .55); color: #fff; text-align: center; }
/* with motion: it DROPS in from above and settles with a bounce (FL_FX.legIn), holds, then FALLS away (FL_FX.legOut).
   Reduced motion (the .fl-root rule below cuts every animation to 1ms): it simply appears, holds, and is gone. */
.fl-legcard[data-on="1"] .fl-lcin { animation: fl-lcdrop .52s cubic-bezier(.34, 1.4, .64, 1) both; }
.fl-legcard[data-on="out"] .fl-lcin { animation: fl-lcfall .42s cubic-bezier(.55, 0, 1, .45) both; }
@keyframes fl-lcdrop { 0% { transform: translateY(-60vh); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fl-lcfall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(60vh) rotate(5deg); opacity: 0; } }
.fl-lcin > * { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-lct { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--fl-dim); }
.fl-lcs { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fl-lcl { font-size: 13px; font-weight: 600; }
.fl-lcx { font-size: 11px; color: var(--fl-dim); min-height: 1.3em; }
.fl-lcn { font-size: 13px; font-weight: 800; color: var(--fl-hi); }
.fl-lcbar { display: block; width: 70%; height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.fl-lcbar > i { display: block; height: 100%; width: 100%; background: var(--fl-hi); transform-origin: left center; }
.fl-lcbar > i.fl-go { animation: fl-drain linear both; }
@keyframes fl-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .fl-lcbar { display: none; } }   /* a draining bar IS motion */

/* 🌐 the move clock (online, clock on) — a hairline along the strip's foot; absolute, so it moves nothing */
.fl-ann { position: relative; }
.fl-clk { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; display: none; background: rgba(255, 255, 255, .08); }
.fl-clk[data-on="1"] { display: block; }
.fl-clkf { display: block; height: 100%; width: 100%; background: var(--fl-rival); transition: width .25s linear; }
.fl-clk[data-mine="1"] .fl-clkf { background: var(--fl-you); }
.fl-clk[data-low="1"] .fl-clkf { background: #ff6b6b; }

/* ── the face picker — the ONLY input (FL-M3) ─────────────────────────── */
.fl-picker { flex: none; height: 80px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.fl-fb { position: relative; flex: 1 1 0; min-width: 0; max-width: 112px; height: 76px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: var(--fl-bd) solid var(--fl-line); background: var(--fl-panel2); color: var(--fl-txt); font-family: var(--fl-ui); cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease, opacity .2s; }
.fl-fbtop { display: flex; align-items: center; gap: 3px; }
.fl-fbpw { position: relative; flex: none; width: 28px; height: 28px; }
.fl-fbpw .fl-inner { inset: 2px; }
.fl-fbdie { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.fl-fbnum { flex: none; width: 8px; font-size: 12px; font-weight: 800; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
/* ⚠️ sized for "▲ RIVAL" on a 53px button at 360 wide (the mock's 9.5px / 4px padding truncated it there) */
.fl-fbtag { flex: none; height: 17px; max-width: calc(100% - 6px); display: flex; align-items: center; justify-content: center; padding: 0 3px; border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums;
  color: transparent; background: transparent; border: 1px solid transparent; }
.fl-fbtag[data-kind="gain"] { color: var(--fl-you-ink); background: var(--fl-you); border-color: var(--fl-you); }
.fl-fbtag[data-kind="you"] { color: var(--fl-you); background: rgba(0, 0, 0, .6); border-color: var(--fl-you); }
.fl-fbtag[data-kind="rival"] { color: var(--fl-rival); background: rgba(0, 0, 0, .6); border-color: var(--fl-rival); }
/* FL-M5 — "must take": you passed last turn, and this face takes nothing. Plain ink on a dashed border — it is YOUR rule,
   not the rival's texture; the button's plate greys like any locked face. */
.fl-fbtag[data-kind="must"] { color: var(--fl-txt); background: rgba(0, 0, 0, .6); border: 1px dashed currentColor; letter-spacing: 0; }
/* states: hover / armed / pressed / locked-you / locked-rival / not your turn — colour, glow, texture, 1–2px */
.fl-fb[data-st="hover"], .fl-fb[data-st="armed"] { box-shadow: inset 0 0 0 2px var(--fl-you), 0 0 18px -3px var(--fl-you); transform: translateY(-2px); }
.fl-root[data-lock="0"] .fl-fb[data-lock=""]:active { box-shadow: inset 0 0 0 2px var(--fl-you), inset 0 3px 9px rgba(0, 0, 0, .55); transform: translateY(1px); filter: brightness(.86); }
.fl-fb[data-lock="you"] { cursor: not-allowed; background: var(--fl-panel); background-image: var(--fl-tex-you), linear-gradient(var(--fl-tint-you), var(--fl-tint-you)); background-size: 8px 8px, auto; }
.fl-fb[data-lock="rival"] { cursor: not-allowed; background: var(--fl-panel); background-image: var(--fl-tex-rival), linear-gradient(var(--fl-tint-rival), var(--fl-tint-rival)); background-size: 7px 7px, auto; }
.fl-fb[data-lock="must"] { cursor: not-allowed; }
.fl-fb[data-lock="you"] .fl-fbpw, .fl-fb[data-lock="rival"] .fl-fbpw, .fl-fb[data-lock="must"] .fl-fbpw { opacity: .45; }
.fl-fb[data-off="1"] { cursor: not-allowed; filter: saturate(.25) brightness(.8); opacity: .5; border-style: dashed; }
.fl-fb[data-shake="a"] { animation: fl-shakeA .4s ease; }
.fl-fb[data-shake="b"] { animation: fl-shakeB .4s ease; }
@media (hover: hover) { .fl-root[data-lock="0"] .fl-fb[data-lock=""][data-st="rest"]:hover { box-shadow: inset 0 0 0 2px var(--fl-you), 0 0 18px -3px var(--fl-you); } }

/* ── the action feed (two lines on a phone) ───────────────────────────── */
.fl-feed { flex: none; height: 54px; display: flex; flex-direction: column; justify-content: center; padding: 0 2px; overflow: hidden;
  background: var(--fl-panel); border: var(--fl-bd) solid var(--fl-line); border-radius: var(--fl-R); }
.fl-frow { flex: none; display: flex; align-items: center; gap: 8px; height: 22px; padding: 0 8px; }
.fl-frow:nth-child(n+3) { display: none; }
.fl-frow[data-fresh="1"] { animation: fl-rise .3s ease-out; }
.fl-fsym { flex: none; width: 14px; text-align: center; font-size: 10px; color: var(--fl-dim); }
.fl-ftxt { flex: 1; min-width: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-fgain { flex: none; min-width: 26px; padding: 0 3px; text-align: right; font-size: 11.5px; font-weight: 800; border-radius: 4px; font-variant-numeric: tabular-nums; }
.fl-frow[data-big="1"] .fl-fgain { color: var(--fl-hi-ink); background: var(--fl-hi); }

/* ── the end screen rows ───────────────────────────────────────────────── */
.fl-endrows { display: flex; flex-direction: column; gap: 6px; }
.fl-endrow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: rgba(127, 127, 127, .1); }
.fl-endrow[data-win="1"] { box-shadow: inset 0 0 0 1.5px currentColor; }
.fl-endnm { font-weight: 700; } .fl-eg { font-style: normal; margin-right: 6px; }
.fl-endlegs { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.fl-endsc { font-weight: 800; font-variant-numeric: tabular-nums; }
.fl-endnote { margin-top: 8px; font-size: 12px; opacity: .7; }

/* ── motion ────────────────────────────────────────────────────────────── */
@keyframes fl-flip { 0% { transform: scaleX(1); } 46% { transform: scaleX(.05); } 54% { transform: scaleX(.05); } 100% { transform: scaleX(1); } }
@keyframes fl-pop { 0% { transform: scale(1); } 35% { transform: scale(.86); } 70% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes fl-tin { from { opacity: 0; } to { opacity: 1; } }
@keyframes fl-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes fl-burst { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 25% { opacity: .9; } 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
@keyframes fl-popin { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; } 60% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes fl-ban { 0% { transform: scale(.94); opacity: .2; } 60% { transform: scale(1.02); } 100% { transform: scale(1); opacity: 1; } }
@keyframes fl-rise { 0% { transform: translateY(8px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fl-shakeA { 0%, 100% { translate: 0 0; } 20% { translate: -4px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
@keyframes fl-shakeB { 0%, 100% { translate: 0 0; } 20% { translate: -4px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
@keyframes fl-glow { 0%, 100% { box-shadow: 0 0 0 2px var(--fl-pc), 0 0 6px -2px var(--fl-pc); } 50% { box-shadow: 0 0 0 2px var(--fl-pc), 0 0 16px 0 var(--fl-pc); } }
@media (prefers-reduced-motion: reduce) {
  .fl-root *, .fl-root { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ── phone: the topbar hides while playing; ☰ in the leg box brings it back ─ */
@media (max-width: 999px) {
  #flood-game-screen.fl-playing .wrap { padding: 0 2px; max-width: none; }
  #flood-game-screen.fl-playing .topbar { display: none; }
  #flood-game-screen.fl-playing.fl-topbar-open .topbar { display: flex; }
}

/* ── desktop: ONE 1280 × 553 box, scaled as a unit by BoardFit ────────── */
@media (min-width: 1000px) {
  #flood-game-screen .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  .fl-root {
    width: 1280px; height: 553px; padding: 14px; gap: 12px;
    flex-direction: row;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 26px 60px -30px #000;
  }
  .fl-menu { display: none; }
  .fl-railA { order: 0; width: 236px; flex-direction: column; flex-wrap: nowrap; gap: 10px; }
  .fl-center { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; gap: 8px; }
  .fl-railB { display: flex; flex-direction: column; flex: none; width: 250px; gap: 6px; }
  .fl-ann, .fl-boardout, .fl-picker, .fl-feed { order: 0; }

  .fl-leg { order: 0; width: auto; height: 76px; justify-content: flex-start; gap: 6px; padding: 9px 10px; }
  .fl-leghead { justify-content: space-between; height: auto; }
  .fl-legt { font-size: 13px; letter-spacing: .02em; }
  .fl-legm { display: inline; }
  .fl-segs { gap: 6px; }
  .fl-seg { height: 34px; padding: 0 8px; gap: 2px; border-radius: 8px; }
  .fl-seglbl { display: block; }
  .fl-segsub { font-size: 12px; text-align: left; }

  .fl-card { flex: none; height: 100px; padding: 0 14px 0 16px; grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "av info" "mt mt"; column-gap: 10px; row-gap: 6px; }
  .fl-card[data-o="0"] { order: 1; } .fl-card[data-o="1"] { order: 2; }
  .fl-av { width: 44px; height: 44px; }
  .fl-glyph { font-size: 18px; }
  .fl-info { gap: 2px; padding-right: 40px; }
  .fl-namerow { padding-right: 0; }
  .fl-name { font-size: 14px; }
  .fl-tag { display: inline-block; }
  .fl-count { font-size: 30px; min-width: 38px; }
  .fl-clbl { font-size: 11px; }
  /* ⭐ the build note: "match total 112 · 56 from leg 1" gets the card's whole width (the mock truncated it) */
  .fl-match { font-size: 11.5px; }
  .fl-now { top: 10px; right: 10px; bottom: auto; font-size: 9.5px; padding: 3px 6px; }
  .fl-sw { right: 10px; top: 36px; width: 24px; height: 24px; }

  .fl-tide { order: 3; height: 40px; flex-direction: column; gap: 6px; padding: 0 2px; }
  .fl-tidelbl { display: flex; align-items: baseline; justify-content: space-between; font-size: 11px; font-variant-numeric: tabular-nums; }
  .fl-tA { color: var(--fl-you); } .fl-tM { color: var(--fl-dim); } .fl-tB { color: var(--fl-rival); }
  .fl-tidebar { height: 12px; }

  .fl-ann { gap: 10px; padding: 0 14px; }
  .fl-anng { font-size: 16px; }
  .fl-annt { font-size: 15px; }
  .fl-annm { font-size: 12px; }
  .fl-ann:not([data-ban=""]) .fl-annt { letter-spacing: .08em; }

  .fl-cbig { font-size: 60px; }
  .fl-csub { font-size: 14px; }

  .fl-picker { height: 84px; gap: 8px; }
  .fl-fb { flex: none; width: 112px; height: 78px; gap: 7px; border-radius: 12px; }
  .fl-fbtop { gap: 8px; }
  .fl-fbpw { width: 34px; height: 34px; }
  .fl-fbnum { width: 14px; font-size: 22px; }
  .fl-fbtag { height: 20px; padding: 0 8px; font-size: 11px; letter-spacing: .08em; }

  .fl-feedlbl { display: block; flex: none; height: 14px; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--fl-dim); }
  .fl-feed { flex: 1 1 0; min-height: 0; height: auto; justify-content: flex-start; padding: 0; }
  .fl-frow { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--fl-line); }
  .fl-frow:nth-child(n+3) { display: flex; }
  .fl-frow[data-fresh="1"] { background: var(--fl-panel2); }
  .fl-fsym { font-size: 12px; }
  .fl-ftxt { font-size: 13px; }
  .fl-fgain { min-width: 30px; font-size: 13px; }
}
