/* Go Round — web preview r1. Tokens match theo-design.md (print + web share them). */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #F7F3EA;
  --ink: #1E1B18;
  --ink-muted: #5C5852;          /* 6.4:1 on paper (spec's 50% ink is 3.1:1, below AA) */
  --line: rgba(30, 27, 24, .14);
  --warm-up: #E4572E;            /* tomato */
  --what-if: #F2B134;            /* mustard */
  --around-the-world: #1F8A84;   /* teal */
  --deeper-cuts: #6B3E75;        /* plum */
  /* v2.4c fine-print LABEL colours (Bonus:/Fact:): band hue, darker OKLCH lightness, >= 4.5:1 on --paper.
     Bands/fills keep the colours above. Source of truth for print: LABEL_COLOURS in scripts/build-questions.py. */
  --label-warmup: #C83C0A;       /* 4.62:1 (band #E4572E is 3.33:1) */
  --label-whatif: #916604;       /* 4.62:1 (band #F2B134 is 1.71:1) */
  --label-teamtalk: #067B76;     /* 4.62:1 (band #1F8A84 is 3.77:1) */
  --label-deepercuts: #6B3E75;   /* 7.38:1, same as band */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --flip: 300ms;
  --card-max: 360px;
  --ring-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='14' r='11' fill='%23E4572E'/%3E%3Ccircle cx='84.24' cy='38.88' r='11' fill='%23F2B134'/%3E%3Ccircle cx='71.16' cy='79.12' r='11' fill='%231F8A84'/%3E%3Ccircle cx='28.84' cy='79.12' r='11' fill='%236B3E75'/%3E%3Ccircle cx='15.76' cy='38.88' r='11' fill='%231E1B18'/%3E%3C/svg%3E");
  --ring-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='14' r='11' fill='%23E4572E'/%3E%3Ccircle cx='84.24' cy='38.88' r='11' fill='%23F2B134'/%3E%3Ccircle cx='71.16' cy='79.12' r='11' fill='%231F8A84'/%3E%3Ccircle cx='28.84' cy='79.12' r='11' fill='%236B3E75'/%3E%3Ccircle cx='15.76' cy='38.88' r='11' fill='%23F7F3EA'/%3E%3C/svg%3E");
  --ring-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23F7F3EA'%3E%3Ccircle cx='50' cy='14' r='11'/%3E%3Ccircle cx='84.24' cy='38.88' r='11'/%3E%3Ccircle cx='71.16' cy='79.12' r='11'/%3E%3Ccircle cx='28.84' cy='79.12' r='11'/%3E%3Ccircle cx='15.76' cy='38.88' r='11'/%3E%3C/g%3E%3C/svg%3E");
  /* back pattern: small rings, alternate tiles rotated 180deg so the pattern has no up/down */
  /* multi-v1: semantic theme tokens. Defaults reproduce the current (paper) theme exactly; [data-theme="midnight"] swaps them. */
  --bg: var(--paper); --fg: var(--ink); --muted: var(--ink-muted); --surface: #FBF8F2; --surface-2: #fff; --hair: var(--line); --edge: var(--ink);
  --accent: var(--ink); --accent-fg: var(--paper); --focus: var(--ink); --err: #B3261E;
  --card-bg: var(--paper); --card-fg: var(--ink); --card-edge: rgba(30,27,24,.1);
  --display: var(--serif); --display-weight: 600;
  --p1: #E4572E; --p2: #1F8A84; --p3: #C08A12; --p4: #6B3E75; /* player dots */
}
/* Midnight (C2 print style): rich black, gold, cream. Applied to the multiplayer screens; ?theme=midnight applies it to the whole game. */
@font-face { font-family: "Fraunces Midnight"; src: url("/fonts/fraunces-midnight.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
:root[data-theme="midnight"] {
  --night: #121110; --tone: #1B1A18; --raise: #211F1C; --cream: #F7F3EA; --gold: #B08D57; --gold-hi: #C9A774;
  --bg: var(--night); --fg: var(--cream); --muted: #B8B2A7; --surface: var(--tone); --surface-2: var(--raise); --hair: rgba(176,141,87,.32); --edge: #77716A;
  --accent: var(--gold); --accent-fg: var(--night); --focus: var(--gold-hi); --err: #F07A55;
  --card-bg: var(--night); --card-fg: var(--cream); --card-edge: rgba(176,141,87,.18);
  --display: "Fraunces Midnight", "Fraunces", Georgia, serif; --display-weight: 400;
  --ink-muted: #B8B2A7; --line: rgba(176,141,87,.32);
  --p1: #F07A55; --p2: #3FB3AC; --p3: #F2B134; --p4: #C58BD4;
  --label-warmup: #F07A55; --label-whatif: #F2B134; --label-teamtalk: #3FB3AC; --label-deepercuts: #C58BD4;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-weight: 500; line-height: 1.45; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 999px; z-index: 10; }
.skip:focus { top: 12px; }

.screen { min-height: 100vh; min-height: 100dvh; width: 100%; max-width: 1040px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }

/* dot ring */
.ring { display: inline-block; background: var(--ring-light) center / contain no-repeat; }
.ring-lg { width: 64px; height: 64px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 56px; min-width: 56px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--accent); background: transparent; font-weight: 600; font-size: 16px; cursor: pointer; touch-action: manipulation; transition: transform .12s ease, background-color .12s ease; }
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--accent); color: var(--accent-fg); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: rgba(30,27,24,.06); }
.btn-small { min-height: 44px; min-width: 44px; padding: 0 14px; font-size: 15px; border-color: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- start ---------- */
.start { display: flex; flex-direction: column; gap: 24px; max-width: 560px; }
.brand { text-align: center; padding-top: 20px; }
.brand h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(44px, 12vw, 72px); line-height: 1; margin: 14px 0 10px; letter-spacing: -.01em; }
.tagline { margin: 0 auto; max-width: 30ch; color: var(--ink-muted); font-size: 16px; }
.start-form { display: flex; flex-direction: column; gap: 22px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; padding: 0; }
.modes { display: grid; gap: 10px; }
.mode-tile { position: relative; display: block; cursor: pointer; }
.mode-tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile-body { display: block; min-height: 64px; padding: 14px 16px 14px 52px; border: 2px solid var(--line); border-radius: 16px; background: #FBF8F2; transition: border-color .15s, background-color .15s; position: relative; }
.tile-body::before { content: ""; position: absolute; left: 16px; top: 17px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); }
.mode-tile input:checked + .tile-body { border-color: var(--ink); background: #fff; }
.mode-tile input:checked + .tile-body::before { background: var(--ink); box-shadow: inset 0 0 0 4px var(--paper); }
.mode-tile input:focus-visible + .tile-body { outline: 3px solid var(--ink); outline-offset: 3px; }
.tile-title { display: block; font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.2; }
.tile-sub { display: block; margin-top: 4px; font-size: 14.5px; color: var(--ink-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px; border: 2px solid var(--line); font-size: 15px; font-weight: 600; background: transparent; color: var(--ink-muted); transition: all .15s; }
.chip span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: transparent; border: 2px solid var(--c); }
.chip input:checked + span { border-color: var(--ink); color: var(--ink); background: #fff; }
.chip input:checked + span::before { background: var(--c); }
.chip input:checked + span::after { content: "✓"; font-size: 13px; }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.hint { min-height: 1.2em; margin: 8px 0 0; font-size: 14px; color: var(--ink-muted); }
.btn-start { min-height: 52px; width: 100%; font-size: 17px; }
.house { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-muted); text-align: left; }
.house h2 { margin: 0 0 8px; font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.house ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }

/* ---------- play ---------- */
.play { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.topbar { position: relative; z-index: 3; width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.topbar #to-modes { justify-self: start; margin-left: -8px; }
.mode-name { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; }

.hot-head { width: 100%; max-width: 420px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "label prog" "input input"; align-items: center; gap: 6px 12px; }
.seat-label { grid-area: label; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
#seat-name { grid-area: input; min-height: 44px; width: 100%; border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 0 14px; font-size: 16px; }
#seat-name:focus-visible { border-color: var(--ink); outline-offset: 2px; }
#seat-name::placeholder { color: var(--ink-muted); opacity: 1; }
.seat-progress { grid-area: prog; justify-self: end; display: flex; align-items: center; gap: 10px; }
.hot-count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.steps li { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c, var(--ink)); background: transparent; }
.steps li.done { background: var(--c); opacity: .55; }
.steps li.now { background: var(--c); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }

.table { width: 100%; display: flex; justify-content: center; flex: 1; align-items: center; }
.stage { position: relative; width: min(var(--card-max), calc(100vw - 32px), calc((100dvh - 290px) * 63 / 88)); min-width: 240px; aspect-ratio: 63 / 88; perspective: 1400px; }
.hot .stage { width: min(var(--card-max), calc(100vw - 32px), calc((100dvh - 380px) * 63 / 88)); }

.card { position: absolute; inset: 0; cursor: pointer; container-type: inline-size; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform var(--flip) cubic-bezier(.3,.7,.3,1); }
.card-inner.no-anim { transition: none; }
.card-inner.from-back { transform: rotateY(180deg); }
.card-inner.from-back-rev { transform: rotateY(-180deg); }
.face { position: absolute; inset: 0; border-radius: 4.5cqw; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 1px 2px rgba(30,27,24,.12), 0 14px 32px -12px rgba(30,27,24,.35); }
.front { background: var(--card-bg); color: var(--card-fg); border: 1px solid var(--card-edge); display: flex; flex-direction: column; }
.back { transform: rotateY(180deg); background: var(--ink) url("/card-back.svg") center / cover no-repeat; }

/* front: band ~ 10/88 of height */
.band { flex: 0 0 auto; height: 15.9cqw; background: var(--c); display: flex; align-items: center; justify-content: space-between; padding: 0 4.8cqw; }
.tag { white-space: nowrap; display: inline-flex; align-items: center; min-height: 7.6cqw; padding: 0 2.6cqw; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: max(11px, 3.4cqw); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
.q { flex: 1; display: flex; align-items: center; padding: 4.8cqw 7.4cqw; margin: 0; }
.q span { font-family: var(--serif); font-weight: 600; font-size: 8.4cqw; line-height: 1.2; text-wrap: pretty; }
.q.long span { font-size: 7.3cqw; }
/* v2.4 fine print: mid-tone, small; 10px floor = 7.5pt */
.fine { flex: 0 0 auto; margin: 0; padding: 0 7.4cqw 2.6cqw; font-size: max(10px, 3.1cqw); line-height: 1.3; color: var(--ink-muted); text-wrap: pretty; }
.fine .fl { color: var(--lc); font-weight: 600; font-variant-caps: small-caps; letter-spacing: .03em; }
.fine .fc { white-space: nowrap; }
.hand-card .fine { padding: 0 16px 14px; } /* v2.4b: same left edge as .hand-card .q (16px) */
.foot { display: flex; justify-content: space-between; padding: 0 4.8cqw 4.4cqw; font-size: max(11px, 3.3cqw); font-weight: 500; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* fan on shuffle */
.fan { position: absolute; inset: 0; pointer-events: none; }
.fan span { position: absolute; inset: 0; border-radius: 4.5cqw; background: var(--ink) url("/card-back.svg") center / cover no-repeat; opacity: 0; box-shadow: 0 8px 20px -10px rgba(30,27,24,.4); }
.stage { container-type: inline-size; }
.fanning .fan span { animation: fan .4s ease both; }
.fanning .fan span:nth-child(1) { --r: -5deg; }
.fanning .fan span:nth-child(2) { --r: 0deg; }
.fanning .fan span:nth-child(3) { --r: 5deg; }
.fanning .card { animation: hide .4s ease both; }
/* stays inside the card footprint: scale .86 + max 5deg keeps every corner within the card box */
@keyframes fan { 0% { opacity: 1; transform: scale(.86); } 50% { opacity: 1; transform: scale(.86) rotate(var(--r)); } 100% { opacity: 1; transform: none; } }
@keyframes hide { 0%, 95% { opacity: 0; } 100% { opacity: 1; } }

/* hand (Ask Around) */
.hand { width: min(760px, 100%); margin-top: 4px; }
/* phone/tablet: compact full-width stack */
.fanbox { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; margin: 0 auto; }
.hand-card { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; font-weight: 500; cursor: pointer; border-radius: 14px; }
.hand-card .face { position: relative; backface-visibility: visible; border-radius: 14px; transform: none; }
.hand-card .band { height: 40px; padding: 0 12px; }
.hand-card .tag { font-size: 12px; min-height: 26px; padding: 0 10px; }
.hand-card .q { padding: 12px 16px 16px; min-height: 64px; }
.hand-card .q span, .hand-card .q.long span { font-size: 18px; line-height: 1.25; }
.hand-card .foot { display: none; }
.hand-card:hover .face { border-color: var(--ink); }
.hand-card:focus-visible { outline: none; }
.hand-card:focus-visible .face { outline: 3px solid var(--ink); outline-offset: 3px; }
.hand-help { text-align: center; margin: 0 0 12px; color: var(--ink-muted); font-size: 15px; }
.ask .stage { display: none; }
.ask.picked .stage { display: block; }
.ask.picked .hand { display: none !important; }

.controls { position: relative; z-index: 4; width: 100%; max-width: 560px; display: flex; gap: 8px; }
.controls .btn { flex: 1 1 0; padding: 0 10px; white-space: nowrap; }
.controls #btn-next { flex-grow: 1.3; }
.keys { margin: 0; font-size: 13px; color: var(--ink-muted); display: none; }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }

.toast { z-index: 20; position: absolute; left: 50%; bottom: calc(100% + 10px); white-space: nowrap; transform: translate(-50%, 8px); margin: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- end ---------- */
.end { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.end h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 10vw, 64px); line-height: 1.05; margin: 8px 0 0; }
.end h2:focus { outline: none; }
.end-sub { margin: 0; color: var(--ink-muted); font-size: 17px; max-width: 32ch; }
.end-actions { display: flex; flex-direction: column; gap: 10px; width: min(100%, 340px); margin-top: 10px; }

/* ---------- desktop ---------- */
/* v2: depth dots, depth filter */
.band .dots { margin: 0 auto 0 2.6cqw; }
.dots { display: inline-flex; gap: 1.5cqw; }
.dots i { display: block; width: 3.1cqw; height: 3.1cqw; border-radius: 50%; border: .55cqw solid var(--paper); }
.dots i.on { background: var(--paper); }
.band.on-light .dots i { border-color: var(--ink); }
.band.on-light .dots i.on { background: var(--ink); }
.hand-card .dots { gap: 5px; } .hand-card .dots i { width: 11px; height: 11px; border-width: 2px; }
/* v2.7 wild cards: ink band (existing --ink token), WILDCARD tag, no dots */
.band.wild-band { background: var(--ink); }
.table { flex-direction: column; }
.go .stage { width: min(var(--card-max), calc(100vw - 32px), calc((100dvh - 320px) * 63 / 88)); }
.depth-chip span::before { display: none; }
.depth-chip span { padding: 0 16px; }
.chip .dots { gap: 3px; }
.chip .dots i { width: 9px; height: 9px; border: 2px solid var(--ink-muted); }
.chip .dots i.on { background: var(--ink-muted); }
.chip input:checked + span .dots i { border-color: var(--ink); }
.chip input:checked + span .dots i.on { background: var(--ink); }

@media (min-width: 900px) {
  :root { --card-max: 420px; }
  .start { max-width: 920px; }
  .brand { padding-top: 48px; }
  .modes { grid-template-columns: repeat(3, 1fr); }
  .tile-body { height: 100%; padding: 18px 18px 18px 54px; }
  .chips { justify-content: flex-start; }
  .btn-start { width: auto; min-width: 240px; align-self: center; }
  .stage, .go .stage { width: min(var(--card-max), calc((100dvh - 260px) * 63 / 88)); }
  .go .stage { width: min(var(--card-max), calc((100dvh - 290px) * 63 / 88)); }
  .hand { --hw: 270px; }
  .fanbox { display: block; position: relative; max-width: none; height: calc(var(--hw) * 88 / 63 + 40px); }
  .hand-card { position: absolute; bottom: 8px; left: 50%; width: var(--hw); aspect-ratio: 63 / 88; border-radius: 0; container-type: inline-size; transform-origin: 50% 110%; transition: transform .25s ease; --t: translateX(-50%); transform: var(--t); }
  .hand-card .face { position: absolute; inset: 0; border-radius: 4.5cqw; }
  .hand-card .band { height: 15.9cqw; padding: 0 4.8cqw; }
  .hand-card .tag { font-size: max(11px, 3.6cqw); min-height: 7.6cqw; padding: 0 2.6cqw; }
  .hand-card .q { padding: 4.8cqw 7cqw; }
  .hand-card .fine { padding: 0 7cqw 4cqw; }
  .hand-card .q span { font-size: 8.4cqw; }
  .hand-card .q.long span { font-size: 7.6cqw; }
  .hand-card .foot { display: flex; }
  .hand-card:nth-of-type(1) { --t: translateX(-154%) rotate(-6deg); }
  .hand-card:nth-of-type(2) { --t: translateX(-50%) translateY(-4%); z-index: 1; }
  .hand-card:nth-of-type(3) { --t: translateX(54%) rotate(6deg); z-index: 2; }
  .hand-card:hover, .hand-card:focus-visible { transform: var(--t) translateY(-4%); z-index: 3; }
  .hot-head { max-width: 420px; }
  .end-actions { flex-direction: row; width: auto; }
  .end-actions .btn { min-width: 200px; }
  .hot .stage { width: min(420px, calc((100dvh - 290px) * 63 / 88)); }
}

/* ---------- reduced motion: flip + fan become a fade ---------- */
@media (prefers-reduced-motion: reduce) {
  .card-inner, .card-inner.from-back, .card-inner.from-back-rev { transform: none !important; transition: none; }
  .back { display: none; }
  .front { transition: opacity 200ms ease; }
  .card-inner.fading .front { opacity: 0; transition: none; }
  .fanning .fan span, .fanning .card { animation: none; }
  .fanning .card { animation: fade .4s ease both; }
  @keyframes fade { 0% { opacity: 0; } 100% { opacity: 1; } }
  .hand-card, .btn, .toast { transition: none; }
}

/* =====================================================================
   PLAY TOGETHER (multi-v1) — Midnight. Everything scoped to #mp.
   ===================================================================== */
.mp-boot #screen-start { visibility: hidden; }
.mp { --gold: #B08D57; --gold-hi: #C9A774; --tone: #1B1A18; --raise: #211F1C; --cream: #F7F3EA; --night: #121110;
  min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--fg); font-size: 16px; }
.mp-screen { position: relative; min-height: 100vh; min-height: 100dvh; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px;
  padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.mp-col { display: flex; flex-direction: column; gap: 14px; }
.mp-col.center, .center { text-align: center; align-items: center; }
.grow-mid { flex: 1; justify-content: center; }
.mp .muted { color: var(--muted); }
.mp .help { font-size: 16px; margin: 0; }
.mp p { margin: 0; }
.mp .lab, .mp legend.lab { font: 600 16px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0; }
.mp .h1 { font: 400 30px/1.15 var(--display); margin: 0; color: var(--fg); letter-spacing: -.005em; }
.mp .h1.big { font-size: 40px; }
.mp .eyebrow { font: 600 16px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; }
.mp .gold { color: var(--gold); }
.mp-err { color: var(--err); min-height: 0; font-weight: 600; }
.mp-err:empty { display: none; }
.mp-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.mp-cta { width: 100%; }
.mp .btn { border-color: var(--gold); color: var(--gold); }
.mp .btn.pri, .mp .btn-ink { background: var(--gold); color: var(--night); border-color: var(--gold); }
.mp .btn.off { background: transparent; color: var(--muted); border: 2px dashed var(--edge); cursor: not-allowed; }
.mp .btn.tert, .mp .btn-ghost { border-color: transparent; color: var(--fg); background: transparent; }
.mp .btn-ghost:hover { background: rgba(247,243,234,.06); }
.mp .btn.warn { background: var(--err); border-color: var(--err); color: var(--night); }
.mp .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mp-link { display: inline-flex; align-self: center; align-items: center; min-height: 44px; color: var(--gold); font-weight: 600; text-decoration: none; }
.mp-link.muted { color: var(--muted); }
.mp-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* header */
.mp-top { max-width: none; min-height: 56px; }
.mp-top .mp-back { justify-self: start; margin-left: -12px; color: var(--fg); font-size: 16px; }
.mp-top .mode-name { font: 400 22px/1.2 var(--display); text-align: center; }
.mp-top-r { justify-self: end; display: flex; align-items: center; gap: 12px; }
.code-chip { min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--hair); background: var(--tone); color: var(--gold); font: 600 16px/1 var(--sans); letter-spacing: .22em; cursor: pointer; display: inline-flex; align-items: center; }
.code-chip.static { cursor: default; }

/* brand */
.mp-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; }
.mp-brand .wm { font: 400 26px/1 var(--display); color: var(--gold); letter-spacing: .09em; text-transform: uppercase; margin: 0; }
.mp-brand.big { padding-top: 56px; gap: 16px; }
.mp-brand.big .wm { font-size: clamp(44px, 13vw, 64px); }
.mp-brand .tagline { color: var(--muted); max-width: 26ch; font-size: 18px; }
.orn { display: flex; align-items: center; gap: 10px; }
.orn i { width: 52px; height: 1.5px; background: var(--hair); }
.orn b { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* tiles (mode + start choice) */
.mp fieldset { display: flex; flex-direction: column; gap: 12px; }
.mp .tiles { display: grid; gap: 10px; }
.mp .tiles .tile { min-height: 68px; }
.mp .tile { position: relative; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 14px 18px 14px 56px; border: 1.5px solid rgba(176,141,87,.22); border-radius: 18px; background: var(--tone); cursor: pointer; }
.mp .tile::before { content: ""; position: absolute; left: 18px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; border: 1.5px solid var(--edge); }
.mp .tile.on { border-color: var(--gold); background: var(--raise); }
.mp .tile.on::before { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 0 6px, transparent 7px); }
.mp .tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mp .tile:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.mp .tile-t { display: block; font: 400 22px/1.2 var(--display); color: var(--fg); }
.mp .tile-s { display: block; margin-top: 4px; color: var(--muted); font-size: 16px; }
.mp .tile.big { padding: 20px 20px 22px 64px; align-items: flex-start; }
.mp .tile.big::before { left: 22px; top: 26px; margin-top: 0; }
.choose { justify-content: space-between; }
.choose-form { margin-top: auto; padding-bottom: 12px; }

/* switch + rows */
.row-sb { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.sw-t { display: block; font-weight: 600; }
.sw-s { display: block; }
.sw { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--raise); border: 1.5px solid var(--edge); position: relative; cursor: pointer; margin: 0; transition: background-color .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.sw:checked { background: var(--gold); border-color: var(--gold); }
.sw:checked::after { transform: translateX(20px); background: var(--night); }
.mp .input { width: 100%; min-height: 56px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--edge); background: var(--tone); color: var(--fg); font-size: 18px; }
.mp .input::placeholder { color: var(--muted); }
.mp .input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(201,167,116,.35); }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.add-row .btn { min-width: 88px; }

/* lists */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 14px; min-height: 56px; border-bottom: 1px solid var(--hair); }
.plist .grow, .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plist li.pending .grow { color: var(--muted); }
.plist li.off .grow::after { content: " · away"; color: var(--muted); font-weight: 500; }
.plist .st { white-space: nowrap; }
.mp .dot { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.mp .dot.ring { box-shadow: inset 0 0 0 2px var(--edge); }
.mp .ico { flex: none; min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 12px; }
.mp .ico:hover { color: var(--fg); background: rgba(247,243,234,.06); }
.names li { padding-left: 6px; font-size: 18px; }

/* lobby */
.lobby-grid { display: flex; flex-direction: column; gap: 24px; flex: 1; }
.lobby-code { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.code-hero { font: 400 64px/1 var(--display); letter-spacing: .14em; margin: 4px 0 0 .14em; color: var(--fg); }
.qr { background: #F3EBDD; border-radius: 14px; padding: 6px; box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 6px var(--night), 0 0 0 7px var(--hair); width: 188px; height: 188px; }
.qr svg { display: block; width: 100%; height: 100%; border-radius: 8px; }
.qr.big { width: 272px; height: 272px; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.share-btn { min-height: 48px; }
.lobby-list { display: flex; flex-direction: column; gap: 12px; }
.lobby-cta { position: sticky; bottom: 0; padding: 12px 0 max(4px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 18px); display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.only-wide { display: none; }
.exp-wide { display: none; }

/* sheets */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); z-index: 21; background: var(--raise); border-top: 1.5px solid var(--hair); border-radius: 24px 24px 0 0; padding: 24px 20px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet-t { font: 400 26px/1.2 var(--display); display: flex; align-items: center; gap: 12px; }
.sheet.full { inset: 0; transform: none; width: 100%; border-radius: 0; border: 0; background: var(--bg); padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); max-width: none; }
.share-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.share-foot { width: min(520px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }

/* join: 4 visual boxes backed by one input */
.boxes { position: relative; display: grid; grid-template-columns: repeat(4, 64px); gap: 12px; justify-content: center; margin-top: 12px; cursor: text; }
.boxes input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; caret-color: transparent; border: 0; z-index: 1; }
.bx { height: 76px; border-radius: 14px; border: 1.5px solid var(--edge); background: var(--tone); display: flex; align-items: center; justify-content: center; font: 400 40px/1 var(--display); color: var(--fg); }
.bx.f { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,167,116,.35); }
.boxes.err .bx { border-color: var(--err); color: var(--err); }
.boxes.shake { animation: mpshake .4s ease; }
@keyframes mpshake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pick { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.pick.center { justify-content: center; }
.mp .pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid rgba(176,141,87,.4); background: var(--tone); color: var(--fg); font-weight: 600; font-size: 16px; cursor: pointer; }
button.pill:hover { border-color: var(--gold); }
.mp .pill.taken { border-style: dashed; border-color: var(--edge); color: var(--muted); cursor: not-allowed; background: transparent; }
.mp .pill.gold { border-color: var(--gold); background: var(--raise); }
.mp .pill.off { opacity: .4; }
.tick { width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 32px; }

/* game */
.stage-mp { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.turn-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--hair); color: var(--gold); font-weight: 600; }
.turn-chip.on { background: var(--gold); color: var(--night); border-color: var(--gold); }
.banner { border: 1.5px solid var(--hair); border-radius: 18px; padding: 16px 20px; background: linear-gradient(var(--raise), var(--tone)); }
.banner.on { border-color: var(--gold); }
.banner-t { font: 400 26px/1.2 var(--display); }
.banner-s { color: var(--muted); margin-top: 4px; }
.mp-fine { max-width: 420px; width: 100%; margin: 0 auto; font-size: 16px; color: var(--muted); text-align: left; }
.mp-fine b { color: var(--fg); font-weight: 600; }
.stage-mp.dim .c2 { opacity: .62; }
.turn .mp-fine { max-width: 340px; }
.c2-steps { display: inline-flex; gap: 8px; }
.c2-steps i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--gold); }
.c2-steps i.on { background: var(--gold); }
.shared-foot { display: flex; flex-direction: column; gap: 12px; }
.shared-foot .hint { display: none; }
.strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.strip .arr { display: none; color: var(--edge); align-self: center; }
.strip .pill { min-height: 44px; padding: 0 14px; cursor: default; }
.strip .nx { display: none; font-weight: 500; }
.host-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c2-wait { width: 300px; aspect-ratio: 751 / 1052; border-radius: 18px; border: 1.5px dashed var(--edge); display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.asked { display: flex; align-items: center; gap: 14px; }
.hand-list { gap: 12px; }

/* C2 card: HTML + SVG rebuild of the print card (premium/C2). Units are cqw of the card width. */
.c2 { container-type: inline-size; width: 300px; max-width: 100%; aspect-ratio: 751 / 1052; flex: none; border-radius: 4.2cqw; background: var(--night);
  box-shadow: 0 0 0 1px rgba(176,141,87,.18), 0 24px 60px rgba(0,0,0,.45); overflow: hidden; position: relative; transition: opacity .2s; }
.c2.lg { width: min(420px, 100%, calc((100dvh - 290px) * .714)); min-width: min(260px, 100%); }
.c2.md { width: min(300px, 100%, calc((100dvh - 330px) * .714)); min-width: min(230px, 100%); }
.c2.sm { width: 210px; }
.c2.xs { width: 96px; border-radius: 6px; }
.c2-face { position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% 118%, rgba(176,141,87,.045) 0 .3deg, transparent .35deg 9deg); }
.c2-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.c2-box { position: absolute; inset: 11.85cqw 11.85cqw 11.85cqw; display: flex; flex-direction: column; }
.c2-head { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; }
.c2-cat { display: inline-flex; align-items: center; gap: 3.2cqw; }
.c2-glyph { width: 10.1cqw; height: 10.1cqw; flex: none; }
.c2-lab { font: 600 4.1cqw/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--cl); }
.c2-dots { display: inline-flex; gap: 1.3cqw; }
.c2-dots i { width: 2.4cqw; height: 2.4cqw; border-radius: 50%; }
.c2-q { margin: 17cqw 0 0; font: 400 8cqw/1.24 var(--display); color: var(--cream); overflow-wrap: break-word; hyphens: manual; }
.c2-art { position: absolute; right: 11.85cqw; bottom: 13cqw; width: 40cqw; height: 33cqw; color: var(--gold); display: flex; align-items: center; justify-content: center; }
.c2-art svg { width: 100%; height: 100%; overflow: visible; }
.c2-art svg [stroke] { stroke-width: max(1.2px, .45cqw); }
.c2.xs .c2-art, .c2.xs .c2-q { display: none; }
.c2.is-wild .c2-lab { color: var(--gold); }
.c2.flip { animation: mpflip var(--flip, 300ms) ease; }
@keyframes mpflip { 0% { transform: perspective(1200px) rotateY(-90deg); opacity: .4; } 100% { transform: none; opacity: 1; } }

