/* BuzzClass shared styles. No external fonts or assets: everything loads from this site. */

:root {
  --honey: #F7B52B;
  --honey-deep: #D9940A;
  --ink: #1B1B1B;
  --cream: #FFF8E7;
  --paper: #FFFFFF;
  --sky: #4FB3E8;
  --leaf: #4CAF3E;
  --berry: #EF5B84;
  --grape: #8E6CEF;
  --tangerine: #FF8A3D;
  --teal: #22B5A6;
  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", system-ui, sans-serif;
  --read-font: "Andika", "Comic Sans MS", "Comic Neue", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66v34' fill='none' stroke='%23F7B52B' stroke-opacity='.22' stroke-width='2'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream) var(--hex);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}

img { -webkit-user-drag: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  font-weight: 800;
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  text-decoration: none;
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: .55em 1.4em;
  background: var(--honey);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn-white { background: var(--paper); }
.btn-sky { background: var(--sky); color: #fff; }
.btn-berry { background: var(--berry); color: #fff; }
.btn-leaf { background: var(--leaf); color: #fff; }
.btn-grape { background: var(--grape); color: #fff; }

.btn-round {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .08s, box-shadow .08s;
}
.btn-round:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn-round svg { width: 32px; height: 32px; }

/* ---------- Home ---------- */

.hero {
  text-align: center;
  padding: max(28px, env(safe-area-inset-top)) 16px 8px;
}
.hero-bee {
  width: clamp(120px, 26vw, 190px);
  animation: hover 2.6s ease-in-out infinite;
}
.hero h1 {
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  margin: 0;
  letter-spacing: -.02em;
  line-height: 1;
}
.tagline {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  margin: .5em auto .8em;
  max-width: 30ch;
  font-weight: 600;
}
.star-pill {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: .3em 1em .3em .6em;
  font-weight: 800;
  font-size: 1.3rem;
}
.star-pill svg { width: 30px; height: 30px; }

main.home-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.band { margin-top: 28px; }
.band h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5em;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin: 0 0 14px;
}
.band-tag {
  background: var(--ink);
  color: var(--honey);
  padding: .25em .8em;
  border-radius: 999px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 32px;
  box-shadow: 0 8px 0 var(--ink);
  overflow: hidden;
  transition: transform .1s, box-shadow .1s;
}
.card:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--ink); }
.card h3 { font-size: 1.7rem; margin: 14px 20px 2px; }
.card p { margin: 0 20px 20px; font-size: 1.1rem; font-weight: 600; }

.art {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-bottom: 4px solid var(--ink);
}
.card-sky .art { background: #BFE6FA; }
.card-leaf .art { background: #CDEFBF; }
.card-berry .art { background: #FFD3DF; }

.art-bubbles span {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,.2);
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.9) 0 7%, rgba(255,255,255,.25) 8% 20%, transparent 21%), var(--sky);
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.12);
  animation: bob 3s ease-in-out infinite;
}
.art-bubbles span:nth-child(2) { background-color: var(--berry); animation-delay: -1s; transform: translateY(-14px); }
.art-bubbles span:nth-child(3) { background-color: var(--grape); animation-delay: -2s; }

.art-bees img { width: 74px; animation: hover 2.4s ease-in-out infinite; }
.art-bees img:nth-child(2) { animation-delay: -.8s; margin-top: -40px; }
.art-bees img:nth-child(3) { animation-delay: -1.6s; }

.art-word { flex-direction: column; gap: 4px; }
.art-word .emoji { font-size: 4.4rem; line-height: 1; }
.art-word .w {
  font-family: var(--read-font);
  font-size: 2rem;
  font-weight: 700;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0 .6em;
}

.card-soon {
  justify-content: center;
  align-items: center;
  min-height: 200px;
  border-style: dashed;
  box-shadow: none;
  background: transparent;
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  padding: 20px;
}
.card-soon:active { transform: none; }

.foot {
  text-align: center;
  padding: 24px 16px max(28px, env(safe-area-inset-bottom));
  font-weight: 700;
  font-size: 1.05rem;
}
.foot a { text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Pledge page ---------- */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px 40px;
  font-size: 1.15rem;
  line-height: 1.55;
  -webkit-user-select: text;
  user-select: text;
}
.page-head { display: flex; align-items: center; gap: 14px; }
.page-head img { width: 72px; }
.page h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0; line-height: 1.1; }
.page h2 { font-size: 1.5rem; margin: 1.8em 0 .4em; }
.pledge-list { list-style: none; padding: 0; margin: 1.2em 0; display: grid; gap: 12px; }
.pledge-list li {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 14px 18px;
}
.pledge-list strong { display: block; font-size: 1.25rem; }
.page .btn { font-size: 1.2rem; }
.back { display: inline-block; margin-top: 1.5em; font-weight: 800; }

/* ---------- Game shell ---------- */

body.game {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
}

.dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  transition: background .2s, transform .2s;
}
.dot.on { background: var(--sky); transform: scale(1.1); }
.dot.star { background: var(--honey); }

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px max(16px, env(safe-area-inset-bottom));
  position: relative;
}

