@font-face { font-family: "Grandstander"; src: url("fonts/grandstander.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --sky: #e4f2f7; --pond: #9fd0e4; --pond-deep: #6fb3d2; --leaf: #4f8f32; --leaf-soft: #86bf55;
  --honey: #f6cf45; --honey-deep: #8a6a00; --ink: #3b2f1e; --paper: #fffaf0;
  --hand: "Grandstander", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(var(--sky), #cbe6f1) fixed; color: var(--ink);
  font-family: var(--hand); -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 4px solid var(--honey-deep); outline-offset: 3px; }
#app { max-width: 760px; margin: 0 auto; min-height: 100%; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.screen { min-height: calc(100dvh - 28px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.screen[hidden], [hidden] { display: none !important; }
h1 { font-weight: 800; color: var(--honey-deep); text-align: center; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.05; margin: 0; }
.lead { font-size: 1.4rem; margin: 0; }

.big { min-height: 72px; min-width: 200px; padding: 10px 32px; border-radius: 40px; font-size: 1.8rem; font-weight: 800;
  border: 4px solid var(--honey-deep); background: var(--honey); box-shadow: 0 6px 0 var(--honey-deep); }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--honey-deep); }
.back { color: #2f5d7a; font-size: 1.1rem; margin-top: auto; padding: 12px; }

.bruce-hero { width: min(52vw, 240px); height: auto; margin-top: 8px; animation: bob 3s ease-in-out infinite; }
#start .go { margin-top: 8px; }

/* round */
.dots { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.dots li { width: 28px; height: 28px; border-radius: 50%; background: #fff8; border: 2px solid #8fb9cc;
  font-size: .85rem; font-weight: 800; display: grid; place-items: center; color: #6b8fa1; }
.dots li.done { background: var(--honey); border-color: var(--honey-deep); color: var(--ink); }
.dots li.now { background: #fff; border-color: var(--honey-deep); color: var(--ink); transform: scale(1.15); }
.talk { display: flex; align-items: center; gap: 10px; width: 100%; }
.bruce-mini { width: 56px; height: auto; flex: none; }
.bubble { flex: 1; margin: 0; background: #fff; border-radius: 22px; padding: 10px 16px; font-size: 1.45rem; font-weight: 700;
  border: 3px solid #e5d7b0; position: relative; min-height: 2.3em; display: flex; align-items: center; }
.bubble::before { content: ""; position: absolute; left: -12px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right: 12px solid #e5d7b0; border-left: 0; }

.pond { flex: 1; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 10px 8px;
  padding: 14px 8px; border-radius: 32px; min-height: 330px;
  background: radial-gradient(46px 26px at 16% 90%, #7dbb5a 98%, transparent),
              radial-gradient(34px 19px at 86% 10%, #7dbb5a 98%, transparent),
              linear-gradient(#bfe3f1, var(--pond-deep));
  box-shadow: inset 0 0 0 4px #ffffff88; transition: background .6s; }
.pond.night { background: radial-gradient(circle at 80% 18%, #fff6c4 0 18px, transparent 19px), linear-gradient(#26375f, #3f5a86); }
.obj { --s: 96px; width: var(--s); height: var(--s); padding: 0; border: 0; background: none; position: relative;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); }
.obj svg { width: 100%; height: 100%; filter: url(#pencil); pointer-events: none; }
.obj .n { position: absolute; right: -4px; top: -6px; min-width: 44px; height: 44px; border-radius: 22px; padding: 0 6px;
  background: #fff; border: 3px solid var(--honey-deep); font-size: 1.7rem; font-weight: 900; display: grid; place-items: center;
  transform: rotate(calc(-1 * var(--r, 0deg))); animation: pop .35s ease-out; }
.obj.counted svg { opacity: .9; }
.pond.night .obj svg { filter: url(#pencil) drop-shadow(0 0 10px #ffe98aaa); }
.obj.bounce { animation: hop .45s ease-out; }
.pond.n1 .obj, .pond.n2 .obj, .pond.n3 .obj { --s: 132px; }
.pond.n7 .obj, .pond.n8 .obj { --s: 84px; }
.pond.n9 .obj, .pond.n10 .obj { --s: 76px; }
.pond.n9 .obj .n, .pond.n10 .obj .n { min-width: 38px; height: 38px; font-size: 1.4rem; }

.answers { display: flex; gap: 14px; justify-content: center; width: 100%; }
.answers button { width: 96px; height: 96px; border-radius: 28px; font-size: 3rem; font-weight: 900;
  border: 4px solid #2f6f8f; background: #fff; box-shadow: 0 6px 0 #2f6f8f; }
.answers button:active { transform: translateY(4px); box-shadow: 0 2px 0 #2f6f8f; }
.answers button.wiggle { animation: wiggle .5s ease-in-out; }

.cheer { position: fixed; inset: 0; background: #fffaf0f2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 16px; text-align: center; z-index: 5; }
.joy { position: relative; }
.cheer img { display: block; width: min(56vw, 260px); height: auto; transform-origin: 50% 90%;
  animation: joy 1s ease-out, bob 3s ease-in-out 1s infinite; }
.sp { position: absolute; left: 50%; top: 45%; margin: -18px 0 0 -18px; width: 36px; line-height: 36px; text-align: center;
  font: 700 34px/36px "Segoe UI Symbol", "Apple Symbols", sans-serif; color: #f2b705; text-shadow: 0 0 6px #fff;
  transform: translate(var(--x), var(--y)); animation: burst .7s var(--d, 0s) cubic-bezier(.2, 1.4, .5, 1) both; }
.sp.h { color: #f08aa8; font-size: 30px; }
.bruce-mini.wiggle { animation: wiggle .5s ease-in-out; }
.cheer p { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 800; color: var(--honey-deep); margin: 0; }

/* end */
#end { justify-content: flex-start; padding-top: 8px; }
.bigstar { width: min(46vw, 200px); height: auto; animation: spin-in .9s ease-out; }
.song { font-size: clamp(1rem, 4.3vw, 1.15rem); background: var(--paper); border: 3px solid #e5d7b0; border-radius: 24px; padding: 14px 20px; max-width: 520px; width: 100%; line-height: 1.4; }
.song h2 { margin: 0; color: var(--leaf); font-size: 1.5rem; }
.song .tune { margin: 0 0 8px; font-size: .95rem; color: #6b5a3a; }
.song p { margin: 0 0 10px; }

@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes hop { 0% { transform: rotate(var(--r,0deg)) translateY(0) scale(1); } 40% { transform: rotate(var(--r,0deg)) translateY(-22px) scale(1.12); } 70% { transform: rotate(var(--r,0deg)) translateY(2px) scale(.96); } 100% { transform: rotate(var(--r,0deg)) translateY(0) scale(1); } }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.25); } }
@keyframes wiggle { 20%, 60% { transform: rotate(-8deg); } 40%, 80% { transform: rotate(8deg); } }
@keyframes joy { 0% { transform: translateY(30px) scale(.6); opacity: 0; } 18% { transform: translateY(0) scale(1.06, .94); opacity: 1; }
  34% { transform: translateY(-46px) rotate(-6deg); } 48% { transform: translateY(0) scale(1.08, .92); }
  66% { transform: translateY(-34px) rotateY(360deg); } 80% { transform: translateY(0) scale(1.05, .95) rotateY(360deg); }
  88% { transform: rotate(5deg) rotateY(360deg); } 94% { transform: rotate(-4deg) rotateY(360deg); } 100% { transform: rotateY(360deg); } }
@keyframes burst { from { transform: translate(0, 0) scale(0) rotate(-90deg); opacity: 0; } 60% { opacity: 1; } }
@keyframes spin-in { from { transform: scale(0) rotate(-180deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 700px) {
  .obj { --s: 120px; } .pond.n7 .obj, .pond.n8 .obj { --s: 110px; } .pond.n9 .obj, .pond.n10 .obj { --s: 100px; }
  .bruce-mini { width: 72px; }
}
