:root {
  color-scheme: light;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.44rem; --text-2xl: 1.728rem; --text-3xl: 2.074rem;
  --text-display-s: 1.44rem; --text-display: 1.728rem; --text-section: 1.2rem; --text-title: 1rem; --text-lead: 1.25rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 140ms; --dur-short: 220ms; --dur-long: 420ms;
  --color-error: oklch(55% 0.18 30); --color-success: oklch(52% 0.12 155);
  --container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
  --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
  /* warm off-white, one apricot accent: a sibling of the other games, not a clone */
  --color-paper: oklch(97.5% 0.012 75); --color-paper-2: oklch(93.5% 0.022 72); --color-paper-3: oklch(88.5% 0.034 70);
  --color-ink: oklch(25% 0.03 50); --color-ink-2: oklch(38% 0.03 50); --color-muted: oklch(50% 0.03 55);
  --color-rule: oklch(89% 0.025 70); --color-accent: oklch(78% 0.13 62); --color-accent-soft: oklch(92% 0.06 70); --color-accent-2: oklch(58% 0.17 35);
  --color-accent-ink: oklch(30% 0.08 50); --color-focus: oklch(45% 0.12 45);
  --color-good: oklch(90% 0.08 150); --color-good-ink: oklch(32% 0.08 155);
  --font-display: "Outfit", system-ui, sans-serif; --font-body: "Outfit", system-ui, sans-serif;
  --font-outlier: var(--font-body);
  --radius-card: 18px; --radius-pill: 999px; --rule-hair: 1px; --rule-bar: 1.5px; --shadow-card: none;
  --tracking-display: -0.02em; --display-weight: 800;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
/* photographs: natural vib=20 con=10 */
[data-slot] > img { filter: saturate(1.1) contrast(1.1); }

:root {
  --text-logo: 3.2rem; --text-title: 2.4rem; --text-row: 1.15rem; --text-count: 40vmin; --page: 30rem;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
.noscript { padding: var(--space-lg); }

.page { max-width: var(--page); margin-inline: auto; padding: calc(var(--space-xl) - var(--space-xs) + var(--safe-t)) calc(var(--space-md) + var(--safe-r)) calc(var(--space-2xl) - var(--space-md) + var(--safe-b)) calc(var(--space-md) + var(--safe-l)); }
.masthead h1 { font-size: var(--text-logo); line-height: 1; max-width: none; }
.masthead h1::after { content: ""; display: inline-block; width: 0.22em; height: 0.22em; margin-left: 0.06em; border-radius: 50%; background: var(--color-accent); }
.masthead .lead { margin-top: var(--space-xs); color: var(--color-ink-2); line-height: 1.35; max-width: 34ch; }
.how { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-md) 0 0; padding: 0; font-size: var(--text-sm); }
.how li { padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink-2); }
.how b { font-weight: 600; color: var(--color-ink); margin-right: var(--space-2xs); }
.title { font-size: var(--text-title); max-width: none; margin-top: var(--space-xs); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: var(--space-xs) var(--space-lg); border: 0; border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font: 600 var(--text-md)/1.1 var(--font-body); cursor: pointer; transition: background-color var(--dur-micro) linear, transform var(--dur-micro) var(--ease-out); touch-action: manipulation; }
.btn:hover { background: var(--color-paper-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--color-ink); color: var(--color-paper); }
.btn--primary:hover { background: var(--color-ink-2); }
.btn--wide { width: 100%; }
.btn--big { min-height: 60px; font-size: var(--text-lg); }
.link { background: none; border: 0; padding: var(--space-xs) 0; min-height: 44px; color: var(--color-ink-2); font: 600 var(--text-sm)/1.2 var(--font-body); text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; text-underline-offset: 0.25em; cursor: pointer; }
.link:hover { color: var(--color-ink); }
.link:active { color: var(--color-muted); }

.quick { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); margin-top: var(--space-lg); }
.field { display: block; margin-top: var(--space-lg); font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.field span { display: block; margin-bottom: var(--space-xs); }
.field input, .field textarea { width: 100%; min-height: 48px; padding: var(--space-sm) var(--space-md); border: 0; border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font-size: var(--text-md); font-weight: 400; }
.field textarea { border-radius: var(--radius-card); line-height: 1.5; }
.field input:hover, .field textarea:hover { background: var(--color-paper-3); }
.field input:focus, .field textarea:focus { outline: none; background: var(--color-paper); box-shadow: inset 0 0 0 2px var(--color-accent); }
.empty, .error { margin-top: var(--space-md); }
.error { color: var(--color-error); font-weight: 600; }

.deckgroup { margin-top: var(--space-xl); }
.deckgroup h3 { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0; color: var(--color-ink-2); margin-bottom: var(--space-xs); max-width: none; }
.deck { display: flex; width: 100%; align-items: baseline; gap: var(--space-sm); min-height: 52px; margin-top: 2px; padding: var(--space-sm) var(--space-md); background: var(--color-paper-2); border: 0; border-radius: 12px; color: var(--color-ink); text-align: left; cursor: pointer; transition: background-color var(--dur-micro) linear; touch-action: manipulation; }
.deck:hover { background: var(--color-paper-3); }
.deck:active { background: var(--color-accent-soft); }
.deck b { flex: 1; min-width: 0; font: 600 var(--text-row)/1.2 var(--font-body); overflow-wrap: break-word; }
.deck small { font-size: var(--text-sm); color: var(--color-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.foot { margin-top: var(--space-xl); font-size: var(--text-sm); color: var(--color-muted); }

.group { border: 0; margin: var(--space-lg) 0 0; padding: 0; min-width: 0; }
.group legend { padding: 0; margin-bottom: var(--space-xs); font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2xs); padding: var(--space-2xs); border-radius: var(--radius-pill); background: var(--color-paper-2); }
.segments button { min-height: 44px; padding: var(--space-2xs); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-ink); font: 600 var(--text-md)/1 var(--font-body); cursor: pointer; touch-action: manipulation; transition: background-color var(--dur-micro) linear; }
.segments button:hover { background: var(--color-paper-3); }
.segments button[aria-pressed="true"] { background: var(--color-paper); box-shadow: 0 1px 3px oklch(25% 0.03 50 / 0.14); }
.toggles { margin: var(--space-lg) 0; }
.toggle { display: flex; align-items: center; gap: var(--space-sm); min-height: 48px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--color-ink); flex: none; margin: 0; }

