/* ============================================================
   TVOIDOM° GAMES — "Pass the phone"

   Self-contained: the tokens are copied from css/brutal.css and this page loads no
   other stylesheet, no GSAP, no WebGL. A party keeps it open for an hour on a
   mid-range phone, so play screens use no backdrop-filter and no blend modes.

   Two brand primitives carry the look:
     THE RING  the degree sign of TVOIDOM° as an object: the hold button, the
               countdown, progress marks.
     THE BAR   a secret is a row of redaction bars until someone holds the ring.

   Motion has three verbs: screens slide sideways (a phone changing hands), the
   bar lifts, the ring fills. Private screens do not animate at all.

   Contents
     1  Tokens, fonts, reset
     2  Shared type and primitives (label, ring, buttons, logo letters)
     3  Hub
     4  Stage shell (stage, screen, rail, body, foot)
     5  Setup (cover, crew, settings, rules)
     6  Handoff and the private card
     7  Clock, count, flash
     8  Talk, vote, verdict (Spy)
     9  Grid, poster, paused
    10  Sheets, toast, service screens
    11  Motion
    12  Short screens (landscape) and wide screens
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --ink:    #0b0e14;
  --ink-2:  #11151f;
  --ink-3:  #161b27;
  --paper:  #f1efe7;
  --sand:   #e9e0cd;   /* large display type */
  --sand-2: #d6cbac;   /* display outline strokes */
  --line:   rgba(241, 239, 231, 0.12);
  --line-2: rgba(241, 239, 231, 0.22);
  --teal:   #5eead4;
  --amber:  #e8a13a;
  --violet: #a78bfa;
  --coral:  #ff8a73;
  --text:      #f1efe7;
  --text-dim:  #94a0b3;
  --text-mute: #8b95a4;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* The current game's accent. Identity only: yes is always teal, time and skip
     always amber, danger always coral, whatever game is on. */
  --g: var(--teal);

  --font-display: 'Clash Display', 'Golos Text', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-latin:   'Clash Display', system-ui, sans-serif;   /* the brand mark, in any language */
  /* Player names, in both languages: a Cyrillic name has to look right inside the
     English interface, and Clash Display has no Cyrillic at all. */
  --font-name:    'Golos Text', 'Manrope', system-ui, sans-serif;

  --display-w: 600;       /* display weight */
  --display-k: 1;         /* display size factor */
  --display-ls: -0.02em;
  --mono-k: 1;            /* mono size factor */
  --char: 0.62;           /* average width of a display capital in em; giant type is sized from it */
  --hero-size: min(23.4vw, 12.5rem);

  --pad: clamp(1rem, 4vw, 3rem);
  --container: 1340px;

  /* Tone. A screen is ink by default; the result poster and the TIME flash are paper. */
  --bg: var(--ink);
  --fg: var(--sand);
  --fg-text: var(--text);
  --fg-dim: var(--text-dim);
  --fg-mute: var(--text-mute);
  --rule: var(--line);
  --rule-2: var(--line-2);
  --btn-bg: var(--sand);
  --btn-fg: var(--ink);
  --acc: var(--g);
  --panel: var(--ink-2);
}

/* Russian switches the whole role, not single glyphs: a per-glyph fallback would mix
   Clash digits and punctuation with letters from another face. Golos Text is a touch
   wider and Cyrillic words are longer, hence the smaller factors. Martian Mono at
   .875em matches Space Mono's cap height. */
:root[lang="ru"] {
  --font-display: 'Golos Text', 'Manrope', system-ui, sans-serif;
  --font-mono:    'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --display-w: 800;
  --display-k: 0.96;
  --display-ls: -0.03em;
  --mono-k: 0.875;
  --char: 0.7;
  --hero-size: min(16.6vw, 9rem);
}

.stage[data-tone="paper"] {
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-text: var(--ink);
  --fg-dim: #414959;
  --fg-mute: #596271;
  --rule: rgba(11, 14, 20, 0.14);
  --rule-2: rgba(11, 14, 20, 0.32);
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --acc: var(--ink);
  --panel: #e7e4d8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* No background on html: the body's ink has to reach the canvas, or it would paint
   over the aurora layer that sits behind the page. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--ink); color: var(--text);
  font-family: var(--font-body); line-height: 1.55;
  overflow-x: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
h1, h2, h3 { font-size: inherit; font-weight: inherit; }
i { font-style: normal; }
button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; }
a, button, summary, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
::selection { background: var(--teal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
/* Headings receive focus from script so a screen reader announces a new screen.
   That is not a reason to draw a ring around them. */
[tabindex="-1"]:focus { outline: none; }

/* ---------- 2. Shared type and primitives ---------- */
.label {
  font-family: var(--font-mono); font-weight: 400;
  font-size: calc(0.72rem * var(--mono-k)); line-height: 1.5;
  text-transform: uppercase; letter-spacing: 0.15em; color: var(--fg-mute);
}
.name { font-family: var(--font-name); }

/* Outlined display type, as on the homepage hero. */
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--sand-2); }
/* Golos Text is a variable font and keeps overlapping contours inside some letters
   (Д, Й); a plain stroke would draw them. So the stroke is doubled and the fill is
   painted over its inner half, which hides whatever is inside the letter. */
:root[lang="ru"] .outline { color: var(--ink); paint-order: stroke fill; -webkit-text-stroke-width: 3px; }

/* The arrow is drawn, not typed. A typed one comes from whichever fallback font the
   platform picks for the language, and looks different in each. */
.arr { position: relative; display: inline-block; flex: none; width: 1.15em; height: 0.75em; }
.arr::before { content: ''; position: absolute; left: 0; right: 0.06em; top: 50%; height: 1.5px; margin-top: -0.75px; background: currentColor; }
.arr::after {
  content: ''; position: absolute; right: 0.05em; top: 50%; width: 0.4em; height: 0.4em; margin-top: -0.2em;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg);
}
.arr--back { transform: scaleX(-1); }

/* The ring. Rotated so it starts filling at twelve o'clock. */
.ring { display: block; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--rule-2); stroke-width: 2; }
.ring-fill { fill: none; stroke: var(--acc); stroke-width: 6; }
.ring--mini { flex: none; width: 22px; height: 22px; }
.ring--mini .ring-track { stroke: currentColor; stroke-width: 9; opacity: 0.4; }
.ring--mini .ring-fill { stroke: currentColor; stroke-width: 14; }
.ring--count .ring-track { stroke-width: 1; }
.ring--count .ring-fill { stroke-width: 3; }

/* The degree sign of the brand, drawn rather than typed, so it is the same ring in
   every typeface. */
