/* =====================================================================
   WHO'S THAT — THE RECESS DESIGN SYSTEM, then the game. Copied from Tales'
   styles.css (2026-11-11), which copied Puzzles': the design system block
   unchanged, the site part cut down to what this game uses.
   =====================================================================
   Tokens are VERBATIM from the monolith's production stylesheet
   (tryrecess/monolith, apps/web/src/styles/tailwind.css, the `.recess-ds`
   light block + the dark block; checked against origin/production a76a72dd11
   on 2026-10-15), by way of Ultitactoe's styles.css, which had transcribed
   them already. Component recipes (.ds-btn, .ds-input, .ds-badge, .ds-card…)
   are Ultitactoe's / Boop Battle's transcription of https://recess.gg/design.
   If a value here looks wrong, re-read the monolith rather than fixing it by eye.

   CANVAS: the real system's cool paper, --ds-bg #f1f4f5 — the owner chose it
   over the brief's "warm paper" (2026-10-15).

   The rules, for anyone adding to this file:
     - Satoshi and nothing else.
     - Pills for buttons, chips and tabs; 14px cards, 10px inputs.
     - Structure from soft shadows and hairline rules, not hard borders.
     - The accent gradient only on small highlight moments — a few words, a
       thin rule, a meter fill — NEVER a background.
     - Soft semantic status colours: badges are -soft fills with -text ink.
   ===================================================================== */

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);

}

/* ---- 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 -------------------------------------------------------- */
/* width 100% + padding: border-box counts the padding inside, so a text box
   never sticks out past its panel */
.ds-input {
  display: flex; align-items: center; gap: 9px; width: 100%; max-width: 100%; box-sizing: border-box;
  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 SITE
   ===================================================================== */
a { color: inherit; }
a.ds-btn { text-decoration: none; }
#app { min-height: 100%; min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; outline: none; width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; box-sizing: border-box; /* width includes the padding: no 32px sideways scroll */ }
.boot { display: grid; place-items: center; min-height: 40vh; color: var(--ds-ink-3); }

/* ---- header: one hairline, no box ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: color-mix(in srgb, var(--ds-bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ds-rule);
}
.site-title { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 500; min-width: 0; }
.site-title a { text-decoration: none; color: var(--ds-ink); display: inline-block; padding: 12px 0; }
@media (max-width: 559px) { .site-tag { display: none; } .site-header { padding: 4px 12px; } }
.site-word { font-family: var(--ds-font-display); font-weight: 900; letter-spacing: var(--ds-track-head); }
.site-tag { color: var(--ds-ink-3); font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav .ds-btn { text-decoration: none; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ds-warning-soft); color: var(--ds-warning); font-size: 11.5px; font-weight: 700; }
.me-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--ds-card); box-shadow: var(--ds-shadow-card-2); font-size: 13px; font-weight: 600; }
.me-chip .ds-badge { padding: 2px 8px; font-size: 11px; }
.me-chip .ds-btn { padding: 4px 10px; font-size: 12px; }

/* ---- page heads ---------------------------------------------------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-title { margin: 0; font-size: clamp(26px, 4vw, 38px); }
.page-lede { margin: 6px 0 0; color: var(--ds-ink-2); font-size: 16px; max-width: 60ch; }

/* ---- panels and rows ------------------------------------------------ */
.panel { background: var(--ds-card); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-card-2); padding: 18px 20px; }
.panel + .panel { margin-top: 14px; }
.panel h3 { margin: 0 0 8px; font-size: 18px; }
.stack { display: grid; gap: 10px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions .ds-btn { text-decoration: none; }
.muted { color: var(--ds-ink-3); }
.small { font-size: 13px; }
.note-box { padding: 12px 14px; border-radius: var(--ds-radius-sm); background: var(--ds-bg-2); font-size: 14px; white-space: pre-wrap; }
.note-box.is-danger { background: var(--ds-danger-soft); color: var(--ds-danger-text); }
.note-box.is-success { background: var(--ds-success-soft); color: var(--ds-success-text); }
.note-box.is-warning { background: var(--ds-warning-soft); color: var(--ds-warning); }

/* ---- sign-in cards (auth.js) — Ultitactoe's ------------------------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 60;
  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;
}
.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; }

/* ---- dialogs and toast ---------------------------------------------- */
.dialog-scrim { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 5, .4); }
.dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; padding: 22px; border-radius: var(--ds-radius-dialog); background: var(--ds-card); box-shadow: var(--ds-shadow-card); display: grid; gap: 12px; }
.dialog h3 { margin: 0; font-size: 20px; }
.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: 80;
}
.toast.is-error { background: var(--ds-danger); color: #fff; }

/* =====================================================================
   THE GAME
   Three separable blocks (.room-status, .room-board, .room-side) so a short
   Village-frame layout can rearrange them later. Touch first: every target
   is at least 44px, nothing depends on hover, no sideways scroll.
   ===================================================================== */
.ds-btn { min-height: 44px; box-sizing: border-box; }
.me-chip .ds-btn { min-height: 44px; padding: 4px 14px; font-size: 13px; }
.dialog-actions { justify-content: flex-end; }
.dialog { max-height: calc(100dvh - 32px); }

/* ---- the start screen ---------------------------------------------- */
/* ---- the start screen (owner-approved mockup, 2026-11-12) -------------
   Big title, a mystery card that flips, the cast drifting past behind, and
   three big choices. All the motion stops under reduced motion (the rule at
   the end of this file). */
.view:has(.home) { max-width: none; padding: 0; display: flex; }
.home { position: relative; flex: 1; min-height: calc(100dvh - 82px); overflow: hidden; display: grid; align-content: center; justify-items: center; gap: clamp(14px, 3dvh, 28px); padding: clamp(14px, 3dvh, 32px) 16px; box-sizing: border-box; }
.hs-row { position: absolute; left: 0; display: flex; gap: 14px; width: max-content; opacity: 0.38; pointer-events: none; animation: hs-drift 70s linear infinite; }
.hs-row.r1 { top: 14px; }
.hs-row.r2 { bottom: 14px; animation-direction: reverse; animation-duration: 85s; }
.home.is-step .hs-row { opacity: 0.22; }
.hs-row .hs-card { width: clamp(64px, 9vw, 104px); }
.hs-row .hs-card:nth-child(3n) { transform: rotate(-3deg); }
.hs-row .hs-card:nth-child(3n+1) { transform: rotate(2deg) translateY(6px); }
.hs-row .hs-card.is-flipper svg { animation: hs-down 9s ease-in-out infinite; }
.hs-row .hs-card:nth-child(7n).is-flipper svg { animation-delay: -4s; }
@keyframes hs-down { 0%, 40%, 100% { filter: none; opacity: 1; } 50%, 90% { filter: grayscale(1); opacity: 0.18; } }
@keyframes hs-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.hs-card { background: var(--ds-card); color: var(--ds-ink); border-radius: 12px; overflow: hidden; box-shadow: var(--ds-shadow-card-2); flex: none; }
.hs-card svg { display: block; width: 100%; height: auto; }
.hs-card span { display: block; text-align: center; font-weight: 700; font-size: 12px; padding: 2px 0 4px; }
/* everybody on this screen blinks, each in their own time */
.home .eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: hs-blink 5.2s infinite; }
.home .hs-card:nth-child(2n) .eyes { animation-delay: -1.7s; animation-duration: 6.1s; }
.home .hs-card:nth-child(3n) .eyes { animation-delay: -3.3s; animation-duration: 4.4s; }
.home .hs-card:nth-child(5n) .eyes { animation-delay: -0.6s; animation-duration: 7s; }
@keyframes hs-blink { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(0.08); } }

