/* frontend/trigammon.css — TRIGAMMON board, both layouts.
 *
 * ⛔ ITS OWN FILE, NOT A BLOCK IN style.css — the Gulls / Swarm precedent.
 *
 * ── Colour is data ──────────────────────────────────────────────────────────
 * Every colour is a variable lifted from the mock (TrigammonBoard.dc.html pal(), :343–374): CLASSIC by default,
 * ARCADE when GameTheme puts `gm-arcade` on the screen (TG-M6 — recolour only: same box, same sizes; Pixel is a
 * later slice). Seats are SHAPE first — ▲ ■ ● engraved on every checker (≥ 8 px on a phone, TG-M4), repeated in
 * banners, trays and the feed — and VALUE second (ivory / rust / slate). A state is a glyph + a ring (◎ landing,
 * ✚ hit, ⊘ blocked), never a recolour alone. Every frame must read in greyscale (the owner is colourblind).
 *
 * ── ⭐ THE ARM IS AUTHORED ONCE, AT 20 px A POINT ─────────────────────────────
 * `.tg-arm` is 301 × 100 (TG_ARM_L × TG_ARM_W in trigammon.js) and everything on it is laid out in those px.
 * The camera (tgCamera) is the ONE writer of its transform; anything that must stay upright carries `.tg-up`,
 * which counter-rotates by the arm's `--tg-a` on the SAME timing (`--tg-camT`), so text never tilts mid-morph.
 * Local TOP edge = the arm's HOME seat (its checkers stack from there), BOTTOM = the seat starting on it.
 *
 * ── ⭐ LOCKED LAYOUT ────────────────────────────────────────────────────────
 * ONE DOM, two arrangements. Every row is a FIXED size except the STAGE. The notice slot, the BOT badge, the
 * TURN chip, the opening-die slot and all four dice slots are reserved from the first frame (review findings
 * 1–3). Feedback changes colour, glow or a small transform — never size or spacing.
 */

