/* =====================================================================
   ULTITACTOE — THE RECESS DESIGN SYSTEM, then the game.
   =====================================================================
   Tokens are lifted VERBATIM from the monolith's production stylesheet
   (tryrecess/monolith, apps/web/src/styles/tailwind.css, `.recess-ds`
   light block + `.dark .recess-ds` dark block), read from origin/production
   on 2026-09-22. Component recipes follow Boop Battle's styles.css, which
   transcribed them from https://recess.gg/design. If a value here looks
   wrong, re-read the monolith rather than "fixing" it by eye.

   THEME. The page is paper (light) by default, as the design page is, and
   follows the OS to dark. `data-theme="light|dark"` on <body> is a local
   override, mirroring the monolith's `data-ds-theme`. Every colour below is
   a token, so both themes come from the two blocks and nothing else.

   The rules the system states for anyone building a surface:
     - Satoshi and nothing else.
     - The accent gradient on a few words, a thin rule, a small number —
       never a whole surface. Here: the word "tactoe", the room code, and
       the ring around the FORCED BOARD (the one highlight moment the game
       has). Nothing else.
     - Pills for buttons and chips; 14px cards, 10px inputs.
     - Structure from soft shadows and hairlines, not hard borders.
     - Glass only over colour or imagery. There is none here.
   ===================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ds-bg);
  color: var(--ds-ink);
  font-family: var(--ds-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- tokens: LIGHT (verbatim) --------------------------------------- */
.recess-ds {
  --ds-bg: #f1f4f5;
  --ds-bg-2: #e9edee;
  --ds-card: #ffffff;
  --ds-ink: #050505;
  --ds-ink-2: rgba(5, 5, 5, 0.76);
  --ds-ink-3: rgba(5, 5, 5, 0.58);
  --ds-ink-4: rgba(5, 5, 5, 0.32);
  --ds-ink-5: rgba(5, 5, 5, 0.12);
  --ds-rule: rgba(5, 5, 5, 0.12);
  --ds-rule-strong: rgba(5, 5, 5, 0.24);
  --ds-ink-fixed: #050505;
  --ds-bg-fixed: #f1f4f5;
  --ds-rule-on-dark: rgba(243, 243, 241, 0.18);
  --ds-ink-on-dark-2: rgba(243, 243, 241, 0.78);
  --ds-ink-on-dark-3: rgba(243, 243, 241, 0.55);
  --ds-accent-grad: linear-gradient(90deg, #7c3aed, #a855f7);
  --ds-accent-1: #7c3aed;
  --ds-accent-2: #a855f7;
  --ds-accent-3: #d7b06a;
  --ds-signal: #d7b06a;
  --ds-blue: #3d4ee8;
  --ds-blue-soft: #e4e6fd;
  --ds-purple: #8b3fc9;
  --ds-purple-soft: #efe3fb;
  --ds-red: #f04a37;
  --ds-red-soft: #fde0da;
  --ds-amber: #f5a623;
  --ds-amber-soft: #fdecc6;
  --ds-green: #3fae47;
  --ds-green-soft: #ddf3df;
  --ds-info: var(--ds-blue);
  --ds-info-soft: var(--ds-blue-soft);
  --ds-success: var(--ds-green);
  --ds-success-soft: var(--ds-green-soft);
  --ds-warning: #8f5600;
  --ds-warning-solid: var(--ds-amber);
  --ds-warning-soft: var(--ds-amber-soft);
  --ds-danger: var(--ds-red);
  --ds-danger-soft: var(--ds-red-soft);
  --ds-success-text: #1f7a29;
  --ds-danger-text: #c0301f;
  --ds-focus-ring: rgba(5, 5, 5, 0.5);
  --ds-focus-ring-soft: rgba(5, 5, 5, 0.16);
  --ds-font-display: "Satoshi", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ds-font-body: "Satoshi", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ds-track-display: -0.04em;
  --ds-track-head: -0.03em;
  --ds-track-label: 0.04em;
  --ds-lead-display: 0.92;
  --ds-lead-body: 1.5;
  --ds-radius: 14px;
  --ds-radius-sm: 10px;
  --ds-radius-pill: 999px;
  --ds-radius-card: 16px;
  --ds-radius-dialog: 20px;
  --ds-shadow-card: 0 18px 44px rgba(5, 5, 5, 0.1);
  --ds-shadow-soft: 0 10px 30px rgba(5, 5, 5, 0.08);
  --ds-shadow-card-2: 0 1px 2px rgba(5, 5, 5, 0.04), 0 12px 32px rgba(5, 5, 5, 0.06);

  /* The game's own two colours, chosen FROM the label palette: X is the
     info blue, O the danger red — the two hues furthest apart that both
     read on paper and on charcoal. A tie is ink-4. */
  --mark-x: var(--ds-blue);
  --mark-x-soft: var(--ds-blue-soft);
  --mark-o: var(--ds-red);
  --mark-o-soft: var(--ds-red-soft);
  --mark-t: var(--ds-ink-4);
  --mark-t-soft: var(--ds-ink-5);
  /* Champion marks (top 5 of a leaderboard; game/board-view.mjs markGlyph):
     a crown in the tier's colour. Gold for Overall, ORANGE for People and
     TEAL for the Computer board: three hues apart from each other, from the
     accent violet (the forced-board ring, the room code) and from the plain
     marks' blue and red. Orange, not coral: coral sits on O's red. The design
     system has neither orange nor teal, so both are defined here (dark
     values below, with the champion styles). Solid colours: the accent
     GRADIENT keeps its three places. */
  --cos-gold: #f0a800;
  --cos-gold-soft: var(--ds-amber-soft);
  --cos-orange: #f97316;
  --cos-orange-soft: #ffe7d4;
  --cos-teal: #0e9f8e;
  --cos-teal-soft: #d2f3ee;
  --cos-human: var(--cos-orange);
  --cos-human-soft: var(--cos-orange-soft);
  --cos-bot: var(--cos-teal);
  --cos-bot-soft: var(--cos-teal-soft);
}

/* ---- tokens: DARK (verbatim) — OS preference, or data-theme="dark" ---- */
@media (prefers-color-scheme: dark) {
  .recess-ds:not([data-theme="light"]) {
    --ds-bg: #151414; --ds-bg-2: #2b2828; --ds-card: #211f1f;
    --ds-ink: #f8fafc; --ds-ink-2: rgba(248, 250, 252, 0.76); --ds-ink-3: rgba(248, 250, 252, 0.7);
    --ds-ink-4: rgba(248, 250, 252, 0.45); --ds-ink-5: rgba(248, 250, 252, 0.12);
    --ds-rule: rgba(255, 255, 255, 0.12); --ds-rule-strong: rgba(255, 255, 255, 0.24);
    --ds-shadow-card: 0 18px 44px rgba(0, 0, 0, 0.55); --ds-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
    --ds-shadow-card-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.5);
    --ds-bg-fixed: #171717;
    --ds-accent-grad: linear-gradient(90deg, #a78bfa, #c084fc); --ds-accent-1: #a78bfa; --ds-accent-2: #c084fc;
    --ds-accent-3: #e5c07b; --ds-signal: #e5c07b;
    --ds-blue: #818cf8; --ds-blue-soft: rgba(129, 140, 248, 0.16);
    --ds-purple: #a78bfa; --ds-purple-soft: rgba(167, 139, 250, 0.16);
    --ds-red: #f87171; --ds-red-soft: rgba(248, 113, 113, 0.16);
    --ds-amber: #fbbf24; --ds-amber-soft: rgba(251, 191, 36, 0.16);
    --ds-green: #86efac; --ds-green-soft: rgba(134, 239, 172, 0.16);
    --ds-warning: #fbbf24; --ds-success-text: var(--ds-green); --ds-danger-text: var(--ds-red);
    --ds-focus-ring: rgba(248, 250, 252, 0.4); --ds-focus-ring-soft: rgba(248, 250, 252, 0.24);
  }
}
.recess-ds[data-theme="dark"] {
  --ds-bg: #151414; --ds-bg-2: #2b2828; --ds-card: #211f1f;
  --ds-ink: #f8fafc; --ds-ink-2: rgba(248, 250, 252, 0.76); --ds-ink-3: rgba(248, 250, 252, 0.7);
  --ds-ink-4: rgba(248, 250, 252, 0.45); --ds-ink-5: rgba(248, 250, 252, 0.12);
  --ds-rule: rgba(255, 255, 255, 0.12); --ds-rule-strong: rgba(255, 255, 255, 0.24);
  --ds-shadow-card: 0 18px 44px rgba(0, 0, 0, 0.55); --ds-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --ds-shadow-card-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.5);
  --ds-bg-fixed: #171717;
  --ds-accent-grad: linear-gradient(90deg, #a78bfa, #c084fc); --ds-accent-1: #a78bfa; --ds-accent-2: #c084fc;
  --ds-accent-3: #e5c07b; --ds-signal: #e5c07b;
  --ds-blue: #818cf8; --ds-blue-soft: rgba(129, 140, 248, 0.16);
  --ds-purple: #a78bfa; --ds-purple-soft: rgba(167, 139, 250, 0.16);
  --ds-red: #f87171; --ds-red-soft: rgba(248, 113, 113, 0.16);
  --ds-amber: #fbbf24; --ds-amber-soft: rgba(251, 191, 36, 0.16);
  --ds-green: #86efac; --ds-green-soft: rgba(134, 239, 172, 0.16);
  --ds-warning: #fbbf24; --ds-success-text: var(--ds-green); --ds-danger-text: var(--ds-red);
  --ds-focus-ring: rgba(248, 250, 252, 0.4); --ds-focus-ring-soft: rgba(248, 250, 252, 0.24);
}

/* ---- type roles (Boop Battle's transcription) ----------------------- */
.ds-display { font-family: var(--ds-font-display); font-weight: 900; letter-spacing: var(--ds-track-display); line-height: var(--ds-lead-display); color: var(--ds-ink); }
.ds-h-section { font-family: var(--ds-font-display); font-weight: 650; letter-spacing: var(--ds-track-head); line-height: 1; color: var(--ds-ink); }
.ds-h-card { font-family: var(--ds-font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; color: var(--ds-ink); }
.ds-lede { font-family: var(--ds-font-body); font-weight: 450; line-height: 1.36; letter-spacing: -0.01em; color: var(--ds-ink); }
.ds-body { font-family: var(--ds-font-body); font-weight: 400; font-size: 15px; line-height: 1.55; color: var(--ds-ink-2); }
.ds-label { font-family: var(--ds-font-display); font-weight: 900; font-size: 11px; letter-spacing: var(--ds-track-label); text-transform: uppercase; color: var(--ds-ink-3); }
.ds-grad-text { background: var(--ds-accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ds-grad-rule { height: 2px; border: 0; border-radius: 999px; background: var(--ds-accent-grad); }

/* ---- buttons: pills, Satoshi 600, soft shadow ---------------------- */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; font-family: var(--ds-font-body); font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em; cursor: pointer; border: 1px solid transparent; border-radius: var(--ds-radius-pill);
  background: transparent; color: var(--ds-ink); white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.ds-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ds-btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.ds-btn:focus-visible { outline: none; box-shadow: var(--ds-shadow-soft), 0 0 0 3px var(--ds-focus-ring); }
.ds-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
/* The primary button INVERTS with the theme: ink on paper in light, a light
   button with dark text in dark (--ds-ink is near-white there). */
.ds-btn-ink { background: var(--ds-ink); color: var(--ds-bg-fixed); border-color: var(--ds-ink); box-shadow: var(--ds-shadow-soft); }
.ds-btn-ink:hover:not(:disabled) { background: var(--ds-card); color: var(--ds-ink); border-color: var(--ds-ink); }
.ds-btn-out { background: var(--ds-card); color: var(--ds-ink); border-color: var(--ds-rule-strong); }
.ds-btn-out:hover:not(:disabled) { background: var(--ds-ink); color: var(--ds-bg-fixed); border-color: var(--ds-ink); }
.ds-btn-ghost { color: var(--ds-ink-2); }
.ds-btn-ghost:hover:not(:disabled) { background: var(--ds-bg-2); color: var(--ds-ink); }
.ds-btn-danger { background: var(--ds-danger-soft); color: var(--ds-danger-text); }
.ds-btn-danger:hover:not(:disabled) { background: var(--ds-danger); color: var(--ds-bg-fixed); }
.ds-btn-danger:focus-visible { box-shadow: 0 0 0 3px var(--ds-danger-soft); }
.ds-btn-sm { padding: 10px 18px; font-size: 13px; }
.ds-btn-xs { padding: 5px 11px; font-size: 12px; }
.ds-btn-lg { padding: 17px 30px; font-size: 15px; }
.ds-btn-block { display: flex; width: 100%; }

/* ---- inputs -------------------------------------------------------- */
.ds-input {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--ds-card); border: 1px solid var(--ds-rule-strong); border-radius: var(--ds-radius-sm);
  padding: 13px 16px; font-family: var(--ds-font-body); font-size: 15px; color: var(--ds-ink);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.ds-input::placeholder { color: var(--ds-ink-4); }
.ds-input:focus { outline: none; border-color: var(--ds-ink); box-shadow: 0 0 0 3px var(--ds-focus-ring-soft); }
.ds-field-label { font-family: var(--ds-font-display); font-size: 13px; font-weight: 600; color: var(--ds-ink); }
.ds-help { font-size: 12.5px; color: var(--ds-ink-3); }

/* ---- selection: the segmented control ------------------------------ */
/* Mutually exclusive choices, both visible at once — which is exactly what
   picking a game mode is. Recipe verbatim from Boop Battle's styles.css. */
.ds-segmented { display: inline-flex; gap: 3px; padding: 4px; background: var(--ds-bg-2); border-radius: var(--ds-radius-pill); }
.ds-segment {
  padding: 8px 18px; border: 0; background: transparent;
  font-family: var(--ds-font-body); font-size: 13px; font-weight: 600;
  color: var(--ds-ink-2); border-radius: var(--ds-radius-pill); cursor: pointer;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.ds-segment:hover:not(:disabled) { color: var(--ds-ink); }
.ds-segment-on { background: var(--ds-card); color: var(--ds-ink); box-shadow: var(--ds-shadow-soft); }
.ds-segment:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.ds-segment:disabled { cursor: not-allowed; }
.ds-segmented:has(.ds-segment:disabled) { opacity: 0.7; }

/* ---- badges, cards, rows, avatars ---------------------------------- */
.ds-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-family: var(--ds-font-body); font-size: 12px; font-weight: 600; border-radius: var(--ds-radius-pill); }
.ds-badge-info { color: var(--ds-info); background: var(--ds-info-soft); }
.ds-badge-success { color: var(--ds-success-text); background: var(--ds-success-soft); }
.ds-badge-warning { color: var(--ds-warning); background: var(--ds-warning-soft); }
.ds-badge-danger { color: var(--ds-danger-text); background: var(--ds-danger-soft); }
.ds-badge-neutral { color: var(--ds-ink-2); background: var(--ds-bg-2); }
.ds-badge-purple { color: var(--ds-purple); background: var(--ds-purple-soft); }
.ds-card { background: var(--ds-card); border: 1px solid var(--ds-rule); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-card); }
.ds-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--ds-rule); }
.ds-row:last-child { border-bottom: none; }
.ds-avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; font-family: var(--ds-font-display); font-size: 13px; font-weight: 700; color: var(--ds-ink); flex: none; }
.ds-avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }

/* =====================================================================
   THE GAME
   ===================================================================== */
#app { min-height: 100%; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }

/* ---- boot ------------------------------------------------------------ */
.boot { flex: 1; display: grid; place-items: center; padding: 24px; }
.boot-card { display: grid; gap: 10px; text-align: center; color: var(--ds-ink-3); }
.boot-text { font-size: 15px; }

/* ---- home: the title screen ------------------------------------------- */
/* An open stage, not a card: the wordmark and the four ways in on the left,
   and on the right a demo board that plays itself (game/home-demo.mjs) under
   the leaderboard's top names. Big soft X and O marks drift behind it all.
   Everything that moves is decoration: pointer-events: none, aria-hidden,
   and still under reduced motion (the global rule at the foot of this file;
   every animation here ends on the element's natural state, so "none" is a
   finished picture, and the demo draws one fixed mid-game position).
   The accent gradient is still only the word "tactoe" and the ring around
   the forced board, which on this screen is the demo's forced board.
   --hd is the demo board's side. It is sized from the frame's HEIGHT first,
   so Village's ~490px frames keep all four actions on screen. */
.home {
  position: relative; isolation: isolate; overflow: hidden; flex: 1; box-sizing: border-box;
  display: grid; place-items: center; padding: clamp(10px, 3dvh, 40px) clamp(16px, 3vw, 40px);
}
.home-stage {
  --hd: clamp(150px, min(100dvh - 148px, 42vw - 60px), 430px);
  position: relative; z-index: 1; width: min(1140px, 100%);
  display: grid; grid-template-columns: minmax(0, 520px) var(--hd);
  grid-template-areas: "corner corner" "main demo";
  column-gap: clamp(28px, 7vw, 104px); row-gap: 12px; align-items: center; justify-content: center;
}
.home-main { grid-area: main; display: grid; gap: clamp(10px, 2.4dvh, 18px); min-width: 0; text-align: left; }
.home-demo { grid-area: demo; min-width: 0; }
/* the scoreboard band across the top: Live games (Guides), the top five, Leaderboard */
.home-corner { grid-area: corner; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }

/* the wordmark, with an X and an O stamped on its corner */
.home-title { position: relative; justify-self: start; font-size: clamp(46px, min(7.4vw, 15dvh), 92px); padding-right: 0.62em; }
.home .wordmark { font-size: 1em; margin: 0; line-height: 0.96; letter-spacing: -0.035em; white-space: nowrap; }
.home .wordmark .ds-grad-text { display: inline-block; }
.home-stamp {
  position: absolute; display: grid; place-items: center; width: 0.36em; height: 0.36em;
  border-radius: 0.1em; background: var(--ds-card); border: 1px solid var(--ds-rule); box-shadow: var(--ds-shadow-soft);
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1; color: transparent;
}
.home-stamp::before { content: attr(data-mark); position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.26em; }
.home-stamp[data-mark="X"]::before { color: var(--mark-x); }
.home-stamp[data-mark="O"]::before { color: var(--mark-o); }
.home-stamp-x { right: 0.2em; top: -0.04em; rotate: 9deg; animation: homeWobble 5.2s ease-in-out 1.4s infinite; }
.home-stamp-o { right: -0.02em; top: 0.4em; rotate: -8deg; animation: homeWobble 6.6s ease-in-out 2.6s infinite reverse; }
.home-lede { font-size: clamp(15px, 2.6dvh, 19px); color: var(--ds-ink-2); margin: 0; }

/* the ways in */
.home-actions { display: grid; gap: clamp(8px, 1.8dvh, 12px); }
.home-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-duo .ds-btn-lg { padding-inline: 12px; }
/* the two big doors: a little picture over the words */
.home-big {
  display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 12px 15px; border-radius: 26px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em;
}
.home-big:hover:not(:disabled) { transform: translateY(-3px) rotate(-0.6deg); }
.home-bot:hover:not(:disabled) { transform: translateY(-3px) rotate(0.6deg); }
.home-pair { display: flex; gap: 5px; height: 40px; align-items: center; }
.home-pair b {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ds-card);
  font-family: var(--ds-font-display); font-weight: 900; font-size: 20px; line-height: 1;
}
.home-pair b[data-mark="X"] { color: var(--mark-x); rotate: -7deg; animation: homeNod 3.1s ease-in-out infinite; }
.home-pair b[data-mark="O"] { color: var(--mark-o); rotate: 6deg; animation: homeNod 3.7s ease-in-out -1.4s infinite; }
.home-cast { display: flex; height: 40px; align-items: center; }
.home-cast .bot-avatar { --av-size: 40px; margin-inline: -3px; box-shadow: 0 0 0 2px var(--ds-card); background: var(--ds-bg-2); }
.home-cast .bot-avatar svg { animation: homeNod 2.9s ease-in-out infinite; }
.home-cast .bot-avatar-medium svg { animation-duration: 3.6s; animation-delay: -1.1s; }
.home-cast .bot-avatar-hard svg { animation-duration: 2.5s; animation-delay: -0.6s; }
.home-cast .bot-avatar-impossible svg { animation-duration: 4.1s; animation-delay: -2.2s; }
.home-bot:hover .home-cast .bot-avatar svg { animation-duration: 0.7s; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join-row .ds-input { text-transform: uppercase; letter-spacing: 0.18em; font-family: var(--ds-font-display); font-weight: 700; text-align: center; }
/* the rules for the game "Create a game" makes: quieter than the doors */
.home-setup { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--ds-rule); background: color-mix(in srgb, var(--ds-card) 72%, transparent); }
.home-setup .mode-pick { display: contents; }
.home-setup .ds-segmented { justify-self: start; }
.home-setup .mode-blurb { grid-column: 1 / -1; text-align: left; }
.home-setup .erase-pick { grid-column: 1 / -1; justify-content: flex-start; }
.home-setup-label { justify-self: start; }
.home-you { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ds-ink-3); }
.home-you .name-input { width: 130px; padding: 6px 10px; font-size: 13px; }
.home-section-label { margin-bottom: -4px; }
/* the computer's setup and the guest's one button keep a card's width */
.home-computer .home-actions, .home-create .home-actions, .home-guest .home-actions { max-width: 460px; }

/* the scoreboard: the Overall board's top five, ranked, under their real
   crown. One big button to the leaderboard. Amber is the leaderboard's own
   top-5 colour (--ds-warning), never the accent gradient. */
.home-champs {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px 12px; margin: 0; padding: 6px 8px 6px 14px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ds-warning-solid) 45%, var(--ds-rule));
  background: color-mix(in srgb, var(--ds-warning-solid) 10%, var(--ds-card)); box-shadow: var(--ds-shadow-soft);
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.home-champs:hover { transform: translateY(-2px); }
.home-champs:empty { display: none; }
.home-top-label { flex: none; font-family: var(--ds-font-display); font-weight: 900; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ds-ink); white-space: nowrap; }
.home-top-label.is-you { color: color-mix(in srgb, var(--ds-warning) 70%, var(--ds-ink)); }
.home-champ-list { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-around; gap: 6px 8px; }
.home-champ { display: inline-flex; align-items: center; gap: 5px; min-width: 3.4em; flex: 0 1 auto; padding: 3px 9px 3px 3px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--ds-ink); }
.home-champ-rank { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ds-warning-soft); color: var(--ds-warning); font-family: var(--ds-font-display); font-weight: 900; font-size: 12.5px; line-height: 1; }
.home-champ .cos { flex: none; width: 19px; height: 19px; }
.home-champ-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 4.7em; max-width: 7.5em; }
.home-champ.is-first { font-size: 15.5px; }
.home-champ.is-first .home-champ-rank { width: 26px; height: 26px; font-size: 14.5px; }
.home-champ.is-first .cos { width: 24px; height: 24px; animation: homeNod 3.3s ease-in-out infinite; }
/* your own name on the board: lit */
.home-champ.is-you { background: var(--ds-warning-solid); color: #2b1a00; padding-right: 5px; box-shadow: 0 2px 10px color-mix(in srgb, var(--ds-warning-solid) 45%, transparent); }
.home-champ.is-you .home-champ-rank { background: #fff; color: #8f5600; }
.home-champ-tag { flex: none; padding: 2px 7px; border-radius: 999px; background: #fff; color: #8f5600; font-size: 10.5px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.home-champ.is-you .home-champ-name { min-width: 0; }
.home-champ.is-mine { padding-right: 10px; }
.home-lb, .home-live { flex: none; }
/* a narrower frame (Village's tile): only number 1 keeps the crown, so five names fit */
@media (max-width: 1250px) { .home-champ:not(.is-first) .cos { display: none; } .home-champ:not(.is-first) { gap: 6px; } }

/* the drifting marks */
.home-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.home-float {
  position: absolute; font-style: normal; font-family: var(--ds-font-display); font-weight: 900; line-height: 1;
  font-size: clamp(90px, 22dvh, 190px); user-select: none;
  animation: homeDrift 19s ease-in-out infinite alternate;
}
.home-float[data-mark="X"] { color: var(--mark-x-soft); }
.home-float[data-mark="O"] { color: var(--mark-o-soft); }
.home-float-1 { left: -2%; top: -6%; --r: -14deg; animation-duration: 23s; }
.home-float-2 { left: 30%; bottom: -12%; --r: 10deg; animation-duration: 17s; animation-delay: -6s; font-size: clamp(70px, 16dvh, 140px); }
.home-float-3 { right: -3%; bottom: -8%; --r: 18deg; animation-duration: 27s; animation-delay: -11s; }
.home-float-4 { right: 6%; top: -10%; --r: -8deg; animation-duration: 21s; animation-delay: -3s; }
.home-float-5 { left: -4%; bottom: 4%; --r: 6deg; animation-duration: 29s; animation-delay: -15s; font-size: clamp(60px, 13dvh, 120px); }
.home-float-6 { left: 46%; top: -9%; --r: 22deg; animation-duration: 25s; animation-delay: -9s; font-size: clamp(60px, 13dvh, 120px); }

/* THE DEMO BOARD (markup: renderDemo in game/home-demo.mjs) */
.hd { width: var(--hd); pointer-events: none; user-select: none; }
.hd-frame {
  position: relative; box-sizing: border-box; width: var(--hd); height: var(--hd); padding: calc(var(--hd) * 0.035);
  background: var(--ds-card); border: 1px solid var(--ds-rule); border-radius: calc(var(--hd) * 0.07); box-shadow: var(--ds-shadow-card);
  rotate: 2deg; animation: hdFloat 8s ease-in-out infinite;
}
.hd-big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: calc(var(--hd) * 0.022); width: 100%; height: 100%; }
.hd-board {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 2px;
  padding: calc(var(--hd) * 0.012); border-radius: calc(var(--hd) * 0.03); background: var(--ds-bg); transition: opacity .3s ease, background .3s ease;
}
.hd-board i {
  display: grid; place-items: center; min-width: 0; min-height: 0; border-radius: calc(var(--hd) * 0.012); background: var(--ds-card);
  font-style: normal; font-family: var(--ds-font-display); font-weight: 900; font-size: calc(var(--hd) * 0.066); line-height: 1;
}
.hd-board i[data-mark="X"] { color: var(--mark-x); }
.hd-board i[data-mark="O"] { color: var(--mark-o); }
.hd-board i.is-new { animation: hdPop .38s cubic-bezier(.2,.9,.3,1.4) both; box-shadow: inset 0 0 0 1.5px currentColor; }
/* where the next player must go: the game's own gradient ring, drawn the way
   the real board draws it (a pseudo-element behind the squares) */
.hd-board { isolation: isolate; }
.hd-board.is-forced::before {
  content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: calc(var(--hd) * 0.03 + 4px); background: var(--ds-accent-grad);
  animation: hdRing .5s cubic-bezier(.2,.9,.3,1.3) .4s both;
}
.hd-big:not(.is-free):not(.is-over) .hd-board:not(.is-forced):not(.is-claimed) { opacity: 0.8; }
.hd-board.is-claimed i { visibility: hidden; }
.hd-board.is-claimed-X { background: var(--mark-x-soft); }
.hd-board.is-claimed-O { background: var(--mark-o-soft); }
.hd-board.is-claimed-T { background: var(--mark-t-soft); }
.hd-claim { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--ds-font-display); font-weight: 900; font-size: calc(var(--hd) * 0.2); line-height: 1; }
.is-claimed-X .hd-claim { color: var(--mark-x); }
.is-claimed-O .hd-claim { color: var(--mark-o); }
.is-claimed-T .hd-claim { color: var(--mark-t); }
.hd-board.is-fresh .hd-claim { animation: hdPop .5s cubic-bezier(.2,.9,.3,1.4) both; }
.hd-big.is-over .hd-board:not(.is-line) { opacity: 0.4; }
.hd-big.is-over .hd-board.is-line { animation: hdWin 1.1s ease-in-out infinite; }
.hd-hop { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ds-ink); pointer-events: none; z-index: 2; }
.hd-hop[data-mark="X"] { background: var(--mark-x); }
.hd-hop[data-mark="O"] { background: var(--mark-o); }
.hd-caption { margin: 12px 0 0; min-height: 2.7em; text-align: center; font-size: 13.5px; line-height: 1.35; color: var(--ds-ink-2); text-wrap: balance; }
.hd-caption b { font-family: var(--ds-font-display); font-weight: 900; }
.hd-caption b[data-mark="X"] { color: var(--mark-x); }
.hd-caption b[data-mark="O"] { color: var(--mark-o); }
.hd-caption em { font-style: normal; font-weight: 700; color: var(--ds-ink); }