.hs-hero { position: relative; z-index: 1; display: grid; grid-template-columns: auto auto; align-items: center; gap: clamp(14px, 3vw, 36px); }
.hs-title { margin: 0; font-family: var(--ds-font-display); font-weight: 900; font-size: clamp(54px, min(11vw, 15dvh), 124px); line-height: 0.92; letter-spacing: -0.03em; color: var(--ds-ink); }
/* the accent gradient, for this one small highlight (the question mark) */
.hs-title b { display: inline-block; background: var(--ds-accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--ds-purple); animation: hs-bob 2.4s ease-in-out infinite; transform-origin: 50% 90%; padding: 0 0.04em 0.08em; }
@keyframes hs-bob { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-8%); } }
.hs-tag { margin: 10px 0 0; font-size: clamp(16px, 2vw, 21px); color: var(--ds-ink-2); max-width: 26ch; line-height: 1.35; }
.hs-flip { width: clamp(120px, min(20vw, 30dvh), 230px); aspect-ratio: 200 / 232; perspective: 900px; transform: rotate(5deg); }
.hs-flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.6, 0, .3, 1); }
.hs-flip-in.is-back { transform: rotateY(180deg); }
.hs-flip-face, .hs-q { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; }
.hs-flip-face .hs-card { height: 100%; border-radius: 18px; box-shadow: var(--ds-shadow-card); }
.hs-flip-face .hs-card span { font-size: clamp(14px, 2vw, 20px); padding: 4px 0 8px; }
.hs-q { transform: rotateY(180deg); display: grid; place-items: center; background: var(--ds-ink); color: var(--ds-bg-fixed); font-family: var(--ds-font-display); font-weight: 900; font-size: clamp(70px, 12vw, 150px); box-shadow: var(--ds-shadow-card); }