/* hand card (Ask Around) */
.hc { position: relative; display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; padding: 20px 22px 22px; border-radius: 16px; border: 0; cursor: pointer; background: var(--tone);
  box-shadow: inset 0 0 0 1.5px var(--cf), inset 0 0 0 5px var(--tone), inset 0 0 0 6px var(--cf); color: var(--cream); }
.hc .c2-glyph { width: 28px; height: 28px; }
.hc .c2-lab { font-size: 16px; }
.hc .c2-dots i { width: 9px; height: 9px; box-shadow: inset 0 0 0 1.5px var(--cl) !important; }
.hc .c2-dots { gap: 5px; }
.hc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hc-q { font: 400 20px/1.3 var(--display); }
.hc.on { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 6px var(--tone), inset 0 0 0 7.5px var(--gold); }
.hc-tag { font: 600 14px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--night); background: var(--gold); padding: 6px 10px; border-radius: 999px; }
.hc:hover { background: var(--raise); }
.who { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; border: 0; background: none; color: var(--fg); font-size: 18px; font-weight: 600; cursor: pointer; text-align: left; padding: 0 4px; }
.radio-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--edge); flex: none; }
.who.on .radio-dot { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 0 6px, transparent 7px); }

/* toast */
.mp-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 64px); transform: translate(-50%, 20px); z-index: 30; max-width: min(520px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; width: max-content; background: var(--raise); color: var(--fg); border: 1.5px solid var(--hair); border-radius: 999px; padding: 12px 22px 12px 18px; font-size: 18px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.mp-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 899px) {
  .c2.lg { width: min(300px, 100%, calc((100dvh - 400px) * .714)); min-width: min(220px, 100%); }
  .lobby { padding-bottom: 150px; }
  .lobby-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 18px 20px max(16px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22px); }
  .lobby-cta > * { width: min(520px, 100%); margin-left: auto; margin-right: auto; }
}
/* laptop / TV */
@media (min-width: 900px) {
  .mp-screen { max-width: 1200px; padding: 24px 40px 32px; }
  .mp-screen.join, .mp-screen.name, .mp-screen.wait, .mp-screen.setup, .mp-screen.choose, .mp-screen.expired, .mp-screen.removed, .mp-screen.rejoin,
  .mp-screen.turn, .mp-screen.listen, .mp-screen.askhand, .mp-screen.askwho, .mp-screen.end-mp { max-width: 560px; }
  .exp-wide { display: inline; }
  .only-wide { display: block; } .only-narrow { display: none !important; }
  .lobby-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
  .lobby-code { align-items: flex-start; text-align: left; }
  .code-hero { font-size: 96px; margin-left: 0; }
  .qr-wrap { flex-direction: row; gap: 20px; }
  .qr { width: 176px; height: 176px; }
  .shared-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
  .shared-foot .hint { display: block; }
  .host-ctl { display: flex; justify-content: flex-end; }
  .host-ctl .btn { min-height: 48px; }
  .strip .arr { display: inline; }
  .strip .nx { display: inline; }
  .stage-mp { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .c2.flip { animation: fade .2s ease; }
  .boxes.shake { animation: none; }
  .mp-toast { transition: opacity .2s; transform: translate(-50%, 0); }
}

/* ?theme=midnight on the single-device game: readability overrides only (the solo card is not re-skinned to C2) */
:root[data-theme="midnight"] .tile-body { background: var(--surface); border-color: rgba(176,141,87,.22); }
:root[data-theme="midnight"] .tile-body::before { border-color: var(--edge); background: transparent; }
:root[data-theme="midnight"] .mode-tile input:checked + .tile-body { background: var(--surface-2); border-color: var(--accent); }
:root[data-theme="midnight"] .mode-tile input:checked + .tile-body::before { background: var(--accent); box-shadow: inset 0 0 0 4px var(--surface-2); border-color: var(--accent); }
:root[data-theme="midnight"] .chip input:checked + span { background: var(--surface-2); border-color: var(--accent); color: var(--fg); }
:root[data-theme="midnight"] .house h2, :root[data-theme="midnight"] .brand h1 { color: var(--fg); }
:root[data-theme="midnight"] .brand h1 { font-family: var(--display); font-weight: 400; }