/* arriving: the title lands, the stamps are stamped, the rest follows */
.home.is-intro .wordmark { animation: homeRise .55s cubic-bezier(.2,.9,.3,1.2) both; }
.home.is-intro .wordmark .ds-grad-text { animation: homeRise .55s cubic-bezier(.2,.9,.3,1.3) .1s both; }
.home.is-intro .home-stamp-x { animation: homeStamp .4s cubic-bezier(.2,.9,.3,1.3) .5s both, homeWobble 5.2s ease-in-out 1.4s infinite; }
.home.is-intro .home-stamp-o { animation: homeStamp .4s cubic-bezier(.2,.9,.3,1.3) .68s both, homeWobble 6.6s ease-in-out 2.6s infinite reverse; }
.home.is-intro .home-lede { animation: homeUp .45s ease-out .18s both; }
.home.is-intro .home-actions { animation: homeUp .45s ease-out .28s both; }
.home.is-intro .home-you, .home.is-intro .home-corner { animation: homeUp .45s ease-out .4s both; }
.home.is-intro .home-champ { animation: homeUp .4s ease-out calc(.5s + var(--i, 0) * .09s) both; }
.home.is-intro .home-demo { animation: homeUp .6s cubic-bezier(.2,.9,.3,1.15) .22s both; }
@keyframes homeRise { from { opacity: 0; transform: translateY(0.35em) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes homeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes homeStamp { from { opacity: 0; transform: scale(2.4); } to { opacity: 1; transform: none; } }
@keyframes homeWobble { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-9deg) scale(1.08); } 92% { transform: rotate(7deg) scale(1.08); } 96% { transform: rotate(-3deg); } }
@keyframes homeNod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes homeDrift { from { transform: translate(0, 0) rotate(var(--r, 0deg)); } to { transform: translate(26px, -22px) rotate(calc(var(--r, 0deg) + 14deg)); } }
@keyframes hdFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(-0.9deg); } }
@keyframes hdPop { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hdRing { from { opacity: 0; transform: scale(1.22); } to { opacity: 1; transform: none; } }
@keyframes hdWin { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }

/* SHORT FRAMES (Village's call ~1400×500 and tile ~1150×490): tighter, and
   the two doors turn sideways (picture beside the words) to save height. */
@media (max-height: 620px) {
  .home { padding-block: 8px; }
  .home-main { gap: 9px; }
  .home-big { flex-direction: row-reverse; gap: 10px; padding: 9px 12px; border-radius: 999px; font-size: 15px; }
  .home-pair { height: 32px; }
  .home-pair b { width: 28px; height: 28px; font-size: 17px; border-radius: 8px; }
  .home-cast { height: 32px; }
  .home-cast .bot-avatar { --av-size: 32px; margin-inline: -4px; }
  .home-setup { padding: 7px 12px; gap: 4px 10px; }
  /* Erase (with its stepper) and Infinite on one line, as in the settings panel */
  .home-setup .rule-opts { gap: 4px 8px; }
  .home-setup .erase-pick { gap: 6px; }
  .home-setup .erase-cap { gap: 4px; }
  .home-setup .erase-cap-n { font-size: 0; min-width: 1.4em; }
  .home-setup .erase-cap-n strong { font-size: 15px; }
  .home-you { font-size: 12.5px; }
  .hd-caption { margin-top: 8px; font-size: 13px; }
  .home-computer .home-lede { display: none; }
  .home-computer .home-title { font-size: clamp(38px, 11dvh, 56px); }
}
/* NARROW AND PORTRAIT (a phone): one column. Leaderboard on top, then the
   title and the ways in, and the demo board underneath in whatever height is
   left (none on a short phone: the actions come first). */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .home { place-items: start center; }
  .home-stage {
    --hd: clamp(120px, min(46vw, 100dvh - 640px), 300px);
    grid-template-columns: minmax(0, 520px); grid-template-areas: "corner" "main" "demo"; row-gap: 14px;
  }
  .home-title { font-size: clamp(42px, min(12.5vw, 9dvh), 76px); }
  .home-demo { margin-top: 2px; }
  /* the board with its caption BESIDE it: a phone has the width, not the height */
  .hd { display: flex; align-items: center; gap: 16px; width: auto; }
  .hd-frame { flex: none; }
  .hd-caption { flex: 1; min-height: 0; margin: 0; text-align: left; font-size: 14.5px; }
  /* the scoreboard becomes a small card under the two pills: its label and
     the five names flow and wrap together. The setup screens leave it out. */
  .home-corner { flex-wrap: wrap; justify-content: space-between; row-gap: 8px; }
  .home-lb { margin-left: auto; }
  .home-champs { order: 3; flex: 1 1 100%; flex-wrap: wrap; border-radius: 18px; padding: 7px 10px; gap: 3px 6px; }
  .home-champ-list { display: contents; }
  .home-champ { font-size: 12.5px; padding: 2px 7px 2px 2px; }
  .home-champ.is-first { font-size: 13.5px; }
  .home-champ-rank, .home-champ.is-first .home-champ-rank { width: 20px; height: 20px; font-size: 12px; }
  .home-champ.is-first .cos { width: 19px; height: 19px; }
  .home-champ-name { min-width: 0; max-width: 6.5em; }
  .home-create .home-champs, .home-computer .home-champs { display: none; }
  /* the computer's setup is taller (four faces and a blurb): the picker is the picture there */
  .home-computer .home-demo { display: none; }
  .hd-frame { rotate: 1.2deg; }
}
@media (max-width: 760px) and (max-height: 820px), (max-aspect-ratio: 4/5) and (max-height: 820px) {
  .home-demo { display: none; }
}
@media (max-width: 380px) {
  .home-big { font-size: 15px; }
  .home-cast .bot-avatar { --av-size: 34px; margin-inline: -5px; }
}

/* the "live" dot: a solid design-system green, still under reduced motion */
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-success); flex: none; box-shadow: 0 0 0 3px var(--ds-success-soft); }

/* ---- leaderboard ------------------------------------------------------ */
/* One viewport tall, like the room: the card never pushes the page into a
   scroll. The LIST scrolls inside the card when a board is longer than the
   frame, so every row stays reachable and nothing is clipped. */
/* ⚠ Two traps, both measured in Chrome with a 48-row board in a 1150×490
   frame. (1) `.screen`'s `flex: 1` makes flex-basis, not `height`, decide
   the size inside #app (which is only min-height), so the screen grew to its
   content, 1583px, and the page scrolled. `flex: none` makes the height
   stick. (2) As a flex column, `.lb { height: 100% }` came out at content
   height, so it is a grid with a minmax(0, 1fr) row, like .screen-room. */
.screen-board { flex: none; display: grid; grid-template-rows: minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.lb {
  min-height: 0; box-sizing: border-box; display: grid; grid-template-rows: minmax(0, 1fr);
  justify-items: center; padding: clamp(10px, 3vh, 32px) 16px;
}
.lb-card {
  align-self: center; width: min(640px, 100%); max-height: 100%; min-height: 0; box-sizing: border-box;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px;
  padding: clamp(14px, 3vh, 26px) clamp(14px, 3vw, 26px);
}
.lb-side { display: grid; gap: 10px; justify-items: center; text-align: center; align-content: start; }
.lb-top { position: relative; width: 100%; display: grid; place-items: center; }
.lb-top [data-action="lb-back"] { position: absolute; left: -6px; top: 50%; transform: translateY(-50%); }
.lb-title { font-size: 28px; margin: 0; }
.lb-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lb-filters .ds-segment { padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.lb-rule { margin: 0; max-width: 46ch; }
.lb-warn { margin: 0; color: var(--ds-warning); }
.lb-list {
  min-height: 0; overflow-y: auto; border-top: 1px solid var(--ds-rule);
  /* a native light scrollbar showed on the dark card */
  scrollbar-width: thin; scrollbar-color: var(--ds-rule-strong) transparent;
}
/* ONE set of column widths for the header AND the rows, in px. They were in
   em, and the header's 11px text made every header column narrower than the
   14px row's, so the headings drifted right ("W" over the losses) until
   2026-09-30. px cannot follow the text size, so the two cannot drift. */
.lb-table { --lb-cols: 31px minmax(0, 1fr) 31px 31px 31px 62px; }
.lb-table.has-act { --lb-cols: 31px minmax(0, 1fr) 31px 31px 31px 62px 53px; }
.lb-row {
  display: grid; grid-template-columns: var(--lb-cols, 31px minmax(0, 1fr) 31px 31px 31px 62px);
  gap: 6px; align-items: center; padding: 8px 8px; font-size: 14px;
  border-bottom: 1px solid var(--ds-rule);
}
.lb-head-row {
  position: sticky; top: 0; z-index: 1; background: var(--ds-card);
  font-size: 11px; font-weight: 650; letter-spacing: var(--ds-track-label); text-transform: uppercase; color: var(--ds-ink-3);
}
.lb-row.is-you { background: var(--ds-blue-soft); }
/* The top five on every ranked board: the rank becomes a filled amber chip
   and the row gets a thin amber bar at its left edge. Design-system warning
   tokens, never the accent gradient (that stays in its three places). It
   sits on top of .is-you's blue, so your own top-five row shows both. */
.lb-row.is-top { box-shadow: inset 3px 0 0 var(--ds-warning); }
.lb-row.is-top .lb-rank {
  justify-self: start; display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; box-sizing: border-box;
  padding-inline: 0.3em; border-radius: var(--ds-radius-pill);
  background: var(--ds-warning-soft); color: var(--ds-warning); font-weight: 800; font-size: 13px;
}
.lb-rank { color: var(--ds-ink-3); font-variant-numeric: tabular-nums; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-head-row .lb-name { font-weight: inherit; }
.lb-n { text-align: center; color: var(--ds-ink-2); font-variant-numeric: tabular-nums; }
.lb-stat { text-align: right; font-family: var(--ds-font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-head-row .lb-stat { font-family: inherit; font-weight: inherit; }
.lb-act { text-align: right; }
.lb-row-hidden { grid-template-columns: minmax(0, 1fr) auto auto; }
.lb-by { color: var(--ds-ink-3); font-size: 12.5px; }
.lb-empty { padding: 28px 8px; text-align: center; color: var(--ds-ink-3); }
/* Role tags: the name ellipsises, the tag and "you" never do, so a long name
   can never push the W/L/D columns or hide the tag. */
/* When the name and its badges do not fit on one line (a phone, staff's extra
   column), the badges WRAP under the name instead of squeezing it to nothing
   or spilling into the W column. Where they fit, it is one line. */
.lb-name { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; overflow: visible; } /* the text clips itself; a focus ring must not be clipped */
.lb-name-text { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a badge wider than the whole column (staff on a phone) shrinks and
   ellipsises inside it rather than overlapping the W column */
.lb-name .ds-badge { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.lb-tag { padding: 2px 8px; font-size: 11px; line-height: 1.35; }
.lb-tag-btn { border: none; cursor: pointer; font-family: var(--ds-font-body); }
.lb-tag-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring-soft); }
.lb-tag-btn.is-set { box-shadow: inset 0 0 0 1.5px currentColor; } /* set by staff, not the role */
.lb-tag-none { background: transparent; color: var(--ds-ink-3); box-shadow: inset 0 0 0 1px var(--ds-rule-strong); }
.lb-tag-editor {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px; border-bottom: 1px solid var(--ds-rule); background: var(--ds-bg-2);
}
.lb-tag-editor .ds-segment { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
/* WIDE AND SHORT (Village's call view, ~1400×500, and the ~1150×490 tile):
   title and filters in a column on the left, the list at full height on the
   right. Stacked, the filters would leave the list a few rows. */
@media (max-height: 620px) and (min-width: 700px) {
  .lb-card {
    width: min(920px, 100%); height: 100%;
    grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 20px;
  }
  /* min-width 0: the column is 250px, and nothing in it may widen it into
     the list (the rule text followed an over-wide filter row in, 2026-09-29) */
  .lb-side { align-content: center; min-width: 0; }
  .lb-filters .ds-segment { padding-inline: 11px; }
  /* Staff have FOUR kinds (People, Computer, Overall, Hidden (n)), which do
     not fit 250px on one line: the control wraps, like the level picker.
     Players' three kinds still fit on one line. */
  .lb-filters .ds-segmented { flex-wrap: wrap; justify-content: center; max-width: 100%; box-sizing: border-box; border-radius: 20px; }
  .lb-list { border-top: none; border-left: 1px solid var(--ds-rule); padding-left: 14px; }
  .lb-row { padding-block: 6px; }
}

/* ---- live games (Guides and Admins; game/live-view.mjs) ----------------
   The leaderboard's frame (.lb, .lb-card, .lb-side, .lb-list: one viewport
   tall, the list scrolling inside the card, the side column in a wide short
   frame), holding a grid of mini boards instead of a table. */
.live-card { width: min(980px, 100%); }
.live-count { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ds-ink-2); }
.live-count strong { font-family: var(--ds-font-display); font-weight: 900; color: var(--ds-ink); }
.live-list { padding-top: 12px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; padding: 2px 2px 6px; }
.live-game {
  appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  display: grid; gap: 7px; align-content: start; padding: 10px;
  background: var(--ds-card); border: 1px solid var(--ds-rule); border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow-soft); transition: transform .14s ease, border-color .14s ease;
}
.live-game:hover { transform: translateY(-2px); border-color: var(--ds-ink); }
.live-game:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.live-players { display: grid; gap: 3px; min-width: 0; }
.live-player { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--ds-ink-2); }
.live-player.is-turn { color: var(--ds-ink); font-weight: 700; }
.live-player.is-away .live-name { color: var(--ds-ink-4); }
.live-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-mark { width: 18px; height: 18px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--ds-font-display); font-weight: 900; font-size: 11px; }
.live-mark[data-mark="X"] { color: var(--mark-x); background: var(--mark-x-soft); }
.live-mark[data-mark="O"] { color: var(--mark-o); background: var(--mark-o-soft); }
.live-player.is-turn .live-mark { box-shadow: 0 0 0 2px currentColor; }
.live-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.live-tiny { padding: 2px 7px; font-size: 11px; }
.live-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--ds-ink-3); }
.live-code { font-family: var(--ds-font-display); font-weight: 900; letter-spacing: 0.12em; color: var(--ds-ink-2); }
/* the mini board: the real board's colours and claimed tints, no gradient
   (the forced board is a plain ink ring here; the gradient keeps its three homes) */
