:root {
  color-scheme: light;
  --paper: oklch(98% 0.007 320); --paper-2: oklch(94.5% 0.014 318); --paper-3: oklch(90.5% 0.022 316);
  --ink: oklch(26% 0.035 310); --ink-2: oklch(40% 0.035 310); --muted: oklch(52% 0.03 312);
  --rule: oklch(88.5% 0.02 316);
  --accent: oklch(60% 0.15 312); --accent-soft: oklch(93% 0.035 312); --accent-ink: oklch(36% 0.1 312);
  --balloon: oklch(74% 0.14 352); --balloon-deep: oklch(60% 0.15 352);
  --font: "Baloo 2", 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.9rem; --t-md: 1.05rem; --t-lg: 1.25rem; --t-xl: 1.55rem; --t-2xl: 2.1rem; --t-3xl: 3.2rem;
  --dur: 140ms; --ease: cubic-bezier(0.16, 1, 0.3, 1); --spring: cubic-bezier(0.34, 1.56, 0.64, 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.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: clip; transition: background-color 200ms linear; }
body.is-caught { background: var(--balloon); }
h1, h2, h3, p, ol, ul, fieldset { margin: 0; }
h1, h2 { font-weight: 800; line-height: 1; letter-spacing: -0.01em; 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-3); padding-top: calc(var(--s-2) + var(--safe-t)); padding-bottom: calc(var(--s-5) + var(--safe-b)); }

.masthead { position: relative; padding-right: 64px; }
.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); }
.mini { position: absolute; top: -6px; right: 4px; transform-origin: 50% 80%; animation: drift 4s ease-in-out infinite; }
.lead { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-lg); line-height: 1.32; max-width: 30ch; text-wrap: pretty; }

.block { border: 0; padding: 0; min-width: 0; margin-top: var(--s-6); }
.label { display: block; padding: 0; margin-bottom: var(--s-2); font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.label .opt { font-weight: 500; color: var(--muted); }
.note { font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; }
.note:not(:empty) { margin-top: var(--s-2); }

.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: 700; font-size: var(--t-md); line-height: 1.2; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background-color var(--dur) linear, opacity var(--dur) linear, transform var(--dur) var(--ease); }
.btn:hover { background: var(--paper-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--ink-2); }
.btn--primary:disabled:hover { background: var(--ink); }
.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); }
.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); }

.players { list-style: none; padding: 0; display: grid; gap: var(--s-2); counter-reset: p; }
.players:not(:empty) { margin-bottom: var(--s-2); }
.player { display: flex; align-items: center; gap: var(--s-2); counter-increment: p; }
.player::before { content: counter(p); width: 1.6em; 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); }

.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-1); padding: var(--s-1); border-radius: var(--pill); background: var(--paper-2); }
.segments button { min-height: 44px; padding: var(--s-1) var(--s-2); border: 0; border-radius: var(--pill); background: transparent; font-weight: 700; cursor: pointer; touch-action: manipulation; transition: background-color var(--dur) linear; }
.segments button:hover { background: var(--paper-3); }
.segments button[aria-pressed="true"] { background: var(--paper); box-shadow: 0 1px 3px oklch(26% 0.035 310 / 0.16); }

.toggles { margin: var(--s-5) 0; }
.toggle { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ink); }
#drinks-note { margin: 0 0 var(--s-2) calc(22px + var(--s-3)); }

.scores { list-style: none; padding: 0; display: grid; gap: 2px; }
.scores li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); min-height: 40px; padding: var(--s-2) var(--s-3); border-radius: 10px; background: var(--paper-2); font-variant-numeric: tabular-nums; }
.scores li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.scores li b { font-weight: 800; }
.scores li.top { background: var(--accent-soft); }
.scores li .plus { font-size: var(--t-sm); font-weight: 700; color: var(--accent); margin-right: var(--s-2); }
#scores-block .link { margin-top: var(--s-2); }
.rules { padding-left: 1.3em; display: grid; gap: var(--s-1); color: var(--ink-2); }
.rules li::marker { color: var(--accent); font-weight: 800; }

/* play */
.topline { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 44px; }
.turn { text-align: center; min-height: 3.6rem; }
.kicker { font-size: var(--t-sm); font-weight: 700; color: var(--muted); }
.turn__name { font-size: var(--t-2xl); overflow-wrap: anywhere; min-height: 1em; }
.turn__name:empty { display: none; }
.turn.fresh { animation: slide 260ms var(--ease) both; }

