:root {
  color-scheme: light;
  --paper: oklch(97.6% 0.011 25); --paper-2: oklch(94% 0.017 25); --paper-3: oklch(90% 0.024 25);
  --ink: oklch(26% 0.03 15); --ink-2: oklch(41% 0.03 15); --muted: oklch(53% 0.025 15);
  --rule: oklch(88% 0.024 20);
  --accent: oklch(66% 0.17 8); --accent-soft: oklch(93.5% 0.04 8); --accent-ink: oklch(36% 0.11 8);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --radius: 18px; --pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --t-sm: 0.875rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.6rem; --t-2xl: 2.2rem; --t-3xl: 3rem; --t-count: 7rem;
  --dur: 140ms; --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --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);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink); font: 400 var(--t-md)/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: clip; }
h1, h2, p, ol, ul { margin: 0; }
h1, h2 { font-weight: 800; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; overflow-wrap: break-word; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.noscript { padding: var(--s-5); }

.page { max-width: var(--page); margin-inline: auto; padding: calc(var(--s-6) + var(--safe-t)) calc(var(--s-4) + var(--safe-r)) calc(var(--s-6) + var(--safe-b)) calc(var(--s-4) + var(--safe-l)); }
.page--stage { min-height: 100dvh; display: flex; flex-direction: column; gap: var(--s-4); padding-top: calc(var(--s-5) + var(--safe-t)); }

.masthead h1 { font-size: var(--t-3xl); }
.masthead h1::after { content: ""; display: inline-block; width: 0.2em; height: 0.2em; margin-left: 0.08em; border-radius: 50%; background: var(--accent); }
.lead { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-lg); line-height: 1.35; max-width: 30ch; text-wrap: pretty; }

.block { margin-top: var(--s-6); }
.label { display: block; margin-bottom: var(--s-2); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.note { font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; }
.block > .note { margin-top: var(--s-2); }
.note:empty { display: none; }
.foot { margin-top: var(--s-5); display: grid; gap: var(--s-2); font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; }
.foot .quiet { color: var(--ink-2); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: var(--s-2) var(--s-5); border: 0; border-radius: var(--pill); background: var(--paper-2); color: var(--ink); font-weight: 600; font-size: var(--t-md); cursor: pointer; touch-action: manipulation; transition: background-color var(--dur) linear, transform var(--dur) var(--ease); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--quiet { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn--wide { width: 100%; }
.btn--big { min-height: 60px; font-size: var(--t-lg); }
.start { margin-top: var(--s-6); }
.link { align-self: flex-start; background: none; border: 0; min-height: 44px; padding: var(--s-2) 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.25em; cursor: pointer; }

/* chips and the two-way switch */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { min-height: 44px; padding: var(--s-2) var(--s-4); border: 0; border-radius: var(--pill); background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); font-weight: 600; color: var(--ink-2); cursor: pointer; touch-action: manipulation; transition: background-color var(--dur) linear, color var(--dur) linear; }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip[aria-pressed="true"]::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-right: 0.45em; border-radius: 50%; background: var(--accent); vertical-align: 0.08em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--paper-2); }
.seg button { min-height: 48px; padding: var(--s-1) var(--s-3); border: 0; border-radius: var(--pill); background: transparent; font-weight: 600; color: var(--ink-2); cursor: pointer; touch-action: manipulation; line-height: 1.2; }
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px oklch(30% 0.03 15 / 0.12); }