.mini-big {
  width: 100%; aspect-ratio: 1; box-sizing: border-box; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px;
  background: var(--ds-bg-2); border-radius: var(--ds-radius-sm); container-type: inline-size;
}
.mini-board { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 2px; background: var(--ds-bg); border-radius: 4px; min-width: 0; }
.mini-board.forced { box-shadow: 0 0 0 2px var(--ds-ink); background: var(--ds-card); }
.mini-big.has-forced .mini-board:not(.forced):not(.claimed) { opacity: 0.7; }
.mini-board i { display: grid; place-items: center; background: var(--ds-card); border-radius: 2px; font-style: normal; font-family: var(--ds-font-display); font-weight: 900; font-size: 8.5cqw; line-height: 1; aspect-ratio: 1; }
.mini-board i[data-mark="X"] { color: var(--mark-x); }
.mini-board i[data-mark="O"] { color: var(--mark-o); }
.mini-board i.last { box-shadow: inset 0 0 0 1.5px currentColor; }
.mini-board.claimed i { opacity: 0; }
.mini-board.claimed-X { background: var(--mark-x-soft); }
.mini-board.claimed-O { background: var(--mark-o-soft); }
.mini-board.claimed-T { background: var(--mark-t-soft); }
.mini-claim { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--ds-font-display); font-weight: 900; font-size: 26cqw; line-height: 1; }
.claimed-X .mini-claim { color: var(--mark-x); }
.claimed-O .mini-claim { color: var(--mark-o); }
.claimed-T .mini-claim { color: var(--mark-t); font-size: 20cqw; }
@media (max-height: 620px) and (min-width: 700px) {
  .live-card { width: min(1100px, 100%); }
  .live-list { padding-top: 0; }
  /* two rows of cards in a ~490px frame */
  .live-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .live-game { padding: 8px; gap: 5px; }
  .live-game .mini-big { width: min(100%, 118px); justify-self: center; }
}