.deg {
  display: inline-block; width: 0.27em; height: 0.27em;
  border: 0.06em solid var(--teal); border-radius: 50%;
  vertical-align: top; margin: 0.1em 0 0 0.05em;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
  width: 100%; min-height: 56px; padding: 0.6rem 1.4rem;
  border: 1px solid transparent; border-radius: 100px;
  font-family: var(--font-mono); font-size: calc(0.82rem * var(--mono-k)); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.3; text-align: center;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.btn-primary { min-height: 60px; background: var(--btn-bg); color: var(--btn-fg); }
.btn-ghost { border-color: var(--rule-2); color: var(--fg-text); font-weight: 400; }
.btn-quiet { min-height: 48px; color: var(--fg-dim); font-weight: 400; }
.btn-menu {
  justify-content: space-between; min-height: 60px; padding-inline: 0.15rem;
  border-radius: 0; border-bottom: 1px solid var(--rule); color: var(--fg-text);
  font-weight: 400; text-align: left;
}
.btn-menu.btn-hold { justify-content: flex-start; color: var(--coral); }
.btn-v { color: var(--fg-mute); }
/* The three meanings that keep their colour in every game, whatever its accent:
   yes / correct is teal, skip / time is amber, danger is coral. */
.btn-yes { min-height: 60px; background: var(--teal); color: var(--ink); }
.btn-skip { min-height: 60px; background: var(--amber); color: var(--ink); }
.btn-danger { border-color: var(--coral); color: var(--coral); font-weight: 400; }
.btn:disabled { opacity: 0.36; }
.btn--sm { width: auto; min-height: 48px; padding-inline: 1.05rem; font-size: calc(0.72rem * var(--mono-k)); }
.btn .name, .btn .btn-what { font-family: var(--font-name); font-weight: 800; font-size: 1.14em; letter-spacing: 0.03em; }
.btn .btn-what { font-family: var(--font-body); font-weight: 700; letter-spacing: 0.02em; }
/* A thumb drifts while it holds. Without this the browser takes the touch for a pan
   after a few pixels and the hold is cancelled half way. */
.btn-hold { touch-action: none; }
.btn-hold.is-holding { border-color: currentColor; }
/* The ring is full: letting go confirms. Yes is teal, in every game. */
.btn-armed { display: none; }
.btn-hold.is-armed .btn-t { display: none; }
.btn-hold.is-armed .btn-armed { display: inline; }
.btn-hold.is-armed .ring-track { opacity: 1; }
.btn-primary.btn-hold.is-armed { background: var(--teal); color: var(--ink); }
.is-waiting { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { background: var(--teal); color: var(--ink); }
  .btn-ghost:hover:not(:disabled), .btn-quiet:hover:not(:disabled) { color: var(--fg); border-color: var(--fg-mute); }
}

.icon-btn {
  position: relative; flex: none; width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule-2); border-radius: 50%;
}
.icon-btn:disabled { opacity: 0.32; }
/* Plus, minus and cross are drawn with two strokes: no icon font, no emoji. */
.plus, .minus, .cross { position: relative; display: block; width: 14px; height: 14px; }
.plus::before, .plus::after, .minus::before, .cross::before, .cross::after {
  content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px;
  margin-top: -0.75px; background: currentColor;
}
.plus::after { transform: rotate(90deg); }
.cross::before { transform: rotate(45deg); }
.cross::after { transform: rotate(-45deg); }

/* EN | RU */
.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rule-2); border-radius: 100px; }
.lang-b {
  position: relative; min-width: 48px; height: 34px; padding: 0 0.6rem; border-radius: 100px;
  font-family: 'Space Mono', monospace; font-size: 0.74rem; letter-spacing: 0.1em; color: var(--fg-mute);
}
/* The pill is 34px tall to sit in a rail; the tap target is 48px. */
.lang-b::after { content: ''; position: absolute; inset: -8px 0; }
.lang-b[aria-pressed="true"] { background: var(--fg); color: var(--bg); font-weight: 700; }

/* A game's logo is its title with one letter that misbehaves. */
.logo-w { display: inline-block; white-space: nowrap; }
.mis { display: inline-block; color: var(--g); }
.mis-hollow { color: transparent; -webkit-text-stroke: 0.026em var(--g); }
.mis-mono { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 0.9em; letter-spacing: 0; }
:root[lang="ru"] .mis-mono { font-family: 'Martian Mono', monospace; font-size: 0.74em; }
.mis-bar { position: relative; color: transparent; }
.mis-bar::after { content: ''; position: absolute; inset: 0.14em 0.02em 0.12em; background: var(--g); }
.mis-ghost { opacity: 0.3; }
.mis-lift { transform: translateY(-0.17em); }
.mis-flip { transform: rotate(180deg); }
.mis-drop { transform: translateY(0.15em) rotate(-14deg); }
.mis-tilt { transform: rotate(13deg); transform-origin: 20% 85%; }

/* ---------- 3. Hub ---------- */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.atmos {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 8%,  rgba(94, 234, 212, 0.16) 0%, transparent 60%),
    radial-gradient(55% 45% at 10% 22%, rgba(124, 110, 255, 0.12) 0%, transparent 62%),
    radial-gradient(70% 60% at 50% 110%, rgba(94, 234, 212, 0.08) 0%, transparent 60%);
}
/* The aurora and the grain belong to the hub. A game gets a plain ink stage. */
html.in-game .grain, html.in-game .atmos { display: none; }
html.tvg-wait .hub { visibility: hidden; }

.hub { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem;
  width: 100%; max-width: var(--container); margin: 0 auto;
  padding: max(0.9rem, env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) 0.4rem max(var(--pad), env(safe-area-inset-left));
}
.brand-mark {
  display: inline-flex; align-items: center; min-height: 48px;
  font-family: var(--font-latin); font-weight: 600; font-size: 1.35rem; letter-spacing: 0.02em; color: var(--paper);
}
.brand-mark sup { color: var(--teal); font-size: 0.7em; line-height: 1; align-self: flex-start; margin-top: 0.55em; }

.hub-cols {
  flex: 1; width: 100%; max-width: var(--container); margin: 0 auto;
  padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
}
.hub-right { display: none; }

