:root {
  color-scheme: light;
  --paper: oklch(97.6% 0.008 340); --paper-2: oklch(94.2% 0.014 330); --paper-3: oklch(90% 0.02 325);
  --ink: oklch(27% 0.03 300); --ink-2: oklch(41% 0.035 300); --muted: oklch(52% 0.03 305);
  --rule: oklch(88% 0.02 320);
  --accent: oklch(70% 0.1 295); --accent-soft: oklch(93% 0.035 295); --accent-ink: oklch(40% 0.11 295);
  --body: oklch(80% 0.08 295); --body-2: oklch(70% 0.1 295); --brow: oklch(42% 0.08 295);
  --mouth: oklch(33% 0.07 345); --throat: oklch(25% 0.06 345);
  --gum: oklch(72% 0.11 5); --tongue: oklch(68% 0.14 10);
  --tooth: oklch(99% 0.012 95); --tooth-2: oklch(91% 0.022 90); --tooth-down: oklch(86% 0.025 85);
  --sore: oklch(63% 0.19 25); --sweat: oklch(86% 0.07 230); --cheek: oklch(76% 0.12 10);
  --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.2rem; --t-xl: 1.5rem; --t-2xl: 2.1rem; --t-3xl: 3.2rem;
  --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, h3, p, ol, ul, fieldset { margin: 0; }
h1, h2 { font-weight: 900; line-height: 1.02; letter-spacing: -0.015em; 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); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 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 { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.masthead h1 { font-size: var(--t-3xl); }
.masthead h1::after { content: ""; display: inline-block; width: 0.2em; height: 0.2em; margin-left: 0.07em; border-radius: 50%; background: var(--accent); }
.mascot { flex: none; margin-top: -6px; }
.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; }
.drinks-note { margin-top: var(--s-2); text-align: center; font-size: var(--t-sm); font-weight: 600; color: var(--accent-ink); }

.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: 800; color: var(--ink-2); }
.opt { font-weight: 400; 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: 800; font-size: var(--t-md); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; 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); }
.link { background: none; border: 0; min-height: 44px; padding: var(--s-2) 0; font-size: var(--t-sm); font-weight: 800; 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: 800; 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(27% 0.03 300 / 0.16); }

.toggles { display: grid; }
.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); }

.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: 800; color: var(--sore); 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-ink); font-weight: 800; }
.foot { margin-top: var(--s-6); font-size: var(--t-sm); color: var(--muted); text-wrap: pretty; }