/* ---- room header ------------------------------------------------------ */
.room-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px clamp(12px, 3vw, 28px); border-bottom: 1px solid var(--ds-rule);
}
.room-header .wordmark-sm { font-size: 20px; margin: 0; }
.room-info { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
/* The room code: the gradient's second appearance. */
.room-code {
  font-family: var(--ds-font-display); font-weight: 900; font-size: 22px; letter-spacing: 0.16em;
  padding: 2px 6px;
}
.room-code-label { margin-right: -4px; }
/* Against the computer: who you are playing, where the room code would be.
   Plain ink, not the gradient — the gradient keeps its three homes. */
.room-vs { font-family: var(--ds-font-display); font-weight: 900; font-size: 20px; }
/* beside the room code, "vs Computer" is a little smaller */
.room-vs-chip { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.room-vs-chip .room-vs { font-size: 16px; }

/* ---- room layout -------------------------------------------------------- */
/* ONE RULE FOR EVERY FRAME SHAPE: the board is a square as big as the
   room's own height allows, and everything else groups beside or around it.

   The room screen is exactly one viewport tall (header + .room-main), and
   .room-main is a SIZE CONTAINER, so the board is sized from the space it
   really has — `cqh`/`cqw` of .room-main — not from `100dvh` minus a guessed
   allowance for the header and the status card. That guess is what clipped
   the bottom row in Village's call view (~1400×500): the status card wrapped
   to two lines and the header grew, and the fixed 200px no longer covered
   them. It also left the empty verdict slot holding a grid column of its
   own, which is what flung the panels to the right past a dead zone.

   LANDSCAPE (wider than tall, the usual case and every Village frame): the
   board takes the full height on the left; the status card, end screen and
   panels stack in a column beside it, flowing into as many panel columns as
   its width allows. Board and column are ONE group, centred together, so a
   very wide frame gets margins at the sides and never a gap in the middle.

   PORTRAIT (taller than wide — phones, a tall narrow frame): the classic
   stack — status, then the board sized to the width AND to the height left
   after the panels' minimum — with the panels below. A phone may scroll the
   page there; that is the one shape allowed to.

   A nested scroll region is not the fix (Boop Battle's rule). The side
   column may scroll ONLY as a last resort in a frame too small for its
   content, so nothing is ever clipped out of reach. */
/* ⚠ A GRID, not the flex column every other screen is. With .room-main as a
   flex item, Chrome resolved its container units against the measuring pass
   (0px tall) and never again: `100cqh` came out 0 and the board fell to its
   floor. As a `minmax(0, 1fr)` grid row the container has a real height when
   its children are styled (measured in Chrome 153, 2026-09-24). */
.screen-room { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.room-main {
  min-height: 0; min-width: 0;
  container: room / size;
}
.room-grid {
  --pad: clamp(8px, 2.2cqh, 24px);
  --gap: clamp(10px, 2cqw, 28px);
  --side-min: 240px;
  /* Two panel columns (2 × 232px + gap) and a little air, no more: a wider
     column is what pushed the board to the left edge and stretched the seat
     cards up to ~1600px. Past board + gap + this, the group centres. */
  --side-max: 600px;
  /* the board: the height, unless the width cannot also fit the side column.
     The cap is only reached in a tall window (≥ ~1000px of room); it keeps a
     big monitor from getting a comically large board. */
  --b: max(200px, min(100cqh - 2 * var(--pad), 100cqw - 2 * var(--pad) - var(--gap) - var(--side-min), 880px));
  height: 100%; box-sizing: border-box; padding: var(--pad);
  display: grid; justify-content: center; align-content: start;
  grid-template-columns: var(--b) minmax(var(--side-min), var(--side-max));
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "board status" "board side";
  column-gap: var(--gap); row-gap: 10px;
}
/* the board column's two children join the grid directly */
.board-col { display: contents; }
.room-grid > .board-col > #status { grid-area: status; min-width: 0; }
.room-grid > .board-col > #board { grid-area: board; width: var(--b); height: var(--b); }
.side-col {
  grid-area: side; min-width: 0; min-height: 0; overflow-y: auto;
  display: grid; gap: 10px; align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  /* panels keep their own height; stretched to a taller neighbour, the
     settings panel ballooned its pickers */
  align-items: start;
}
/* An empty slot must not hold a grid track (that was the dead zone). The
   seats container is `contents` so its two panels — Players, and the
   between-games settings — are separate items that can sit side by side. */
.side-col > :empty { display: none; }
#seats { display: contents; }
/* (between games, the characters' picker is a compact one: "computer
   characters", further down) Below 820px of height the settings panel drops the one-line rule
   under each picker: the player has just played it, Help and the badge
   tooltips still carry it, and the end screen needs the room. */
@media (max-height: 820px), (max-aspect-ratio: 4/5) {
  .settings-panel .mode-blurb, .settings-panel .rule-opts-help { display: none; }
  /* Erase and Infinite wrap to two lines in a ~290px panel; a guest's "the
     host chooses" line goes (the panel's tooltip and the disabled controls
     say it) so the end screen still fits a 1150×490 tile. */
  .settings-panel .host-note { display: none; }
  .settings-panel .rule-opts { gap: 4px 12px; }
  /* erase on: label, Off/On and the stepper on ONE line (the word "each"
     goes; the group's aria-label and the tooltip still say it) */
  .settings-panel .erase-pick { gap: 6px; }
  .settings-panel .erase-cap { gap: 4px; }
  .settings-panel .erase-cap-n { font-size: 0; min-width: 1.4em; }
  .settings-panel .erase-cap-n strong { font-size: 15px; }
}
/* Once the game is over the verdict card says everything the status card
   did ("You win!" and how), so the status card steps aside and the end
   screen gets its height. */
.room-grid:has(.big.is-over) > .board-col > #status { display: none; }

/* PORTRAIT: stack — only for frames clearly taller than wide, or too narrow
   for a board beside a 240px column. A square-ish frame fits side by side
   better (measured: 800×800 scrolled when stacked, fits beside).
   The board is as wide as the frame, but never taller than the height left
   after the header, the status card and one row of panels — or, at the end,
   the two rows the end screen needs. */
@media (max-aspect-ratio: 4/5), (max-width: 519px) {
  .screen-room { display: flex; height: auto; min-height: 100dvh; overflow: visible; }
  .room-main { container-type: inline-size; }
  .room-grid:has(.big.is-over) { --reserve: 550px; }
  .room-grid {
    --b: max(220px, min(100cqw - 2 * var(--pad), 100dvh - var(--reserve, 380px), 640px));
    --pad: clamp(10px, 3cqw, 24px);
    height: auto;
    /* the column is the frame's width (to 640px), not the board's: at the
       end the board shrinks, and the panels must still get two across */
    grid-template-columns: minmax(0, min(100%, 640px));
    grid-template-rows: auto auto auto;
    grid-template-areas: "status" "board" "side";
  }
  .room-grid > .board-col > #board { justify-self: center; }
  .room-grid > .board-col > #status { justify-self: center; max-width: var(--b); }
  .side-col { overflow: visible; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
}

/* BELOW 820px OF HEIGHT the side furniture compacts: seat cards laid out
   sideways (the Players panel at about half the height), smaller end-screen
   buttons, and the settings panel without its row labels (the options name
   themselves: Classic | Domination, Easy … Impossible). */
@media (max-height: 820px), (max-aspect-ratio: 4/5) {
  /* side by side while each card gets ~150px, stacked when the panel is
     narrower — so a name is never cut to "Christo…" */
  .panel .seat-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
  /* (.seat-cards .seat: the base .seat rule comes later in the file) */
  .seat-cards .seat { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; align-content: center; column-gap: 10px; row-gap: 3px; padding: 8px 10px; }
  .seat-cards .seat > :not(.seat-mark) { grid-column: 2; }
  .seat-cards .seat > .seat-mark { grid-row: 1 / span 4; align-self: center; width: 34px; height: 34px; font-size: 18px; }
  .verdict-sub { font-size: 13px; }
  .verdict-actions { gap: 6px; }
  .verdict .ds-btn-block { padding-block: 10px; }
  .verdict .ds-btn-sm { padding: 6px 12px; font-size: 12px; }
  .settings-panel .mode-row { gap: 5px; padding-top: 9px; }
  .settings-panel .mode-row > .ds-label { display: none; }
  .settings-panel .ds-segment { padding-block: 6px; }
}
/* Under 450px of height, height wins over a full name: the two seat cards
   stay side by side (a long name ellipsises; the tooltip has it whole). */
@media (max-height: 450px) {
  .home-setup .rule-opts-help { display: none; }
  .panel .seat-cards { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
}
/* SHORT frames (Village's tile ~490px, the call view ~500px): tighter
   padding everywhere. */
@media (max-height: 620px) {
  .room-header { padding-block: 8px; }
  .status { padding: 9px 14px; }
  .panel, .verdict { padding: 12px 14px; gap: 9px; }
  .verdict { gap: 8px; }
  .verdict-title { font-size: 21px; }
}

/* ---- turn indicator ---------------------------------------------------- */
.status {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  /* The column sets the width now, so the status card always matches the
     board beneath it at every viewport. */
  width: 100%; padding: 12px 16px; border-radius: var(--ds-radius);
  background: var(--ds-card); border: 1px solid var(--ds-rule); box-shadow: var(--ds-shadow-card-2);
  transition: background .2s ease;
}
.status-inner { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* "Computer is thinking" — three dots, so the pause reads as thought and
   not as a frozen board. Reduced motion stops them (the rule at the end). */
.thinking-dots { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.25; animation: thinkDot 1s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: 0.16s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes thinkDot { 0%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .thinking-dots i { opacity: 0.6; } }
.status .status-mark { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--ds-font-display); font-weight: 900; font-size: 18px; flex: none; }
.status .status-mark[data-mark="X"] { color: var(--mark-x); background: var(--mark-x-soft); }
.status .status-mark[data-mark="O"] { color: var(--mark-o); background: var(--mark-o-soft); }
.status-text { display: grid; gap: 2px; min-width: 0; }
.status-title { font-family: var(--ds-font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.status-sub { font-size: 13px; color: var(--ds-ink-3); }
.status.is-you { border-color: var(--ds-ink); }
.status.is-you .status-title { color: var(--ds-ink); }

/* ---- the board ---------------------------------------------------------- */
/* Sized by whichever is tighter: the column's width or the viewport's
   height (Village hands the game ~490px of height — height is always the
   constraint there, never width). */
/* position: relative anchors the claim flourish's layer (game/board-fx.mjs),
   which is drawn OVER the settled board and removed when it finishes. */
.board-wrap { width: 100%; aspect-ratio: 1; position: relative; }
.big {
  /* Equal minmax(0,1fr) rows and columns inside a SQUARE box: the nine
     boards, and the nine cells in each, are square by construction. */
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.4%, 12px);
  width: 100%; height: 100%; padding: clamp(6px, 1.4%, 12px);
  background: var(--ds-card); border: 1px solid var(--ds-rule); border-radius: var(--ds-radius-card);
  box-shadow: var(--ds-shadow-card-2);
}
.small {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 3px; padding: 5px; min-width: 0; min-height: 0;
  background: var(--ds-bg); border-radius: var(--ds-radius-sm);
  transition: opacity .18s ease, background .18s ease;
}
/* A free move: every open board is playable and says so with a hairline. */
.small.open { box-shadow: inset 0 0 0 1px var(--ds-rule-strong); }
/* THE FORCED BOARD — the gradient's third and last appearance, as a ring.
   Drawn on a pseudo-element behind the board so the ring is a true gradient
   and the board's own corners stay crisp. */
.small.forced::before {
  content: ""; position: absolute; inset: -4px; z-index: -1;
  border-radius: calc(var(--ds-radius-sm) + 4px); background: var(--ds-accent-grad);
}
.small.forced { background: var(--ds-card); }
/* While a board is forced, the others step back. Not hidden: the whole
   position has to stay readable. */
.big.has-forced .small:not(.forced):not(.claimed) { opacity: 0.62; }
/* A CLAIMED BOARD IS ITS GLYPH. The nine small marks are cleared once the
   board is won — the flourish's last beat is them collapsing into the one
   big mark, and what it hands back to has to match. That includes the
   last-move square: its ring beside the big glyph read as a stray grey box
   (owner, 2026-09-25), so a claimed board shows its mark and nothing else. */
.small.claimed .cell { opacity: 0; }
.small.claimed-X { background: var(--mark-x-soft); }
.small.claimed-O { background: var(--mark-o-soft); }
.small.claimed-T { background: var(--mark-t-soft); }
/* The claim: one big glyph over the small board. */
.small .claim {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1;
  /* Sized to FILL the small board. `cqw` is the big board's width (the
     container is `.big`); a small board is ~31.5% of it, so 33cqw is
     ~1.05× a small board's width — the same ratio game/board-fx.mjs uses
     for the flourish's glyph, so the handoff is seamless. */
  font-size: clamp(30px, 33cqw, 210px);
}
.small.claimed-X .claim { color: var(--mark-x); }
.small.claimed-O .claim { color: var(--mark-o); }
.small.claimed-T .claim { color: var(--mark-t); font-size: clamp(24px, 26cqw, 164px); }
/* A tie's equals sign is an SVG (board-view.mjs TIE_GLYPH), a block in the
   claim's centred grid, so it sits dead centre at every size. The font's
   "=" hung 8% of its size low. Sized to the font "=" it replaces. */
.tie-glyph { display: block; width: 0.56em; height: 0.3136em; fill: currentColor; }
/* The three boards that won the game. */
.small.win-line { box-shadow: 0 0 0 3px currentColor; }
.small.win-line.claimed-X { color: var(--mark-x); }
.small.win-line.claimed-O { color: var(--mark-o); }
.big { container-type: inline-size; }

.cell {
  appearance: none; border: 0; margin: 0; padding: 0; min-width: 0; min-height: 0;
  display: grid; place-items: center; border-radius: 6px;
  background: var(--ds-card); color: var(--ds-ink);
  font-family: var(--ds-font-display); font-weight: 900; font-size: clamp(14px, 4.2cqw, 30px); line-height: 1;
  cursor: default; transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.cell[data-mark="X"] { color: var(--mark-x); }
.cell[data-mark="O"] { color: var(--mark-o); }
.cell.last { box-shadow: inset 0 0 0 2px currentColor; }
.cell.last:not([data-mark]) { box-shadow: none; }
/* A legal square for the player whose turn it is: a quiet dot, a preview
   of their own mark on hover. Only ever rendered when it IS their turn. */
.cell.playable { cursor: pointer; }
.cell.playable::after { content: ""; width: 18%; height: 18%; border-radius: 50%; background: var(--ds-ink-5); transition: background .12s ease; }
.cell.playable:hover { background: var(--ds-bg-2); transform: scale(1.04); }
.cell.playable:hover::after { content: attr(data-preview); width: auto; height: auto; border-radius: 0; background: none; color: var(--ds-ink-4); font-size: inherit; }
.cell.playable:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.cell:disabled { cursor: default; }
/* A move that has been sent and not yet answered: a faint preview of the
   mark, so the round trip is visible instead of feeling like a dead click. */
.cell.pending::after { content: attr(data-preview); color: var(--ds-ink-4); width: auto; height: auto; background: none; border-radius: 0; }
.big.is-over .cell, .big.is-waiting .cell { cursor: default; }

/* ---- erase (an option on top of either mode) --------------------------
   LOCKED: the square just erased, which the mover may not place in this
   turn. Hatched, so it reads as "blocked" to everyone, not as an ordinary
   empty square. Only ever present for one move. */
.cell.locked {
  background-color: var(--ds-bg-2);
  background-image: repeating-linear-gradient(45deg, var(--ds-rule-strong) 0 2px, transparent 2px 7px);
  box-shadow: inset 0 0 0 2px var(--ds-rule-strong);
}
/* Choosing a mark to erase: the placements step back, and only the marks
   the rulebook lets you erase light up. Hover shows the strike. */
.big.is-erasing .cell:not(.erasable) { opacity: 0.45; }
/* The forced board confines where you PLACE, not what you erase: while
   choosing an erase, every board is back at full strength (a target is
   often in a board the forced ring would otherwise dim) and the ring
   quietens so the amber targets lead. */
.big.is-erasing.has-forced .small:not(.forced):not(.claimed) { opacity: 1; }
.big.is-erasing .small.forced::before { opacity: 0.3; }
.cell.erasable { cursor: pointer; box-shadow: inset 0 0 0 2px var(--ds-warning-solid); background: var(--ds-warning-soft); }
.cell.erasable:hover { transform: scale(1.06); text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--ds-warning-solid); }
.cell.erasable:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.status-erase { margin-left: auto; flex: none; }

/* ---- infinite (an option on top of either mode, never with erase) --------
   VANISH-NEXT: each player's oldest mark in an open board where they hold
   three. Their next mark there removes it. Shown to everyone, both players'
   at once: faded, with a dashed ring in the mark's own colour, and a slow
   pulse. Reduced motion (.big.still, and the global rule) keeps it still:
   faded and ringed, the warning is the same. */
.cell.vanish-next { box-shadow: inset 0 0 0 2px currentColor; outline: 2px dashed currentColor; outline-offset: -5px; }
.cell.vanish-next > * { opacity: 0.42; animation: vanishWarn 1.1s ease-in-out infinite alternate; }
.big.still .cell.vanish-next > * { animation: none; }
@keyframes vanishWarn { from { opacity: 0.85; } to { opacity: 0.25; } }
/* The mark that just vanished: a ghost fading and shrinking out. Never drawn
   under reduced motion (the removal is instant). */
.cell:has(> .vanish-ghost) { position: relative; }
.vanish-ghost { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; animation: vanishOut .65s ease-in forwards; }
.vanish-ghost[data-mark="X"] { color: var(--mark-x); }
.vanish-ghost[data-mark="O"] { color: var(--mark-o); }
@keyframes vanishOut { from { opacity: 1; transform: scale(1); filter: blur(0); } to { opacity: 0; transform: scale(0.4); filter: blur(2px); } }

/* ---- the tiebreaker (game/tiebreak-view.mjs) -----------------------------
   After a draw between people, if both accept: rounds of plain 3×3. The 3×3
   board takes the big board's place, at the same size (#board is the
   square). Amber (the design system's warning tokens) marks "tiebreaker"
   throughout; the accent gradient keeps its three homes. */
.tb-frame { position: relative; width: 100%; height: 100%; }
.tb-board {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 2.2%, 14px); width: 100%; height: 100%; box-sizing: border-box; padding: clamp(10px, 4%, 26px);
  background: var(--ds-card); border: 1px solid var(--ds-rule); border-radius: var(--ds-radius-card);
  box-shadow: var(--ds-shadow-card-2), inset 0 0 0 3px var(--ds-warning-soft);
  container-type: inline-size;
}
.tb-board.is-mine { box-shadow: var(--ds-shadow-card-2), inset 0 0 0 3px var(--ds-warning-solid); }
.tb-board.is-between .tb-cell { opacity: 0.55; }
.tb-cell {
  appearance: none; border: 0; margin: 0; padding: 0; min-width: 0; min-height: 0;
  display: grid; place-items: center; border-radius: var(--ds-radius-sm);
  background: var(--ds-bg); color: var(--ds-ink);
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1; font-size: clamp(28px, 17cqw, 150px);
  cursor: default; transition: background .12s ease, transform .12s ease;
}
.tb-cell[data-mark="X"] { color: var(--mark-x); }
.tb-cell[data-mark="O"] { color: var(--mark-o); }
.tb-cell.last { box-shadow: inset 0 0 0 3px currentColor; }
.tb-cell.win { background: var(--ds-warning-soft); }
.tb-cell.playable { cursor: pointer; background: var(--ds-card); box-shadow: inset 0 0 0 1px var(--ds-rule-strong); }
.tb-cell.playable:hover { background: var(--ds-bg-2); transform: scale(1.03); }
.tb-cell.playable:hover::after, .tb-cell.pending::after { content: attr(data-preview); color: var(--ds-ink-4); }
.tb-cell.playable:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.tb-cell:disabled { cursor: default; }
.tb-tag { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 3px 10px; font-size: 11.5px; white-space: nowrap; pointer-events: none; }
/* the board is the deciding round once the game is over: the status card steps aside, as at any end */
.room-grid:has(.tb-board.is-over) > .board-col > #status { display: none; }

/* the clock: digits and a draining bar. Amber, then danger red for the last 3 s. */
.tb-clock { display: grid; gap: 4px; justify-items: end; flex: none; margin-left: auto; min-width: 62px; }
.tb-clock-n { font-family: var(--ds-font-display); font-weight: 900; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ds-ink); }
.tb-clock-bar { width: 62px; height: 5px; border-radius: 999px; background: var(--ds-bg-2); overflow: hidden; }
.tb-clock-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ds-warning-solid); }
.tb-clock.is-low .tb-clock-n { color: var(--ds-danger-text); }
.tb-clock.is-low .tb-clock-bar i { background: var(--ds-danger); }
.tb-clock.is-mine.is-low:not(.is-still) .tb-clock-n { animation: tbPulse .5s ease-in-out infinite alternate; }
@keyframes tbPulse { to { transform: scale(1.12); } }
.tb-clock-start .tb-clock-n { color: var(--ds-ink-3); font-size: 18px; }
.tb-clock-offer .tb-clock-n { font-size: 15px; color: var(--ds-ink-2); }
.tb-status .status-text { flex: 1; }

/* the offer, in the end screen */
.tb-offer { display: grid; gap: 7px; width: 100%; justify-items: center; padding: 10px; border-radius: var(--ds-radius-sm); background: var(--ds-warning-soft); }
.tb-offer-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.tb-offer-head .ds-label { color: var(--ds-warning); }
.tb-offer-head .tb-clock { margin-left: 0; }
.tb-offer-head .votes { margin-left: auto; margin-right: 10px; }
.tb-offer-text { margin: 0; font-size: 12.5px; color: var(--ds-ink-2); text-align: center; line-height: 1.35; }
.tb-offer-short { display: none; }
/* Village's frames: one short line instead of three (the full text is the
   button's tooltip), and tighter, so the offer never pushes a panel out of
   the frame (measured: the long form overflowed 1400×500 by 35px). */
@media (max-height: 620px) {
  .tb-offer { padding: 7px 8px; gap: 5px; }
  .tb-offer-text { font-size: 12px; }
  .tb-offer-long { display: none; }
  .tb-offer-short { display: inline; }
  .tb-offer .ds-btn-block { padding-block: 9px; }
  .tb-offer .ds-btn-sm { padding-block: 4px; }
}

/* ---- Guide pings (a watching GUIDE/ADMIN points at a square) -----------
   Every square is a button for them (.pingable); a click never plays. The
   ping is drawn on a layer over the board (game.js drawPings), in the Guide
   tag's green, with a "Guide" label, and is gone after PING_SHOW_MS (2 s).
   Reduced motion: the same ring and label, still, then gone. */
.big.is-pinging .cell { cursor: pointer; }
.big.is-pinging .cell:hover { box-shadow: inset 0 0 0 2px var(--ds-success); }
.big.is-pinging .small.claimed .cell:hover { opacity: 0.35; }
.ping-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ping { position: absolute; }
.ping-ring {
  position: absolute; inset: -3px; border-radius: 8px;
  box-shadow: 0 0 0 3px var(--ds-success), 0 0 0 7px var(--ds-success-soft);
  background: color-mix(in srgb, var(--ds-success) 22%, transparent);
  animation: pingPulse 0.66s ease-out var(--ping-age, 0ms) 3 both, pingFade 2s linear var(--ping-age, 0ms) both;
}
.ping-label {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 2px 8px; border-radius: var(--ds-radius-pill); white-space: nowrap;
  font-family: var(--ds-font-body); font-size: 11px; font-weight: 700; line-height: 1.4;
  color: var(--ds-success-text); background: var(--ds-card); box-shadow: 0 0 0 1.5px var(--ds-success), var(--ds-shadow-soft);
  animation: pingFade 2s linear var(--ping-age, 0ms) both;
}
@keyframes pingPulse {
  0% { transform: scale(1.5); opacity: 0.2; }
  60% { transform: scale(0.96); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pingFade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.ping.is-still .ping-ring, .ping.is-still .ping-label { animation: none; }

/* ---- champion marks: crowns ------------------------------------------
   A top-5 player's mark, X or O alike (game/board-view.mjs markGlyph;
   shapes in index.html: the royal crown for Overall, the plain crown for the
   others). The SVG is sized in em, so it takes the size every existing mark
   rule already sets in cqw/px. A darker edge of its own colour keeps the
   shape crisp on a pale cell. Colour rides on data-tier / .tier-*, so the
   last-move ring, the claimed tint and the win-line outline follow the
   champion's colour through currentColor, exactly as they follow X and O. */
@media (prefers-color-scheme: dark) {
  .recess-ds:not([data-theme="light"]) {
    --cos-orange: #fb923c; --cos-orange-soft: rgba(251, 146, 60, 0.18);
    --cos-teal: #2dd4bf; --cos-teal-soft: rgba(45, 212, 191, 0.16);
  }
}
.recess-ds[data-theme="dark"] {
  --cos-orange: #fb923c; --cos-orange-soft: rgba(251, 146, 60, 0.18);
  --cos-teal: #2dd4bf; --cos-teal-soft: rgba(45, 212, 191, 0.16);
}
.cos {
  display: block; width: 1.15em; height: 1.15em; overflow: visible;
  fill: currentColor; stroke: color-mix(in srgb, currentColor 52%, #000); stroke-width: 5; stroke-linejoin: round; paint-order: stroke;
}
/* in a board square: ~two-thirds of the cell (a letter's 1em looked lost),
   still clear of the 2px last-move ring */
.cell .cos { width: 1.55em; height: 1.55em; }
.cos-overall { color: var(--cos-gold); fill: url(#cos-gold); }
.cos-human { color: var(--cos-human); }
.cos-bot { color: var(--cos-bot); }
/* TWO CHAMPIONS OF ONE TIER: X's crowns stay solid, O's are HOLLOW, a thick
   outline in the same colour around the card's own colour. Solid against
   outline survives a Village tile's cell size; two shades of one colour do
   not. (seatAlt() in board-view.mjs decides; it applies to every place the
   mark is drawn.) */
.cos.cos-alt { fill: var(--ds-card); stroke: currentColor; stroke-width: 9; }
/* at a board square's ~26px a 9-unit outline went faint: thicker where small */
.cell .cos.cos-alt, .cos-preview .cos.cos-alt, .status-mark .cos.cos-alt, .seat-mark .cos.cos-alt, .verdict-icon .cos.cos-alt { stroke-width: 13; }
.cell[data-tier="overall"] { color: var(--cos-gold); }
.cell[data-tier="human"] { color: var(--cos-human); }
.cell[data-tier="bot"] { color: var(--cos-bot); }
.small.claimed.tier-overall { background: var(--cos-gold-soft); }
.small.claimed.tier-human { background: var(--cos-human-soft); }
.small.claimed.tier-bot { background: var(--cos-bot-soft); }
.small.tier-overall .claim, .small.win-line.tier-overall { color: var(--cos-gold); }
.small.tier-human .claim, .small.win-line.tier-human { color: var(--cos-human); }
.small.tier-bot .claim, .small.win-line.tier-bot { color: var(--cos-bot); }
.small .claim .cos { width: 0.82em; height: 0.82em; stroke-width: 3.5; }
.small .claim .cos.cos-alt { stroke-width: 7; }
/* .seat .seat-mark, not .seat-mark: the base .seat-mark[data-mark] rules come
   LATER in this file and would win a tie */
.status .status-mark[data-tier="overall"], .seat .seat-mark[data-tier="overall"], .verdict-icon[data-tier="overall"] { color: var(--cos-gold); background: var(--cos-gold-soft); }
.status .status-mark[data-tier="human"], .seat .seat-mark[data-tier="human"], .verdict-icon[data-tier="human"] { color: var(--cos-human); background: var(--cos-human-soft); }
.status .status-mark[data-tier="bot"], .seat .seat-mark[data-tier="bot"], .verdict-icon[data-tier="bot"] { color: var(--cos-bot); background: var(--cos-bot-soft); }
.status-mark .cos, .seat-mark .cos { width: 1.2em; height: 1.2em; }
/* THE HOVER PREVIEW: a champion's legal squares carry a faint copy of their
   own crown, shown on hover (and while a move is in flight) in place of the
   letter preview. */
.cos-preview { display: none; opacity: 0.4; }
.cell.playable[data-preview-tier]:hover::after, .cell.pending[data-preview-tier]::after { content: none; display: none; }
.cell.playable[data-preview-tier]:hover .cos-preview, .cell.pending[data-preview-tier] .cos-preview { display: block; }
/* THE END-SCREEN HEADLINE: the winner's mark, then their name. */
.verdict-title { display: flex; align-items: center; justify-content: center; gap: 0.3em; flex-wrap: wrap; }
.verdict-icon { display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; border-radius: 50%; flex: none; }
.verdict-icon.mark-x:not([data-tier]) { background: var(--mark-x-soft); }
.verdict-icon.mark-o:not([data-tier]) { background: var(--mark-o-soft); }
.verdict-icon .cos { width: 0.82em; height: 0.82em; }
.verdict-you { font-weight: 700; color: var(--ds-ink); }
/* GOLD SHINES: a slow sheen on the crown and a four-point sparkle that
   twinkles at its corner, staggered per square (--d) so the board never
   pulses in unison. The sparkle is invisible unless animated, so reduced
   motion (the global rule at the end of this file, and .big.still from
   prefersReduced()) leaves a plain, static gold crown. */
.cos-twinkle { opacity: 0; fill: #fff6cf; stroke: none; transform-box: fill-box; transform-origin: center; }
.cos-live .cos-twinkle { animation: cosTwinkle 2.6s ease-in-out var(--d, 0ms) infinite; }
.cos-live .cos-shape { animation: cosSheen 2.6s ease-in-out var(--d, 0ms) infinite; }
.big.still .cos-twinkle, .big.still .cos-shape { animation: none; }
@keyframes cosTwinkle {
  0%, 62%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
  72% { opacity: 1; transform: scale(1) rotate(45deg); }
  84% { opacity: 0; transform: scale(0.3) rotate(90deg); }
}
@keyframes cosSheen { 0%, 55%, 100% { filter: brightness(1); } 72% { filter: brightness(1.28); } }

/* ---- the claim flourish (game/board-fx.mjs) ----------------------------
   Drawn OVER the already-settled board and removed when it ends, so it can
   be cancelled at any instant without leaving anything half-played, and it
   cannot block a click or a move. The tile is opaque (card + the claim's
   own soft tint, exactly what a claimed .small composites to) so whatever
   is underneath does not show through mid-sequence.

   Confetti uses the label palette as SOLID colours. The accent gradient
   keeps its three existing homes — "tactoe", the room code, the forced-board
   ring — and this adds no fourth. */
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.fx-tile {
  position: absolute; border-radius: var(--ds-radius-sm);
  background: var(--ds-card); /* opaque base, as the real board has */
  display: grid; place-items: center;
}
.fx-tile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--fx-soft); }
.fx-X { --fx-soft: var(--mark-x-soft); --fx-ink: var(--mark-x); }
.fx-O { --fx-soft: var(--mark-o-soft); --fx-ink: var(--mark-o); }
.fx-T { --fx-soft: var(--mark-t-soft); --fx-ink: var(--mark-t); }
/* a champion's claim flips to their crowns, in their colour */
.fx-tier-overall { --fx-soft: var(--cos-gold-soft); --fx-ink: var(--cos-gold); }
.fx-tier-human { --fx-soft: var(--cos-human-soft); --fx-ink: var(--cos-human); }
.fx-tier-bot { --fx-soft: var(--cos-bot-soft); --fx-ink: var(--cos-bot); }
.fx-glyph .cos { width: 0.82em; height: 0.82em; stroke-width: 3.5; }

/* the nine cells flipping to the winner's mark, one after another */
.fx-cells { position: absolute; inset: 5px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.fx-cell {
  display: grid; place-items: center; border-radius: 6px;
  background: var(--ds-card); color: var(--fx-ink);
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1; font-size: 42%;
  opacity: 0;
  animation:
    fxFlip 130ms ease-out calc(var(--i) * 26ms) both,
    fxClear 200ms ease-in 360ms forwards;
}
@keyframes fxFlip {
  from { opacity: 0; transform: rotateY(85deg) scale(0.86); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes fxClear { to { opacity: 0; transform: scale(0.72); } }

/* …collapsing into the one big mark */
.fx-glyph {
  position: relative; font-family: var(--ds-font-display); font-weight: 900; line-height: 1;
  color: var(--fx-ink);
}
.fx-celebrate .fx-glyph { opacity: 0; animation: fxGlyphIn 280ms cubic-bezier(0.2, 1.35, 0.45, 1) 360ms both; }
@keyframes fxGlyphIn {
  from { opacity: 0; transform: scale(0.45); }
  to { opacity: 1; transform: scale(1); }
}
/* a tie: no flip, no confetti — nobody won it — the equals sign just arrives */
.fx-calm .fx-glyph { animation: fxCalmIn 220ms ease-out both; }
@keyframes fxCalmIn { from { opacity: 0; } to { opacity: 1; } }

.fx-confetti { position: absolute; inset: 0; overflow: visible; }
.fx-confetti i {
  position: absolute; left: 50%; top: 50%;
  width: var(--fx-bit, 6px); height: var(--fx-bit, 6px);
  background: var(--c); border-radius: 1.5px; opacity: 0;
  animation: fxPop 340ms cubic-bezier(0.15, 0.75, 0.35, 1) calc(330ms + var(--d)) forwards;
}
@keyframes fxPop {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
  70% { opacity: 1; }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); }
}

/* ---- the game-win celebration (game/celebrate.mjs) ---------------------
   Like the claim flourish: drawn OVER the settled board (the end screen is
   already beside it), pointer-events none, and dropped at any instant.
   game.js redraws it after every render; each delay below is "its start
   minus the age", so a redraw carries on instead of restarting.
   --ink is the winner's colour: their champion tier's, else their mark's.
   It never uses the accent gradient.

   On the REAL board (#board[data-cele]): the winning boards (or the 3×3's
   winning squares) lift and pulse, and the rest dims, for the span of the
   celebration. Domination dims the rest and lights the winner's boards on
   the layer, one by one. */
#board[data-cele~="line"]:not([data-cele~="still"]) .small.win-line,
#board[data-cele~="tb-line"]:not([data-cele~="still"]) .tb-cell.win {
  z-index: 1;
  animation: celeLift var(--cele-span) ease-in-out var(--cele-at) both;
}
#board[data-cele~="line"]:not([data-cele~="still"]) .small:not(.win-line),
#board[data-cele~="count"]:not([data-cele~="still"]) .small:not(.win-line),
#board[data-cele~="tb-line"]:not([data-cele~="still"]) .tb-cell:not(.win) {
  animation: celeDim var(--cele-span) ease var(--cele-at) both;
}
/* reduced motion: the same picture, held still */
#board[data-cele~="still"]:is([data-cele~="line"], [data-cele~="count"]) .small:not(.win-line),
#board[data-cele~="still"][data-cele~="tb-line"] .tb-cell:not(.win) { opacity: 0.35; }
#board[data-cele~="still"][data-cele~="tb-line"] .tb-cell.win { box-shadow: inset 0 0 0 4px var(--cele-ink); }
@keyframes celeLift {
  0% { transform: none; filter: none; }
  12% { transform: translateY(-3px) scale(1.05); filter: drop-shadow(0 0 12px var(--cele-ink)); }
  28% { transform: translateY(-3px) scale(1.025); filter: drop-shadow(0 0 5px var(--cele-ink)); }
  44% { transform: translateY(-3px) scale(1.05); filter: drop-shadow(0 0 12px var(--cele-ink)); }
  60% { transform: translateY(-3px) scale(1.03); filter: drop-shadow(0 0 7px var(--cele-ink)); }
  88% { transform: translateY(-2px) scale(1.03); filter: drop-shadow(0 0 7px var(--cele-ink)); }
  100% { transform: none; filter: none; }
}
@keyframes celeDim { 0%, 100% { opacity: 1; } 10%, 88% { opacity: 0.32; } }

.cele-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: var(--ds-radius-card); }
.cele { position: absolute; inset: 0; animation: celeOut 260ms ease-in var(--fade) both; }
.cele.is-still { animation: none; }
@keyframes celeOut { from { opacity: 1; } to { opacity: 0; } }

/* a. Domination's count (and every still frame's highlight) */
.cele-tile {
  position: absolute; border-radius: var(--ds-radius-sm);
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: inset 0 0 0 3px var(--ink), 0 0 18px 2px color-mix(in srgb, var(--ink) 50%, transparent);
  animation: celeTileIn 260ms cubic-bezier(0.2, 1.4, 0.4, 1) var(--at) both;
}
@keyframes celeTileIn { from { opacity: 0; transform: scale(0.84); } to { opacity: 1; transform: none; } }
.cele-n {
  position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--ink); color: #fff; font: 900 13px/1 var(--ds-font-display);
}
/* …or the line: a soft glow under a solid core, drawn end to end */
.cele-line { position: absolute; left: 0; top: 0; overflow: visible; }
.cele-line line { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: celeDraw var(--draw) cubic-bezier(0.5, 0, 0.3, 1) var(--at) both; }
/* the core is a lighter tint of the winner's colour, so it reads OVER their
   own big marks (in the plain colour it vanished into them) */
.cele-line-core { stroke-width: var(--thick); stroke: color-mix(in srgb, var(--ink) 45%, #fff); }
.cele-line-glow { stroke-width: calc(var(--thick) * 2.4); opacity: 0.55; filter: blur(5px); }
@keyframes celeDraw { to { stroke-dashoffset: 0; } }

/* b. the champion's crown, dropping in with a burst in the tier's colour */
.cele-crown {
  position: absolute; width: 1em; height: 1em; transform: translate(-50%, -50%);
  animation: celeDrop 420ms cubic-bezier(0.3, 1.5, 0.5, 1) var(--at) both;
}
.cele-crown .cos { position: relative; width: 1em; height: 1em; stroke-width: 3.5; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--ink) 55%, transparent)); }
.cele-crown .cos.cos-alt { stroke-width: 7; }
@keyframes celeDrop {
  from { opacity: 0; transform: translate(-50%, -190%) scale(0.7); }
  55% { opacity: 1; transform: translate(-50%, -44%) scale(1.04, 0.94); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.cele-burst, .cele-ring { position: absolute; left: 50%; top: 50%; }
.cele-burst i {
  position: absolute; left: -0.025em; top: -0.16em; width: 0.05em; height: 0.32em; border-radius: 0.03em;
  background: var(--ink); opacity: 0;
  animation: celeRay 560ms ease-out calc(var(--at) + 260ms) both;
}
@keyframes celeRay {
  from { opacity: 1; transform: rotate(var(--a)) translateY(-0.45em) scaleY(0.4); }
  to { opacity: 0; transform: rotate(var(--a)) translateY(-1.05em) scaleY(1); }
}
.cele-ring {
  width: 1em; height: 1em; margin: -0.5em 0 0 -0.5em; border-radius: 50%;
  border: 0.035em solid var(--ink); opacity: 0;
  animation: celeRing 560ms ease-out calc(var(--at) + 260ms) both;
}
@keyframes celeRing { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.7); } }

/* c. confetti, in shades of the winner's one colour, thrown up from the banner */
.cele-confetti { position: absolute; width: 0; height: 0; }
.cele-confetti i {
  position: absolute; left: 0; top: 0; border-radius: 1.5px; background: var(--ink); opacity: 0;
  animation: celeConfetti 1100ms cubic-bezier(0.2, 0.7, 0.4, 1) var(--at) both;
}
.cele-confetti i.s1 { background: color-mix(in srgb, var(--ink) 55%, #fff); }
.cele-confetti i.s2 { background: color-mix(in srgb, var(--ink) 72%, #000); }
@keyframes celeConfetti {
  0% { opacity: 0; transform: translate(-50%, -50%); }
  4% { opacity: 1; }
  35% { opacity: 1; transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(calc(var(--rot) * 0.4)); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(calc(var(--dx) * 1.35), calc(var(--dy) + var(--fall))) rotate(var(--rot)); }
}
.cele-banner {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 0.35em; padding: 0.32em 0.8em; border-radius: var(--ds-radius-pill);
  background: var(--ds-card); color: var(--ds-ink); white-space: nowrap;
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1.1;
  box-shadow: var(--ds-shadow-card-2), 0 0 0 3px var(--ink);
  animation: celeBanner 280ms cubic-bezier(0.2, 1.4, 0.4, 1) var(--at) both;
}
.cele-gentle .cele-banner { box-shadow: var(--ds-shadow-card-2), 0 0 0 2px var(--ds-rule-strong); }
.cele-banner-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cele-banner-mark { flex: none; display: grid; place-items: center; color: var(--ink); }
.cele-banner-mark .cos { width: 1em; height: 1em; stroke-width: 4; }
@keyframes celeBanner { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%); } }
/* reduced motion: one still frame, everything in its final place */
.cele.is-still * { animation: none !important; }

/* ---- seats ------------------------------------------------------------ */
.panel { padding: 16px; display: grid; gap: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat {
  display: grid; gap: 8px; justify-items: center; text-align: center; padding: 14px 10px;
  border-radius: var(--ds-radius-sm); background: var(--ds-bg); border: 1px solid var(--ds-rule);
}
.seat.is-you { border-color: var(--ds-ink); }
.seat.is-turn { background: var(--ds-card); box-shadow: var(--ds-shadow-soft); }
.seat-mark {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--ds-font-display); font-weight: 900; font-size: 22px;
}
.seat-mark[data-mark="X"] { color: var(--mark-x); background: var(--mark-x-soft); }
.seat-mark[data-mark="O"] { color: var(--mark-o); background: var(--mark-o-soft); }
.seat-name { font-weight: 600; font-size: 14px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-name.empty { color: var(--ds-ink-3); font-weight: 450; }
.seat-away { color: var(--ds-ink-3); font-size: 12px; }
.seat-turn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ds-ink); display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ---- game mode -------------------------------------------------------- */
.mode-pick { display: grid; gap: 6px; justify-items: center; }
.mode-blurb { text-align: center; }
.mode-row { display: grid; gap: 8px; justify-items: center; padding-top: 12px; border-top: 1px solid var(--ds-rule); }
.settings-panel > .mode-row:first-child { padding-top: 0; border-top: 0; }
.mode-badge { flex: none; }
/* Domination's running score: the count of claimed boards, beside the
   player it belongs to. Absent in classic, where boards are not a score. */
.seat-tally { font-size: 12.5px; color: var(--ds-ink-3); }
.seat-tally strong { font-family: var(--ds-font-display); font-size: 15px; font-weight: 900; color: var(--ds-ink); }
.seat-erases.is-spent strong { color: var(--ds-ink-4); }

/* ---------------------------------------------------------------- computer characters
   Pip the Puppy (easy), Shelly the Turtle (medium), Rusty the Fox (hard),
   Olive the Owl (impossible): faces from game/bot-avatars.mjs, lines from
   game/bot-lines.mjs. The faces' own colours are fixed (they are drawings,
   on a soft disc), so both themes share them. Never the accent gradient. */
:root {
  --av-ink: #2b2420;
  --av-pup: #e2b27a; --av-pup-ear: #9b6a3e; --av-pup-muzzle: #f7e6cc; --av-pup-tongue: #ef7d8f;
  --av-tur: #8fc46f; --av-tur-shell: #5f8a3c; --av-tur-scute: #446a28; --av-tur-rim: #d9c27c; --av-tur-cheek: #f0a3a0;
  --av-fox: #e8782f; --av-fox-inner: #7a3712; --av-fox-white: #fff4e8;
  --av-owl: #8c6b4f; --av-owl-belly: #dcc4a6; --av-owl-eye: #fffaf0; --av-owl-beak: #f0a93a;
}
.bot-avatar {
  --av-size: 22px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--av-size); height: var(--av-size);
  border-radius: 50%; background: var(--ds-bg-2);
  vertical-align: middle;
}
.bot-avatar svg { display: block; width: 88%; height: 88%; overflow: visible; transform-origin: 50% 90%; }
/* thinking: a little bob, each at its own pace (reduced motion: none, by the
   global rule, and renderSeats leaves the class off) */
.bot-avatar.is-thinking svg { animation: avBob 900ms ease-in-out infinite; }
.bot-avatar-easy.is-thinking svg { animation-duration: 420ms; }
.bot-avatar-hard.is-thinking svg { animation-name: avTilt; animation-duration: 1100ms; }
.bot-avatar-impossible.is-thinking svg { animation-duration: 1800ms; }
@keyframes avBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9%); } }
@keyframes avTilt { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-9deg); } 70% { transform: rotate(7deg); } }