.hero { padding: clamp(1.6rem, 6vh, 4.5rem) 0 clamp(2.2rem, 7vh, 4rem); }
.eyebrow {
  display: flex; align-items: flex-start; gap: 0.7rem; margin-bottom: clamp(1.3rem, 4vh, 2.4rem);
  font-family: var(--font-mono); font-size: calc(0.72rem * var(--mono-k)); line-height: 1.7;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-dim);
}
.eyebrow-dot {
  flex: none; width: 8px; height: 8px; margin-top: 0.42em; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 12px var(--teal);
}
.hero-title {
  font-family: var(--font-display); font-weight: var(--display-w); font-size: var(--hero-size);
  line-height: 0.9; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--sand);
}
.hero-title .line { position: relative; display: block; width: max-content; max-width: 100%; }
.hero-title .line-in { display: block; padding-top: 0.04em; }
:root[lang="ru"] .hero-title { line-height: 0.98; }
.hero-sub {
  max-width: 30ch; margin-top: clamp(1.3rem, 4vh, 2.2rem);
  font-size: clamp(1.02rem, 1.35vw, 1.2rem); line-height: 1.6; color: var(--text-dim);
}
.noscript {
  margin-top: 1.2rem; padding: 0.9rem 1rem; max-width: 46ch;
  border: 1px solid var(--amber); border-radius: 12px; color: var(--text); font-size: 0.95rem;
}

.resume {
  display: flex; align-items: center; gap: 0.9rem; min-height: 64px;
  margin-bottom: clamp(1.8rem, 5vh, 3rem); padding: 0.8rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--g) 55%, transparent); border-radius: 16px;
  background: color-mix(in srgb, var(--g) 9%, transparent);
}
.resume-ring { flex: none; width: 14px; height: 14px; border: 3px solid var(--g); border-radius: 50%; }
.resume-t {
  flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0;
  font-family: var(--font-mono); font-size: calc(0.74rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.12em; line-height: 1.6;
}
.resume-t > span + span::before { content: '·'; margin: 0 0.55em; color: var(--text-mute); }
.resume-k { color: var(--g); font-weight: 700; }
.resume-g { color: var(--text); }
.resume-n { color: var(--text-dim); font-weight: 700; letter-spacing: 0.05em; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 0.8rem; }

.rows { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row-a {
  --row-pad: clamp(1.15rem, 3.2vw, 1.9rem);
  --row-title: calc(min(clamp(2.35rem, 10.8vw, 4.2rem), 12vw) * var(--display-k));
  position: relative; display: grid; grid-template-columns: clamp(2rem, 7vw, 5rem) minmax(0, 1fr);
  column-gap: clamp(0.5rem, 2vw, 2rem); align-items: start;
  min-height: 72px; padding: var(--row-pad) 0;
  transition: padding-left 0.4s var(--ease);
}
.row-n {
  padding-top: 0.55em; font-family: var(--font-mono); font-weight: 700; line-height: 1;
  font-size: calc(clamp(0.8rem, 1.5vw, 1.05rem) * var(--mono-k)); color: var(--g);
}
.row-title {
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: var(--row-title);
  line-height: 0.96; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--sand);
  transition: color 0.3s ease;
}
/* The arrow sits beside the title, out of the grid, so the pitch under it keeps the
   full width of the row. */
.row:not(.is-soon) .row-title { padding-right: 2.3rem; }
.row-pitch { max-width: 40ch; margin-top: 0.7rem; font-size: clamp(0.96rem, 1.2vw, 1.08rem); line-height: 1.5; color: var(--text-dim); }
.row-meta {
  margin-top: 0.5rem; font-family: var(--font-mono); font-size: calc(0.68rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-mute);
}
.row-go {
  position: absolute; right: 0; top: calc(var(--row-pad) + var(--row-title) * 0.48 - 0.45rem);
  font-size: 1.3rem; color: var(--g); transition: transform 0.3s var(--ease);
}
.resume .row-go { position: relative; top: auto; right: auto; }
/* SOON sits in the meta line, so a long title keeps the whole width of its row. */
.row-tag {
  display: inline-block; margin-left: 0.9em; padding: 0.22rem 0.6rem; white-space: nowrap; vertical-align: 0.08em;
  border: 1px solid var(--line-2); border-radius: 100px;
  font-size: calc(0.6rem * var(--mono-k)); letter-spacing: 0.16em; color: var(--text-dim);
}
/* Not built yet: present, legible, clearly not a button. */
.row.is-soon .row-title { color: rgba(233, 224, 205, 0.46); }
.row.is-soon .row-n, .row.is-soon .mis { opacity: 0.8; }
.row.is-soon .mis-ghost { opacity: 0.3; }
.row.is-soon .row-pitch { color: var(--text-mute); }
@media (hover: hover) and (pointer: fine) {
  .row:not(.is-soon) .row-a:hover { padding-left: 1.2rem; }
  .row:not(.is-soon) .row-a:hover .row-title { color: var(--g); }
  .row:not(.is-soon) .row-a:hover .row-go { transform: translateX(6px); }
}
.row-a:focus-visible { outline-offset: -2px; }

.house { padding-top: clamp(3rem, 9vh, 6rem); }
.house-list { border-top: 1px solid var(--line); }
.house-list li {
  display: grid; grid-template-columns: clamp(2rem, 7vw, 5rem) minmax(0, 1fr);
  column-gap: clamp(0.5rem, 2vw, 2rem); align-items: baseline;
  padding: clamp(0.95rem, 2.4vw, 1.35rem) 0; border-bottom: 1px solid var(--line);
}
.house-n { font-family: var(--font-mono); font-weight: 700; font-size: calc(0.8rem * var(--mono-k)); color: var(--teal); }
.house-list p {
  font-family: var(--font-display); font-weight: 500;
  font-size: calc(min(clamp(1.3rem, 5vw, 2.1rem), 6.6vw) * var(--display-k));
  line-height: 1.14; letter-spacing: -0.01em; color: var(--sand);
  overflow-wrap: anywhere;
}
:root[lang="ru"] .house-list p { font-weight: 700; }

.hub-foot {
  margin-top: clamp(3.5rem, 10vh, 7rem); padding: clamp(2.2rem, 6vh, 4rem) 0 max(1.3rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2); background: var(--ink-2); overflow: hidden;
}
.studio, .foot-word, .foot-base {
  width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: max(var(--pad), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right));
}
.studio > span { display: block; max-width: 44ch; color: var(--text-dim); font-size: 1rem; line-height: 1.6; }
.studio a {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; margin-top: 0.3rem;
  font-family: var(--font-mono); font-size: calc(0.8rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal);
}
.foot-word { margin-top: clamp(1.6rem, 5vh, 3.5rem); margin-bottom: clamp(1.2rem, 3vh, 2rem); line-height: 0.8; }
.foot-word-in {
  display: inline-block; white-space: nowrap; user-select: none;
  font-family: var(--font-latin); font-weight: 700; font-size: clamp(3.6rem, 21.5vw, 17rem);
  text-transform: uppercase; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1.2px var(--line-2);
}
.foot-word-in .deg { border-color: var(--teal); border-width: 0.035em; }
.foot-base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1.4rem;
  padding-top: 1.2rem; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: calc(0.7rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-mute);
}
.foot-base a { display: inline-flex; align-items: center; min-height: 48px; font-family: 'Space Mono', monospace; font-size: 0.7rem; }