/* play */
.play { max-width: var(--page); height: 100dvh; margin-inline: auto; display: flex; flex-direction: column; overflow: hidden; padding: calc(var(--s-1) + var(--safe-t)) calc(var(--s-2) + var(--safe-r)) calc(var(--s-3) + var(--safe-b)) calc(var(--s-2) + var(--safe-l)); }
.topline { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 44px; padding-inline: var(--s-2); }
.status { text-align: center; padding: 0 var(--s-3) var(--s-1); }
.status__who { font-size: var(--t-xl); font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.status__sub { min-height: 1.5em; color: var(--ink-2); font-weight: 600; text-wrap: balance; }

.beast { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 26px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.beast__body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 10px 14px; border-radius: 46% 46% 30% 30% / 26% 26% 16% 16%; background: var(--body); }
.beast__body::before, .beast__body::after { content: ""; position: absolute; top: -24px; width: 40px; height: 52px; background: var(--body-2); border-radius: 60% 60% 30% 30% / 90% 90% 20% 20%; z-index: -1; }
.beast__body::before { left: 22%; transform: rotate(-16deg); }
.beast__body::after { right: 22%; transform: rotate(16deg); }
.beast { position: relative; z-index: 0; }

.face { flex: none; display: block; width: 100%; height: clamp(68px, 14dvh, 128px); overflow: visible; }
.eyeball { fill: #fff; }
.pupil { fill: var(--ink); }
.glint { fill: #fff; }
.lid { fill: var(--body-2); transform: translateY(var(--lid, 12px)); transition: transform 360ms var(--ease); }
.brow { fill: none; stroke: var(--brow); stroke-width: 9; stroke-linecap: round; transform-box: fill-box; transform-origin: center; transition: transform 360ms var(--ease); }
.brow--l { transform: translateY(var(--brow-y, 0)) rotate(var(--brow-r, 0deg)); }
.brow--r { transform: translateY(var(--brow-y, 0)) rotate(calc(var(--brow-r, 0deg) * -1)); }
.look { transform: translate(var(--look-x, 0px), var(--look-y, 0px)); transition: transform 280ms var(--ease); }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 5.3s infinite; }
.twitch { transform-box: fill-box; transform-origin: center; }
.drop { fill: var(--sweat); opacity: 0; transform-box: fill-box; transition: opacity 300ms linear; }
.cheek { fill: var(--cheek); opacity: 0; transition: opacity 400ms linear; }

.beast[data-mood="1"] { --lid: 18px; --brow-y: 3px; --brow-r: 4deg; }
.beast[data-mood="2"] { --lid: 26px; --brow-y: 6px; --brow-r: 7deg; }
.beast[data-mood="3"] { --lid: 33px; --brow-y: 9px; --brow-r: 10deg; }
.beast[data-mood="1"] .drop--1, .beast[data-mood="2"] .drop, .beast[data-mood="3"] .drop { opacity: 1; animation: drip 2.4s ease-in infinite; }
.beast[data-mood="2"] .drop--2 { animation-delay: -1.1s; }
.beast[data-mood="3"] .drop--2 { animation-delay: -1.1s; }
.beast[data-mood="2"] .cheek { opacity: 0.45; }
.beast[data-mood="3"] .cheek { opacity: 0.8; }
.beast[data-mood="3"] .beast__body { animation: shiver 1.6s ease-in-out infinite; }
.beast.tense { --brow-y: 10px; }
.beast.tense .twitch--r { animation: twitch 240ms steps(2, jump-none) infinite; }
.beast.tense .twitch:not(.twitch--r) { animation: twitch 310ms steps(2, jump-none) infinite reverse; }
.beast.tense .eye { animation: none; }
.beast.phew { --lid: 46px; --brow-y: -2px; --brow-r: -8deg; }
.beast.shut { --lid: 40px; --brow-y: 2px; --brow-r: -6deg; --look-x: 0px; --look-y: 0px; }
.beast.shut .drop, .beast.shut .eye { animation: none; }
.beast.chomp { animation: chomp 460ms cubic-bezier(0.3, 0.7, 0.4, 1) both; }

/* the mouth: a size container, so the teeth scale with whatever room the phone leaves */
.mouth { --gum-h: 12px; --row: clamp(48px, 26cqh, 96px); --corner: clamp(18px, 7cqw, 34px); --side-w: clamp(44px, 15cqw, 62px);
  position: relative; flex: 1; min-height: 210px; container-type: size; overflow: hidden; border-radius: 18% / 18%;
  background: radial-gradient(ellipse 70% 60% at 50% 55%, var(--throat), var(--mouth) 80%); box-shadow: inset 0 0 0 var(--gum-h) var(--gum); }
.tongue { position: absolute; left: 22%; right: 22%; bottom: calc(var(--row) * 0.35); height: 34%; border-radius: 50% 50% 44% 44% / 60% 60% 40% 40%; background: var(--tongue); pointer-events: none; }
.tongue::after { content: ""; position: absolute; left: 50%; top: 18%; width: 4px; height: 40%; margin-left: -2px; border-radius: 2px; background: oklch(58% 0.14 10); }
.row { position: absolute; left: var(--corner); right: var(--corner); height: var(--row); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); z-index: 1; }
.row--top { top: 0; }
.row--bot { bottom: 0; }
.side { position: absolute; top: var(--row); bottom: var(--row); width: var(--side-w); display: grid; grid-auto-rows: minmax(44px, 68px); align-content: center; gap: 6px; z-index: 1; }
.side:empty { display: none; }
.side--l { left: 0; }
.side--r { right: 0; }

.tooth { position: relative; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tooth:focus-visible { outline: 3px solid var(--paper); outline-offset: -3px; }
.tooth::before { content: ""; position: absolute; background: var(--gum); }
.socket { position: absolute; overflow: hidden; pointer-events: none; }
.cap { position: absolute; inset: 0; background: var(--tooth); transition: transform 220ms var(--ease), background-color 200ms linear; }
.tooth:hover .cap { background: #fff; }
.tooth:disabled { cursor: default; }
.tooth.pressing .cap { transition: transform 1250ms cubic-bezier(0.4, 0, 0.7, 1); }
.tooth.down .cap { background: var(--tooth-down); transition: transform 260ms cubic-bezier(0.3, 1.4, 0.6, 1); }
.tooth.sore .cap { background: var(--sore); }

.row--top .tooth::before { left: -1px; right: -1px; top: 0; height: calc(var(--gum-h) + 7px); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.row--top .socket { left: 9%; right: 9%; top: var(--gum-h); bottom: 8%; }
.row--top .cap { border-radius: 4px 4px 46% 46% / 4px 4px 34% 34%; box-shadow: inset 0 -7px 0 var(--tooth-2); }
.row--top .pressing .cap { transform: translateY(-36%); }
.row--top .down .cap { transform: translateY(-76%); }

.row--bot .tooth::before { left: -1px; right: -1px; bottom: 0; height: calc(var(--gum-h) + 7px); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.row--bot .socket { left: 9%; right: 9%; bottom: var(--gum-h); top: 8%; }
.row--bot .cap { border-radius: 46% 46% 4px 4px / 34% 34% 4px 4px; box-shadow: inset 0 7px 0 #fff, inset 0 -5px 0 var(--tooth-2); }
.row--bot .pressing .cap { transform: translateY(36%); }
.row--bot .down .cap { transform: translateY(76%); }

.side--l .tooth::before { top: -1px; bottom: -1px; left: 0; width: calc(var(--gum-h) + 7px); border-radius: 0 50% 50% 0 / 0 50% 50% 0; }
.side--l .socket { top: 10%; bottom: 10%; left: var(--gum-h); right: 10%; }
.side--l .cap { border-radius: 4px 46% 46% 4px / 4px 40% 40% 4px; box-shadow: inset -6px 0 0 var(--tooth-2); }
.side--l .pressing .cap { transform: translateX(-36%); }
.side--l .down .cap { transform: translateX(-76%); }

.side--r .tooth::before { top: -1px; bottom: -1px; right: 0; width: calc(var(--gum-h) + 7px); border-radius: 50% 0 0 50% / 50% 0 0 50%; }
.side--r .socket { top: 10%; bottom: 10%; right: var(--gum-h); left: 10%; }
.side--r .cap { border-radius: 46% 4px 4px 46% / 40% 4px 4px 40%; box-shadow: inset 6px 0 0 var(--tooth-2); }
.side--r .pressing .cap { transform: translateX(36%); }
.side--r .down .cap { transform: translateX(76%); }

/* the snap: two lips of monster skin close over the mouth, gritted teeth along the seam */
.lip { position: absolute; left: 0; right: 0; height: 0; background: var(--body); z-index: 3; pointer-events: none; transition: height 420ms var(--ease); }
.lip--top { top: 0; }
.lip--bot { bottom: 0; }
.shut .lip { height: calc(50% + 1px); transition: height 110ms cubic-bezier(0.6, 0, 1, 0.6); }
.seam { --t: 11px; position: absolute; left: 9%; right: 9%; top: 50%; height: 26px; margin-top: -13px; z-index: 4; border-radius: 13px; pointer-events: none; opacity: 0; transform: scaleX(0.6); transition: opacity 120ms linear, transform 200ms var(--ease);
  background: radial-gradient(circle at 50% 0, var(--tooth) var(--t), transparent calc(var(--t) + 0.5px)) 0 0 / 30px 13px repeat-x, radial-gradient(circle at 50% 100%, var(--tooth) var(--t), transparent calc(var(--t) + 0.5px)) 15px 100% / 30px 13px repeat-x, var(--mouth); }
.shut .seam { opacity: 1; transform: none; transition: opacity 30ms linear 70ms, transform 160ms cubic-bezier(0.3, 1.6, 0.5, 1) 70ms; }
.sealed .mouth { background: var(--body); box-shadow: none; }
.shut .mouth { cursor: pointer; }
.shut .row, .shut .side { pointer-events: none; } /* pressed teeth are disabled buttons and would swallow the tap */

/* caught: the panel joins the column, the monster makes room */
.caught { flex: none; display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-2) 0; animation: rise 360ms var(--ease) both; }
.caught__drink { padding: var(--s-2) var(--s-4); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: var(--t-lg); text-align: center; overflow-wrap: anywhere; }
.tally { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-1) var(--s-2); }
.tally li { display: flex; gap: 0.4em; align-items: baseline; min-height: 30px; padding: 2px var(--s-3); border-radius: var(--pill); background: var(--paper-2); font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tally li b { font-weight: 900; }
.tally li.hit { background: oklch(92% 0.05 25); color: oklch(42% 0.15 25); }
.is-caught .mouth { min-height: 96px; }
.is-caught .status__who { color: var(--sore); }

@keyframes blink { 0%, 95%, 100% { transform: none; } 97% { transform: scaleY(0.1); } }
@keyframes twitch { 0% { transform: translate(-1.5px, 1px) scale(0.97); } 100% { transform: translate(1.5px, -1px) scale(1.04); } }
@keyframes drip { 0% { transform: translateY(-4px); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes shiver { 0%, 100% { transform: none; } 25% { transform: translateX(-1.5px) rotate(-0.3deg); } 75% { transform: translateX(1.5px) rotate(0.3deg); } }
@keyframes chomp { 0% { transform: none; } 12% { transform: translateY(10px) scale(1.04, 0.95); } 28% { transform: translate(-9px, -4px) rotate(-2deg); } 44% { transform: translate(8px, 2px) rotate(1.6deg); } 60% { transform: translate(-5px, 0) rotate(-1deg); } 78% { transform: translate(3px, 0); } 100% { transform: none; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@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.85rem; } .mascot { width: 76px; height: 76px; } }
@media (max-height: 680px) { .status__who { font-size: var(--t-lg); } .beast { padding-top: 20px; } .mouth { --row: clamp(46px, 25cqh, 80px); } }

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