.stage { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--color-paper); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stage[data-rot] { inset: auto; left: 50%; top: 50%; width: 100dvh; height: 100dvw; }
.stage[data-rot="cw"] { transform: translate(-50%, -50%) rotate(90deg); }
.stage[data-rot="ccw"] { transform: translate(-50%, -50%) rotate(-90deg); }
.fill { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--space-xs) + var(--safe-t)) calc(var(--space-md) + var(--safe-r)) calc(var(--space-xs) + var(--safe-b)) calc(var(--space-md) + var(--safe-l)); }
.center { align-items: center; justify-content: center; text-align: center; gap: var(--space-sm); }
.prep-title { font-size: var(--text-title); max-width: none; }
.prep-team { font: 800 var(--text-2xl)/1 var(--font-display); color: var(--color-accent-2); }
.prep-actions { display: flex; gap: var(--space-xs); margin-top: var(--space-sm); align-items: center; }
.count { font: 800 var(--text-count)/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-display); }

.clock { display: flex; justify-content: space-between; align-items: center; font: 800 var(--text-2xl)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.clock.low { color: var(--color-accent-2); }
.bar { height: 6px; border-radius: var(--radius-pill); overflow: hidden; background: var(--color-paper-3); margin-top: var(--space-2xs); }
.bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--color-accent); transform-origin: left; }
.wordbox { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.word { width: 100%; text-align: center; font: 800 2rem/1 var(--font-display); letter-spacing: var(--tracking-display); overflow-wrap: normal; text-wrap: balance; }
.zones { display: flex; justify-content: space-between; gap: var(--space-md); }
.zone { min-width: 88px; min-height: 44px; padding: var(--space-xs) var(--space-md); border: 0; border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font: 600 var(--text-md)/1 var(--font-body); cursor: pointer; touch-action: manipulation; transition: background-color var(--dur-micro) linear; }
.zone:hover { background: var(--color-paper-3); }
.zone:active { background: var(--color-accent-soft); }
.zones.full { position: absolute; inset: 0; top: 56px; gap: 0; }
.zones.full .zone { flex: 1; min-height: 0; background: transparent; border-radius: 0; display: flex; align-items: flex-end; padding: calc(var(--space-sm) + var(--safe-b)) var(--space-lg); color: var(--color-muted); }
.zones.full .zone--good { justify-content: flex-end; }
.zones.full .zone:active { background: var(--color-paper-2); }
.flash { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 var(--text-count)/1 var(--font-display); letter-spacing: var(--tracking-display); }
.flash.good { background: var(--color-good); color: var(--color-good-ink); }
.flash.pass { background: var(--color-accent-2); color: var(--color-paper); }
.flash.end { background: var(--color-ink); color: var(--color-paper); }

.board { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; gap: 2px; }
.board li { display: flex; justify-content: space-between; align-items: baseline; min-height: 44px; padding: var(--space-xs) var(--space-md); border-radius: 12px; background: var(--color-paper-2); font: 600 var(--text-row)/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
.board li.lead-team { background: var(--color-accent-soft); }
.board li.now { box-shadow: inset 0 0 0 2px var(--color-accent); }
.hint { margin-top: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); }
.words { list-style: none; margin: var(--space-xs) 0 var(--space-lg); padding: 0; display: grid; gap: 2px; }
.words button { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); width: 100%; min-height: 48px; padding: var(--space-xs) var(--space-md); background: var(--color-paper-2); border: 0; border-radius: 12px; color: var(--color-ink); text-align: left; font-size: var(--text-md); cursor: pointer; touch-action: manipulation; transition: background-color var(--dur-micro) linear; }
.words button:hover { background: var(--color-paper-3); }
.words button[data-good="true"] { background: var(--color-good); color: var(--color-good-ink); font-weight: 600; }
.words small { font-size: var(--text-sm); white-space: nowrap; }
.res-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }

@media (max-width: 22rem) { :root { --text-logo: 2.6rem; --text-title: 2rem; } }
@media (prefers-reduced-motion: reduce) { .btn, .deck, .zone, .segments button, .words button { transition: none; } }

/* back to games.el.zone, on the home screen only */
.back-home { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; min-height: 44px; margin: -12px 0 4px -6px; padding: 0 10px 0 4px; border-radius: 999px; color: inherit; opacity: 0.6; font-size: 0.875rem; font-weight: 600; line-height: 1; text-decoration: none; transition: opacity 140ms linear; }
.back-home:hover, .back-home:focus-visible { opacity: 1; }
.back-home svg { flex: none; }