/* Desktop with a mouse: the list on the left, a paper ticket with the QR on the right.
   A touch device never gets here: nobody can scan their own screen. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .hub-cols {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(290px, 26vw, 360px);
    column-gap: clamp(2.5rem, 6vw, 6.5rem); align-items: start;
  }
  .hub-right { display: block; position: sticky; top: 0; padding-top: clamp(2rem, 9vh, 5.5rem); }
  :root { --hero-size: min(13.5vw, 12.5rem); }
  :root[lang="ru"] { --hero-size: min(9.4vw, 8.6rem); }
}
.ticket {
  position: relative; padding: 1.3rem 1.75rem 0.7rem;
  background: var(--paper); color: var(--ink); border-radius: 14px;
  transform: rotate(2.2deg); transform-origin: 60% 40%;
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.85), 0 2px 0 rgba(255, 255, 255, 0.35) inset;
}
.ticket-top {
  display: flex; justify-content: space-between; gap: 0.8rem; padding-bottom: 0.9rem;
  border-bottom: 1px dashed rgba(11, 14, 20, 0.34);
  font-family: var(--font-mono); font-size: calc(0.6rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.13em; color: #596271;
}
.ticket-top span:last-child { text-align: right; }
/* The SVG carries its own quiet zone (4 of 37 modules a side), in this same paper
   colour. Pulling the image left by that much lines the code itself up with the text. */
.ticket-qr { --qr: min(100%, 244px); width: var(--qr); height: auto; margin: 0.3rem 0 0 calc(-0.108 * 244px); }
.ticket-h {
  margin-top: 0.1rem; font-family: var(--font-display); font-weight: var(--display-w);
  font-size: calc(1.95rem * var(--display-k)); line-height: 0.98; letter-spacing: var(--display-ls);
  text-transform: uppercase;
}
.ticket-p { margin-top: 0.8rem; font-size: 0.95rem; line-height: 1.5; color: #414959; }
.ticket-p b { display: block; font-family: 'Space Mono', monospace; font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; color: var(--ink); }
.ticket-here {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  min-height: 52px; margin-top: 1rem; border-top: 1px dashed rgba(11, 14, 20, 0.34);
  font-family: var(--font-mono); font-size: calc(0.72rem * var(--mono-k)); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink);
}
.ticket :focus-visible { outline-color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .ticket-here .arr { transition: transform 0.3s var(--ease); }
  .ticket-here:hover .arr { transform: translateX(6px); }
}

/* ---------- 4. Stage shell ---------- */
.stage {
  position: fixed; inset: 0; z-index: 100;
  height: 100vh; height: 100dvh;
  display: flex; justify-content: center;
  background: var(--ink); color: var(--fg-text);
  /* Said again here on purpose. A custom property is worked out where it is declared:
     the one on :root has already become teal, and would stay teal whatever --g the
     stage is given for the game on it. */
  --acc: var(--g);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.stage input { -webkit-user-select: text; user-select: text; }
.stage[data-tone="paper"] :focus-visible { outline-color: var(--ink); }
.stage-col {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); container-type: inline-size;
}
.stage-host { position: absolute; inset: 0; }
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bg); color: var(--fg-text);
}
.rail, .body, .foot { position: relative; z-index: 1; }
.rail { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 48px; margin-bottom: 0.6rem; }
.rail-l { display: flex; align-items: center; min-width: 0; }
.rail-r { flex: none; display: flex; align-items: center; gap: 0.55rem; }
.rail-label {
  display: flex; align-items: center; gap: 0.6rem; min-width: 0;
  font-family: var(--font-mono); font-size: calc(0.7rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-mute);
}
.rail-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-label .name { font-weight: 700; letter-spacing: 0.08em; color: var(--fg-text); }
.rail-dot { flex: none; width: 10px; height: 10px; border: 2.5px solid var(--acc); border-radius: 50%; }
.rail-back {
  display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; min-height: 48px; padding-right: 0.6rem;
  font-family: var(--font-mono); font-size: calc(0.72rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-dim);
}
.rail-back .arr { font-size: 0.95rem; }
.rail-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The menu is three small rings: the brand's degree sign, thrice. */
.menu-btn { gap: 4px; }
.menu-btn i { width: 7px; height: 7px; border: 1.5px solid var(--fg-text); border-radius: 50%; }

.body {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.body::-webkit-scrollbar { display: none; }
.foot { flex: none; display: flex; flex-direction: column; gap: 0.6rem; padding-top: 0.8rem; }
.foot:empty { display: none; }
/* Where the body scrolls under the foot, let it fade out instead of being cut. */
.screen--setup .foot::before, .screen--grid .foot::before, .screen--poster .foot::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 28px; pointer-events: none;
  background: linear-gradient(to top, var(--bg), transparent);
}
.foot-hint {
  text-align: center; font-family: var(--font-mono); font-size: calc(0.66rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.1em; line-height: 1.5; color: var(--amber);
}
.foot-note { padding: 0.2rem 0 0.3rem; text-align: center; font-size: 0.92rem; line-height: 1.45; color: var(--fg-mute); }
.foot-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; }
.foot-pair .btn { padding-inline: 0.6rem; overflow-wrap: anywhere; }

/* Public headings: loud. Giant type is bounded by the width it has, not by rem alone:
   a reader who doubles the text size gets larger body text, not headlines that no
   longer fit the screen. */
.t-big {
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: calc(min(clamp(2.5rem, 13.2cqw, 3.9rem), 14.5cqw) * var(--display-k));
  line-height: 0.96; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--fg);
  overflow-wrap: anywhere;
}
/* One word, one box: see words() in core/ui.js. */
.w { display: inline-block; white-space: nowrap; }
.t-big .name, .t-mid .name { font-weight: 700; letter-spacing: -0.02em; }
:root[lang="ru"] .t-big .name, :root[lang="ru"] .t-mid .name { font-weight: 800; }
.t-mid {
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: calc(min(clamp(1.35rem, 6.4cqw, 1.8rem), 8cqw) * var(--display-k));
  line-height: 1.04; letter-spacing: -0.01em; text-transform: uppercase; color: var(--fg);
  overflow-wrap: anywhere;
}
.lead { max-width: 34ch; font-size: 1.02rem; line-height: 1.55; color: var(--fg-dim); }
/* A headline with a name in it: the name takes its own line and fills it (ui.fit). */
.shout { display: flex; flex-direction: column; gap: 0.1em; }
.shout > span { display: block; }
.shout .shout-name { font-weight: 800; letter-spacing: -0.03em; line-height: 0.94; overflow-wrap: anywhere; }
/* The rings that hold a public screen's empty half. Decoration only. */
/* No height of its own: on a screen that is already full the rings give way, rather
   than making the screen scroll for the sake of an ornament. */