#trigammon-game-screen, .tg-root {
  --tg-bg: radial-gradient(130% 120% at 50% -10%, #23242b 0%, #15161b 55%, #0a0b0d 100%);
  --tg-felt: #173d31; --tg-feltLine: rgba(0, 0, 0, .35);
  --tg-wood: linear-gradient(180deg, #6d4a2a, #3b2517);
  --tg-panel: rgba(255, 255, 255, .045); --tg-panel2: rgba(255, 255, 255, .025); --tg-line: rgba(255, 255, 255, .12);
  --tg-txt: #eceae3; --tg-dim: #9b9da4;
  --tg-mov: #3a86ff; --tg-movGlow: rgba(58, 134, 255, .85);   /* "can move" — Backgammon's blue (backgammon.js chipStyle) */
  --tg-sel: #e8c15a; --tg-selGlow: rgba(232, 193, 90, .55); --tg-hit: #e0553d; --tg-hitGlow: rgba(224, 85, 61, .6);
  --tg-lock: rgba(255, 255, 255, .14);
  --tg-btnBg: linear-gradient(180deg, #8a6134, #5f4123); --tg-btnTxt: #fdf6e8;
  --tg-trace: rgba(255, 222, 160, .95);
  /* seats: tint (points, trays, glyphs), fill (the checker), ink (its glyph), rim */
  --tg-t0: #f3e7cb; --tg-f0: radial-gradient(circle at 34% 28%, #fffaf0, #f0e2c4 60%, #d6c39b); --tg-i0: #5b4520; --tg-r0: rgba(0, 0, 0, .3);
  --tg-t1: #d9773c; --tg-f1: radial-gradient(circle at 34% 28%, #ef9350, #cf6a31 60%, #a44b1d); --tg-i1: #fff1e4; --tg-r1: rgba(0, 0, 0, .26);
  --tg-t2: #7d8b9e; --tg-f2: radial-gradient(circle at 34% 28%, #4a5364, #2c3340 60%, #161b24); --tg-i2: #e3ebf8; --tg-r2: rgba(255, 255, 255, .28);
  /* the diamond halves: each seat's tint at the mock's alpha (.26 / .15 alternating) */
  --tg-d0: rgba(243, 231, 203, .26); --tg-d1: rgba(217, 119, 60, .26); --tg-d2: rgba(125, 139, 158, .26);
  --tg-serif: 'Optima', 'Palatino Linotype', Georgia, serif;
  --tg-ui: system-ui, 'Segoe UI', sans-serif;
  --tg-rad: 10px;
}
/* ARCADE — recolour only (GameTheme: `gm-arcade` on the screen). The mock's Arcade palette. */
#trigammon-game-screen.gm-arcade, .gm-arcade .tg-root {
  --tg-bg: radial-gradient(130% 120% at 50% -10%, #1d1440 0%, #120d28 55%, #08050f 100%);
  --tg-felt: #140d2c; --tg-feltLine: rgba(0, 229, 255, .25);
  --tg-wood: linear-gradient(180deg, #2e2059, #170f31);
  --tg-panel: rgba(255, 255, 255, .07); --tg-panel2: rgba(255, 255, 255, .04); --tg-line: rgba(0, 229, 255, .32);
  --tg-txt: #f6f4ff; --tg-dim: rgba(246, 244, 255, .6);
  --tg-mov: #ff4fd8; --tg-movGlow: rgba(255, 79, 216, .8);    /* magenta: Arcade's cyan selection sits too close to blue */
  --tg-sel: #00e5ff; --tg-selGlow: rgba(0, 229, 255, .55); --tg-hit: #ff3b6b; --tg-hitGlow: rgba(255, 59, 107, .6);
  --tg-lock: rgba(255, 255, 255, .18);
  --tg-btnBg: linear-gradient(180deg, #00e5ff, #00a3bf); --tg-btnTxt: #04232a;
  --tg-t0: #ffe14d; --tg-f0: radial-gradient(circle at 34% 28%, #fff5b0, #ffe14d 58%, #dcb61c); --tg-i0: #3a2e00; --tg-r0: rgba(60, 44, 0, .5);
  --tg-t1: #ff2e88; --tg-f1: radial-gradient(circle at 34% 28%, #ff7ab6, #ff2e88 58%, #c30a5d); --tg-i1: #fff0f7; --tg-r1: rgba(255, 255, 255, .35);
  --tg-t2: #5f7cff; --tg-f2: radial-gradient(circle at 34% 28%, #8ba4ff, #3f6bff 58%, #1734b8); --tg-i2: #eaf0ff; --tg-r2: rgba(255, 255, 255, .4);
  --tg-d0: rgba(255, 225, 77, .26); --tg-d1: rgba(255, 46, 136, .26); --tg-d2: rgba(95, 124, 255, .26);
  --tg-serif: system-ui, 'Segoe UI', sans-serif;
}

/* ── setup card (on the screen's palette) ───────────────────────────────── */
#trigammon-game-screen { background: var(--tg-bg); color: var(--tg-txt); }
/* The MP idle bar floats OVER the board rather than taking a row of its own (index.html, beside #tg-mp-timeout-bar):
   .mp-timeout-float is position:absolute, so the wrap is what it is absolute TO (Ramp's rule). */
#trigammon-game-screen .wrap { position: relative; }
.tg-setup-card { max-width: 480px; margin: 24px auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 9px; font-family: var(--tg-ui); background: var(--tg-panel); color: var(--tg-txt); border: 1px solid var(--tg-line); }
.tg-setup-eyebrow { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--tg-sel); font-weight: 700; }
.tg-setup-title { margin: 0; font: 700 26px/1.15 var(--tg-serif); }
.tg-setup-blurb, .tg-setup-hint { margin: 0; line-height: 1.5; font-size: 13.5px; }
.tg-setup-hint { color: var(--tg-dim); font-size: 12px; }
.tg-setup-lab { margin-top: 6px; font-weight: 700; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--tg-dim); }
.tg-setup-seat { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 11px; border-radius: var(--tg-rad); background: var(--tg-panel); border: 1px solid var(--tg-line); }
.tg-setup-seat b { flex: 1; min-width: 0; font-size: 13px; }
.tg-setup-seat span { font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--tg-dim); }
.tg-setup-row { display: flex; align-items: center; gap: 10px; height: 40px; }
.tg-setup-bot { width: 86px; font-size: 12.5px; }
.tg-opts { flex: 1; display: flex; gap: 6px; height: 34px; }
.tg-opt { flex: 1; border-radius: 8px; border: 1px solid var(--tg-line); background: var(--tg-panel); color: var(--tg-dim); font: 700 11px var(--tg-ui); letter-spacing: .04em; cursor: pointer; transition: background .15s, box-shadow .15s, filter .15s; }
.tg-opt[data-on="1"] { background: #8a6134; color: #fdf6e8; border-color: rgba(255, 255, 255, .2); }
.gm-arcade .tg-opt[data-on="1"] { background: #00a3bf; color: #04232a; }
.tg-opt:active { filter: brightness(.85); }
.tg-start { height: 46px; margin-top: 8px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: var(--tg-btnBg); color: var(--tg-btnTxt); font: 700 15px var(--tg-ui); letter-spacing: .04em; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .4); transition: filter .15s; }
.tg-start:active { filter: brightness(.9); }
@media (hover: hover) { .tg-start:hover { filter: brightness(1.12); } .tg-opt:hover { box-shadow: 0 0 0 2px var(--tg-sel); } }

/* the seat symbol, everywhere it appears outside a checker */
.tg-sym { flex: none; display: inline-block; width: 1.25em; text-align: center; font-style: normal; font-weight: 700; line-height: 1; }
.tg-sym[data-s="0"] { color: var(--tg-t0); }
.tg-sym[data-s="1"] { color: var(--tg-t1); }
.tg-sym[data-s="2"] { color: var(--tg-t2); }

/* ── the root (phone first: the mock's 384 × 812 arrangement) ───────────── */
.tg-root {
  --tg-feedH: 22px;
  position: relative; box-sizing: border-box; overflow: hidden;
  width: 100%; height: var(--tg-phone-h, 740px); padding: 8px 6px 6px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 52px var(--tg-feedH) 22px minmax(0, 1fr) 58px 58px;
  grid-template-areas: "opps opps" "feed tog" "note note" "stage stage" "you you" "dice btns";
  gap: 4px 8px;
  background: var(--tg-bg); color: var(--tg-txt); font-family: var(--tg-ui);
  user-select: none; -webkit-user-select: none;
}
.tg-root *, .tg-root *::before, .tg-root *::after { box-sizing: border-box; }
.tg-root button { font-family: inherit; -webkit-tap-highlight-color: transparent; margin: 0; }
.tg-root i, .tg-root em { font-style: normal; }
body.chat-collapsed .tg-root { --tg-feedH: 60px; }   /* TG-M5 — the feed takes the freed strip on a phone */
.tg-col { display: contents; }
.tg-opps { grid-area: opps; display: flex; gap: 6px; min-width: 0; }
.tg-feed { grid-area: feed; min-width: 0; }
.tg-toggle { grid-area: tog; }
.tg-notice { grid-area: note; }
.tg-stagewrap { grid-area: stage; }
.tg-ban[data-you="1"] { grid-area: you; }
.tg-dicepanel { grid-area: dice; }
.tg-btns { grid-area: btns; }
.tg-trays, .tg-msg, .tg-feedhead, .tg-dicehead { display: none; }

/* ── banners ─────────────────────────────────────────────────────────────── */
.tg-ban { position: relative; flex: 1 1 0; min-width: 0; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 6px; border-radius: var(--tg-rad); background: var(--tg-panel); box-shadow: inset 0 0 0 1.5px var(--tg-line); transition: box-shadow .2s; }
.tg-ban[data-on="1"][data-s="0"] { box-shadow: inset 0 0 0 1.5px var(--tg-t0), 0 0 14px -2px var(--tg-t0); }
.tg-ban[data-on="1"][data-s="1"] { box-shadow: inset 0 0 0 1.5px var(--tg-t1), 0 0 14px -2px var(--tg-t1); }
.tg-ban[data-on="1"][data-s="2"] { box-shadow: inset 0 0 0 1.5px var(--tg-t2), 0 0 14px -2px var(--tg-t2); }
.tg-av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tg-panel2); box-shadow: inset 0 0 0 1px var(--tg-line); font-size: 11px; }
.tg-bmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tg-bname { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tg-bname b { min-width: 0; font: 600 12px/1.1 var(--tg-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ⛔ RESERVED even on your own banner (finding 2): a take-over badge must not shove the name */
.tg-bot { flex: none; width: 18px; font: 700 8px/1 var(--tg-ui); letter-spacing: .05em; padding: 2px 0; border-radius: 4px; background: var(--tg-panel2); box-shadow: inset 0 0 0 1px var(--tg-line); white-space: nowrap; overflow: hidden; text-align: center; }
.tg-bot[data-on="0"] { visibility: hidden; }
.tg-rel { font: 700 8px/1 var(--tg-ui); letter-spacing: .06em; color: var(--tg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-rel[data-hot="1"] { color: var(--tg-hit); }
/* ⏱ SLICE C — THE TAKE-OVER BEAT (mock frame 11; tgHandover in trigammon.js). A double knock of a ring on an OVERLAY,
   so the banner's own 1- / 2-layer box-shadow is never animated (a box-shadow keyframe needs the same layer count in
   every frame — .475); the badge STAMPS in by scale on its own box. Opacity + transform only: the name never moves.
   'bot' knocks in the hit colour; 'back' (a reclaim) in the seat's own track colour. */
.tg-ban::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 2px var(--tg-ho, var(--tg-hit)), 0 0 18px var(--tg-ho, var(--tg-hitGlow)); }
.tg-ban[data-handover="back"][data-s="0"] { --tg-ho: var(--tg-t0); }
.tg-ban[data-handover="back"][data-s="1"] { --tg-ho: var(--tg-t1); }
.tg-ban[data-handover="back"][data-s="2"] { --tg-ho: var(--tg-t2); }
.tg-ban[data-handover="bot"]::after, .tg-ban[data-handover="back"]::after { animation: tg-handover 1.2s ease-out; }
.tg-ban[data-handover="bot"] .tg-bot { animation: tg-stamp .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.tg-ban[data-handover="bot"] .tg-rel { animation: tg-relknock 1.2s ease-out; }   /* your own banner has no badge: its line carries it */
@keyframes tg-handover { 0% { opacity: 0; } 12% { opacity: 1; } 32% { opacity: .25; } 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tg-stamp { 0% { opacity: 0; transform: scale(1.9); } 60% { opacity: 1; transform: scale(.9); } 100% { opacity: 1; transform: scale(1); } }
@keyframes tg-relknock { 0%, 60% { color: var(--tg-hit); } 100% { color: var(--tg-dim); } }
.tg-stat { font: 600 9.5px/1 var(--tg-ui); color: var(--tg-dim); white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.tg-od { flex: none; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.tg-turn { flex: none; width: 14px; height: 14px; overflow: hidden; border-radius: 50%; font: 700 0/1 var(--tg-ui); color: transparent; box-shadow: inset 0 0 0 1px var(--tg-line); }
.tg-ban[data-on="1"] .tg-turn { background: var(--tg-sel); box-shadow: none; }
.tg-ban[data-you="1"] { height: 58px; padding: 0 9px; gap: 8px; }
.tg-ban[data-you="1"] .tg-av { width: 32px; height: 32px; font-size: 14px; }
.tg-ban[data-you="1"] .tg-bname b { font-size: 14px; }
.tg-ban[data-you="1"] .tg-stat { font-size: 10px; }
.tg-ban[data-you="1"] .tg-bot { display: none; }

/* ── feed + view toggle + notice ─────────────────────────────────────────── */
.tg-feed { height: var(--tg-feedH); display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 8px; border-radius: 6px; background: var(--tg-panel2); box-shadow: inset 0 0 0 1px var(--tg-line); overflow: hidden; }
.tg-feedl { display: flex; align-items: center; gap: 5px; height: 16px; flex: none; min-width: 0; font: 500 10.5px/1.25 var(--tg-ui); color: var(--tg-dim); }
.tg-feedl span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-feedl[data-hot="1"] { color: var(--tg-txt); }
.tg-feedl .tg-sym { width: 12px; font-size: 10px; }
#tg-feed-1, #tg-feed-2, #tg-feed-3 { display: none; }
body.chat-collapsed #tg-feed-1, body.chat-collapsed #tg-feed-2 { display: flex; }
.tg-toggle { position: relative; height: 22px; align-self: center; display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--tg-panel2); box-shadow: inset 0 0 0 1px var(--tg-line); }
.tg-tog { width: 64px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .07); color: var(--tg-txt); font: 700 8.5px/1 var(--tg-ui); letter-spacing: .08em; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, filter .15s; }
.tg-tog:active { filter: brightness(.85); }
.tg-toggle[data-lock="1"] .tg-tog { cursor: not-allowed; opacity: .55; }
@media (hover: hover) { .tg-toggle[data-lock="0"] .tg-tog:hover { box-shadow: 0 0 0 1.5px var(--tg-sel); color: var(--tg-txt); } }
/* ⛔ RESERVED on the phone too (finding 1): the board must not re-centre when a notice appears */
.tg-notice { width: min(100%, 330px); height: 22px; justify-self: center; align-self: center; display: flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: 11px; font: 700 8.5px/1 var(--tg-ui); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tg-txt); }
.tg-notice[data-on="1"] { background: rgba(224, 85, 61, .14); box-shadow: inset 0 0 0 1px var(--tg-hit); }

/* ── the stage + the three arms ──────────────────────────────────────────── */
.tg-stagewrap { position: relative; min-height: 0; min-width: 0; }
.tg-stage { --tg-camT: 0ms; position: absolute; inset: 0; overflow: hidden; }
.tg-shake { position: absolute; inset: 0; }
.tg-arm {
  --tg-a: 0;
  position: absolute; left: 0; top: 0; width: 301px; height: 100px;
  transform-origin: 0 50%;
  transition: transform var(--tg-camT) cubic-bezier(.45, 0, .2, 1);
  will-change: transform;
}
/* anything that must stay upright: counter-rotate with the arm, on the same clock */
.tg-up { transform: rotate(calc(var(--tg-a) * -1deg)) scaleX(var(--tg-mx, 1)); transition: transform var(--tg-camT) cubic-bezier(.45, 0, .2, 1), opacity .25s; }
.tg-felt { position: absolute; inset: 0; background: var(--tg-felt); box-shadow: inset 0 0 0 1px var(--tg-feltLine);
  /* the Y: the junction end is cut to a point so the three arms tile the centre; laid flat, it squares off */
  clip-path: polygon(0 50%, 28.87px 0, 100% 0, 100% 100%, 28.87px 100%);
  transition: clip-path var(--tg-camT) cubic-bezier(.45, 0, .2, 1); }
/* laid flat it squares off — at u = --tg-trim, which a PHONE sets to clip the dead junction cap (tgPoses) */
.tg-stage[data-view="rows"] .tg-felt { clip-path: polygon(var(--tg-trim, 0px) 50%, var(--tg-trim, 0px) 0, 100% 0, 100% 100%, var(--tg-trim, 0px) 100%); }
.tg-barline { position: absolute; left: 150px; top: 0; width: 6px; height: 100%; background: var(--tg-wood); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4); }
.tg-hub { position: absolute; left: -6.6px; top: -6.6px; width: 13.2px; height: 13.2px; border-radius: 50%; background: var(--tg-wood); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); transform-origin: 50% 50%; transition: transform var(--tg-camT) cubic-bezier(.45, 0, .2, 1), opacity var(--tg-camT); z-index: 7; }
.tg-hub[data-on="0"] { opacity: 0; }
.tg-arm[data-inset="1"] { opacity: .92; }

/* the lane — your track, dashed along your own edge of your two arms (the FTUE; the camera's seat on MY BOARD) */
.tg-lane { position: absolute; left: 30px; width: 246px; height: 4px; opacity: .8; z-index: 2; pointer-events: none; display: none; }
.tg-arm[data-numside="top"] .tg-lane { display: block; top: 1px; }
.tg-arm[data-numside="bot"] .tg-lane { display: block; bottom: 1px; }
.tg-arm[data-lane="0"] .tg-lane { background: repeating-linear-gradient(90deg, var(--tg-t0) 0 8px, transparent 8px 16px); }
.tg-arm[data-lane="1"] .tg-lane { background: repeating-linear-gradient(90deg, var(--tg-t1) 0 8px, transparent 8px 16px); }
.tg-arm[data-lane="2"] .tg-lane { background: repeating-linear-gradient(90deg, var(--tg-t2) 0 8px, transparent 8px 16px); }

/* a point: 20 × 100, a split-tint diamond — the upper half the arm's home seat, the lower the seat starting on it */
.tg-pt { position: absolute; top: 0; width: 20px; height: 100px; cursor: default; }
.tg-dia { position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(to bottom, var(--tg-dH) 0 50%, var(--tg-dS) 50% 100%); transition: filter .15s; }
.tg-pt[data-alt="1"] .tg-dia { opacity: .6; }
.tg-arm[data-hs="0"] { --tg-dH: var(--tg-d0); } .tg-arm[data-hs="1"] { --tg-dH: var(--tg-d1); } .tg-arm[data-hs="2"] { --tg-dH: var(--tg-d2); }
.tg-arm[data-ss="0"] { --tg-dS: var(--tg-d0); } .tg-arm[data-ss="1"] { --tg-dS: var(--tg-d1); } .tg-arm[data-ss="2"] { --tg-dS: var(--tg-d2); }
/* a 44px-ish tap halo for the points you can act on (the mock's verdict: you tap a stack, not a sliver) */
.tg-pt[data-st="move"], .tg-pt[data-st="sel"], .tg-pt[data-st="dest"], .tg-pt[data-st="hit"] { cursor: pointer; }
.tg-pt[data-st="dest"]::after, .tg-pt[data-st="hit"]::after, .tg-pt[data-st="move"]::after { content: ''; position: absolute; inset: 0 -4px; }
@media (hover: hover) { .tg-root[data-lock="0"] .tg-pt[data-st="move"]:hover .tg-dia, .tg-root[data-lock="0"] .tg-pt[data-st="dest"]:hover .tg-dia { filter: brightness(1.5); } }
.tg-pt:active .tg-dia { filter: brightness(.8); }
.tg-ring { position: absolute; left: -.5px; top: 23px; width: 21px; height: 54px; border-radius: 20px; display: none; z-index: 1; pointer-events: none; }
.tg-pt[data-st="dest"] .tg-ring, .tg-pt[data-st="sel"] .tg-ring { display: block; border: 2px solid var(--tg-sel); box-shadow: 0 0 14px var(--tg-selGlow); }
.tg-pt[data-st="hit"] .tg-ring { display: block; border: 2px solid var(--tg-hit); box-shadow: 0 0 14px var(--tg-hitGlow); }
.tg-pt[data-st="dest"] .tg-dia { background: rgba(232, 193, 90, .45); }
.gm-arcade .tg-pt[data-st="dest"] .tg-dia { background: rgba(0, 229, 255, .4); }
.tg-pt[data-st="hit"] .tg-dia { background: rgba(224, 85, 61, .5); }
.tg-pt[data-st="sel"] .tg-dia { background: rgba(232, 193, 90, .7); opacity: 1; }
.gm-arcade .tg-pt[data-st="sel"] .tg-dia { background: rgba(0, 229, 255, .65); }
.tg-pt[data-st="blk"] .tg-dia { background: repeating-linear-gradient(45deg, rgba(155, 157, 164, .45) 0 2px, transparent 2px 5px); opacity: 1; }
/* the other seats' last turn, left on the board until they move again (Backgammon's trace, backgammon.js :250):
   a ring on the CHECKERS that arrived (never the point — a ringed point is a landing you can take), red + a
   double ring for one that hit, and a faint dashed outline on a point one left. Shape, not only colour. */
/* ⭐ DOTTED, not solid (owner playtest 2026-09-22): a solid gold ring read as "yours to move" — the same family as
   your breathing ring below. box-shadow cannot be dotted, so it is a ::before (::after is the glyph). */
.tg-chk::before { content: ''; position: absolute; inset: -2.6px; border-radius: 50%; display: none; pointer-events: none; }
.tg-pt[data-trace="to"] .tg-chk[data-on="1"]::before { display: block; border: 1.6px dotted var(--tg-trace); }
.tg-pt[data-trace="hit"] .tg-chk[data-on="1"] { box-shadow: 0 0 0 1.6px var(--tg-hit), 0 0 0 3.4px rgba(0, 0, 0, .55), 0 0 0 4.6px var(--tg-hit); }
.tg-pt[data-st=""][data-trace="from"] .tg-ring { display: block; border: 1.2px dashed var(--tg-trace); opacity: .55; }
.tg-mark { position: absolute; left: -4px; width: 28px; top: 50%; height: 18px; margin-top: -9px; display: flex; align-items: center; justify-content: center; z-index: 30; font: 700 16px/1 var(--tg-ui); text-shadow: 0 1px 2px rgba(0, 0, 0, .8); pointer-events: none; }
.tg-pt[data-st="dest"] .tg-mark { color: var(--tg-sel); }
.tg-pt[data-st="hit"] .tg-mark { color: var(--tg-hit); }
.tg-pt[data-st="blk"] .tg-mark { color: var(--tg-dim); }

/* checkers — 18 px, stacked from the owner's edge; 6–8 overlap; 9+ keep 8 and a ×N badge */
.tg-chk { position: absolute; left: 1px; top: 0; width: 18px; height: 18px; border-radius: 50%; display: none; pointer-events: none; }
.tg-chk[data-on="1"] { display: block; }
.tg-chk[data-s="0"] { --tg-rim: var(--tg-r0); background: var(--tg-f0); box-shadow: inset 0 0 0 1.2px var(--tg-rim), 0 1.3px 3.6px -1px rgba(0, 0, 0, .55); }
.tg-chk[data-s="1"] { --tg-rim: var(--tg-r1); background: var(--tg-f1); box-shadow: inset 0 0 0 1.2px var(--tg-rim), 0 1.3px 3.6px -1px rgba(0, 0, 0, .55); }
.tg-chk[data-s="2"] { --tg-rim: var(--tg-r2); background: var(--tg-f2); box-shadow: inset 0 0 0 1.2px var(--tg-rim), 0 1.3px 3.6px -1px rgba(0, 0, 0, .55); }
.tg-chk::after { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 var(--tg-gly, 11.2px)/1 var(--tg-ui);
  transform: rotate(calc(var(--tg-a) * -1deg)) scaleX(var(--tg-mx, 1)); transition: transform var(--tg-camT) cubic-bezier(.45, 0, .2, 1); }
.tg-chk[data-s="0"]::after { content: '▲'; color: var(--tg-i0); }
.tg-chk[data-s="1"]::after { content: '■'; color: var(--tg-i1); }
.tg-chk[data-s="2"]::after { content: '●'; color: var(--tg-i2); }
/* ⛔⛔ NO SEAT QUALIFIER (MP playtest 2026-09-26): these three were .tg-chk[data-s="0"] — slice 1 always sat you at 0, so online at
   seat 1 or 2 your checkers had NO "can move" ring, no breathe, no picked-up ring. A move / sel point only ever holds
   YOUR checkers; the rim is the seat's own (--tg-rim). Board-suite §12 reads the computed ring at seat 2. */
.tg-pt[data-st="move"] .tg-chk { box-shadow: 0 0 0 1.6px var(--tg-mov), inset 0 0 0 1.2px var(--tg-rim); }
/* ⭐ your movable checkers BREATHE, in BLUE — Backgammon's "can move" colour (owner 2026-09-22); gold stays the
   picked-up checker and its landings, so "can move" and "picked up" never share a colour. (owner playtest 2026-09-22) — a slow pulse of the ring, so yours pop out of a busy
   board. Scoped to an UNLOCKED root: a running box-shadow animation beats the lock rule below (animations outrank
   author declarations). The SELECTED one holds still — it is the picked-up state. Reduced motion: static ring. */
.tg-root[data-lock="0"] .tg-pt[data-st="move"] .tg-chk { animation: tg-breathe 1.8s ease-in-out infinite; }
@keyframes tg-breathe {
  /* ⛔ SAME LAYER COUNT in every keyframe: a box-shadow list only interpolates layer by layer — with 2 layers here and
     3 at 50% it FLIPPED on/off instead of fading (owner, 2026-09-22 .475). The glow rests at 0 px, transparent. */
  0%, 100% { box-shadow: 0 0 0 1.2px var(--tg-mov), 0 0 0 0 rgba(0, 0, 0, 0), inset 0 0 0 1.2px var(--tg-rim); }
  50% { box-shadow: 0 0 0 2.4px var(--tg-mov), 0 0 11px var(--tg-movGlow), inset 0 0 0 1.2px var(--tg-rim); }
}
.tg-pt[data-st="sel"] .tg-chk { box-shadow: 0 0 0 2px var(--tg-sel), 0 0 12px var(--tg-selGlow), inset 0 0 0 1.2px var(--tg-rim); }
.tg-root[data-lock="1"] .tg-pt[data-st="move"] .tg-chk { box-shadow: none; }
.tg-cnt { position: absolute; left: -4px; top: 50%; width: 28px; height: 14px; margin-top: -7px; border-radius: 7px; display: none; align-items: center; justify-content: center; z-index: 20; font: 700 9px/1 var(--tg-ui); color: var(--tg-txt); background: rgba(8, 8, 10, .86); box-shadow: inset 0 0 0 1px var(--tg-line);
  transform: rotate(calc(var(--tg-a) * -1deg)) scaleX(var(--tg-mx, 1)); transition: transform var(--tg-camT) cubic-bezier(.45, 0, .2, 1), opacity .25s; pointer-events: none; }
.tg-cnt:not(:empty) { display: flex; }

/* track numbers — beyond the camera seat's own edge of its two arms */
.tg-num { position: absolute; left: -4px; width: 28px; height: 12px; display: none; align-items: center; justify-content: center; font: 600 9.2px/1 var(--tg-ui); color: var(--tg-dim); pointer-events: none; }
.tg-arm[data-numside="top"] .tg-num { display: flex; top: -14px; }
.tg-arm[data-numside="bot"] .tg-num { display: flex; top: 102px; }
.tg-arm[data-inset="1"] .tg-num, .tg-arm[data-inset="1"] .tg-lane { display: none; }
/* while the camera moves, the numbers and the lane (already the NEW board's) are hidden; they fade in on arrival */
.tg-num, .tg-lane { transition: opacity .18s; }
.tg-stage[data-cam="1"] .tg-num, .tg-stage[data-cam="1"] .tg-lane { opacity: 0; transition: opacity .08s; }

/* the tip end cap: the home seat's OFF tray (upper) and the starting seat's BAR (lower) — fixed halves */
.tg-cap { position: absolute; left: 276px; top: 0; width: 25px; height: 100px; background: var(--tg-wood); border-left: 1px solid rgba(0, 0, 0, .45); }
.tg-tray { position: absolute; left: 1.6px; width: 21.8px; border-radius: 4px; background: rgba(0, 0, 0, .34); box-shadow: inset 0 0 0 1px var(--tg-line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: box-shadow .2s, background .2s; }
.tg-tray[data-kind="off"] { top: 1.2px; height: 40px; }
.tg-tray[data-kind="bar"] { top: 46px; height: 48px; }
.tg-tray b { font: 700 8.8px/1 var(--tg-ui); }
.tg-tray[data-s="0"] b { color: var(--tg-t0); } .tg-tray[data-s="1"] b { color: var(--tg-t1); } .tg-tray[data-s="2"] b { color: var(--tg-t2); }
.tg-tray em { font: 700 11.6px/1 var(--tg-ui); color: var(--tg-txt); font-variant-numeric: tabular-nums; }
.tg-tray[data-kind="bar"][data-hot="1"] { background: rgba(224, 85, 61, .2); box-shadow: inset 0 0 0 1.5px var(--tg-hit); }
.tg-tray[data-kind="bar"][data-hot="1"] em { color: var(--tg-hit); }
.tg-tray[data-sel="1"] { box-shadow: inset 0 0 0 2px var(--tg-sel), 0 0 12px var(--tg-selGlow); }
.tg-tray[data-flash="1"] { animation: tg-flash .6s ease-out; }
.tg-tray[data-live="1"] { cursor: pointer; box-shadow: inset 0 0 0 2px var(--tg-sel), 0 0 12px var(--tg-selGlow); background: rgba(232, 193, 90, .22); }
@keyframes tg-flash { 0% { box-shadow: inset 0 0 0 2px var(--tg-hit), 0 0 18px var(--tg-hitGlow); } 100% { box-shadow: inset 0 0 0 1.5px var(--tg-hit); } }

/* "VIEWING BOT TWO'S BOARD" — load-bearing when the camera follows another seat (TG-M1; Tidebreaker's lesson) */
.tg-viewing { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); height: 20px; padding: 0 10px; display: flex; align-items: center; border-radius: 10px; font: 700 9px/1 var(--tg-ui); letter-spacing: .08em; white-space: nowrap; background: var(--tg-panel); box-shadow: inset 0 0 0 1px var(--tg-line); z-index: 40; opacity: 0; transition: opacity .25s; pointer-events: none; }
.tg-viewing[data-on="1"] { opacity: 1; }

/* ⭐ THE FLIP (owner 2026-09-22) — .tg-flip wraps the arms, hub and arrows; tgSetDir is its one writer (a flat
   scaleX(-1) at rest, a 3D rotateY turn while flipping). The perspective lives on its parent, .tg-shake. Everything
   upright counter-mirrors by --tg-mx; while it turns, the text and the arrows fade out (the mirror switches at the
   half, edge-on, unseen) and fade back in when it lands. The glyphs ▲ ■ ● read the same mirrored, so they stay. */
.tg-shake { perspective: 1600px; }
.tg-flip { position: absolute; inset: 0; transform-origin: 50% 50%; }
.tg-stage[data-flipping="1"] .tg-up, .tg-stage[data-flipping="1"] .tg-cnt, .tg-stage[data-flipping="1"] .tg-dirs { opacity: 0; transition: opacity .12s; }
.tg-stage[data-flipping="1"] .tg-chk::after { transition: none; }
.tg-dirs { transition: opacity .3s; }

/* the direction arrows (owner playtest 2026-09-22) — drawn in stage px by tgPaintDirs, one set per view. Only the
   current view's set shows, and neither while the camera moves: the old set fades OUT as the move starts and the new
   one fades IN once it settles (never a pop). Seat tint, soft — a guide, not a highlight. */
.tg-dirs { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 8; }
.tg-dir { opacity: 0; transition: opacity .3s ease-out; }
.tg-dir polyline { fill: none; stroke-width: var(--tg-dw); stroke-linecap: round; stroke-linejoin: round; }
.tg-dir[data-s="0"] polyline { stroke: var(--tg-t0); } .tg-dir[data-s="0"] polygon { fill: var(--tg-t0); }
.tg-dir[data-s="1"] polyline { stroke: var(--tg-t1); } .tg-dir[data-s="1"] polygon { fill: var(--tg-t1); }
.tg-dir[data-s="2"] polyline { stroke: var(--tg-t2); } .tg-dir[data-s="2"] polygon { fill: var(--tg-t2); }
.tg-stage[data-view="y"] .tg-dir-y, .tg-stage[data-view="rows"] .tg-dir-rows { opacity: .42; }
.tg-stage[data-cam="1"] .tg-dir { opacity: 0; transition: opacity .2s ease-in; }

/* the flight layer — an absolute sibling of the arms inside the stage, never fixed */
.tg-fly { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
.tg-flychip { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; line-height: 1; z-index: 72;
  transition: left .16s ease-in-out, top .16s ease-in-out; box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .6); }
.tg-flychip[data-s="0"] { background: var(--tg-f0); color: var(--tg-i0); }
.tg-flychip[data-s="1"] { background: var(--tg-f1); color: var(--tg-i1); }
.tg-flychip[data-s="2"] { background: var(--tg-f2); color: var(--tg-i2); }
.tg-burst { position: absolute; width: 0; height: 0; z-index: 73; pointer-events: none; }
.tg-burst-ring { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; border: 4px solid #ff5555; animation: rosetteRing .55s ease-out forwards; }
.tg-burst-spark { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #ff7b7b; animation: rosetteSpark .55s ease-out forwards; }

/* ── the first-run card (owner 2026-09-22) — the picks apply live and the board behind is the explanation.
   PC: CENTRED over the board, on a light dim (owner playtest 2026-09-23: at the left edge it read as a side menu,
   not a choice to make before playing — covering part of the board is fine). Phone: a sheet over the lower strip.
   The dim is see-through and lets clicks by; the real view buttons are lifted ABOVE it, lit by HintArrow. ──── */
/* ⏱ THE OPENING CEREMONY (owner 2026-09-26, TG-M7; tgCeremony) — the first-run card's overlay shape: a dim and a
   centred opaque card. The WHOLE overlay is the skip target (tap anywhere). Rows: roll → (tie → roll | wait) →
   win / out; every state change is opacity / transform / colour, so no row moves. The pair's flight (.tg-cfly) is a
   child of the overlay, not the card, so it stays opaque while the card and dim fade under it. */
.tg-cer { position: absolute; inset: 0; z-index: 80; display: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tg-cer[data-on="1"] { display: block; }
.tg-cer::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .42); transition: opacity .3s; }
.tg-ccard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 316px; box-sizing: border-box; padding: 14px 14px 10px; border-radius: 14px;
  background: #1b1d23; box-shadow: inset 0 0 0 1.5px var(--tg-sel), 0 14px 40px -6px rgba(0, 0, 0, .75); display: flex; flex-direction: column; gap: 7px;
  animation: tg-cer-in .3s ease-out both; transition: opacity .3s; }
.gm-arcade .tg-ccard { background: #0d1024; }   /* OPAQUE, like .tg-icard: the panel tokens are washes */
/* the card leaves by its OWN animation: tg-cer-in holds opacity 1 (fill both), and a running animation beats a plain
   opacity rule — the card stayed up under the flying pair (headless frame, .560) */
.tg-cer[data-fly="1"] .tg-ccard { animation: tg-cer-out .3s ease-in forwards; }
.tg-cer[data-fly="1"]::before { opacity: 0; }
@keyframes tg-cer-out { to { opacity: 0; transform: translate(-50%, -50%) scale(.96); } }
@keyframes tg-cer-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.tg-chead { font: 800 15px/1.2 var(--tg-ui); letter-spacing: .1em; color: var(--tg-txt); text-align: center; }
.tg-csub { font: 500 10.5px/1.3 var(--tg-ui); color: var(--tg-dim); text-align: center; margin-bottom: 2px; }
.tg-crow { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--tg-line); transition: opacity .3s, box-shadow .3s, background .3s; }
.tg-cname { flex: 1; min-width: 0; font: 700 13px/1.1 var(--tg-ui); color: var(--tg-txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-cdie { flex: none; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; }
.tg-crow[data-st="wait"] { opacity: .45; }                                   /* its die still counts — it waits */
.tg-crow[data-st="tie"] { box-shadow: inset 0 0 0 1.5px var(--tg-hit); }
.tg-crow[data-st="win"] { background: rgba(232, 193, 90, .13); box-shadow: inset 0 0 0 2px var(--tg-sel); }
.gm-arcade .tg-crow[data-st="win"] { background: rgba(0, 229, 255, .12); }
.tg-crow[data-st="win"] .tg-cdie { filter: drop-shadow(0 0 8px var(--tg-selGlow)); }
.tg-crow[data-st="out"] { opacity: .5; }
.tg-crow[data-st="out"] .tg-cdie { animation: tg-cer-drop .6s cubic-bezier(.5, 0, .8, .4) forwards; }
@keyframes tg-cer-drop { to { transform: translateY(46px) rotate(38deg); opacity: 0; } }
.tg-cnote { height: 24px; display: flex; align-items: center; justify-content: center; text-align: center; font: 700 9.5px/1.25 var(--tg-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--tg-sel); overflow: hidden; }   /* two lines RESERVED: a tie names two or three seats */
.tg-cnote[data-hot="1"] { color: var(--tg-hit); }
.tg-cskip { font: 600 8.5px/1 var(--tg-ui); letter-spacing: .16em; color: var(--tg-dim); text-align: center; }
.tg-cfly { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tg-intro { position: absolute; inset: 0; z-index: 80; display: none; pointer-events: none; }
.tg-intro[data-on="1"] { display: block; }
.tg-intro::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .42); }
.tg-root[data-intro="1"] .tg-toggle { z-index: 85; }
.tg-icard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 340px; box-sizing: border-box; padding: 16px; border-radius: 14px; pointer-events: auto;
  background: #1b1d23; box-shadow: inset 0 0 0 1.5px var(--tg-sel), 0 14px 40px -6px rgba(0, 0, 0, .75); display: flex; flex-direction: column; gap: 8px; }
.gm-arcade .tg-icard { background: #0d1024; }   /* OPAQUE: the panel tokens are near-transparent washes, and the card sits on text */
.tg-ihead { font: 800 15px/1.2 var(--tg-ui); color: var(--tg-txt); }
.tg-ilab { font: 700 9px/1 var(--tg-ui); letter-spacing: .14em; color: var(--tg-dim); margin-top: 2px; }
.tg-iopts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tg-iopt { display: flex; align-items: center; gap: 7px; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 9px; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, .05); color: var(--tg-txt); box-shadow: inset 0 0 0 1px var(--tg-line); transition: box-shadow .15s, background .15s; }
.tg-iopt[data-on="1"] { background: rgba(232, 193, 90, .14); box-shadow: inset 0 0 0 2px var(--tg-sel); }
.gm-arcade .tg-iopt[data-on="1"] { background: rgba(0, 229, 255, .12); }
.tg-iopt:disabled { cursor: progress; }
.tg-iico { flex: none; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font: 700 20px/1 var(--tg-ui); color: var(--tg-sel); font-style: normal; }
.tg-iico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tg-itxt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tg-itxt b { font: 700 12.5px/1.1 var(--tg-ui); }
.tg-itxt small { font: 500 10px/1.2 var(--tg-ui); color: var(--tg-dim); }
.tg-inote { font: 500 10.5px/1.4 var(--tg-ui); color: var(--tg-dim); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-top: 4px; }
.tg-ifake { display: flex; gap: 2px; padding: 2px; width: max-content; border-radius: 8px; background: var(--tg-panel); box-shadow: inset 0 0 0 1px var(--tg-line); }
.tg-ifake i { font: 700 8.5px/1 var(--tg-ui); font-style: normal; letter-spacing: .08em; color: var(--tg-txt); background: rgba(255, 255, 255, .07); border-radius: 6px; padding: 5px 9px; }
.tg-inote b { color: var(--tg-txt); font-weight: 700; }
/* the first-run card points at the REAL buttons with HintArrow (hint-arrow.css) — the standard "look here" hint this
   card gave birth to (2026-09-22). TriGammon only picks its colour: the selection gold (Arcade's cyan follows). */
.tg-root { --ha-color: var(--tg-sel); --ha-glow: var(--tg-selGlow); }
.tg-icard .tg-igo { width: 100%; flex: none; margin-top: 4px; }
@media (max-width: 999px) {
  .tg-icard { left: 6px; right: 6px; top: auto; bottom: 6px; width: auto; transform: none; padding: 12px; gap: 6px; }
}

/* ── dice + buttons ──────────────────────────────────────────────────────── */
.tg-dicepanel { display: flex; align-items: center; min-width: 0; }
.tg-dicebox { --tg-die: 34px; --tg-dgap: 6px; position: relative; width: calc(var(--tg-die) * 4 + var(--tg-dgap) * 3); height: var(--tg-die); display: flex; gap: var(--tg-dgap); }
.tg-dghost { flex: none; width: var(--tg-die); height: var(--tg-die); border-radius: 7px; border: 1.5px dashed var(--tg-line); background: rgba(255, 255, 255, .03); }
.tg-dicerow { position: absolute; left: 0; top: 0; height: var(--tg-die); display: flex; gap: var(--tg-dgap); align-items: center; }
.tg-die { position: relative; display: inline-flex; }
.tg-die[data-used="1"] > :first-child { opacity: .4; filter: grayscale(.5); }
.tg-dieused { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font: 700 18px/1 var(--tg-ui); color: rgba(20, 16, 10, .7); text-shadow: 0 0 3px rgba(255, 255, 255, .6); pointer-events: none; }
.tg-die[data-used="1"] .tg-dieused { display: flex; }
.tg-dicerow[data-lock="1"] .tg-die { filter: saturate(.6); }
.tg-btns { display: flex; align-items: center; gap: 6px; }
.tg-btn { width: 104px; height: 46px; border-radius: var(--tg-rad); border: 1px solid var(--tg-line); background: var(--tg-btnBg); color: var(--tg-btnTxt); font: 700 14px/1 var(--tg-ui); letter-spacing: .04em; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); transition: filter .12s; }
/* ONLINE the button's longest labels ("Take my seat back", "🤖 playing for Samantha") wrap onto two lines at a
   smaller size rather than overflow the phone's 96 px (finding 3's rule: size it for its widest label) */
.tg-btn[data-long="1"] { font-size: 10.5px; line-height: 1.15; white-space: normal; overflow: hidden; padding: 0 4px; }
.tg-bot[data-held="1"] { text-overflow: ellipsis; }
.tg-btn:disabled { background: var(--tg-lock); color: var(--tg-dim); border: 1px dashed var(--tg-line); box-shadow: none; cursor: not-allowed; }
.tg-btn:not(:disabled):active { filter: brightness(.88); }
.tg-undo { width: 46px; height: 46px; border-radius: var(--tg-rad); border: 1px solid var(--tg-line); background: var(--tg-panel); color: var(--tg-txt); font: 700 14px/1 var(--tg-ui); cursor: pointer; transition: filter .12s; }
.tg-undo:disabled { color: var(--tg-dim); border-style: dashed; background: transparent; cursor: not-allowed; }
.tg-undo:not(:disabled):active { filter: brightness(.85); }
@media (hover: hover) { .tg-btn:not(:disabled):hover { filter: brightness(1.12); box-shadow: 0 0 12px -2px var(--tg-selGlow); } .tg-undo:not(:disabled):hover { box-shadow: 0 0 0 1.5px var(--tg-sel); } }

/* ── the end screen rows ─────────────────────────────────────────────────── */
.tg-endrows { display: flex; flex-direction: column; gap: 6px; }
.tg-endrow { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.tg-endrow[data-win="1"] { box-shadow: inset 0 0 0 1.5px #e8c15a; }
.tg-endpl { font-weight: 800; }
.tg-endnm { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.tg-endst { font-size: 12px; opacity: .75; }
.tg-endsc { font-weight: 800; font-variant-numeric: tabular-nums; }
.tg-endnote { margin-top: 8px; font-size: 12px; opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  .tg-root *, .tg-root *::before, .tg-root *::after { animation: none !important; transition: none !important; }
}

/* ── PHONE ───────────────────────────────────────────────────────────────── */
@media (max-width: 999px) {
  #trigammon-game-screen.tg-playing .wrap { padding: 0 2px; max-width: none; }
  #trigammon-game-screen.tg-playing .topbar { display: none; }
  /* ⛔ the NOTCH: the hidden topbar was the only thing carrying env(safe-area-inset-top), so the board drew under an
     iPhone's status bar + camera (the 2026-09-22 notch sweep, style.css; test/_safe_area_top.test.js) */
  #trigammon-game-screen.tg-playing > .wrap { padding-top: env(safe-area-inset-top, 0px); }   /* PADDING: a margin collapses through the screen (min-height 100vh) and grew the page by the notch (.476) */
}
/* the 360 × 740 floor — same slots, same arrangement */
@media (max-width: 370px) {
  .tg-root { padding: 6px 5px 5px; gap: 4px 6px; }
  .tg-dicebox { --tg-die: 30px; --tg-dgap: 5px; }
  .tg-btn { width: 96px; }
  .tg-undo { width: 42px; }
  .tg-tog { width: 58px; }
  .tg-stat { font-size: 9px; }
}

/* ── DESKTOP — ONE design box, scaled as a unit by BoardFit (the mock's 1280 × 637 less the 84px chat strip) ── */
@media (min-width: 1000px) {
  #trigammon-game-screen .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  .tg-root {
    width: 1280px; height: 553px; padding: 14px;
    display: flex; flex-direction: row; gap: 14px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 26px 60px -30px #000;
  }
  .tg-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
  .tg-colL { width: 300px; flex: none; }
  .tg-colC { flex: 1 1 0; gap: 6px; }
  .tg-colR { width: 306px; flex: none; }
  .tg-opps { flex-direction: column; gap: 10px; }
  .tg-ban { flex: none; height: 96px; gap: 9px; padding: 0 11px; }
  .tg-av { width: 32px; height: 32px; font-size: 14px; }
  .tg-bname b { font-size: 14px; }
  .tg-bot { width: 64px; font-size: 8.5px; padding: 3px 4px; }
  .tg-rel { font-size: 8.5px; letter-spacing: .09em; }
  .tg-stat { font-size: 10.5px; }
  .tg-od { width: 26px; height: 26px; }
  .tg-turn { width: auto; height: auto; padding: 3px 5px; border-radius: 4px; font: 700 9px/1 var(--tg-ui); letter-spacing: .08em; color: transparent; box-shadow: none; }
  .tg-ban[data-on="1"] .tg-turn { color: #15161b; }
  .tg-ban[data-you="1"] { height: 62px; }
  .tg-ban[data-you="1"] .tg-bot { display: none; }
  .tg-feed { flex: 1 1 0; height: auto; justify-content: flex-start; gap: 6px; padding: 10px 11px; border-radius: var(--tg-rad); }
  .tg-feedhead, .tg-trayhead, .tg-dicehead { display: block; font: 700 9px/1 var(--tg-ui); letter-spacing: .16em; color: var(--tg-dim); }
  .tg-feedhead { margin-bottom: 3px; }
  #tg-feed-1, #tg-feed-2, #tg-feed-3 { display: flex; }
  .tg-feedl { height: 18px; font-size: 11px; }
  .tg-notice { flex: none; align-self: center; width: 380px; font-size: 9.5px; }
  .tg-stagewrap { flex: 1 1 0; }
  .tg-trays { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: var(--tg-rad); background: var(--tg-panel2); box-shadow: inset 0 0 0 1px var(--tg-line); }
  .tg-trayhead { margin-bottom: 3px; }
  .tg-trow { display: flex; align-items: center; gap: 8px; height: 20px; font: 500 11px/1 var(--tg-ui); color: var(--tg-dim); }
  .tg-trow .tg-sym { font-size: 11px; }
  .tg-tnm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tg-toff { width: 58px; text-align: right; color: var(--tg-txt); font-variant-numeric: tabular-nums; }
  .tg-tbar { width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
  .tg-tbar[data-hot="1"] { color: var(--tg-hit); }
  .tg-toggle { height: 30px; align-self: stretch; }
  .tg-tog { flex: 1; width: auto; font-size: 9.5px; }
  .tg-dicepanel { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; border-radius: var(--tg-rad); background: var(--tg-panel2); box-shadow: inset 0 0 0 1px var(--tg-line); }
  .tg-dicebox { --tg-die: 40px; --tg-dgap: 8px; }
  .tg-msg { display: flex; flex: 1 1 0; min-height: 0; align-items: center; font: 500 11.5px/1.35 var(--tg-ui); color: var(--tg-dim); overflow: hidden; }
  .tg-btns { gap: 8px; }
  .tg-btn { flex: 1; width: auto; height: 44px; }
  .tg-undo { width: 74px; height: 44px; font-size: 12px; }
}
