/* ---------- Tokens ----------
   Display: Fraunces with the SOFT axis at 100, a round storybook serif for the frog's voice, the numbers, and the buttons.
   Body: Lexend, a wide sans made for fast reading, so short facts stay clear over the pond on a phone. */
:root {
  --pond-top: #23907d;
  --pond: #15655f;
  --pond-deep: #082f3a;
  --pad: #e2f9ad;
  --pad-hi: #f2ffd0;
  --pad-edge: #86c647;
  --frog: #52c234;
  --lotus: #ff6f9f;
  --lotus-edge: #cf3f73;
  --ink: #10302d;
  --sun: #ffd95a;
  --sun-edge: #c9930c;
  --foam: #f3fbef;
  --foam-2: rgba(243, 251, 239, .8);
  --hair: rgba(255, 255, 255, .1);
  --glass: rgba(6, 42, 46, .76);
  --glass-soft: rgba(6, 42, 46, .5);

  --display: "Fraunces", "Cooper Black", Georgia, serif;
  --body: "Lexend", system-ui, -apple-system, sans-serif;

  /* Type scale, about 1.2 at each step, from a 17 px body. */
  --t-xs: .8125rem;   /* 13 */
  --t-sm: .9375rem;   /* 15 */
  --t-md: 1.0625rem;  /* 17 */
  --t-lg: 1.25rem;    /* 20 */
  --t-xl: 1.5rem;     /* 24 */
  --t-2xl: 2rem;      /* 32 */

  /* Space scale. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  --spring: cubic-bezier(.3, 1.6, .5, 1);
  --settle: cubic-bezier(.2, .9, .3, 1.15);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 var(--t-md)/1.5 var(--body);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  letter-spacing: -.005em;
  color: var(--foam);
  background: linear-gradient(var(--pond-top), var(--pond) 38%, var(--pond-deep)) fixed;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  /* "clip", not "hidden": hidden makes body a scroll box, and then the sticky frog and the sticky Next button do not stick. */
  overflow-x: clip;
}
button, input { font-family: inherit; letter-spacing: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; }

