:root {
  color-scheme: light;
  --paper: oklch(97.4% 0.011 30); --paper-2: oklch(94% 0.016 28); --paper-3: oklch(90.5% 0.022 26);
  --card: oklch(99.4% 0.004 30);
  --ink: oklch(26% 0.03 10); --ink-2: oklch(41% 0.03 10); --muted: oklch(53% 0.025 15);
  --rule: oklch(89% 0.02 20);
  --accent: oklch(66% 0.16 8); --accent-soft: oklch(93.5% 0.04 8); --accent-ink: oklch(42% 0.13 8);
  --twist: oklch(92% 0.065 75); --twist-ink: oklch(38% 0.08 60);
  --font: "Nunito", 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-3xl: 3.2rem;
  --dur: 160ms; --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: 500 var(--t-md)/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: clip; }
h1, h2, p { margin: 0; }
h1 { font-weight: 900; line-height: 1; letter-spacing: -0.025em; text-wrap: balance; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.noscript { padding: var(--s-5); }

/* home */
.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)); }
.masthead h1 { font-size: var(--t-3xl); }
.masthead h1::after { content: ""; display: inline-block; width: 0.2em; height: 0.2em; margin-left: 0.06em; border-radius: 50%; background: var(--accent); }
.lead { margin-top: var(--s-3); 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-3); font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.note { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; font-variant-numeric: tabular-nums; }
.note.warn { color: var(--accent-ink); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 48px; padding: var(--s-2) var(--s-4) var(--s-2) var(--s-3); border: 0; border-radius: var(--pill); background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); color: var(--ink-2); font-weight: 700; cursor: pointer; touch-action: manipulation; transition: background-color var(--dur) linear, box-shadow var(--dur) linear, color var(--dur) linear; }
.chip::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rule); background: var(--card) no-repeat center / 12px 12px; transition: background-color var(--dur) linear; }
.chip:hover { background: var(--paper-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); box-shadow: none; color: var(--accent-ink); }
.chip[aria-pressed="true"]::before { box-shadow: none; background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.2 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.chip small { font-size: var(--t-sm); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.75; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: var(--s-2) var(--s-5); border: 0; border-radius: var(--pill); background: var(--paper-2); font-weight: 800; 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--primary:hover:not(:disabled) { background: var(--ink-2); }
.btn--wide { width: 100%; }
.btn--big { min-height: 64px; font-size: var(--t-xl); }
#start { margin-top: var(--s-5); }
.link { background: none; border: 0; min-height: 44px; padding: var(--s-2) 0; font-size: var(--t-sm); font-weight: 700; 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); }
.foot { margin-top: var(--s-6); display: grid; gap: var(--s-2); justify-items: start; font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; }
.foot .quiet { font-weight: 700; color: var(--ink-2); }

/* play: the whole screen is the button */
.table { position: fixed; inset: 0; display: flex; flex-direction: column; gap: var(--s-3); max-width: var(--page); margin-inline: auto; padding: calc(var(--s-2) + var(--safe-t)) calc(var(--s-4) + var(--safe-r)) calc(var(--s-4) + var(--safe-b)) calc(var(--s-4) + var(--safe-l)); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.table__top, .table__bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 48px; }
.count { font-size: var(--t-sm); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.card { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-4); border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 0 var(--rule), 0 10px 30px -18px oklch(40% 0.08 10 / 0.35); }
.card__kicker { font-size: var(--t-xl); font-weight: 800; line-height: 1.15; color: var(--accent-ink); }
.card__fit { flex: 1; min-height: 0; display: flex; align-items: center; overflow: hidden; }
.card__text { width: 100%; font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: normal; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; font-size: var(--t-md); font-weight: 700; color: var(--ink-2); }
.card__pack { padding: 2px var(--s-3); border-radius: var(--pill); background: var(--paper-2); font-size: var(--t-sm); color: var(--muted); }
.card__pack:empty { display: none; }
.card.twist { background: var(--twist); color: var(--twist-ink); box-shadow: none; }
.card.twist .card__kicker, .card.twist .card__foot { color: var(--twist-ink); }
.card.in { animation: card-in 220ms var(--ease); }
.card.back { animation: card-back 220ms var(--ease); }
@keyframes card-in { from { opacity: 0.2; transform: translateX(28px) rotate(1deg); } }
@keyframes card-back { from { opacity: 0.2; transform: translateX(-28px) rotate(-1deg); } }

.round { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.round:hover:not(:disabled) { background: var(--paper-3); }
.round:disabled { opacity: 0.35; cursor: default; }
.tap-hint { line-height: 1.3; text-wrap: balance; font-size: var(--t-sm); font-weight: 700; color: var(--muted); text-align: right; }
.tap-hint.news { color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 22.5rem) { :root { --t-3xl: 2.7rem; --t-xl: 1.4rem; } .card { padding-inline: var(--s-4); } }
@media (min-width: 40rem) { .table { padding-top: calc(var(--s-5) + var(--safe-t)); padding-bottom: calc(var(--s-6) + var(--safe-b)); } }

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