.deco { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 -16px; overflow: hidden; pointer-events: none; }
.deco::before, .deco::after {
  content: ''; position: absolute; left: 50%; top: max(calc(12% + 1.4rem), calc((5.5rem - 100%) * 999)); width: 132%; aspect-ratio: 1;
  border: 1px solid var(--rule-2); border-radius: 50%; transform: translateX(-50%);
}
/* The second term of max(): with less than 5.5rem of room both rings leave the frame.
   A sliver of an arc under a full screen's last line reads as a rendering fault. */
.deco::after { top: max(calc(34% + 1.4rem), calc((5.5rem - 100%) * 999)); width: 88%; border-color: var(--rule); }
/* minmax(0, 1fr): a grid track is otherwise as wide as its widest word, and a
   heading that is never narrower than its text cannot be fitted to anything. */
.head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem; padding: 0.4rem 0 1.1rem; }

/* ---------- 5. Setup ---------- */
.cover { padding: 0.4rem 0 1.5rem; }
.cover-n { font-family: var(--font-mono); font-weight: 700; font-size: calc(0.8rem * var(--mono-k)); letter-spacing: 0.1em; color: var(--acc); }
.cover-title {
  margin-top: 0.35rem;
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: min(6.8rem, calc((100cqw - 34px) / (var(--chars) * var(--char))));
  line-height: 0.9; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--fg);
}
.cover-pitch { margin-top: 0.9rem; font-size: 1.04rem; line-height: 1.5; color: var(--fg-dim); }
.cover-meta { margin-top: 0.45rem; }

.sec { padding: 1.15rem 0 1.25rem; border-top: 1px solid var(--rule); }
.sec .sec-head { padding-bottom: 0; margin-bottom: 0.85rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; }
.chip { display: inline-flex; align-items: center; max-width: 100%; min-height: 48px; padding-left: 1.05rem; border: 1px solid var(--rule-2); border-radius: 100px; }
.chip .name { margin-right: -0.25rem; }
.chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 1rem; }
.chip-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; color: var(--fg-mute); }
.chip-x .cross { width: 12px; height: 12px; }
.crew-add { display: flex; gap: 0.5rem; }
/* 17px: iOS zooms the page when a focused input is under 16px. */
.field {
  flex: 1; min-width: 0; height: 52px; padding: 0 1.2rem;
  border: 1px solid var(--rule-2); border-radius: 100px; background: transparent;
  font-family: var(--font-name); font-weight: 700; font-size: 1.0625rem; color: var(--fg-text);
  -webkit-appearance: none; appearance: none;
}
.field::placeholder { font-family: var(--font-body); font-weight: 400; color: var(--fg-mute); opacity: 1; }
.field:focus { outline: none; border-color: var(--acc); }
.field:disabled { opacity: 0.5; }
.add-btn { width: 52px; height: 52px; }
.crew-anon { margin-top: 0.75rem; }

.rules li { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); align-items: baseline; padding: 0.5rem 0; }
.rules-n { font-family: var(--font-mono); font-weight: 700; font-size: calc(0.72rem * var(--mono-k)); color: var(--acc); }
.rules p { font-size: 0.98rem; line-height: 1.5; color: var(--fg-dim); }

.settings { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.settings summary { display: flex; align-items: center; gap: 0.8rem; min-height: 60px; list-style: none; cursor: pointer; }
.settings summary::-webkit-details-marker { display: none; }
.set-title { color: var(--fg-text); }
.set-sum {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
  font-family: var(--font-mono); font-size: calc(0.64rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-mute);
}
.settings summary .plus { flex: none; color: var(--acc); }
.settings summary .plus::after { transition: transform 0.2s var(--ease); }
.settings[open] summary .plus::after { transform: rotate(0deg); }
.settings[open] .set-sum { visibility: hidden; }
.set-rows { display: grid; gap: 1.15rem; padding: 0.2rem 0 1.4rem; }
.set-row { display: grid; gap: 0.5rem; min-width: 0; }
.set-row--line { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; }
.seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--rule-2); border-radius: 100px; }
.seg-b {
  flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 0.2rem; border-radius: 100px;
  font-family: var(--font-mono); font-size: calc(0.74rem * var(--mono-k));
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-dim);
}
.seg-b[aria-pressed="true"] { background: var(--fg); color: var(--bg); font-weight: 700; }
.seg-b:disabled { opacity: 0.3; }
/* Five or six options do not fit one row on a narrow phone, or at 200% text (the
   query is in rem, so it follows the reader's font size): two rows instead of six
   targets too small to hit. */
@container (max-width: 22rem) {
  .seg:has(> :nth-child(5)) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 28px; }
}
.picks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 48px; padding: 0 1rem 0 0.85rem;
  border: 1px solid var(--rule-2); border-radius: 100px;
  font-size: 0.93rem; line-height: 1.2; text-align: left; color: var(--fg-dim);
}
.pick-ring { flex: none; width: 12px; height: 12px; border: 1.5px solid var(--fg-mute); border-radius: 50%; }
.pick[aria-pressed="true"] {
  color: var(--fg-text); border-color: color-mix(in srgb, var(--acc) 60%, transparent);
  background: color-mix(in srgb, var(--acc) 8%, transparent);
}
.pick[aria-pressed="true"] .pick-ring { border-color: var(--acc); background: var(--acc); box-shadow: inset 0 0 0 2.5px var(--bg); }
.step { display: inline-flex; align-items: center; gap: 0.35rem; }
.step-v {
  min-width: 2.3ch; text-align: center;
  font-family: var(--font-display); font-weight: var(--display-w); font-size: 1.7rem; line-height: 1; color: var(--fg);
}
.switch { position: relative; width: 60px; height: 48px; }
.switch::before { content: ''; position: absolute; left: 4px; right: 4px; top: 10px; bottom: 10px; border: 1px solid var(--rule-2); border-radius: 100px; }
.switch i { position: absolute; left: 9px; top: 15px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg-mute); transition: transform 0.16s var(--ease); }
.switch[aria-checked="true"] i { transform: translateX(24px); background: var(--acc); }