/* the picker: one button per character, face over name over difficulty */
.char-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 4px; background: var(--ds-bg-2); border-radius: 20px; width: 100%; box-sizing: border-box; }
.char-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  padding: 7px 4px 6px; border: 0; border-radius: 16px; background: transparent;
  color: var(--ds-ink-3); font: inherit; cursor: pointer;
}
.char-btn .bot-avatar { --av-size: 64px; background: var(--ds-card); }
.char-btn:hover:not(:disabled) { color: var(--ds-ink); }
.char-btn.is-on { background: var(--ds-card); color: var(--ds-ink); box-shadow: var(--ds-shadow-soft); }
.char-btn.is-on .bot-avatar { background: var(--ds-bg-2); }
.char-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.char-btn:disabled { cursor: not-allowed; }
.char-pick:has(.char-btn:disabled) { opacity: 0.7; }
.char-btn-text { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; line-height: 1.15; }
.char-btn-name { font-weight: 700; font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-btn-level { font-size: 11.5px; color: var(--ds-ink-3); white-space: nowrap; }
.char-btn.is-on .char-btn-level { color: var(--ds-ink-2); }
/* between games, in the settings panel (a ~70px button): the face over the
   difficulty, no name (the blurb and the tooltip carry it) */
.settings-panel .char-btn { gap: 2px; padding: 4px 2px; }
.settings-panel .char-btn .bot-avatar { --av-size: 36px; }
.settings-panel .char-btn-name { display: none; }
.settings-panel .char-btn-level { font-size: 11px; font-weight: 600; color: inherit; letter-spacing: -0.01em; }
@media (max-height: 620px) {
  .char-btn { padding: 5px 4px 4px; gap: 2px; }
  /* the 64px faces need the room: the buttons name each difficulty, so the
     "Difficulty" label goes (as the between-games panel's labels do). Without
     this, Domination's two-line rule overflowed the 1150×490 tile by 6px. */
  .home-section-label { display: none; }
}

/* the room header */
.room-vs-chip { align-items: center; }
.room-vs-chip .bot-avatar { --av-size: 36px; }

/* THE COMPUTER'S SEAT CARD: its face (56px) stands in for the mark, with
   the X or O riding on the face's corner (opaque, ringed in the card's
   colour), then its name and its difficulty. */
.seat.is-bot { position: relative; }
.seat-bot-face { position: relative; display: block; flex: none; width: 56px; height: 56px; }
.seat-bot-face .bot-avatar { --av-size: 56px; }
.seat .seat-bot-face > .seat-mark {
  position: absolute; right: -6px; bottom: -4px;
  width: 24px; height: 24px; font-size: 13px;
  box-shadow: 0 0 0 2px var(--ds-bg);
}
.seat .seat-bot-face > .seat-mark[data-mark="X"] { background: linear-gradient(var(--mark-x-soft), var(--mark-x-soft)), var(--ds-card); }
.seat .seat-bot-face > .seat-mark[data-mark="O"] { background: linear-gradient(var(--mark-o-soft), var(--mark-o-soft)), var(--ds-card); }
.seat.is-turn .seat-bot-face > .seat-mark { box-shadow: 0 0 0 2px var(--ds-card); }
.seat-bot { display: flex; align-items: center; }
.seat-bot-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* a narrow centred card (tall frames): the name wraps rather than cut to "Shelly the…" */
.seat-bot.seat-name { white-space: normal; text-wrap: balance; }

/* THE SPEECH BUBBLE sits INSIDE the character's own card, so a line never
   changes the layout (Village frames have no height to spare), never covers
   the other player's card, and can never be clipped by the side column:
   floating it above the card did both, in real Chrome (2026-10-15).
   Tall frames (the card a centred column): across the card's foot, its
   tail up at the face. */
/* (beats the short-frame `.seat-cards .seat > :not(.seat-mark)` column rule) */
.seat-cards .seat > .bot-say { grid-column: auto; grid-row: auto; }
.bot-say {
  position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 4;
  grid-column: auto; grid-row: auto; /* auto: an abs-pos grid item then spans the whole card, not a track */
  padding: 4px 9px; border-radius: 12px;
  background: var(--ds-card); color: var(--ds-ink);
  border: 1.5px solid var(--ds-rule-strong); box-shadow: var(--ds-shadow-soft);
  font-size: 12px; font-weight: 600; line-height: 1.25; text-align: left; white-space: normal;
  pointer-events: none;
  animation: sayIn 240ms cubic-bezier(.2, 1.4, .4, 1) var(--age, 0ms) both;
}
.bot-say::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 9px; height: 9px;
  background: var(--ds-card); border: 1.5px solid var(--ds-rule-strong); border-right: 0; border-bottom: 0;
  transform: translate(-50%, -5.5px) rotate(45deg);
}
@keyframes sayIn { from { opacity: 0; transform: translateY(4px) scale(0.94); } to { opacity: 1; transform: none; } }
.bot-say.is-still { animation: none; }
/* while it speaks, the bubble stands in for the card's badge line (the header keeps the level) */
.seat.is-bot:has(.bot-say) .level-badge { visibility: hidden; }