.prompt {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 28px;
  padding: 6px 26px;
  box-shadow: 0 6px 0 var(--ink);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
}
.prompt .target {
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: 1.1;
  color: var(--berry);
  min-width: 1ch;
  text-align: center;
}

/* ---------- Overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 16px;
  text-align: center;
  background: var(--cream) var(--hex);
  overflow-y: auto;
}
.overlay.hidden { display: none; }
.overlay .bee { width: clamp(110px, 24vmin, 200px); animation: hover 2.6s ease-in-out infinite; }
.overlay h1 { font-size: clamp(2.4rem, 8vw, 4rem); margin: 0; line-height: 1; }
.overlay p.big { font-size: clamp(1.3rem, 3.6vw, 1.8rem); font-weight: 700; margin: 0; }
.choices { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.choice { min-width: 150px; font-size: clamp(1.6rem, 5vw, 2.2rem); border-radius: 28px; }
.overlay .home-link { margin-top: 6px; }

.star-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 560px; }
.star-row svg { width: clamp(36px, 8vw, 52px); height: auto; }
.star-row .earned { animation: starIn .4s cubic-bezier(.3,1.6,.5,1) both; }

/* ---------- Bubble Pop ---------- */

.bubbles {
  flex: 1;
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: space-evenly;
  justify-items: center;
  gap: 12px;
  padding-top: 12px;
}
@media (orientation: portrait) {
  .bubbles { grid-template-columns: repeat(2, 1fr); }
}

.bubble {
  --c: var(--sky);
  width: clamp(92px, 21vmin, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  padding: 0;
  font-weight: 900;
  font-size: clamp(2.6rem, 10vmin, 5.2rem);
  color: #fff;
  text-shadow: 0 4px 0 rgba(0,0,0,.18);
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.95) 0 7%, rgba(255,255,255,.3) 8% 20%, transparent 21%), var(--c);
  box-shadow: inset -10px -14px 0 rgba(0,0,0,.13), 0 8px 0 rgba(0,0,0,.1);
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  transition: opacity .3s, filter .3s;
}
.bubble.dim { opacity: .35; filter: grayscale(.6); }
.bubble.wiggle { animation: wiggle .45s ease; }
.bubble.pop { animation: pop .35s ease-out forwards; pointer-events: none; }

/* ---------- Count the Bees ---------- */

