:root {
  color-scheme: light;
  --paper: oklch(97.6% 0.012 85); --paper-2: oklch(93.8% 0.018 85); --paper-3: oklch(89.5% 0.024 85);
  --ink: oklch(25% 0.025 60); --ink-2: oklch(40% 0.025 60); --muted: oklch(52% 0.022 60);
  --rule: oklch(88% 0.022 80);
  --accent: oklch(70% 0.14 158); --accent-soft: oklch(93% 0.05 158); --accent-ink: oklch(30% 0.07 158);
  --wait: oklch(90% 0.055 60); --wait-ink: oklch(38% 0.07 55);
  --go: oklch(78% 0.16 155); --go-ink: oklch(24% 0.06 155);
  --early: oklch(89% 0.06 25); --early-ink: oklch(45% 0.15 25);
  --font: "Outfit", 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.4rem; --t-3xl: 3.2rem; --t-pad: 4.4rem;
  --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.02; letter-spacing: -0.02em; 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-7) + 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.22em; height: 0.22em; margin-left: 0.06em; border-radius: 50%; background: var(--go); }
.lead { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-lg); line-height: 1.35; max-width: 32ch; 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; }
.foot { margin-top: var(--s-6); font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; }

.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:hover { background: var(--paper-3); }
.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--primary:hover { background: var(--ink-2); }
.btn--quiet { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn--quiet:hover { background: var(--paper-2); }
.btn--wide { width: 100%; }
.btn--big { min-height: 60px; font-size: var(--t-lg); }
.block .btn--big { margin-top: var(--s-3); }
.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; }
.link:hover { color: var(--ink); }

.panel { padding: var(--s-4) var(--s-5); border-radius: var(--radius); background: var(--paper-2); }
.panel__stat { font-weight: 600; color: var(--ink-2); text-wrap: pretty; }
.panel .label { margin-bottom: var(--s-3); }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: var(--s-3); }
.panel .label + .spark { margin-top: 0; }
.spark span { flex: 1; max-width: 28px; min-height: 6px; border-radius: 6px 6px 3px 3px; background: oklch(84% 0.03 80); }
.spark span.now { background: var(--accent); }

.players { list-style: none; padding: 0; display: grid; gap: var(--s-2); margin-bottom: 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:hover { background: var(--paper-3); }
.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:hover { background: var(--paper-2); color: var(--ink); }
.remove:disabled { visibility: hidden; }
#players-note:empty { display: none; }
#players-note { margin-top: var(--s-2); }

/* pass */
.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-sm); font-weight: 600; color: var(--ink-2); margin-top: var(--s-3); }
.name { font-size: var(--t-3xl); margin-top: calc(var(--s-3) * -1); overflow-wrap: anywhere; }
.page--stage > .btn--big { margin-top: auto; }

/* the pad: the whole screen is the button. No transitions here, the change to green must be instant. */
.pad { position: fixed; inset: 0; display: flex; flex-direction: column; padding: calc(var(--s-2) + var(--safe-t)) calc(var(--s-4) + var(--safe-r)) calc(var(--s-6) + var(--safe-b)) calc(var(--s-4) + var(--safe-l)); background: var(--wait); color: var(--wait-ink); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.pad__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%; max-width: var(--page); margin-inline: auto; }
.pad .link, .pad .step { color: inherit; }
.pad .link { text-decoration-color: currentColor; }
.pad__body { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--s-3); text-align: center; }
.pad__word { font-size: var(--t-pad); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pad__sub { min-height: 1.5em; font-size: var(--t-lg); font-weight: 600; max-width: 22ch; text-wrap: balance; opacity: 0.85; }
.pad__tries { list-style: none; padding: 0; display: flex; justify-content: center; gap: var(--s-2); }
.pad__tries li { min-width: 52px; height: 32px; padding: 0 var(--s-2); display: grid; place-items: center; border-radius: var(--pill); box-shadow: inset 0 0 0 1.5px currentColor; font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0.5; }
.pad__tries li.done { opacity: 1; background: oklch(100% 0 0 / 0.45); box-shadow: none; }
.pad[data-state="go"] { background: var(--go); color: var(--go-ink); }
.pad[data-state="early"] { background: var(--early); color: var(--early-ink); }
.pad[data-state="shown"], .pad[data-state="paused"] { background: var(--paper); color: var(--ink); }
.pad[data-state="shown"] .pad__tries li.done { background: var(--paper-2); }
.pad[data-state="go"] .pad__sub, .pad[data-state="go"] .pad__tries { visibility: hidden; }

/* results */
.big { font-size: var(--t-pad); margin-top: calc(var(--s-3) * -1); font-variant-numeric: tabular-nums; }
.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(--paper-2); color: var(--ink-2); text-wrap: pretty; }
.outcome.good { background: var(--accent-soft); color: var(--accent-ink); }
.times, .ranking { list-style: none; padding: 0; display: grid; gap: 2px; }
.times li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); min-height: 40px; padding: var(--s-2) var(--s-4); border-radius: 10px; background: var(--paper-2); font-variant-numeric: tabular-nums; }
.times li b { font-weight: 800; }
.times li.top { background: var(--accent-soft); color: var(--accent-ink); }
.ranking li { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: var(--s-2) var(--s-4); border-radius: 12px; background: var(--paper-2); font-variant-numeric: tabular-nums; }
.ranking li.top { background: var(--accent-soft); }
.ranking .rank { width: 1.2em; flex: none; font-weight: 800; color: var(--muted); }
.ranking .who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ranking .who > b { font-weight: 600; overflow-wrap: anywhere; line-height: 1.2; }
.ranking .meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.ranking .tap { font-size: var(--t-sm); color: var(--muted); }
.ranking .tap.fast { padding: 0 var(--s-2); border-radius: var(--pill); background: var(--go); color: var(--go-ink); font-weight: 600; }
.ranking .avg { flex: none; font-size: var(--t-lg); font-weight: 800; }
.stack { display: grid; gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 22rem) { :root { --t-3xl: 2.6rem; --t-2xl: 2rem; --t-pad: 3.6rem; } }

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