/* ---------- Pond scene (decoration only, when WebGL is off) ---------- */
.scene { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sun {
  position: absolute; left: 50%; top: -34vmin; width: 110vmin; height: 80vmin;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 226, 120, .5), rgba(255, 226, 120, .12) 60%, transparent);
}
.ring {
  position: absolute; width: 220px; height: 220px; margin: -110px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 0 0 26px rgba(255, 255, 255, .03), inset 0 0 0 30px rgba(255, 255, 255, .03);
  transform: scale(.2); opacity: 0;
  animation: ripple 7s ease-out infinite;
}
.r1 { left: 14%; top: 72%; }
.r2 { left: 88%; top: 40%; animation-delay: 2.4s; }
.r3 { left: 62%; top: 90%; animation-delay: 4.6s; }
.drift { position: absolute; fill: #2c9a63; opacity: .55; animation: drift 9s ease-in-out infinite alternate; }
.d1 { width: 130px; height: 65px; left: -30px; top: 58%; }
.d2 { width: 96px; height: 48px; right: -18px; top: 76%; animation-delay: -3s; fill: #38a86a; }
.d3 { width: 70px; height: 35px; left: 62%; top: 94%; animation-delay: -6s; }
.reeds { position: absolute; bottom: -8px; height: min(46vh, 340px); color: #06363a; opacity: .85; }
.reeds.left { left: -14px; transform-origin: 20% 100%; animation: sway 6s ease-in-out infinite alternate; }
.reeds.right { right: -14px; transform: scaleX(-1); }
.fire {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #fff3a6;
  box-shadow: 0 0 10px 4px rgba(255, 233, 120, .65);
  animation: fire 8s ease-in-out infinite;
  opacity: 0;
}
.f1 { left: 9%; top: 30%; } .f2 { left: 84%; top: 22%; animation-delay: -2s; } .f3 { left: 72%; top: 62%; animation-delay: -4s; }
.f4 { left: 22%; top: 84%; animation-delay: -5.5s; } .f5 { left: 48%; top: 12%; animation-delay: -1s; } .f6 { left: 93%; top: 80%; animation-delay: -6.5s; }

/* ---------- Page frame ---------- */
#app {
  position: relative; z-index: 1;
  max-width: 30rem;
  margin: 0 auto;
  padding:
    max(var(--s3), env(safe-area-inset-top))
    max(var(--s4), env(safe-area-inset-right))
    calc(var(--s6) + env(safe-area-inset-bottom))
    max(var(--s4), env(safe-area-inset-left));
}
.top, .view { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--s2); min-height: 48px;
}
.wordmark {
  font: 900 1.625rem/1 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -.02em;
  color: var(--sun);
  text-decoration: none;
  text-shadow: 0 2px 0 var(--sun-edge), 0 4px 0 rgba(0, 0, 0, .18);
  transform: rotate(-3deg);
  white-space: nowrap;
  padding: var(--s2) 0;
}
.wordmark span { color: var(--foam); font-size: .6em; margin-left: 1px; letter-spacing: 0; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.progress {
  justify-self: center;
  display: flex; gap: var(--s1);
  margin: 0; padding: var(--s1);
  list-style: none;
  border-radius: 999px;
  background: var(--glass-soft);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.progress li {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  font-size: 13px; line-height: 1;
  transition: transform .25s var(--spring), background .2s;
}
.progress li.now { background: rgba(255, 255, 255, .5); transform: scale(1.12); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.progress li.done { background: var(--pad); }
[data-view="intro"] .progress, [data-view="loading"] .progress, [data-view="result"] .progress { visibility: hidden; }
.chips { display: flex; gap: var(--s2); justify-self: end; }
.chip {
  position: relative;
  display: inline-grid; place-items: center;
  min-width: 40px; height: 40px; padding: 0 var(--s3);
  font: 800 var(--t-md)/1 var(--display);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  color: var(--foam);
  background: var(--glass-soft);
  border: 0; border-radius: 999px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#pointsChip { min-width: 52px; color: var(--ink); background: var(--sun); box-shadow: inset 0 -2px 0 rgba(160, 110, 0, .35); }
#pointsChip.bump { animation: bump .4s var(--spring); }
#pointsChip.fire { box-shadow: 0 0 0 3px rgba(255, 140, 60, .55), 0 0 18px 4px rgba(255, 160, 60, .7); }
#soundBtn { padding: 0; font-size: 1.05rem; cursor: pointer; transition: transform .12s var(--spring); }
#soundBtn:active { transform: scale(.9); }
/* The visible chip is 40 px. The tap area is 48 px. */
#soundBtn::after { content: ""; position: absolute; inset: -4px; }

/* ---------- Frog stage ---------- */
/* The frog stays in its place on the pond while the page scrolls. */
.stage {
  position: sticky; top: 0; z-index: 0;
  display: grid; justify-items: center;
  padding-top: var(--s2);
  transition: opacity .15s linear;
}
.bubble {
  position: relative;
  max-width: min(20rem, 100%);
  margin: 0 0 var(--s3);
  padding: 10px 18px 11px;
  font: 500 var(--t-md)/1.35 var(--body);
  text-align: center;
  color: var(--ink);
  background: var(--foam);
  border-radius: 20px;
  box-shadow: 0 3px 0 rgba(10, 50, 45, .18), 0 10px 24px rgba(0, 0, 0, .14);
}
.bubble::after {
  content: "";
  position: absolute; left: 50%; bottom: -7px;
  width: 16px; height: 16px;
  background: var(--foam);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 3px;
}
.bubble.pop { animation: pop .35s var(--spring); }
.stage.quiet .bubble { opacity: 0; transition: opacity .2s; }
#frog { width: 196px; height: auto; overflow: visible; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .2)); }
#frogBody { transform-origin: 120px 165px; animation: breathe 3.2s ease-in-out infinite; }
.lid { transform-origin: center; transform-box: fill-box; transform: scaleY(0); animation: blink 4.6s infinite; }
.pupil { transition: transform .12s ease-out; }
#frog.gulp #frogBody { animation: gulp .5s var(--spring); }
#frog.dizzy #frogBody { animation: wobble .6s ease-in-out; }
#frog.hop #frogBody { animation: hop .7s cubic-bezier(.3, 1.5, .5, 1); }
[data-view="game"] #frog { width: 128px; }
[data-view="game"] .bubble { font-size: var(--t-sm); margin-bottom: var(--s2); }

/* ---------- Views ---------- */
.view { display: none; }
[data-view="intro"] #intro, [data-view="game"] #game, [data-view="result"] #result { display: block; }

/* ---------- Shared parts ---------- */
.small { font-size: var(--t-sm); line-height: 1.45; color: var(--foam-2); margin: var(--s3) 0 0; }

/* A glass panel. Text on it stays clear over the frog and the pond. */
.panel {
  margin: var(--s4) 0 0;
  padding: 20px;
  text-align: left;
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 30px rgba(2, 22, 26, .22);
}
.wall-title { font: 800 var(--t-lg)/1.2 var(--display); color: var(--sun); margin: 0 0 var(--s3); }

/* A strip of three numbers: one glass bar, three cells, hairline dividers. */
.strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0; padding: 0; list-style: none;
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.strip > * {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 2px; min-width: 0;
  padding: var(--s3) var(--s1) 14px;
  font-size: var(--t-xs); line-height: 1.25; color: var(--foam-2);
  text-align: center;
}
.strip > * + * { border-left: 1px solid var(--hair); }

.btn {
  display: block; width: 100%; min-height: 58px;
  font: 800 var(--t-lg)/1.1 var(--display);
  letter-spacing: -.01em;
  color: var(--ink);
  background: linear-gradient(#ffe88f, #ffd440);
  border: 0; border-radius: 20px;
  padding: var(--s4) var(--s5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 5px 0 var(--sun-edge), 0 14px 22px rgba(0, 0, 0, .22);
  cursor: pointer;
  transition: transform .14s var(--spring), box-shadow .14s ease-out, filter .14s;
}
.btn:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 1px 0 var(--sun-edge), 0 4px 8px rgba(0, 0, 0, .2); transition-duration: .05s; }
.btn:disabled { filter: saturate(.5); opacity: .7; }
.btn-small {
  width: auto; min-height: 50px; flex: none;
  font-size: var(--t-md);
  padding: 0 18px; border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 4px 0 var(--sun-edge);
}
.btn-small:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 1px 0 var(--sun-edge); }
.btn:focus-visible, .pad:focus-visible, .chip:focus-visible, .betBtn:focus-visible,
input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #fff; outline-offset: 3px;
}

input {
  min-width: 0; min-height: 50px;
  font: 600 var(--t-md) var(--body);
  color: var(--ink); background: var(--foam);
  border: 2px solid transparent; border-radius: 16px;
  padding: 0 14px;
  box-shadow: inset 0 2px 3px rgba(0, 40, 40, .12);
  transition: border-color .15s;
}
input::placeholder { color: rgba(16, 48, 45, .45); font-weight: 500; }
input:focus { border-color: var(--sun); outline: none; }
.claim-row { display: flex; gap: 10px; }
.claim-row input { flex: 1; }

.report {
  margin: var(--s4) 0 0; padding: 14px var(--s4);
  border-radius: 18px; text-align: left;
  background: rgba(255, 217, 90, .14); border: 1.5px solid rgba(255, 217, 90, .45);
  font-size: var(--t-sm); line-height: 1.45;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.report b { display: block; font: 800 var(--t-md)/1.3 var(--display); color: var(--sun); margin-bottom: 2px; }

/* ---------- Intro ---------- */
.intro { text-align: center; padding-top: var(--s2); }
.intro h1 {
  font-weight: 900;
  font-size: clamp(2.5rem, 11.5vw, 3.25rem);
  line-height: .98;
  letter-spacing: -.025em;
  margin: 0 0 var(--s3);
  text-wrap: balance;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.lede { font-size: var(--t-md); line-height: 1.5; margin: 0 auto var(--s5); max-width: 21rem; text-wrap: pretty; }
.intro .report { margin: 0 0 var(--s4); }
.rules { margin-bottom: var(--s5); }
.rules b { font: 900 var(--t-2xl)/1 var(--display); color: var(--sun); font-variant-numeric: lining-nums; }
#playBtn { animation: nudge 2.6s ease-in-out 1.4s infinite; }
#introNote { margin-top: var(--s4); text-wrap: balance; }

.guide { margin-top: var(--s7); padding: var(--s5) 20px var(--s3); }
.guide h2 { font-size: var(--t-xl); line-height: 1.15; font-weight: 800; color: var(--sun); margin: 0 0 var(--s4); }
.guide h2 + details { margin-top: 0; }
.steps + h2 { margin-top: var(--s6); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s4); }
.steps li {
  counter-increment: step;
  position: relative; padding-left: 42px; min-height: 30px;
  font-size: var(--t-sm); line-height: 1.5; color: var(--foam-2);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  font: 800 var(--t-sm)/1 var(--display);
  color: var(--ink); background: var(--pad);
  box-shadow: inset 0 -2px 0 var(--pad-edge);
}
.steps b { display: block; font: 800 var(--t-md)/1.3 var(--display); color: var(--foam); margin-bottom: 1px; }
.guide details { border-top: 1px solid var(--hair); }
.guide summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: 52px; padding: var(--s2) 0;
  cursor: pointer; list-style: none;
  font-weight: 600; font-size: var(--t-md);
}
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after {
  content: "+"; flex: none;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font: 700 1.25rem/1 var(--body); color: var(--sun);
  background: rgba(255, 217, 90, .12);
  transition: transform .25s var(--spring);
}
.guide details[open] summary::after { transform: rotate(45deg); }
.guide details p { margin: 0 0 var(--s4); color: var(--foam-2); font-size: var(--t-sm); line-height: 1.55; }
.guide details[open] p { animation: drop .25s ease-out; }
.noscript { max-width: 30rem; margin: 40px auto; padding: 0 16px; color: #f3fbef; font: 600 1.1rem system-ui; }

/* ---------- Game: subject and bet ---------- */
.topic {
  display: table; max-width: 100%;
  margin: var(--s2) auto var(--s3);
  padding: 7px 20px 9px;
  font: 800 1.375rem/1.15 var(--display);
  text-align: center; text-wrap: balance;
  color: var(--sun);
  background: rgba(6, 42, 46, .74);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 6px 16px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.bet { text-align: center; margin: var(--s2) 0 var(--s2); animation: rise .4s var(--settle) backwards; }
.bet-q { font: 700 var(--t-lg)/1.2 var(--display); margin: 0 0 var(--s4); text-shadow: 0 1px 2px rgba(3, 25, 32, .6), 0 0 16px rgba(3, 25, 32, .5); }
.bet-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.betBtn {
  --face: var(--pad); --hi: var(--pad-hi); --edge: var(--pad-edge);
  display: grid; align-content: center; gap: var(--s1); justify-items: center;
  min-height: 96px; padding: var(--s3) var(--s1);
  border: 0; border-radius: 24px; cursor: pointer;
  color: var(--ink); font: 600 var(--t-xs)/1.2 var(--body);
  background: radial-gradient(120% 140% at 20% 0%, var(--hi), var(--face) 60%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45), 0 6px 0 var(--edge), 0 14px 18px rgba(0, 0, 0, .2);
  transition: transform .14s var(--spring), box-shadow .14s ease-out;
}
.betBtn b { font: 900 2.125rem/1 var(--display); letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.betBtn[data-bet="2"] { --face: #ffd95a; --hi: #fff3b8; --edge: var(--sun-edge); }
.betBtn[data-bet="3"] { --face: #ff8fb2; --hi: #ffc4d6; --edge: var(--lotus-edge); }
.betBtn:nth-child(2) { animation-delay: .05s; }
.betBtn:active { transform: translateY(5px) scale(.98); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45), 0 1px 0 var(--edge), 0 4px 8px rgba(0, 0, 0, .2); transition-duration: .05s; }
@media (hover: hover) { .betBtn:hover { transform: translateY(-2px); } }

/* ---------- Game: timer ---------- */
.timer { display: flex; align-items: center; gap: var(--s3); transition: opacity .3s; }
.betTag {
  min-width: 40px; padding: 5px 10px 6px; text-align: center;
  font: 800 var(--t-sm)/1 var(--display); color: var(--ink);
  background: var(--pad); border-radius: 999px;
}
.betTag.big { background: var(--sun); box-shadow: 0 0 14px rgba(255, 217, 90, .8); }
.track { position: relative; flex: 1; height: 12px; border-radius: 999px; background: rgba(4, 36, 40, .6); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .3); }
.fill {
  position: absolute; inset: 0 auto 0 0; width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9be25a, var(--sun));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.bug { position: absolute; top: 50%; left: 100%; width: 34px; height: 27px; margin: -15px 0 0 -17px; animation: buzz .12s linear infinite alternate; }
.secs { min-width: 2ch; text-align: right; font: 900 1.625rem/1 var(--display); font-variant-numeric: tabular-nums lining-nums; }
.timer.hot .fill { background: linear-gradient(90deg, #ff9dbd, var(--lotus)); }
.timer.hot .secs { color: #fff; text-shadow: 0 2px 0 var(--lotus-edge), 0 0 14px rgba(120, 10, 50, .6); animation: bump .5s var(--spring) infinite; }
.timer.stopped .bug { animation: none; }
.timer.stopped { opacity: .5; }

/* ---------- Game: the three pads ---------- */
.pads { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pad-wrap {
  --face: var(--pad); --hi: var(--pad-hi); --edge: var(--pad-edge);
  filter: drop-shadow(0 6px 0 var(--edge)) drop-shadow(0 12px 10px rgba(0, 0, 0, .18));
  animation: rise .5s var(--settle) backwards;
  transition: transform .14s var(--spring), filter .14s, opacity .3s;
}
.pad-wrap:nth-child(2) { animation-delay: .07s; }
.pad-wrap:nth-child(3) { animation-delay: .14s; }
.face {
  position: relative; overflow: hidden;
  color: var(--ink);
  background: radial-gradient(120% 140% at 20% 0%, var(--hi), var(--face) 55%);
  border-radius: 28px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45), inset 0 -10px 14px rgba(70, 130, 30, .18);
  /* A round bite on the edge, like the notch of a lily pad. */
  -webkit-mask: radial-gradient(circle 15px at 100% 34px, transparent 97%, #000);
  mask: radial-gradient(circle 15px at 100% 34px, transparent 97%, #000);
  animation: float 4.5s ease-in-out infinite;
}
.pad-wrap:nth-child(2) .face { animation-delay: -1.5s; -webkit-mask: radial-gradient(circle 15px at 0 34px, transparent 97%, #000); mask: radial-gradient(circle 15px at 0 34px, transparent 97%, #000); }
.pad-wrap:nth-child(3) .face { animation-delay: -3s; }
.face::before {
  content: ""; position: absolute; inset: 0 0 52% 0; pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
}
.face::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-20deg);
  animation: sweep .9s .4s ease-out both;
}
.pad {
  position: relative; z-index: 1;
  display: block; width: 100%; min-height: 64px;
  font: 500 var(--t-md)/1.38 var(--body);
  color: inherit; text-align: left; text-wrap: pretty;
  background: none; border: 0;
  padding: 18px 28px;
  border-radius: inherit;
  cursor: pointer;
}
.pad:disabled { cursor: default; }
.pad-wrap:has(.pad:not(:disabled):active) { transform: translateY(5px) scale(.99); filter: drop-shadow(0 1px 0 var(--edge)); transition-duration: .05s; }
@media (hover: hover) {
  .pad-wrap:has(.pad:not(:disabled):hover) { transform: translateY(-3px) scale(1.015); }
}
/* Short answers (cards with one subject) use the display face. */
.pads.short .pad { font: 800 1.3125rem/1.2 var(--display); letter-spacing: -.01em; text-align: center; text-wrap: balance; padding: 20px 30px; }

.pad-wrap.picked { --face: #ffe98a; --hi: #fff7c9; --edge: var(--sun-edge); transform: scale(1.02); }
.pad-wrap.miss .face { animation: shake .45s; }
.pad-wrap.sink { animation: sink .28s ease-in forwards; }

/* ---------- Game: the reveal. Gold is the fib (the answer), pink is a wrong pick, green is true. ---------- */
.pad-wrap.is-fib { --face: #ffd95a; --hi: #fff3b8; --edge: #c9930c; }
.pad-wrap.is-fib .face {
  color: var(--ink);
  animation: flip .5s var(--spring);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5), inset 0 -10px 14px rgba(170, 110, 0, .2), 0 0 0 3px rgba(255, 236, 150, .55), 0 0 26px 4px rgba(255, 214, 90, .55);
}
.pad-wrap.is-wrong { --face: #ff8fb2; --hi: #ffc4d6; --edge: var(--lotus-edge); }
.pad-wrap.is-wrong .face { color: #3a0a1d; }
.pad-wrap.is-true:not(.is-wrong) { opacity: .86; }
.pad-wrap.is-true .face, .pad-wrap.is-fib .face { animation-iteration-count: 1; }
.pad-wrap.is-fib .pad, .pad-wrap.is-true .pad { min-height: 0; padding-top: 14px; padding-bottom: 6px; }
.pads.short .pad-wrap.is-fib .pad, .pads.short .pad-wrap.is-true .pad { padding: 14px 28px 6px; font-size: 1.125rem; }

.after {
  position: relative; z-index: 1;
  display: none;
  padding: 0 28px 14px;
  font-size: .875rem; line-height: 1.42; text-wrap: pretty;
}
.pad-wrap.is-fib .after, .pad-wrap.is-true .after { display: block; animation: drop .35s ease-out .1s backwards; }
.pads.short .after { text-align: center; }
.tag {
  display: flex; width: fit-content; align-items: center;
  margin: 0 0 6px;
  font: 800 .75rem/1 var(--display);
  padding: 4px 9px 5px; border-radius: 999px;
  background: var(--ink); color: var(--pad);
}
.pads.short .tag { margin-inline: auto; }
.is-fib .tag { background: var(--ink); color: #ffe48a; }
.is-wrong .tag { background: #3a0a1d; color: #ffd3e2; }
.note { font-weight: 500; }
.after a {
  display: inline-block; padding: 2px 0;
  color: inherit; font-weight: 600; font-size: var(--t-xs);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  opacity: .78; white-space: nowrap;
}

/* After the answer, the crowd line takes the place of the stopped timer, so the Next button never covers it. */
.status { display: grid; margin: 0 0 var(--s4); }
.status > * { grid-area: 1 / 1; }
.status:has(.timer:not([hidden])) { min-height: 48px; align-items: center; }
.status:has(.crowd:not(:empty)) .timer { visibility: hidden; }
.crowd {
  justify-self: center; max-width: 100%;
  margin: 0; padding: 7px 16px 8px;
  font-size: var(--t-sm); font-weight: 600; line-height: 1.3; text-align: center; text-wrap: balance;
  border-radius: 999px;
  background: rgba(6, 42, 46, .74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: drop .3s ease-out;
}
.crowd:empty { display: none; }
/* The button stays at the bottom of the screen, so the player does not scroll to continue. */
#nextBtn {
  position: sticky; bottom: calc(var(--s3) + env(safe-area-inset-bottom)); z-index: 5;
  animation: rise .35s var(--settle);
}

/* ---------- Tongue, fly, petals, points ---------- */
#tongue {
  position: fixed; left: 0; top: 0; height: 13px; width: 0;
  margin-top: -6px;
  background: var(--lotus);
  border-radius: 999px;
  transform-origin: 0 50%;
  pointer-events: none; z-index: 20;
  box-shadow: inset 0 -4px 0 var(--lotus-edge);
  visibility: hidden;
}
.fly, .petal, .plus { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 21; }
.fly { width: 40px; height: 32px; margin: -16px 0 0 -20px; }
.fly svg { width: 100%; height: 100%; display: block; }
.petal { width: 12px; height: 16px; border-radius: 60% 60% 60% 0; background: var(--lotus); }
.plus {
  width: 96px; margin: -20px 0 0 -48px; text-align: center;
  font: 900 2.125rem/1 var(--display); font-variant-numeric: tabular-nums lining-nums;
  color: var(--sun);
  text-shadow: 0 3px 0 var(--sun-edge), 0 6px 10px rgba(0, 0, 0, .3);
}
.plus.neg { color: #ffb3cb; text-shadow: 0 3px 0 var(--lotus-edge), 0 6px 10px rgba(0, 0, 0, .3); }

#app.shake { animation: appshake .4s; }
body.hot::after {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(255, 70, 120, .7));
  box-shadow: inset 0 0 0 6px rgba(255, 120, 160, .8);
  animation: pulse .5s ease-in-out infinite alternate;
}

/* ---------- Result ---------- */
.result { text-align: center; padding-top: var(--s1); }
.summary { margin-bottom: var(--s6); }
/* One entrance for the result: the score lands first, then each part under it. */
.summary > * { animation: settle .55s var(--settle) backwards; }
.summary > :nth-child(2) { animation-delay: .08s; }
.summary > :nth-child(3) { animation-delay: .16s; }
.summary > :nth-child(4) { animation-delay: .24s; }
.summary > :nth-child(5) { animation-delay: .32s; }
.summary > :nth-child(6) { animation-delay: .4s; }
.score {
  font-weight: 900;
  font-size: clamp(2.75rem, 13vw, 3.5rem);
  line-height: 1; letter-spacing: -.03em;
  margin: 0 0 var(--s2);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.score span { color: var(--sun); font-variant-numeric: tabular-nums lining-nums; }
.caught { margin: 0; font-weight: 600; font-size: var(--t-md); }
.grid { font-size: 1.875rem; line-height: 1; letter-spacing: .14em; margin: var(--s3) 0 var(--s5); }
.stats { margin-bottom: var(--s4); }
.stats dt { order: 2; }
.stats dd { order: 1; margin: 0; font: 800 1.625rem/1.1 var(--display); color: var(--foam); font-variant-numeric: tabular-nums lining-nums; }
.share-preview {
  margin: 0 0 var(--s4); padding: 14px var(--s4);
  border-radius: 18px; text-align: left; white-space: pre-wrap;
  font: 500 var(--t-sm)/1.55 var(--body); color: var(--foam);
  background: var(--glass);
  border: 1.5px dashed rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}

.breakdown { list-style: none; margin: 0; padding: 0; text-align: left; }
.breakdown li {
  display: grid; grid-template-columns: 24px 1fr 3.4rem; gap: 10px; align-items: center;
  padding: 14px 0;
}
.breakdown li + li { border-top: 1px solid var(--hair); }
.breakdown li:first-child { padding-top: var(--s1); }
.breakdown li:last-child { padding-bottom: 0; }
.breakdown .mark { font-size: 1.375rem; text-align: center; line-height: 1; }
.breakdown b { display: block; font-weight: 600; font-size: var(--t-sm); line-height: 1.3; margin-bottom: var(--s2); }
.breakdown .bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.breakdown .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9be25a, var(--sun)); transform-origin: left; animation: grow .8s cubic-bezier(.2, .8, .3, 1) .2s backwards; }
.breakdown li.lost .bar i { background: linear-gradient(90deg, #ffb3cb, #ff8fb2); }
.breakdown small { display: block; margin-top: 6px; text-wrap: balance; color: var(--foam-2); font-size: var(--t-xs); }
.breakdown .pts { min-width: 0; text-align: right; font: 800 var(--t-lg)/1 var(--display); color: var(--sun); font-variant-numeric: tabular-nums lining-nums; }
.breakdown .pts.neg { color: #ffb3cb; }

.beat { font: 700 1.125rem/1.3 var(--display); margin: 0 0 var(--s4); text-wrap: balance; }
.spread { padding: var(--s2) 0 0; }
.spread:empty { display: none; }
.spread svg { display: block; width: 100%; height: auto; overflow: visible; }
.spread rect { fill: rgba(226, 249, 173, .5); transform-box: fill-box; transform-origin: bottom; animation: growY .7s cubic-bezier(.2, .8, .3, 1) backwards; }
.spread rect.me { fill: var(--sun); filter: drop-shadow(0 0 6px rgba(255, 217, 90, .8)); }
.spread text { fill: var(--foam); opacity: .7; font: 500 10px var(--body); text-anchor: middle; }

.write .small { margin: 0; }
.write .stem { display: block; font: 800 var(--t-lg)/1.25 var(--display); margin: var(--s4) 0 var(--s2); }
#fibMsg { margin: var(--s3) 0 0; min-height: 1.45em; }
#fibMsg:empty { margin: 0; min-height: 0; }
#fibMsg.good, .small.good { color: #c9f59a; font-weight: 600; }
#fibMsg.bad, .small.bad { color: #ffc4d6; font-weight: 600; }

.claim label { display: block; font-size: var(--t-sm); color: var(--foam-2); margin-bottom: var(--s2); }
.claim input {
  font: 900 var(--t-xl)/1 var(--display);
  letter-spacing: .3em; text-align: center; text-transform: uppercase;
  padding-left: calc(14px + .3em);
}
.claim input::placeholder { color: rgba(16, 48, 45, .28); }
#claimMsg:empty { display: none; }

.wall { list-style: none; margin: var(--s4) 0 0; padding: 0; text-align: left; counter-reset: rank; font-variant-numeric: tabular-nums lining-nums; }
.wall li {
  counter-increment: rank;
  display: grid; grid-template-columns: 1.75rem 1fr auto 2.75rem; gap: 10px; align-items: center;
  min-height: 44px; padding: 0 var(--s3); border-radius: 12px;
}
.wall li::before { content: counter(rank); color: var(--foam-2); font: 700 var(--t-sm) var(--display); }
.wall li:nth-child(odd) { background: rgba(255, 255, 255, .05); }
.wall li.me { background: var(--pad); color: var(--ink); font-weight: 600; }
.wall li.me::before { color: inherit; }
.wall .who { font: 800 var(--t-md) var(--display); letter-spacing: .14em; }
.wall .pts { font: 800 var(--t-md) var(--display); }
.wall .of { color: inherit; opacity: .7; text-align: right; font-size: var(--t-sm); }
.wall .empty { display: block; padding: 0; background: none !important; color: var(--foam-2); font-size: var(--t-sm); min-height: 0; }
.wall .empty::before { content: none; }

.fibs:has(#fibWallTitle[hidden]) { display: none; }
.fibwall { list-style: none; margin: 0; padding: 0; text-align: left; }
.fibwall li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  min-height: 44px; padding: 10px var(--s3); border-radius: 12px; font-size: var(--t-sm);
}
.fibwall li:nth-child(odd) { background: rgba(255, 255, 255, .05); }
.fibwall li.me { background: var(--sun); color: var(--ink); font-weight: 600; }
.fibwall .who { font: 800 var(--t-sm) var(--display); letter-spacing: .12em; }
.fibwall .fooled { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.next { text-align: center; margin-top: var(--s6); }
.next strong { font: 800 var(--t-md) var(--display); font-variant-numeric: tabular-nums lining-nums; color: var(--sun); }

/* ---------- Motion ---------- */
@keyframes ripple { 0% { transform: scale(.2); opacity: 0; } 15% { opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes drift { to { transform: translate(18px, -10px) rotate(8deg); } }
@keyframes sway { to { transform: rotate(2.5deg); } }
@keyframes fire { 0%, 100% { opacity: 0; transform: translate(0, 0); } 30% { opacity: .9; } 60% { opacity: .3; transform: translate(26px, -34px); } 80% { opacity: .8; } }
@keyframes bob { 50% { transform: translateY(5px) rotate(-1deg); } }
@keyframes float { 50% { transform: translateY(3px) rotate(.4deg); } }
@keyframes breathe { 50% { transform: scale(1.03, .97); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(0); } 97% { transform: scaleY(1); } }
@keyframes gulp { 30% { transform: scale(1.2, .78); } 60% { transform: scale(.9, 1.14); } }
@keyframes wobble { 20% { transform: rotate(-9deg); } 50% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes hop { 35% { transform: translateY(-38px) scale(.95, 1.08); } 70% { transform: translateY(0) scale(1.1, .88); } }
@keyframes pop { from { transform: scale(.85); opacity: .4; } }
@keyframes bump { 40% { transform: scale(1.25); } }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 90% { transform: translateY(-4px) rotate(-1deg); } 95% { transform: translateY(0) rotate(1deg); } }
@keyframes buzz { from { transform: translateY(-2px) rotate(-6deg); } to { transform: translateY(2px) rotate(6deg); } }
@keyframes rise { from { transform: translateY(36px) scale(.94); opacity: 0; } }
@keyframes settle { from { transform: translateY(14px) scale(.97); opacity: 0; } }
@keyframes drop { from { transform: translateY(-6px); opacity: 0; } }
@keyframes flip { 40% { transform: rotateX(70deg) scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes sweep { to { left: 130%; } }
@keyframes sink { to { transform: translateY(46px) scale(.9); opacity: 0; } }
/* The shake moves only side to side, with no rotation, so it never widens the page. */
@keyframes appshake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes growY { from { transform: scaleY(0); } }

/* ---------- Sizes ---------- */
@media (max-width: 400px) {
  /* In the game the header holds the progress, the points, and the sound button, so the wordmark drops ".win". */
  [data-view="game"] .wordmark span { display: none; }
  .wordmark { font-size: 1.5rem; }
}
@media (max-width: 359px) {
  .progress li { width: 21px; height: 21px; font-size: 11px; }
  .chip { padding: 0 var(--s2); }
}
@media (max-height: 700px) and (max-width: 500px) {
  /* Short phones: a smaller frog keeps the pads above the fold. */
  #frog { width: 168px; }
  [data-view="game"] #frog { width: 108px; }
  .bubble { margin-bottom: var(--s2); }
}
@media (min-width: 700px) {
  #app { max-width: 32rem; padding-top: var(--s6); }
  #frog { width: 228px; }
  [data-view="game"] #frog { width: 156px; }
  .reeds { height: min(60vh, 520px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ring, .fire { display: none; }
}

/* The music button shows a line through it when the music is off. */
#musicBtn { position: relative; }
#musicBtn.off { opacity: .6; }
#musicBtn.off::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2.5px; border-radius: 2px; background: currentColor; transform: rotate(-35deg); }

/* ---------- 3D mode ----------
   pond3d.js adds the class has3d to <html> after WebGL starts with no error.
   The WebGL pond draws behind the page. A second canvas above the page draws the tongue and the particles. */
#pond3d, #pond3d-fx { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#pond3d { z-index: 0; opacity: 0; transition: opacity .5s ease-out; }
/* A soft vignette above the WebGL pond and below the page. */
#pond3d-vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease-out;
  background: radial-gradient(ellipse 130% 95% at 50% 38%, transparent 52%, rgba(2, 20, 28, .5) 100%);
}
.has3d #pond3d-vignette { opacity: 1; }
#pond3d-fx { z-index: 20; }
.has3d #pond3d { opacity: 1; }
.has3d body { background: var(--pond-deep); }
/* The WebGL pond replaces the CSS scene. The 3D frog replaces the SVG frog, its tongue, and its petals. */
.has3d .scene, .has3d #tongue, .has3d .petal { display: none; }
/* The SVG frog stays in the layout as an invisible placeholder. The 3D frog reads its rect. */
.has3d #frog { visibility: hidden; animation: none; filter: none; }
/* Text that sits directly on the scene gets a soft shadow, so it stays easy to read. */
.has3d .intro h1, .has3d .lede, .has3d .small, .has3d .crowd, .has3d .topic,
.has3d .score, .has3d .caught, .has3d .wall-title, .has3d .secs {
  text-shadow: 0 1px 2px rgba(3, 25, 32, .55), 0 0 18px rgba(3, 25, 32, .45);
}
.has3d .intro h1, .has3d .score { text-shadow: 0 4px 0 rgba(0, 0, 0, .22), 0 0 24px rgba(3, 25, 32, .45); }
.has3d .wordmark { text-shadow: 0 2px 0 var(--sun-edge), 0 5px 0 rgba(0, 0, 0, .2), 0 0 16px rgba(3, 25, 32, .4); }