/* Short frames (sideways cards, every Village frame): the face is the
   card's left column, and the bubble comes out of it, over the name and
   the difficulty (both hidden meanwhile; the header shows them), never
   over a Domination tally. */
@media (max-height: 820px), (max-aspect-ratio: 4/5) {
  .seat-cards .seat > .seat-bot-face { grid-column: 1; grid-row: 1 / span 4; align-self: center; }
  .seat-cards .seat.is-bot { min-height: 72px; }
  .seat-cards .seat.is-bot > .bot-say { left: 76px; right: 6px; top: 6px; bottom: auto; }
  .seat-cards .seat.is-bot:not(:has(.seat-tally)) > .bot-say { top: 50%; translate: 0 -50%; }
  .seat-cards .seat.is-bot > .bot-say::before { left: 0; top: 50%; transform: translate(-5.5px, -50%) rotate(-45deg); }
  .seat-cards .seat.is-bot:has(.bot-say) .seat-bot { visibility: hidden; }
}
/* The erase option: Off/On, and a 1..7 stepper beside it when on. One row. */
.erase-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.erase-label { margin-right: 2px; }
.erase-cap { display: inline-flex; align-items: center; gap: 6px; }
.erase-cap .ds-btn-xs { min-width: 28px; padding-inline: 0; }
.erase-cap-n { font-size: 13px; color: var(--ds-ink-3); min-width: 4.2em; text-align: center; }
.erase-cap-n strong { font-family: var(--ds-font-display); font-weight: 900; font-size: 15px; color: var(--ds-ink); }
.erase-badge { flex: none; }
/* Erase and Infinite side by side; they wrap in a narrow frame. */
.rule-opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.infinite-pick { display: flex; align-items: center; gap: 8px; }
.rule-opts-help { text-align: center; }
.infinite-badge { flex: none; }
.home-setup .rule-opts { grid-column: 1 / -1; justify-content: flex-start; }
.home-setup .rule-opts-help { grid-column: 1 / -1; text-align: left; }