.hs-note { position: relative; z-index: 1; }
.hs-choices { position: relative; z-index: 1; display: grid; gap: clamp(10px, 1.6vw, 18px); grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(960px, 100%); }
.hs-choice { position: relative; display: grid; gap: 4px; align-content: center; text-align: left; min-height: clamp(104px, 20dvh, 150px); padding: 18px clamp(96px, 11vw, 132px) 18px 22px; border-radius: 22px; background: var(--ds-card); box-shadow: var(--ds-shadow-card); color: var(--ds-ink); text-decoration: none; overflow: hidden; transition: transform .15s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.hs-choice:hover { transform: translateY(-4px) rotate(-0.6deg); }
.hs-choice:active { transform: scale(0.98); }
.hs-choice:focus-visible { outline: 3px solid var(--ds-focus-ring); outline-offset: 3px; }
.hs-choice.is-main { background: var(--ds-ink); color: var(--ds-bg-fixed); }
.hs-choice-name { font-family: var(--ds-font-display); font-weight: 900; white-space: nowrap; font-size: clamp(21px, 1.9vw, 26px); letter-spacing: -0.02em; }
.hs-choice-text { font-size: 15px; opacity: 0.75; max-width: 16ch; line-height: 1.3; }
.hs-peek { position: absolute; right: -16px; top: 50%; margin-top: -44px; display: flex; }
.hs-peek .hs-card { width: clamp(50px, 5vw, 66px); margin-left: -30px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.hs-peek .hs-card:nth-child(1) { transform: rotate(-8deg) translateY(14px); animation: hs-nod 3.2s ease-in-out infinite; }
.hs-peek .hs-card:nth-child(2) { transform: rotate(6deg) translateY(4px); animation: hs-nod 3.2s ease-in-out -1.1s infinite; }
.hs-peek .hs-card:nth-child(3) { transform: rotate(14deg) translateY(18px); animation: hs-nod 3.2s ease-in-out -2s infinite; }
.hs-peek .hs-card span, .hs-plus .hs-card span { display: none; }
@keyframes hs-nod { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.hs-digits { position: absolute; right: 16px; top: 50%; translate: 0 -50%; display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; }
.hs-digits i { display: grid; place-items: center; height: 30px; border-radius: 8px; background: var(--ds-bg-2); font-style: normal; font-weight: 900; font-size: 17px; animation: hs-nod 2.6s ease-in-out infinite; }
.hs-digits i:nth-child(2) { animation-delay: -.5s; }
.hs-digits i:nth-child(3) { animation-delay: -1s; }
.hs-digits i:nth-child(4) { animation-delay: -1.5s; translate: 15px 0; }
.hs-digits i:nth-child(5) { animation-delay: -2s; translate: 15px 0; }
.hs-plus { position: absolute; right: 22px; top: 50%; margin-top: -42px; width: clamp(56px, 6vw, 76px); transform: rotate(8deg); animation: hs-nod 3s ease-in-out infinite; }
.hs-plus::after { content: "+"; position: absolute; right: -8px; bottom: -8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ds-accent-grad); color: #fff; font-weight: 900; font-size: 22px; }
.hs-staff { position: relative; z-index: 1; text-decoration: none; background: var(--ds-card); }

/* step two: the panel that opens after a choice */
.hs-sheet { position: relative; z-index: 1; width: min(720px, 100%); box-sizing: border-box; display: grid; gap: 12px; padding: 22px; border-radius: 22px; background: var(--ds-card); box-shadow: var(--ds-shadow-card); }
.hs-sheet.is-narrow { width: min(460px, 100%); }
.hs-sheet > p { margin: 0; }
.hs-sheet-title { margin: 0; font-family: var(--ds-font-display); font-weight: 900; font-size: 30px; letter-spacing: -0.02em; }
.hs-back { justify-self: start; text-decoration: none; min-height: 44px; margin: -6px 0 -6px -10px; }
.hs-code-input { font-size: 40px; height: 84px; }
@media (min-width: 700px) { .hs-sheet .mode-list { grid-template-columns: 1fr 1fr; } }
/* not wide enough for three side by side: one big row each */
@media (max-width: 899px) {
  .hs-choices { grid-template-columns: minmax(0, 1fr); width: min(560px, 100%); }
  .hs-choice { min-height: 92px; }
  .hs-choice-text { max-width: none; }
}
@media (max-width: 700px) {
  .hs-hero { grid-template-columns: minmax(0, 1fr) auto; }
  .hs-tag { display: none; }
  .hs-row .hs-card { width: 60px; }
}
/* a short screen: the panel's settings must not push Make a room off the bottom */
@media (max-height: 700px) and (min-width: 700px) {
  .home.is-step { align-content: start; }
  .hs-sheet { gap: 8px; padding: 16px 22px; }
  .hs-sheet-title { font-size: 24px; }
  .hs-sheet .mode-blurb, .hs-sheet .set-row small { font-size: 12.5px; }
}

.home-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.home-card { display: grid; gap: 12px; }
.home-card h3 { margin: 0; font-size: 22px; }
.home-card p { margin: 0; }
.mode-list { display: grid; gap: 8px; }
.mode-choice {
  display: grid; gap: 4px; text-align: left; padding: 14px 16px; min-height: 44px; cursor: pointer;
  background: var(--ds-card); border: 1px solid var(--ds-rule-strong); border-radius: var(--ds-radius-sm);
}
@media (min-width: 700px) { .hs-sheet .mode-list.is-three { grid-template-columns: 1fr 1fr 1fr; } }
.mode-list.is-three .mode-choice, .mode-list.is-four .mode-choice { padding-top: 8px; padding-bottom: 8px; }
@media (min-width: 900px) { .hs-sheet .mode-list.is-four { grid-template-columns: repeat(4, 1fr); } }

/* ---- "My own board": tap who goes on it ---- */
.pick { display: grid; gap: 8px; padding: 12px; border-radius: var(--ds-radius-sm); background: var(--ds-bg-2); }
.pick[hidden] { display: none; }
.pick > p { margin: 0; }
.pick-count { font-weight: 700; }
.pick-shelves { display: grid; gap: 8px; max-height: min(46dvh, 380px); overflow-y: auto; overscroll-behavior: contain; padding: 4px; margin: -4px; }
.pick-shelves > p { margin: 0; }
.pick-title { margin: 4px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ds-ink-3); }
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.pick-card {
  position: relative; display: block; padding: 0; border: 0; cursor: pointer; overflow: hidden; min-height: 44px; text-align: center;
  background: var(--ds-card); color: inherit; font: inherit; border-radius: var(--ds-radius-sm); box-shadow: var(--ds-shadow-card-2);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pick-card svg, .pick-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.pick-name { display: block; padding: 3px 2px 4px; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-card .card-by { display: block; padding: 0 2px 4px; margin-top: -3px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-tick { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 999px; background: var(--ds-ink); color: var(--ds-bg-fixed); font-size: 14px; font-weight: 900; line-height: 22px; display: none; }
.pick-card[aria-pressed="true"] { outline: 3px solid var(--ds-ink); outline-offset: -3px; }
.pick-card[aria-pressed="true"] .pick-tick { display: block; }
.pick-card:disabled { cursor: not-allowed; opacity: 0.4; }
.pick-card:focus-visible { box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.pick-problem { display: grid; gap: 8px; }
.pick-fix { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-fix .ds-btn { min-height: 44px; }
.mode-choice[aria-checked="true"] { border-color: var(--ds-ink); box-shadow: 0 0 0 1px var(--ds-ink); }
.mode-choice:disabled { cursor: not-allowed; opacity: 0.6; }
.mode-choice:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.mode-name { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mode-blurb { font-size: 14px; color: var(--ds-ink-2); line-height: 1.4; }
/* the room's settings: big rows, the whole row is the tap target */
.set-list { display: grid; gap: 6px; }
.set-row { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--ds-radius-sm); background: var(--ds-bg-2); cursor: pointer; }
.set-row[hidden] { display: none; }
.set-row input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--ds-ink); }
.set-row span { display: grid; gap: 2px; min-width: 0; }
.set-row b { font-size: 15px; }
.set-row small { font-size: 13px; color: var(--ds-ink-2); line-height: 1.35; }
.code-input { font-size: 28px; font-weight: 700; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---- my characters, and the staff page ------------------------------ */
.mine-page { display: grid; gap: 14px; }
.mine-page > * { margin-top: 0; margin-bottom: 0; }
.char-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); }
.char-card { display: grid; gap: 8px; align-content: start; padding: 10px; background: var(--ds-card); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-card-2); min-width: 0; }
.staff-maker .char-card { background: var(--ds-bg-2); box-shadow: none; }
.char-pic { display: block; border-radius: var(--ds-radius-sm); overflow: hidden; }
.char-pic svg { display: block; width: 100%; height: auto; }
.char-name { font-size: 18px; font-weight: 900; letter-spacing: var(--ds-track-head); text-align: center; }
.char-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.char-actions .ds-btn { min-height: 44px; padding-left: 8px; padding-right: 8px; text-decoration: none; }
.char-meta { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.empty-box { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 32px 20px; }
.empty-box p { margin: 0; font-size: 17px; }
.empty-box .ds-btn { text-decoration: none; }
.mine-page .page-head .ds-btn { text-decoration: none; }

/* where a character stands with the Guides */
.char-grid.is-mine { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); align-items: start; }
.char-card.is-fresh { outline: 3px solid var(--ds-purple); outline-offset: 1px; }
.char-by { text-align: center; font-size: 14px; color: var(--ds-ink-2); }
.char-why { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--ds-radius-sm); background: var(--ds-danger-soft); color: var(--ds-danger-text); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.char-why.is-calm { background: var(--ds-bg-2); color: var(--ds-ink-2); text-align: center; }
.char-actions .is-wide { grid-column: 1 / -1; }
.char-actions:empty { display: none; }
.hs-news { position: absolute; top: 10px; right: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: var(--ds-accent-grad); color: #fff; font-family: var(--ds-font); font-size: 12px; font-weight: 900; letter-spacing: 0; }
.hs-news[hidden] { display: none; }

/* a drawn or uploaded picture wherever a character's drawing would be */
.char-pic img, .guess-pic img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--ds-bg-2); }
.guess-pic img { border-radius: var(--ds-radius-sm); }
.mine-head { display: flex; gap: 12px 20px; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
.mine-head h3, .mine-head p { margin: 0; }
.mine-head p { margin-top: 4px; max-width: 60ch; }
.mine-head .ds-btn { text-decoration: none; }

/* ---- the drawing tool, and framing an upload ------------------------- */
/* Narrow: the sheet on top, the tools below. Wide: the tools in a column on
   the right. The sheet is always square and never taller than the screen. */
.paint { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.paint-main { min-width: 0; display: grid; justify-items: center; }
/* one column: leave room under the sheet for the brushes and colours, so nobody has to scroll to change colour */
.paint-sheet { width: min(100%, max(280px, calc(100dvh - 520px))); aspect-ratio: 1; border-radius: var(--ds-radius); overflow: hidden; box-shadow: var(--ds-shadow-card-2); background: #fff; }
.paint-sheet canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.paint-sheet canvas.is-rubber { cursor: cell; }
.paint-sheet canvas.is-move { cursor: grab; }
.paint-side { display: grid; gap: 12px; align-content: start; min-width: 0; margin-top: 0; }
.paint-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.paint-head p { margin: 0; }
.paint-head .creator-name { font-size: 26px; }
.paint-tools { display: grid; gap: 12px; }
.paint-tools .name-grid { max-height: 300px; }
.paint-tools > .ds-btn, .paint-group > .ds-btn { justify-self: start; }
.paint-group { display: grid; gap: 6px; min-width: 0; }
.paint-group h3, .paint-tools p { margin: 0; }
.paint-brushes { display: grid; grid-template-columns: repeat(3, 48px) minmax(0, 1fr); gap: 8px; }
.paint-brush { display: grid; place-items: center; min-height: 48px; padding: 0 10px; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; color: var(--ds-ink); background: var(--ds-card); border: 1px solid var(--ds-rule-strong); border-radius: var(--ds-radius-sm); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.paint-brush i { display: block; border-radius: 50%; background: var(--ds-ink); }
.paint-brush[aria-pressed="true"], .paint-dot[aria-pressed="true"] { border-color: var(--ds-ink); box-shadow: 0 0 0 3px var(--ds-ink); }
.paint-dots { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.paint-dot { width: 44px; height: 44px; padding: 0; cursor: pointer; border-radius: 50%; border: 2px solid var(--ds-rule-strong); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.paint-brush:focus-visible, .paint-dot:focus-visible { outline: 3px solid var(--ds-focus-ring); outline-offset: 2px; }
.paint-undo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.paint-rule { font-size: 14px; line-height: 1.4; }
.zoom-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; align-items: center; }
.zoom-row .ds-btn { min-height: 44px; padding: 0; font-size: 22px; }
.zoom-row input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--ds-ink); }
@media (min-width: 900px) {
  .paint { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 20px; }
  .paint-sheet { width: min(100%, max(320px, calc(100dvh - 120px))); }
}
/* a wide but short screen (a Chromebook): tighter tools so Done stays in view */
@media (min-width: 900px) and (max-height: 800px) {
  .paint-side { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .paint-tools { gap: 8px; }
  .paint-dots { grid-template-columns: repeat(7, 36px); gap: 6px 8px; }
  .paint-dot { width: 36px; height: 36px; }
  .paint-brush { min-height: 44px; }
  .paint-brushes { grid-template-columns: repeat(3, 44px) minmax(0, 1fr); }
  .paint-tools .name-grid { max-height: 220px; }
  .paint-rule { font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
}
.upload-page { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.upload-rules { display: grid; gap: 14px; width: min(100%, 560px); box-sizing: border-box; min-width: 0; }
.upload-rules > * { margin: 0; }
.rule-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.rule-list li { padding: 10px 14px; border-radius: var(--ds-radius-sm); background: var(--ds-bg-2); font-size: 17px; font-weight: 700; }
.upload-rules .row-actions { justify-content: space-between; }
.upload-rules .row-actions .ds-btn { text-decoration: none; }

/* ---- the Guides' review page ---------------------------------------- */
.review-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); align-items: start; }
.review-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px; background: var(--ds-card); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-card-2); }
.review-pics { display: grid; gap: 8px; align-content: start; justify-items: start; }
.review-pics > .char-pic { width: 100%; }
/* the same character at the size it is on a board */
.review-small { width: 72px; background: var(--ds-bg-2); border-radius: 8px; overflow: hidden; font-size: 11px; font-weight: 700; text-align: center; }
.review-small span { display: block; padding: 1px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.review-body .char-name { text-align: left; }
.review-body .char-meta { justify-content: flex-start; }
.review-form { display: grid; gap: 6px; }
.review-form-title { margin: 0; font-weight: 700; }
.review-form .set-row { min-height: 44px; padding: 6px 10px; }
.review-note { display: grid; gap: 4px; }
.review-note textarea { resize: vertical; min-height: 60px; font: inherit; }
.review-form .row-actions { justify-content: flex-end; }
@media (max-width: 480px) { .review-card { grid-template-columns: 96px minmax(0, 1fr); } }

/* ---- the character creator ------------------------------------------ */
/* Narrow: the character on top (it stays in view), then the parts. Wide:
   the character in a column on the left. */
.creator { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.creator-side { position: sticky; top: 64px; z-index: 5; min-width: 0; }
.creator-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 12px 14px; }
.creator-pic { grid-row: span 2; border-radius: var(--ds-radius-sm); overflow: hidden; }
.creator-pic svg { display: block; width: 100%; height: auto; }
.creator-name { font-size: 24px; font-weight: 900; letter-spacing: var(--ds-track-head); align-self: end; }
.creator-save { margin: 0; align-self: start; min-height: 1.4em; }
.creator-save.is-error { color: var(--ds-danger-text); }
.creator-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.creator-actions .ds-btn-lg { padding-top: 10px; padding-bottom: 10px; }
.creator-main { min-width: 0; display: grid; gap: 12px; align-content: start; }
.creator-main .page-head { margin: 0; }
.creator-parts { display: grid; gap: 20px; margin-top: 0; }
.part-slot { display: grid; gap: 8px; min-width: 0; }
.part-slot h3, .part-slot p { margin: 0; }
.part-slot > .ds-btn { justify-self: start; }
.part-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(30%, 104px), 1fr)); }
.part-grid.is-colours { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.part {
  display: grid; gap: 4px; justify-items: center; align-content: start; min-height: 44px; margin: 0; padding: 6px; cursor: pointer;
  font: inherit; color: var(--ds-ink); background: var(--ds-card); border: 1px solid var(--ds-rule-strong); border-radius: var(--ds-radius-sm);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.part[aria-pressed="true"] { border-color: var(--ds-ink); box-shadow: 0 0 0 2px var(--ds-ink); }
.part:disabled { cursor: not-allowed; opacity: 0.35; }
.part:focus-visible, .name-item:focus-visible { outline: 3px solid var(--ds-focus-ring); outline-offset: 1px; }
.part-pic { display: block; width: 100%; border-radius: 8px; overflow: hidden; }
.part-pic svg { display: block; width: 100%; height: auto; }
.part-dot { display: block; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ds-rule-strong); }
.part-label { font-size: 13px; font-weight: 700; line-height: 1.2; text-align: center; }
.part.is-colour .part-label::first-letter { text-transform: uppercase; }
.name-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 420px; overflow-y: auto; padding: 3px; overscroll-behavior: contain; }
.name-item { justify-content: center; cursor: pointer; }
@media (min-width: 900px) {
  .creator { grid-template-columns: 300px minmax(0, 1fr); align-items: start; gap: 20px; }
  .creator-side { top: 76px; }
  .creator-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 8px; padding: 18px; }
  .creator-pic { grid-row: auto; width: 100%; border-radius: var(--ds-radius); }
  .creator-name { font-size: 32px; }
  .creator-actions { grid-template-columns: minmax(0, 1fr); width: 100%; }
}
/* a wide but short screen (a Chromebook): a smaller picture so the buttons stay in view */
@media (min-width: 900px) and (max-height: 800px) {
  .creator-pic { width: min(100%, 34dvh); }
}

/* ---- waiting for a friend ------------------------------------------ */
.waiting { max-width: 520px; margin: 24px auto; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 20px; }
.waiting p { margin: 0; }
.waiting-title { margin: 0; font-size: 26px; }
.code-big { font-size: clamp(48px, 14vw, 84px); font-weight: 900; letter-spacing: 0.14em; margin-right: -0.14em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---- the room ------------------------------------------------------- */
/* Narrow (phone, tablet upright): what to do, then the board, then the history.
   Wide: the board with everything else in a column beside it. */
.room { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "status" "act" "board" "history"; }
.room-status { grid-area: status; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.room-board { grid-area: board; min-width: 0; }
.room-side { display: contents; }
.act-panel { grid-area: act; }
#rHistory { grid-area: history; margin-top: 0; }
@media (min-width: 900px) {
  .room { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "status status" "board side"; align-items: start; }
  .room-side { grid-area: side; display: grid; gap: 14px; align-content: start; min-width: 0; position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow-y: auto; padding: 2px; margin: -2px; }
  .room-side .act-panel, .room-side #rHistory { grid-area: auto; }
}

/* whose turn it is: always on screen, never by colour alone */
.turn { font-family: var(--ds-font-display); font-weight: 900; font-size: clamp(22px, 4vw, 30px); letter-spacing: var(--ds-track-head); padding: 8px 18px; border-radius: var(--ds-radius-pill); background: var(--ds-bg-2); color: var(--ds-ink-2); }
.turn.is-mine { background: var(--ds-ink); color: var(--ds-bg-fixed); }
.turn.is-over { background: var(--ds-purple-soft); color: var(--ds-purple); }
.status-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.status-chips.is-centred { justify-content: center; }
/* a card a Guide took off the board, and a maker's credit at the end */
.face.is-removed { cursor: default; opacity: 0.55; }
.face.is-removed .face-name, .face.is-removed.is-down .face-name { color: var(--ds-ink-4); text-decoration: none; font-style: italic; }
.card-by { display: block; font-size: 13px; font-weight: 500; color: var(--ds-ink-2); }
.status-note { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--ds-ink-2); }

/* ---- the board ------------------------------------------------------ */
.board-hint { margin: 0 0 10px; font-size: 14px; color: var(--ds-ink-2); min-height: 2.8em; }
.board { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 560px) { .board { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* Board beside the side column (a tablet on its side, 1024x768): the board is
   never wider than its 4 rows can be tall, so all 24 stay on screen. */
/* Upright tablet (768x1024), one column: with the question list folded away
   the 4 rows fit under the panel. */
@media (min-width: 560px) and (max-width: 899px) { .board { max-width: max(420px, calc(6 * ((100dvh - 480px) / 4 - 26px) + 40px)); margin: 0 auto; } }
@media (min-width: 900px) { .board { max-width: max(520px, calc(6 * ((100dvh - 284px) / 4 - 26px) + 40px)); margin: 0 auto; } }
/* A wide but short screen (a Chromebook, 1366x657): 8 across in 3 rows, so
   all 24 are on screen without scrolling (owner, 2026-11-11). The page is
   allowed to be wider here, and the board is never wider than its 3 rows
   can be tall. */
@media (min-width: 1200px) and (max-height: 800px) {
  .view:has(.room) { max-width: 1400px; padding-top: 12px; padding-bottom: 12px; }
  .room { gap: 10px 14px; }
  .board { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: max(640px, calc(8 * ((100dvh - 246px) / 3 - 26px) + 56px)); }
  .face-name { font-size: 13px; }
}
@media (min-width: 900px) and (max-height: 800px) {
  /* the side column is short here: keep the Ask button in view while its list scrolls */
  .room-side { max-height: calc(100dvh - 216px); }
  .room-side .mine-pic { width: 52px; }
  .room-side [data-act="askChosen"] { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 0 0 8px var(--ds-card); }
  .room-side [data-act="askChosen"]:disabled { opacity: 1; background: var(--ds-bg-2); color: var(--ds-ink-3); border-color: transparent; }
  .board-hint { min-height: 0; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .room-side .vibe { padding: 8px 10px; gap: 4px; }
  .room-side .vibe-q { font-size: 15px; min-height: 0; }
  .room-side .vibe .ds-btn { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
}
.face {
  position: relative; display: block; padding: 0; margin: 0; border: 0; cursor: pointer; overflow: hidden;
  background: var(--ds-card); border-radius: var(--ds-radius-sm); box-shadow: var(--ds-shadow-card-2);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .15s ease, opacity .15s ease;
}
.face svg, .face img { display: block; width: 100%; height: auto; transition: filter .15s ease, opacity .15s ease; }
/* a drawn or uploaded picture on a card: always a square, like the drawn characters */
.card-img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--ds-bg-2); }
.face-name { display: block; padding: 3px 2px 5px; font-size: clamp(11px, 2.4vw, 14px); font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.face:focus-visible { outline: 3px solid var(--ds-focus-ring); outline-offset: 2px; }
.face.is-down { box-shadow: none; background: var(--ds-bg-2); }
.face.is-down svg, .face.is-down img { filter: grayscale(1); opacity: 0.16; }
.face.is-down .face-name { color: var(--ds-ink-4); text-decoration: line-through; }
.board.is-picking .face:not(.is-down) { outline: 3px solid var(--ds-accent-1); outline-offset: 1px; }
.board.is-over .face { cursor: default; }
.face.is-secret { outline: 3px solid var(--ds-accent-1); outline-offset: 1px; }
.face.is-secret svg, .face.is-secret img { filter: none; opacity: 1; }
.face-tag { position: absolute; top: 4px; left: 4px; padding: 2px 8px; border-radius: 999px; background: var(--ds-ink); color: var(--ds-bg-fixed); font-size: 11px; font-weight: 700; }

/* ---- the side panel: your mystery person, what to do, the history ---- */
.act-panel { display: grid; gap: 12px; border: 2px solid transparent; }
/* tablet upright: your mystery person beside what to do, so the board stays in view */
@media (min-width: 560px) and (max-width: 899px) {
  .act-panel { grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 18px; }
  .act-panel .mine { border-bottom: 0; padding-bottom: 0; }
  .act-panel .act-buttons { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .act-panel .act-buttons .ds-help, .act-panel .reveal { grid-column: 1 / -1; }
  .act-panel .reveal { max-width: 300px; }
}
@media (max-width: 559px) {
  .act-panel { padding: 14px; gap: 10px; }
  .mine { padding-bottom: 10px; }
  .mine-pic { width: 56px; }
  .act-buttons .ds-btn-lg { padding: 13px 20px; }
  .yes-no .ds-btn { padding: 16px 10px; }
  .reveal { max-width: 260px; margin: 0 auto; }
}
.act-panel.is-urgent { border-color: var(--ds-ink); }
.mine { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--ds-rule); }
.mine-pic { width: 72px; flex: none; border-radius: var(--ds-radius-sm); overflow: hidden; }
.mine-pic svg, .reveal-pic svg, .guess-pic svg { display: block; width: 100%; height: auto; }
.mine-name { font-size: 22px; font-weight: 900; letter-spacing: var(--ds-track-head); }
.act-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.act-text { margin: 6px 0 0; font-size: 15px; color: var(--ds-ink-2); line-height: 1.4; }
.act-buttons { display: grid; gap: 8px; margin-top: 12px; }
.act-buttons:empty { display: none; }
.act-buttons .ds-help { margin: 0; text-align: center; }
.yes-no { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yes-no .ds-btn { font-size: 20px; padding: 20px 10px; }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reveal-card { margin: 0; text-align: center; font-weight: 700; }
.reveal-pic { border-radius: var(--ds-radius-sm); overflow: hidden; }
.reveal-card figcaption { display: grid; gap: 2px; padding-top: 6px; }
.guess-pic { width: 140px; margin: 0 auto 10px; border-radius: var(--ds-radius-sm); overflow: hidden; }

.history { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; max-height: 260px; overflow-y: auto; }
.history li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--ds-rule); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.h-turn { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: var(--ds-track-label); color: var(--ds-ink-3); white-space: nowrap; }
.h-who { font-weight: 700; }
.is-yes { color: var(--ds-success-text); }
.is-no { color: var(--ds-danger-text); }
.ds-btn.is-yes, .ds-btn.is-no { color: var(--ds-bg-fixed); }

#rHistory { scroll-margin-top: 84px; }

/* ---- menu mode: the question list ----------------------------------- */
.q-menu { display: grid; gap: 8px; min-width: 0; }
.act-panel .act-buttons .q-menu { grid-column: 1 / -1; }
.q-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.q-tab {
  min-height: 44px; padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px;
  color: var(--ds-ink); background: var(--ds-card); border: 1px solid var(--ds-rule-strong); border-radius: var(--ds-radius-pill);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.q-tab[aria-selected="true"] { background: var(--ds-ink); color: var(--ds-bg-fixed); border-color: var(--ds-ink); }
.q-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); max-height: 244px; overflow-y: auto; padding: 3px; overscroll-behavior: contain; }
.q-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; box-sizing: border-box; min-height: 44px; margin: 0;
  padding: 9px 14px; text-align: left; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.25;
  color: var(--ds-ink); background: var(--ds-card); border: 1px solid var(--ds-rule-strong); border-radius: var(--ds-radius-sm);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button.q-item { cursor: pointer; }
.q-item[aria-pressed="true"] { border-color: var(--ds-ink); box-shadow: 0 0 0 2px var(--ds-ink); }
.q-item.is-asked { background: var(--ds-bg-2); border-color: transparent; color: var(--ds-ink-2); }
/* while it's the other player's turn: on a phone or an upright tablet (every
   one-column layout) the list folds away behind a button so the board is
   right there; beside the board (900px and up) it stays open */
.q-fold { display: grid; gap: 8px; min-width: 0; }
.act-panel .act-buttons .q-fold { grid-column: 1 / -1; }
@media (min-width: 900px) { .q-fold-btn { display: none; } }
@media (max-width: 899px) { .q-fold:not(.is-open) > .q-menu, .q-fold:not(.is-open) > [data-act="askChosen"] { display: none; } }
/* Vibe Check: one idea card at a time */
.vibe { display: grid; gap: 6px; padding: 12px; border-radius: var(--ds-radius-sm); background: var(--ds-purple-soft); min-width: 0; }
.act-panel .act-buttons .vibe { grid-column: 1 / -1; }
.vibe .ds-label { color: var(--ds-purple); }
.vibe-q { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; min-height: 2.6em; color: var(--ds-ink); }
.q-tab:focus-visible, .q-item:focus-visible { outline: 3px solid var(--ds-focus-ring); outline-offset: 1px; }

/* ---- the end of the game: one big screen for each player ------------- */
.finale {
  position: fixed; inset: 0; z-index: 65; overflow-y: auto; overflow-x: hidden;
  display: flex; align-items: safe center; justify-content: center;
  padding: clamp(16px, 4dvh, 40px) 16px; background: var(--ds-bg);
}
.finale-in { position: relative; width: min(600px, 100%); display: grid; gap: clamp(10px, 2.4dvh, 18px); justify-items: center; text-align: center; }
.finale-main { display: grid; gap: clamp(10px, 2.4dvh, 18px); justify-items: center; min-width: 0; width: 100%; }
/* menu mode: the questions asked sit beside the result on a wide screen, below it on a narrow one */
@media (min-width: 900px) {
  .finale-in.has-history { width: min(1000px, 100%); grid-template-columns: minmax(0, 1fr) minmax(0, 380px); align-items: center; gap: 28px; }
  .finale-in.has-history .finale-history .history { max-height: min(420px, 60dvh); }
}
.finale-title { margin: 0; font-family: var(--ds-font-display); font-weight: 900; font-size: clamp(36px, min(11vw, 14dvh), 84px); line-height: 1; letter-spacing: var(--ds-track-display); color: var(--ds-ink); }
/* the accent gradient, for this one small highlight moment (the winner's headline) */
.finale-title.is-won { background: var(--ds-accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--ds-purple); padding-bottom: 0.08em; }
.finale-text { margin: 0; font-size: clamp(17px, 2.6vw, 21px); line-height: 1.4; color: var(--ds-ink-2); max-width: 32ch; }
.finale-card { margin: 0; display: grid; gap: 8px; min-width: 0; }
.finale-pic { border-radius: var(--ds-radius); overflow: hidden; background: var(--ds-card); box-shadow: var(--ds-shadow-card); }
.finale-pic svg { display: block; width: 100%; height: auto; }
.finale-card figcaption { display: grid; gap: 2px; }
.finale-name { font-size: clamp(20px, 3.4vw, 28px); font-weight: 900; letter-spacing: var(--ds-track-head); }
.finale-card.is-hero { width: min(300px, 64vw, 40dvh); }
.finale-card.is-hero .finale-name { font-size: clamp(26px, 5vw, 38px); }
.finale-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 3vw, 22px); width: min(460px, 100%, 62dvh); }
.finale-actions { display: grid; gap: 10px; width: min(360px, 100%); margin-top: 4px; }
.finale-history { width: min(460px, 100%); text-align: left; box-sizing: border-box; }
.finale-history .history { max-height: 220px; }
.finale-wait { margin: 0; min-height: 44px; display: grid; place-items: center; font-weight: 700; color: var(--ds-ink-2); }
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -24px; width: 10px; height: 16px; border-radius: 3px; opacity: 0.9; animation: confetti-fall 3s linear infinite; }
.confetti .c0 { background: var(--ds-purple); }
.confetti .c1 { background: var(--ds-amber); }
.confetti .c2 { background: var(--ds-green); }
.confetti .c3 { background: var(--ds-blue); }
.confetti .c4 { background: var(--ds-red); border-radius: 50%; height: 10px; }
/* a short screen (a Chromebook with the call beside it): smaller pictures, buttons side by side */
@media (max-height: 740px) and (min-width: 560px) {
  .finale-pair { width: min(460px, 100%, 56dvh); }
  .finale-card.is-hero { width: min(300px, 34dvh); }
  .finale-actions { grid-template-columns: 1fr 1fr; width: min(560px, 100%); }
}
@keyframes confetti-fall {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(calc(100dvh + 48px)) rotate(540deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .ds-btn:hover:not(:disabled) { transform: none; }
}