/* ---------- 6. Handoff and the private card ---------- */
/* Loud public: the name of whoever takes the phone next, as large as it fits. */
.pass { display: flex; flex-direction: column; gap: 1.05rem; padding-top: 0.6rem; }
.pass-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.pass-count { color: var(--fg-text); }
.giant {
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: clamp(1.6rem, calc((100cqw - 34px) / (var(--chars) * 0.82)), 7.4rem);
  line-height: 0.92; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--fg);
  overflow-wrap: anywhere;
}
.giant.name { font-weight: 800; letter-spacing: -0.03em; }
.marks { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 0.2rem; }
.marks li { width: 11px; height: 11px; border: 1.5px solid var(--rule-2); border-radius: 50%; }
.marks .is-done { border-color: var(--fg-mute); background: var(--fg-mute); }
.marks .is-now { border: 3px solid var(--acc); }

/* Quiet private: a card is read at arm's length and must not be readable from across
   the table. Modest type, the upper half of the screen, away from the holding thumb. */
.slot {
  flex: none; display: grid; gap: 0.6rem; margin-top: 0.2rem; padding: 1.15rem 1.15rem 1.05rem;
  border: 1px solid var(--rule-2); border-radius: 18px; background: var(--panel);
}
.slot-row { position: relative; overflow: hidden; }
.slot-label { height: 1.2rem; }
.slot-title { height: 2.75rem; }
.slot-line { height: 1.5rem; }
.slot-help { height: 2.25rem; margin-top: 0.2rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); }
/* THE BAR. Its width belongs to the row, never to the text under it. */
.bar {
  position: absolute; left: 0; top: 50%; width: var(--w); height: 0.72rem; margin-top: -0.36rem;
  border-radius: 2px; background: var(--sand); transform-origin: 50% 0;
}
.slot-title .bar { top: 0.2rem; height: 1.75rem; margin-top: 0; }
.slot-help .bar { top: calc(50% + 0.38rem); }
/* The transition exists only on the way open. Closing is instant: a secret that fades
   out is a secret still on screen. */
.slot[data-open="true"] .bar { transform: translateY(-85%) scaleY(0.06); opacity: 0; transition: transform 0.17s var(--ease), opacity 0.17s linear; }
.slot-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-label .slot-text {
  font-family: var(--font-mono); font-size: calc(0.66rem * var(--mono-k)); line-height: 1.2rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-mute);
}
.slot-title .slot-text {
  max-height: 2.75rem; padding-top: 0.12rem; white-space: normal; text-overflow: clip;
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: clamp(1.25rem, calc((100cqw - 72px) / (var(--chars) * 0.72)), 1.95rem);
  line-height: 1.04; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--fg);
}
.slot-line .slot-text { font-size: clamp(0.7rem, calc((100cqw - 72px) / (var(--chars) * 0.58)), 0.95rem); line-height: 1.5rem; color: var(--fg-text); }
.slot-help .slot-text { font-size: clamp(0.7rem, calc((100cqw - 72px) / (var(--chars) * 0.6)), 0.88rem); line-height: 1.5rem; color: var(--fg-dim); }

.hold { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.85rem; padding: 0.4rem 0 0.5rem; }
/* A thread from the card down to the ring: hold here, and that opens. */
.hold::before { content: ''; flex: 1 1 auto; width: 1px; min-height: 0; background: linear-gradient(to bottom, transparent, var(--rule-2) 55%); }
.hold-ring {
  position: relative; flex: none; width: clamp(116px, 37cqw, 150px); aspect-ratio: 1;
  display: grid; place-items: center; border-radius: 50%;
  /* The browser must not scroll, zoom or open a callout while a finger rests here. */
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.hold-ring .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.hold-ring::before {
  content: ''; position: absolute; inset: 10%; border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; transition: background-color 0.12s linear;
}
.hold-ring.is-holding::before { background: color-mix(in srgb, var(--acc) 15%, transparent); }
.hold-cap {
  position: relative; max-width: 64%; pointer-events: none;
  font-family: var(--font-mono); font-weight: 700; font-size: calc(0.68rem * var(--mono-k));
  line-height: 1.5; text-transform: uppercase; letter-spacing: 0.14em; text-align: center; color: var(--fg-text);
}
.hold-note { font-family: var(--font-mono); font-size: calc(0.68rem * var(--mono-k)); letter-spacing: 0.06em; text-align: center; color: var(--fg-mute); }

/* ---------- 7. Clock, count, flash ---------- */
.clock {
  display: inline-flex; font-family: var(--font-display); font-weight: var(--display-w);
  line-height: 0.86; letter-spacing: 0; color: var(--fg); font-variant-numeric: tabular-nums;
}
/* One fixed cell per character, so the time does not shiver as digits change. */
.clock-d { display: inline-block; width: 0.62em; text-align: center; }
.clock-c { display: inline-block; width: 0.3em; text-align: center; transform: translateY(-0.07em); }
.clock--main { font-size: min(clamp(4rem, 25cqw, 6.8rem), 27cqw); }
.clock--flip { font-size: min(clamp(2.4rem, 13.5cqw, 3.6rem), 15cqw); }
.clock.is-low { color: var(--amber); }
.clock-ctl { flex: none; display: flex; flex-direction: column; gap: 0.4rem; }

/* The light is the clock: it drains with the time left and turns amber for the last
   ten seconds. One transform a second on a plain gradient, nothing blurred live. */
.light {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  --lc: var(--g);
  background: linear-gradient(to top,
    color-mix(in srgb, var(--lc) 30%, transparent) 0%,
    color-mix(in srgb, var(--lc) 11%, transparent) 55%,
    transparent 100%);
  transform-origin: 50% 100%; transition: transform 1s linear;
}
.light.is-low { --lc: var(--amber); }

.screen--count .body { justify-content: center; }
.count { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; text-align: center; }
.count .t-mid { max-width: 16ch; }
.count-ring { position: relative; width: min(72cqw, 320px); aspect-ratio: 1; display: grid; place-items: center; }
.count-ring .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.count-n { position: relative; font-family: var(--font-display); font-weight: var(--display-w); font-size: min(38cqw, 11rem); line-height: 1; color: var(--fg); }

/* The paper flash: the time-up cue for iPhones, which cannot vibrate, and for rooms
   too loud to hear an alarm. */
.flash { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--paper); color: var(--ink); }
.flash-t {
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: min(10rem, calc((100cqw - 40px) / (var(--chars) * var(--char))));
  line-height: 0.9; letter-spacing: var(--display-ls); text-transform: uppercase;
}
/* A game that has turned its own screen on its side (a phone held across a forehead
   with the page still upright) turns the word with it: the long side is the line. */
.flash[data-turn] .flash-t {
  position: absolute; left: 50%; top: 50%; width: 100vh; width: 100dvh; text-align: center;
  font-size: min(10rem, calc((100vh - 40px) / (var(--chars) * var(--char))));
  transform: translate(-50%, -50%) rotate(90deg);
}
.flash[data-turn="ccw"] .flash-t { transform: translate(-50%, -50%) rotate(-90deg); }