.ask {
  font-size: clamp(1.5rem, 4.4vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 10px;
}

.meadow {
  position: relative;
  flex: 1;
  min-height: 0;
  width: min(100%, 960px);
  border: 4px solid var(--ink);
  border-radius: 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 88%, #FFE066 0 10px, transparent 11px),
    radial-gradient(circle at 34% 94%, #FF9EBB 0 10px, transparent 11px),
    radial-gradient(circle at 63% 90%, #FFFFFF 0 10px, transparent 11px),
    radial-gradient(circle at 86% 93%, #C9A7FF 0 10px, transparent 11px),
    linear-gradient(#BDE9FF, #E6F7FF 72%, #A7DC8E 72%, #8CCF70);
}

.bee-btn {
  position: absolute;
  width: clamp(64px, 13vmin, 112px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: none;
  border: 0;
  padding: 0;
  border-radius: 50%;
}
.bee-btn img {
  width: 100%;
  height: 100%;
  display: block;
  animation: hover 2.4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.bee-btn.counted { background: radial-gradient(circle, rgba(255,255,255,.95) 0 58%, transparent 60%); }
.bee-btn.counted::after {
  content: attr(data-n);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 40px;
  height: 40px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--berry);
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
  border: 3px solid var(--ink);
  animation: starIn .3s cubic-bezier(.3,1.6,.5,1) both;
}
.bee-btn.wiggle img { animation: wiggle .45s ease; }

.answers {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding-top: 16px;
}
.answer {
  width: clamp(84px, 16vmin, 128px);
  aspect-ratio: 1;
  border-radius: 26px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 6px 0 var(--ink);
  font-size: clamp(2.4rem, 8vmin, 4.2rem);
  font-weight: 900;
  padding: 0;
  transition: transform .08s, box-shadow .08s, opacity .3s;
}
.answer:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.answer.right { background: var(--leaf); color: #fff; }
.answer.dim { opacity: .3; }

/* ---------- Word Garden ---------- */

.picture {
  font-size: clamp(6rem, 28vmin, 13rem);
  line-height: 1.15;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 40px;
  padding: .1em .35em;
  box-shadow: 0 8px 0 var(--ink);
  animation: popIn .35s cubic-bezier(.3,1.6,.5,1) both;
}
.words {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(20px, 5vmin, 44px);
}
.word {
  font-family: var(--read-font);
  font-size: clamp(2.4rem, 8vmin, 4.2rem);
  font-weight: 700;
  letter-spacing: .04em;
  min-width: 3.6em;
  padding: .2em .7em;
  border-radius: 26px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 6px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, opacity .3s;
}
.word:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.word.right { background: var(--leaf); color: #fff; }
.word.dim { opacity: .3; }

/* ---------- Effects ---------- */

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i {
  position: absolute;
  top: -24px;
  left: var(--x);
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: var(--c);
  animation: fall var(--t) ease-in var(--d) forwards;
}

.spark {
  position: fixed;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--c);
  pointer-events: none;
  z-index: 35;
  animation: spark .5s ease-out forwards;
}

@keyframes hover { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes pop { 0% { transform: scale(1); opacity: 1; } 60% { transform: scale(1.35); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Feed the Monster ---------- */

.hidden { display: none !important; }

.monster-stage { justify-content: space-evenly; }
.monster-box { position: relative; flex: none; }
.monster {
  display: block;
  width: clamp(170px, 36vmin, 330px);
  height: auto;
  overflow: visible;
  cursor: pointer;
}
.m-all { transform-box: view-box; transform-origin: 100px 190px; }
.m-mouth { transform-box: view-box; transform-origin: 100px 110px; animation: breathe 2.2s ease-in-out infinite; }
.m-eyes { transform-box: view-box; transform-origin: 100px 76px; animation: blink 4.5s infinite; }
.monster.chomp .m-mouth { animation: chomp .28s ease-in-out 3; }
.monster.chomp .m-all { animation: happyHop .85s ease-out; }
.monster.shake .m-all { animation: headShake .6s ease; }

.hint {
  position: absolute;
  top: -6px;
  right: -14%;
  min-width: 1.6em;
  padding: 0 .3em;
  font-size: clamp(2.6rem, 9vmin, 4.4rem);
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 5px 0 var(--ink);
  color: var(--grape);
  animation: popIn .3s cubic-bezier(.3,1.6,.5,1) both;
}

.fruit-row {
  display: flex;
  gap: clamp(16px, 5vw, 48px);
  justify-content: center;
  align-items: center;
  min-height: clamp(120px, 24vmin, 200px);
}
.fruit-row .bubble {
  width: clamp(110px, 23vmin, 190px);
  animation: floatIn .5s cubic-bezier(.3,1.4,.5,1) both, bob 3.2s ease-in-out .6s infinite;
  animation-delay: var(--d, 0s), calc(var(--d, 0s) + .6s);
}
.fruit-row .bubble.wiggle { animation: wiggle .45s ease; }
.fruit-row .bubble.dim { opacity: .45; }

.bubble.flying {
  position: fixed;
  margin: 0;
  z-index: 30;
  animation: none;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.5,0,.8,.6), opacity .5s;
}

.reward {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: clamp(120px, 24vmin, 200px);
  padding: 8px 28px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 32px;
  box-shadow: 0 6px 0 var(--ink);
  animation: popIn .35s cubic-bezier(.3,1.6,.5,1) both;
}
.reward-pic { font-size: clamp(4rem, 15vmin, 7rem); line-height: 1; }
.reward-text { font-size: clamp(1.8rem, 6vmin, 3rem); font-weight: 900; }

.known { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 640px; }
.known span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
}
.known span.got { background: var(--honey); }

.sticker-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 800;
  font-size: 1.3rem;
}
.sticker-big { font-size: 5rem; line-height: 1.1; animation: starIn .5s cubic-bezier(.3,1.6,.5,1) .8s both; }
.clubhouse {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 600px;
  font-size: 2rem;
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 20px;
  padding: 8px 14px;
}
.clubhouse:empty { display: none; }

@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.88); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes chomp { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.06); } }
@keyframes happyHop { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-18px) scale(1.04, .96); } 60% { transform: translateY(0) scale(.97, 1.03); } }
@keyframes headShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } 75% { transform: rotate(-3deg); } }
@keyframes floatIn { from { transform: translateY(80px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Home card art for Feed the Monster */
.card-grape .art { background: #E3D9FF; }
.art-monster svg { width: 128px; height: 128px; }
.art-letter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,.2);
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.9) 0 7%, rgba(255,255,255,.25) 8% 20%, transparent 21%), var(--berry);
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.12);
  animation: bob 3s ease-in-out infinite;
}

/* Home card art for Math Maze */
.card-maze .art { background: #CDEFBF; position: relative; }
.art-maze svg { width: 230px; height: auto; }
.art-maze img { position: absolute; width: 58px; left: calc(50% - 112px); bottom: 18px; animation: hover 2.4s ease-in-out infinite; }