.players { list-style: none; padding: 0; display: grid; gap: var(--s-2); margin: var(--s-4) 0 var(--s-2); counter-reset: p; }
.player { display: flex; align-items: center; gap: var(--s-2); counter-increment: p; }
.player::before { content: counter(p); width: 1.4em; flex: none; text-align: right; font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.player input { flex: 1; min-width: 0; min-height: 48px; padding: var(--s-2) var(--s-4); border: 0; border-radius: var(--pill); background: var(--paper-2); font-size: var(--t-md); }
.player input:focus { background: var(--paper); box-shadow: inset 0 0 0 2px var(--accent); outline: none; }
.player input::placeholder { color: var(--muted); }
.remove { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.remove:disabled { visibility: hidden; }

/* game screens */
.topline { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 44px; margin-top: calc(var(--s-3) * -1); }
.step { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.kicker { font-size: var(--t-lg); font-weight: 600; color: var(--ink-2); margin-top: var(--s-2); }
.prompt { font-size: var(--t-2xl); margin-top: calc(var(--s-3) * -1); }
.prompt.long { font-size: var(--t-xl); line-height: 1.12; }
.prompt--small, .prompt--small.long { font-size: var(--t-xl); line-height: 1.12; }
.name { font-size: var(--t-3xl); margin-top: calc(var(--s-3) * -1); overflow-wrap: anywhere; }
.page--stage > .btn--big, .stack { margin-top: auto; }
.stack { display: grid; gap: var(--s-2); padding-top: var(--s-2); }

.count-wrap { flex: 1; display: flex; min-height: 13rem; }
.count { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); padding: var(--s-4); border: 0; border-radius: var(--radius); background: var(--paper-2); color: var(--ink); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background-color var(--dur) linear; }
.count__big { font-size: var(--t-count); font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.count__sub { font-size: var(--t-lg); font-weight: 600; color: var(--ink-2); }
#card[data-state="ready"] .count__big { color: var(--accent); }
#card[data-state="count"] .count { background: var(--accent-soft); color: var(--accent-ink); cursor: default; }
#card[data-state="count"] .count__big { animation: pop 900ms var(--ease) both; }
#card[data-state="point"] .count { background: var(--accent); color: oklch(99% 0.005 25); cursor: default; }
#card[data-state="point"] .count__big { font-size: calc(var(--t-count) * 0.8); animation: pop 500ms var(--ease) both; }
#card[data-state="point"] .count__sub { color: inherit; opacity: 0.9; }
@keyframes pop { from { transform: scale(1.35); opacity: 0.2; } 40% { transform: scale(1); opacity: 1; } }

.rule { padding: var(--s-4) var(--s-5); border-radius: var(--radius); background: var(--paper-2); color: var(--ink-2); text-wrap: pretty; }
.rule__head { font-size: var(--t-lg); font-weight: 800; color: var(--ink); }
.scale { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); margin-top: var(--s-3); }
.scale li { display: grid; justify-items: center; padding: var(--s-2) var(--s-1); border-radius: 12px; background: var(--paper); line-height: 1.2; }
.scale b { font-size: var(--t-xl); font-weight: 800; color: var(--accent-ink); }
.scale span { font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
#card[data-state="point"] .count-wrap { flex: none; min-height: 9rem; }

.vote-start { display: grid; gap: var(--s-3); margin-top: auto; }
.vote-start:not([hidden]) ~ .stack { margin-top: 0; }

/* voting */
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.pick { min-height: 60px; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--radius); background: var(--paper-2); font-weight: 600; font-size: var(--t-lg); line-height: 1.15; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation; }
.pick[aria-checked="true"] { background: var(--accent); color: oklch(99% 0.005 25); }

/* reveal */
.outcome { font-size: var(--t-lg); font-weight: 600; line-height: 1.35; padding: var(--s-4) var(--s-5); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); text-wrap: pretty; }
.bars { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.bars li { display: grid; grid-template-columns: minmax(4.5rem, 38%) 1fr 1.6rem; align-items: center; gap: var(--s-3); min-height: 32px; }
.bars .who { font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .track { height: 22px; border-radius: var(--pill); background: var(--paper-2); overflow: hidden; }
.bars .fill { display: block; height: 100%; min-width: 0; border-radius: var(--pill); background: oklch(82% 0.05 15); transform-origin: left; animation: grow 600ms var(--ease) both; }
.bars .top .fill { background: var(--accent); }
.bars .n { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.bars .zero { color: var(--muted); }
.bars .zero .who { font-weight: 400; }
@keyframes grow { from { transform: scaleX(0); } }

@media (hover: hover) {
  .btn:hover { background: var(--paper-3); }
  .btn--primary:hover { background: var(--ink-2); }
  .btn--quiet:hover { background: var(--paper-2); }
  .link:hover { color: var(--ink); }
  .chip:not([aria-pressed="true"]):hover { background: var(--paper-2); }
  .player input:hover { background: var(--paper-3); }
  .remove:hover { background: var(--paper-2); color: var(--ink); }
  .count:hover { background: var(--paper-3); }
  .pick:not([aria-checked="true"]):hover { background: var(--paper-3); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 22.5rem) { :root { --t-3xl: 2.5rem; --t-2xl: 1.9rem; --t-xl: 1.4rem; --t-count: 5.6rem; } }
@media (max-height: 640px) { .count-wrap { min-height: 10rem; } }

/* 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; }