/* ---------- 8. Talk, vote, verdict ---------- */
.say { display: flex; flex-direction: column; gap: 1.1rem; padding-top: 1.2rem; }
.verdict { display: block; }
.verdict.is-yes { color: var(--teal); }
.verdict.is-no { color: var(--coral); }

.screen--talk .body { gap: 0.75rem; }
/* The far side of the table reads this copy. */
.talk-flip { flex: none; display: flex; justify-content: center; padding: 0.15rem 0 0.2rem; transform: rotate(180deg); }
.rail-flip { display: none; transform: rotate(180deg); }
.rail-flip .clock--flip { font-size: min(1.9rem, 9cqw); }
/* Below a tall phone the candidates need the room more than the clock does: the far
   side's copy moves into the rail and the controls line up beside the numerals. */
@media (max-height: 800px) {
  .talk-flip { display: none; }
  .rail-flip { display: inline-flex; }
  .screen--talk .clock--main { font-size: min(clamp(3rem, 16cqw, 4.2rem), 17cqw); }
  .screen--talk .talk-time { align-items: center; }
  .screen--talk .clock-ctl { flex-direction: row; }
  .screen--talk .clock-ctl .btn--sm { padding-inline: 0.7rem; font-size: calc(0.66rem * var(--mono-k)); letter-spacing: 0.05em; }
  .screen--talk .wall-list li { padding: 0.16rem 0; }
}
.wall { flex: 1 1 auto; min-height: 6.2rem; display: flex; flex-direction: column; padding-top: 0.7rem; border-top: 1px solid var(--rule); }
.wall .sec-head { flex: none; padding-bottom: 0.45rem; }
.wall-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.wall-scroll::-webkit-scrollbar { display: none; }
.wall-list { columns: 2; column-gap: 1.2rem; font-size: clamp(0.84rem, 3.85cqw, 1rem); line-height: 1.25; color: var(--fg-text); }
.wall-list li { padding: 0.21rem 0; break-inside: avoid; }
.talk-time { flex: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem; padding-top: 0.85rem; border-top: 1px solid var(--rule); }
.talk-clock { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.talk-held { color: var(--amber); }
.talk-time--off { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.idea {
  flex: none; display: flex; align-items: center; gap: 0.8rem;
  min-height: 56px; padding: 0.6rem 1rem; text-align: left;
  border: 1px dashed var(--rule-2); border-radius: 16px;
}
.idea-main { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.idea-q { font-size: 0.98rem; line-height: 1.35; color: var(--fg-text); }
.idea-go { font-size: 1.05rem; color: var(--acc); }

/* ---------- 9. Grid, poster, paused ---------- */
.cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; padding-bottom: 0.4rem; }
.cell {
  min-height: 60px; padding: 0.5rem 0.85rem; text-align: left;
  border: 1px solid var(--rule-2); border-radius: 14px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.2; color: var(--fg-text);
  overflow-wrap: anywhere;
}
.cell.name {
  font-family: var(--font-name); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em;
  /* Sized from the name's length (--chars, 10 when nobody set it) and the width of one
     of two columns, so that fourteen capitals stay whole on a 320 px screen. */
  font-size: clamp(0.72rem, calc((50cqw - 48px) / (var(--chars, 10) * 0.7)), 1.04rem);
}
.cell[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.cells--dense .cell { min-height: 50px; font-size: 0.95rem; }

/* The result, on paper, composed to be screenshotted into the group chat. */
.poster { flex: none; padding: 0.95rem 1rem 0.85rem; border: 1.5px solid var(--ink); border-radius: 6px; }
.poster-top { display: flex; justify-content: space-between; gap: 0.8rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule-2); }
.poster-top .label { white-space: nowrap; letter-spacing: 0.1em; font-size: calc(clamp(0.58rem, 3.2cqw, 0.72rem) * var(--mono-k)); }
/* The kicker may take two lines (Russian ones are long); the round number never breaks. */
.poster-top .label:first-child { min-width: 0; white-space: normal; }
.poster-top .label:last-child { flex: none; }
.poster-h {
  padding: 1.05rem 0 0.9rem;
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: min(5.8rem, calc((100cqw - 68px) / (var(--chars) * var(--char))));
  line-height: 0.88; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--ink);
}
.poster-hl { display: block; width: max-content; }
.poster-why { padding-bottom: 0.95rem; font-family: var(--font-mono); font-size: calc(0.72rem * var(--mono-k)); line-height: 1.5; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-dim); }
.poster-rows { border-top: 1px solid var(--rule-2); }
.poster-rows:empty { display: none; }
.poster-row { display: grid; gap: 0.2rem; padding: 0.7rem 0 0.75rem; border-bottom: 1px solid var(--rule); }
/* With no tally the foot's own rule follows at once: one line there, not two. */
.poster-rows:has(+ .poster-base) .poster-row:last-child { border-bottom: 0; }
.poster-v {
  font-family: var(--font-display); font-weight: var(--display-w);
  font-size: clamp(1.45rem, calc((100cqw - 68px) / (var(--chars) * var(--char))), 2.5rem);
  line-height: 1; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--ink);
  overflow-wrap: anywhere;
}
.poster-v.name { font-weight: 800; letter-spacing: -0.03em; }
.poster-note { color: var(--fg-dim); letter-spacing: 0.1em; }
@container (max-width: 21rem) { .poster-note { letter-spacing: 0.06em; } }
.poster-v + .poster-note { margin-top: 0.2rem; }
.tally { padding: 0.75rem 0 0.1rem; }
.tally-list { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.35rem; }
.tally-list li { display: inline-flex; align-items: baseline; gap: 0.4rem; font-size: 0.92rem; }
.tally-list .name { font-weight: 700; }
.tally-list b { font-family: 'Space Mono', monospace; font-weight: 700; }
/* A spy is marked with the ring, never with a colour. */
.tally-list .is-marked .name::after {
  content: ''; display: inline-block; width: 0.42em; height: 0.42em; margin-left: 0.18em;
  border: 1.5px solid var(--ink); border-radius: 50%; vertical-align: 0.5em;
}
.poster-base { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--rule-2); }
.poster-base .label { font-family: 'Space Mono', monospace; font-size: 0.72rem; text-transform: none; letter-spacing: 0.04em; color: var(--ink); }
.poster-ring { width: 16px; height: 16px; border: 3.5px solid var(--ink); border-radius: 50%; }