.stage { flex: 1; min-height: 300px; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--paper-2); padding: var(--s-4) var(--s-3) var(--s-2); overflow: hidden; }
.stage.shake { animation: shake 360ms linear both; }
.sky { position: relative; flex: 1; min-height: 140px; }
/* The balloon grows from its knot, which sits on the hose clip at the bottom centre of the sky. */
.wob { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transform-origin: 50% 100%; animation: sway calc(var(--sway, 3s)) ease-in-out infinite; --tilt: 1deg; }
.grow { height: 100%; display: flex; justify-content: center; align-items: flex-end; transform-origin: 50% 100%; transform: scale(var(--size, 0.34)); transition: transform 380ms var(--spring); }
.balloon { display: block; height: 100%; max-width: 100%; aspect-ratio: 200 / 244; overflow: visible; }
.balloon__body { fill: var(--balloon); }
.balloon__knot { fill: var(--balloon-deep); }
.balloon__shine { fill: #fff; opacity: 0.42; }
.grow.puff .balloon { animation: puff 560ms var(--ease) both; }
.sky.popped .wob { visibility: hidden; }

.burst { position: absolute; inset: 0; pointer-events: none; }
.burst .flash { position: absolute; left: 50%; width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, oklch(96% 0.06 95 / 0.8) 31% 52%, transparent 53%); animation: flash 420ms var(--ease) both; }
.burst .bit { position: absolute; left: 50%; width: var(--w, 16px); height: var(--h, 12px); margin: calc(var(--h, 12px) / -2) 0 0 calc(var(--w, 16px) / -2); border-radius: 40% 60% 30% 70% / 60% 30% 70% 40%; background: var(--balloon); animation: fly 900ms cubic-bezier(0.1, 0.8, 0.3, 1) both; }
.burst .bit:nth-child(3n) { background: var(--balloon-deep); }

.pump { position: relative; flex: none; display: block; width: 100%; max-width: 340px; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 14px; }
.pump svg { display: block; width: 100%; height: auto; max-height: 150px; overflow: visible; }
.hose { fill: none; stroke: oklch(70% 0.03 310); stroke-width: 9; stroke-linecap: round; }
.pump__clip { fill: oklch(58% 0.03 310); }
.pump__foot { fill: oklch(40% 0.035 310); }
.pump__body { fill: var(--accent); }
.pump__band { fill: oklch(52% 0.15 312); }
.pump__rod rect { fill: oklch(48% 0.03 310); }
.pump__rod .pump__grip { fill: var(--ink); }
.pump__rod { transition: transform 110ms var(--ease); }
.pump.down .pump__rod { transform: translateY(40px); transition-duration: 70ms; }
.pump__hint { position: absolute; left: 0; bottom: 18%; width: 54%; text-align: center; font-size: var(--t-sm); font-weight: 700; color: var(--muted); }
.pump[aria-disabled="true"] { cursor: default; }
.pump[aria-disabled="true"] .pump__body, .pump[aria-disabled="true"] .pump__rod { opacity: 0.55; }
.pump:focus-visible { outline-offset: -2px; }

.count { display: grid; justify-items: center; gap: var(--s-1); }
.dots { list-style: none; padding: 0; display: flex; gap: var(--s-3); }
.dots li { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rule); transition: background-color var(--dur) linear, transform 220ms var(--spring); }
.dots li.on { background: var(--accent); box-shadow: none; transform: scale(1.12); }
.status { min-height: 1.45em; font-size: var(--t-md); font-weight: 600; color: var(--ink-2); text-align: center; }

/* caught */
#caught { color: var(--ink); }
.caught__head { margin-top: var(--s-6); text-align: center; animation: thump 520ms var(--spring) both; }
.scraps { display: block; margin: 0 auto var(--s-2); fill: var(--balloon-deep); }
.caught__word { font-size: clamp(5rem, 30vw, 8rem); line-height: 0.85; letter-spacing: -0.02em; }
.caught__word::after { content: ""; display: inline-block; width: 0.16em; height: 0.16em; margin-left: 0.05em; border-radius: 50%; background: var(--ink); }
.caught__who { margin-top: var(--s-3); font-size: var(--t-xl); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; text-wrap: balance; }
.caught__meta { margin-top: var(--s-1); font-size: var(--t-md); font-weight: 600; color: oklch(30% 0.04 310 / 0.85); }
.caught__drink { display: inline-block; margin-top: var(--s-4); padding: var(--s-2) var(--s-5); border-radius: var(--pill); background: oklch(100% 0 0 / 0.55); font-size: var(--t-lg); font-weight: 700; overflow-wrap: anywhere; }
.caught__body { flex: 1; display: flex; flex-direction: column; gap: var(--s-5); margin-top: var(--s-3); }
#caught .label { color: var(--ink); }
#caught .scores li { background: oklch(100% 0 0 / 0.38); }
#caught .scores li.top { background: oklch(100% 0 0 / 0.7); }
#caught .scores li .plus { color: var(--ink); }
.stack { display: grid; gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px oklch(26% 0.035 310 / 0.35); }
.btn--ghost:hover { background: oklch(100% 0 0 / 0.25); }

@keyframes sway { 0%, 100% { transform: rotate(calc(var(--tilt) * -1)); } 50% { transform: rotate(var(--tilt)); } }
@keyframes drift { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-4px); } }
@keyframes puff { 0% { transform: scale(1, 1); } 30% { transform: scale(1.05, 0.95); } 55% { transform: scale(0.97, 1.04); } 78% { transform: scale(1.015, 0.99); } 100% { transform: none; } }
@keyframes flash { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes fly { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 2px); } }
@keyframes thump { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes slide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 22.5rem) { :root { --t-3xl: 2.7rem; --t-2xl: 1.8rem; } }
@media (max-height: 700px) { .stage { min-height: 250px; } .pump svg { max-height: 118px; } .turn { min-height: 0; } .turn__name { font-size: var(--t-xl); } }

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