/* ---- watchers --------------------------------------------------------- */
.watchers { display: grid; gap: 4px; }
.watcher { display: flex; align-items: center; gap: 9px; padding: 6px 4px; font-size: 14px; border-bottom: 1px solid var(--ds-rule); }
.watcher:last-child { border-bottom: none; }
.watcher .ds-avatar { background: var(--ds-bg-2); }
.watcher .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watcher.is-me .who { font-weight: 600; }
.watcher.away { color: var(--ds-ink-3); }
.watchers-empty { color: var(--ds-ink-3); font-size: 13px; padding: 4px; }

/* ---- verdict / end screen ------------------------------------------------- */
.verdict { padding: 18px 16px; display: grid; gap: 12px; text-align: center; justify-items: center; }
.verdict-eyebrow { color: var(--ds-ink-3); }
.verdict-title { font-size: 26px; margin: 0; }
.verdict-title .mark-x { color: var(--mark-x); }
.verdict-title .mark-o { color: var(--mark-o); }
.verdict-sub { font-size: 14px; color: var(--ds-ink-2); margin: -4px 0 0; }
.verdict-actions { display: grid; gap: 8px; width: 100%; }
.votes { display: flex; gap: 6px; justify-content: center; }
.vote-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ds-ink-5); }
.vote-dot.on { background: var(--ds-success); }

.waiting-note { padding: 14px 16px; font-size: 14px; color: var(--ds-ink-2); display: grid; gap: 10px; }
.waiting-note .ds-btn { justify-self: start; }
.leave-row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* ---- the tutorial (game/tutorial-view.mjs) ------------------------------
   An overlay, not a page: it pauses nothing and the game keeps running
   underneath. Sits below #authScreen (z 30) because sign-in outranks it.
   The demo board uses the board's two mark colours and the accent gradient
   for the "play here" ring, so it reads as the same game, but it is drawn
   with its own classes and cannot be broken by a change to the real
   board's sizing or hover states. */
.tut-screen {
  position: fixed; inset: 0; z-index: 25;
  display: flex; align-items: safe center; justify-content: safe center;
  padding: clamp(10px, 3vh, 28px) clamp(10px, 3vw, 28px);
  background: color-mix(in srgb, var(--ds-bg) 78%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overflow: auto;
}
/* THE HANDS-ON TUTORIAL: a demo board beside its instruction. The board's
   side is --tut: the frame's height minus the card's own chrome, so the
   whole card fits Village's ~490px tile and ~500px call frame, and grows to
   420px in a normal window. */
.tut-card {
  --tut: clamp(210px, calc(100dvh - 150px), 420px);
  width: min(900px, 100%);
  padding: clamp(12px, 2.2vh, 20px) clamp(14px, 2.6vw, 22px);
  display: grid; gap: clamp(8px, 1.6vh, 14px);
}
/* The overlay fades in once when it opens. NOT on the card: the card is
   rebuilt on every step, and the shared `pop` animation is the toast's
   (it carries translate(-50%)), which threw the card half its width to the
   left for 180ms on every click until 2026-10-01. */
.tut-screen:not([hidden]) { animation: tutIn .18s ease-out; }
@keyframes tutIn { from { opacity: 0; } to { opacity: 1; } }
.tut-head { display: flex; align-items: center; gap: 10px; }
.tut-head .ds-label { margin-right: auto; }
.tut-count { font-size: 12px; font-weight: 650; color: var(--ds-ink-3); font-variant-numeric: tabular-nums; }
/* Skip: present, but quiet. Advancing is by clicking the board, never this. */
.tut-skip { color: var(--ds-ink-3); font-weight: 500; }
.tut-body { display: grid; grid-template-columns: var(--tut) minmax(220px, 1fr); gap: clamp(12px, 2.4vw, 24px); align-items: center; }
.tut-demo { position: relative; width: var(--tut); height: var(--tut); }
.tut-text { display: grid; gap: 8px; min-width: 0; align-content: center; }
.tut-title { font-size: clamp(18px, 2.2vw, 22px); margin: 0; }
.tut-para { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ds-ink-2); }
.tut-done { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--ds-success-text); font-weight: 600; }
.tut-tick { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; background: var(--ds-success-soft); margin-right: 2px; }
.tut-wait { margin: 0; font-size: 14.5px; color: var(--ds-ink-3); font-style: italic; }
.tut-later { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: var(--ds-track-label); text-transform: uppercase; color: var(--ds-ink-3); }
.tut-nudge { margin: 0; font-size: 13.5px; font-weight: 650; color: var(--ds-warning); }
.tut-finish { justify-self: start; margin-top: 4px; }

/* the demo's 3×3 grid of small boards */
.tut-big {
  width: 100%; height: 100%;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 5px; padding: 5px;
  background: var(--ds-card); border: 1px solid var(--ds-rule); border-radius: 12px;
}
.tut-board {
  position: relative; isolation: isolate; min-width: 0; min-height: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 2px; padding: 3px;
  background: var(--ds-bg); border-radius: 6px;
}
.tut-open { box-shadow: inset 0 0 0 1px var(--ds-rule-strong); }
.tut-forced { background: var(--ds-card); }
/* the "play here" ring, drawn as in the real game */
.tut-forced::before {
  content: ""; position: absolute; inset: -3px; z-index: -1;
  border-radius: 8px; background: var(--ds-accent-grad);
}
.tut-big.has-forced .tut-board:not(.tut-forced):not(.tut-claimed) { opacity: 0.55; }
.tut-cell {
  appearance: none; border: 0; margin: 0; padding: 0; min-width: 0; min-height: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 3px;
  background: var(--ds-card); color: var(--ds-ink-4);
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1;
  font-size: calc(var(--tut) / 17);
}
.tut-cell[data-mark="X"] { color: var(--mark-x); }
.tut-cell[data-mark="O"] { color: var(--mark-o); }
.tut-cell.tut-last { box-shadow: inset 0 0 0 2px currentColor; }
/* a square just erased, locked for one move, as on the real board */
.tut-erased {
  background-color: var(--ds-bg-2);
  background-image: repeating-linear-gradient(45deg, var(--ds-rule-strong) 0 1.5px, transparent 1.5px 5px);
  box-shadow: 0 0 0 2px var(--ds-warning-solid);
}
.tut-claimed .tut-cell { opacity: 0; }
/* Infinite in the tutorial: the same warning and fade as the real board. */
.tut-cell.tut-vanish-next { outline: 2px dashed currentColor; outline-offset: -4px; }
.tut-vanish-next > .tut-mark { opacity: 0.42; animation: vanishWarn 1.1s ease-in-out infinite alternate; }
.tut-card.is-still .tut-vanish-next > .tut-mark { animation: none; }
.tut-cell:has(> .vanish-ghost) { position: relative; }
.tut-claimed-X { background: var(--mark-x-soft); }
.tut-claimed-O { background: var(--mark-o-soft); }
.tut-claimed-T { background: var(--mark-t-soft); }
.tut-claim {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--ds-font-display); font-weight: 900; line-height: 1; font-size: calc(var(--tut) / 3.2);
}
.tut-claimed-X .tut-claim { color: var(--mark-x); }
.tut-claimed-O .tut-claim { color: var(--mark-o); }
.tut-claimed-T .tut-claim { color: var(--mark-t); font-size: calc(var(--tut) / 4.2); }
.tut-win { box-shadow: 0 0 0 3px currentColor; }
.tut-win-X { color: var(--mark-x); }
.tut-win-O { color: var(--mark-o); }

/* THE TARGET: the one thing to click. A green "go" ring that pulses; under
   reduced motion it is the same ring, still. A board target rings the
   whole small board. */
.tut-target, .tut-target-board { position: relative; z-index: 1; }
/* an opaque fill: a translucent one let a forced board's purple ring show through */
.tut-target { background: color-mix(in srgb, var(--ds-success) 24%, var(--ds-card)); box-shadow: 0 0 0 3px var(--ds-success), 0 0 14px 2px color-mix(in srgb, var(--ds-success) 55%, transparent); }
.tut-target-erase { background: var(--mark-o-soft); }
/* a free move: the open BOARDS ring green; their squares only tint */
.tut-target.tut-target-soft { box-shadow: none; background: color-mix(in srgb, var(--ds-success) 12%, var(--ds-card)); animation: none !important; }
.tut-target-open { box-shadow: 0 0 0 3px var(--ds-success); opacity: 1 !important; }
/* a board target is usually also the forced board, whose purple ring (::before,
   3px) paints over the board's own shadow: the green ring is drawn WIDER, so
   it shows outside the purple one */
.tut-target-board { box-shadow: 0 0 0 7px var(--ds-success), 0 0 20px 6px color-mix(in srgb, var(--ds-success) 50%, transparent); opacity: 1 !important; }
.tut-card:not(.is-still) .tut-target, .tut-card:not(.is-still) .tut-target-board { animation: tutPulse 1.3s ease-in-out infinite; }
@keyframes tutPulse { 50% { box-shadow: 0 0 0 5px var(--ds-success), 0 0 22px 6px color-mix(in srgb, var(--ds-success) 40%, transparent); } }
@keyframes tutPulseBoard { 50% { box-shadow: 0 0 0 9px var(--ds-success), 0 0 26px 8px color-mix(in srgb, var(--ds-success) 40%, transparent); } }
.tut-card:not(.is-still) .tut-target-board { animation-name: tutPulseBoard; }
/* a click that missed: the target gives a little shake toward the player */
.tut-card.is-nudged:not(.is-still) .tut-target, .tut-card.is-nudged:not(.is-still) .tut-target-board { animation: tutShake .35s ease-in-out, tutPulse 1.3s ease-in-out .35s infinite; }
@keyframes tutShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.tut-target:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-success), 0 0 0 6px var(--ds-focus-ring); }

/* "this square sends them there": an arrow over the grid (send step only).
   Its dashes flow toward the target board; still under reduced motion. */
.tut-arrow { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); pointer-events: none; z-index: 2; overflow: visible; }
.tut-arrow line { stroke: var(--ds-ink); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 6 5; }
.tut-arrow marker path { fill: var(--ds-ink); }
.tut-arrow.is-moving line { animation: tutFlow .8s linear infinite; }
@keyframes tutFlow { to { stroke-dashoffset: -22; } }

/* phones: the board above the words */
@media (max-width: 600px) {
  .tut-card { --tut: min(calc(100vw - 52px), 360px); }
  .tut-body { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .tut-text { text-align: center; justify-items: center; }
  .tut-finish { justify-self: center; }
}
/* Village's frames (~490-500px tall): tighter type so the words sit beside the board */
@media (max-height: 620px) {
  .tut-title { font-size: 18px; }
  .tut-para { font-size: 14px; }
  .tut-done { font-size: 13px; }
}

/* ---- sign-in cards (auth.js) -------------------------------------------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: safe center; justify-content: safe center;
  padding: clamp(10px, 3vh, 32px) clamp(10px, 3vw, 32px);
  background: color-mix(in srgb, var(--ds-bg) 82%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overflow: auto;
}
.auth-panel {
  width: min(480px, 100%); padding: clamp(18px, 3vh, 30px) clamp(18px, 3vw, 32px);
  display: grid; gap: 12px; text-align: center; justify-items: center; animation: pop .18s ease-out;
}
.auth-eyebrow { color: var(--ds-ink-3); }
.auth-title { font-size: clamp(22px, 2.6vw, 30px); }
.auth-body { font-size: 15px; color: var(--ds-ink-2); line-height: 1.45; }
.auth-actions { display: grid; gap: 10px; width: 100%; justify-items: stretch; }
.auth-action { text-decoration: none; }
.auth-link-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.auth-link-row .ds-input { font-size: 13px; padding: 8px 12px; }
.auth-note { font-size: 12.5px; color: var(--ds-ink-3); }
.auth-error { color: var(--ds-danger-text); font-size: 14px; }

/* ---- toast + connection ------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  max-width: min(92vw, 480px); padding: 12px 18px; border-radius: var(--ds-radius-pill);
  background: var(--ds-ink); color: var(--ds-bg-fixed); font-weight: 600; font-size: 14px;
  box-shadow: var(--ds-shadow-soft); z-index: 20; animation: pop .16s ease-out;
}
.toast.is-error { background: var(--ds-danger); color: #fff; }
.conn {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: var(--ds-radius-pill); font-size: 12.5px; font-weight: 600;
  background: var(--ds-warning-soft); color: var(--ds-warning); z-index: 20;
}
.conn.is-bad { background: var(--ds-danger-soft); color: var(--ds-danger-text); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