.screen--paused .body { justify-content: center; }
/* A closed card, dimmed: all there is to see while a round waits. */
.paused-cover { opacity: 0.3; padding-bottom: 6%; }
.paused-sheet { display: grid; gap: 0.6rem; margin: 0 -6px; padding: 1.35rem 1.1rem 0.8rem; border: 1px solid var(--rule-2); border-radius: 24px; background: var(--panel); }
.paused-sheet .btn-primary { margin-top: 0.7rem; }

/* ---------- 10. Sheets, toast, service screens ---------- */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 430px; max-height: none;
  margin: 0 auto; padding: 0; border: 0; overflow: visible;
  background: transparent; color: var(--text);
}
dialog.sheet::backdrop { background: rgba(5, 7, 12, 0.74); }
.sheet-in {
  display: grid; gap: 0.75rem; max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  padding: 0.7rem 1.1rem max(1rem, env(safe-area-inset-bottom));
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--ink-2);
  /* A sheet is always ink, even over the paper poster. */
  --bg: var(--ink-2); --fg: var(--sand); --fg-text: var(--text); --fg-dim: var(--text-dim); --fg-mute: var(--text-mute);
  --rule: var(--line); --rule-2: var(--line-2); --btn-bg: var(--sand); --btn-fg: var(--ink); --acc: var(--g);
}
.sheet-grip { justify-self: center; width: 38px; height: 4px; margin-bottom: 0.45rem; border-radius: 4px; background: var(--line-2); }
.sheet-title {
  font-family: var(--font-display); font-weight: var(--display-w); font-size: calc(min(2rem, 9cqw) * var(--display-k));
  line-height: 1; letter-spacing: var(--display-ls); text-transform: uppercase; color: var(--fg);
}
.sheet-text { font-size: 1rem; line-height: 1.5; color: var(--fg-dim); }
.sheet-actions { display: grid; gap: 0.5rem; margin-top: 0.45rem; }
.menu { display: grid; border-top: 1px solid var(--rule); }
.sheet-body .rules li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.sheet-body .rules li:last-child { border-bottom: 0; }

.toasts { position: absolute; left: 16px; right: 16px; top: max(72px, calc(env(safe-area-inset-top) + 60px)); z-index: 40; display: flex; justify-content: center; pointer-events: none; }
.toast {
  max-width: 100%; padding: 0.7rem 1.05rem; border-radius: 16px; background: var(--sand); color: var(--ink);
  font-family: var(--font-mono); font-size: calc(0.72rem * var(--mono-k)); line-height: 1.45; letter-spacing: 0.04em; text-align: center;
}
dialog .toast { position: absolute; left: 50%; bottom: calc(100% + 0.8rem); width: max-content; max-width: calc(100% - 32px); transform: translateX(-50%); }

.note { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: auto 0; padding-bottom: 12%; }
.note-ring { width: 56px; height: 56px; border: 2px solid var(--rule-2); border-top-color: var(--acc); border-radius: 50%; }

/* ---------- 11. Motion ---------- */
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
@keyframes slide-back { from { transform: translateX(-30px); opacity: 0; } }
@keyframes bar-lift { 0%, 30% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes ring-draw { from { transform: scale(0.4); opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .screen.is-entering { animation: slide-in 0.19s var(--ease) both; }
  .screen.is-entering-back { animation: slide-back 0.19s var(--ease) both; }
  /* The hub opens the way a card does: each line of the headline is a bar that lifts. */
  .hero-title .line::after {
    content: ''; position: absolute; inset: 0.07em -0.03em 0.03em; background: var(--sand);
    transform-origin: 50% 0; transform: scaleY(0); animation: bar-lift 0.62s var(--ease) both;
  }
  .hero-title .line:nth-child(2)::after { animation-delay: 0.09s; }
  .hero-title .line:nth-child(3)::after { animation-delay: 0.18s; }
  .hero-title .deg { animation: ring-draw 0.4s var(--ease) 0.55s both; }
  /* Once is enough: coming back from a game must not replay the opening. */
  html.tvg-played .hero-title .line::after, html.tvg-played .hero-title .deg { animation: none; }
}
/* A private screen never animates: nothing of the last card may linger in a transition. */
.stage[data-private] .screen { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 12. Short screens and wide screens ---------- */
/* A phone on its side, or text at 200%: stop pinning the foot and let the whole
   screen scroll. Nothing is clipped; the primary action is simply further down. */
@media (max-height: 540px) {
  .screen { display: block; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .screen::-webkit-scrollbar { display: none; }
  .body { overflow: visible; }
  .foot { padding-top: 1rem; }
  /* The foot is no longer pinned here: its fade would only dim the end of the list. */
  .foot::before { display: none !important; }
  .deco { display: none; }
  .wall { min-height: 0; }
  .wall-scroll { overflow: visible; }
  .wall-list { columns: 4; }
  .note { margin: 2rem 0; padding-bottom: 0; }
  .screen--card .body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; column-gap: 1.5rem; }
  .screen--card .hold { padding: 0; justify-content: center; }
  .count-ring { width: min(46cqw, 44vh); }
  .count-n { font-size: min(22cqw, 22vh); }
  .cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cell.name { font-size: clamp(0.72rem, calc((25cqw - 41px) / (var(--chars, 10) * 0.7)), 1.04rem); }
  .paused-cover { display: none; }
}
/* A phone on its side has the width for two panes: candidates left, clock and
   decisions right. */
@media (max-height: 540px) and (min-width: 640px) {
  .screen--talk { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 1.5rem; align-content: start; }
  .screen--talk .rail { grid-column: 1 / -1; }
  .screen--talk .body { display: contents; }
  .screen--talk .wall { grid-column: 1; grid-row: 2 / span 3; }
  .screen--talk .wall-list { columns: 3; }
  .screen--talk .talk-time { grid-column: 2; grid-row: 2; }
  .screen--talk .idea { grid-column: 2; grid-row: 3; margin-top: 0.75rem; }
  .screen--talk .foot { grid-column: 2; grid-row: 4; padding-top: 0.75rem; }
}
@media (max-height: 540px) and (max-width: 520px) {
  .wall-list { columns: 2; }
  .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell.name { font-size: clamp(0.72rem, calc((50cqw - 48px) / (var(--chars, 10) * 0.7)), 1.04rem); }
  .screen--card .body { display: flex; }
}

/* Wide screens: the game runs in a phone-wide column, centred. Not a big phone on its
   side, which is wider than 900 px too: that one keeps the whole width, like every
   other phone held that way. */
@media (min-width: 900px) and (min-height: 541px) {
  .stage { background: radial-gradient(60% 70% at 50% 0%, #131a26 0%, var(--ink) 70%); }
  .stage-col { max-width: 430px; border-inline: 1px solid var(--line); }
  .screen { padding-inline: 20px; }
  .deco { margin-inline: -20px; }
}
