/* ====================================================
   TOKENS
==================================================== */
:root{
  --ink:        #1A1B4B;
  --ink-soft:   #2C2E6B;
  --paper:      #F7F7F2;
  --pink:       #FF5C7A;
  --pink-deep:  #E8425F;
  --marigold:   #FFB84D;
  --teal:       #4ECDC4;
  --teal-deep:  #33A69E;
  --yellow:     #FFE66D;
  --violet:     #8C7CFF;

  --font-display: "Baloo 2", ui-rounded, "Segoe UI", sans-serif;
  --font-body: "Nunito", ui-rounded, "Segoe UI", sans-serif;

  --radius-lg: 32px;
  --radius-md: 20px;
  --shadow-pop: 0 12px 0 rgba(26,27,75,0.9);
  --shadow-soft: 0 10px 30px rgba(26,27,75,0.12);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255,184,77,0.16), transparent 40%),
    radial-gradient(circle at 88% 18%, rgba(78,205,196,0.16), transparent 42%),
    radial-gradient(circle at 50% 95%, rgba(255,92,122,0.14), transparent 45%);
}

h1,h2{ font-family: var(--font-display); margin:0; }
p{ line-height:1.6; }

::selection{ background: var(--yellow); color: var(--ink); }

/* focus visibility */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible{
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ====================================================
   TOPBAR
==================================================== */
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(26,27,75,0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(247,247,242,0.08);
}

.brand{ display:flex; align-items:center; gap:10px; }
.brand-blob{
  width: 26px; height:26px; border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
  background: linear-gradient(135deg, var(--pink), var(--marigold));
  display:inline-block;
  animation: blobmorph 5s ease-in-out infinite;
}
.brand-blob.small{ width:20px; height:20px; }
.brand-text{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}

.stat-cluster{ display:flex; gap: 22px; align-items:flex-end; }
.stat{ display:flex; flex-direction:column; align-items:center; min-width: 46px; }
.stat-num{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--yellow);
  line-height:1;
}
.stat-best .stat-num{ color: var(--teal); }
.stat-label{
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.65;
  margin-top: 3px;
}

.mute-btn{
  width: 38px; height:38px;
  border-radius: 50%;
  border: none;
  background: rgba(247,247,242,0.1);
  color: var(--paper);
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mute-btn:hover{ background: rgba(247,247,242,0.2); transform: scale(1.08); }
.mute-btn:active{ transform: scale(0.92); }

/* ====================================================
   HERO
==================================================== */
.hero{
  text-align:center;
  padding: 64px 20px 30px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-title{
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1;
  display:flex;
  flex-wrap:wrap;
  gap: 0.28em;
  justify-content:center;
}
.wobble{
  display:inline-block;
  animation: wobble-in 0.7s cubic-bezier(.34,1.56,.64,1) both;
  animation-delay: var(--d);
}
.wobble.accent{
  color: var(--pink);
  -webkit-text-stroke: 1.5px var(--ink);
}
.hero-sub{
  margin: 22px auto 0;
  font-size: 1.08rem;
  opacity: 0.82;
  max-width: 540px;
}
.hero-hint{
  margin-top: 26px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 0.85rem;
  font-weight:700;
  color: var(--teal);
  animation: point-bounce 1.8s ease-in-out infinite;
}

/* ====================================================
   POP ZONE (signature bubble field)
==================================================== */
.pop-zone{
  position: relative;
  height: min(72vh, 620px);
  margin: 10px 16px 60px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #21226B 0%, #171840 100%);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(247,247,242,0.06), var(--shadow-soft);
  cursor: crosshair;
  touch-action: none;
}
.floor-line{
  position:absolute;
  left:0; right:0; bottom: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(247,247,242,0.18) 0 10px, transparent 10px 22px);
}

.bubble{
  position:absolute;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  will-change: transform;
  cursor: pointer;
  user-select:none;
  box-shadow: inset -6px -8px 0 rgba(0,0,0,0.08), inset 6px 6px 0 rgba(255,255,255,0.18);
}
.bubble::after{
  content:"";
  position:absolute;
  top: 18%; left: 22%;
  width: 26%; height: 18%;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  filter: blur(1px);
}
.bubble.popping{
  animation: bubble-pop 0.32s ease forwards;
  pointer-events:none;
}

.pop-particle{
  position:absolute;
  border-radius: 2px;
  pointer-events:none;
}

.pop-zone-empty-msg{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  opacity:0.5;
  pointer-events:none;
}

/* ====================================================
   SHARED PANEL LAYOUT
==================================================== */
.panel{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items:center;
  max-width: 1120px;
  margin: 0 auto 90px;
  padding: 0 24px;
}
.panel-copy{ max-width: 460px; }
.eyebrow{
  display:inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--marigold);
  margin-bottom: 10px;
}
.panel-copy h2{
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin-bottom: 12px;
}
.panel-copy p{
  opacity: 0.82;
  font-size: 1rem;
}

@media (max-width: 860px){
  .panel{ grid-template-columns: 1fr; text-align:center; }
  .panel-copy{ max-width: none; margin: 0 auto; }
  .doodle-tools{ justify-content:center; }
  .whack-hud{ align-items:center; }
}

/* ====================================================
   SQUISH PAD
==================================================== */
.squish-stage{
  display:flex; align-items:center; justify-content:center;
  height: 320px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 40%, #2C2E6B, #1A1B4B);
  touch-action:none;
}
#squishBlob{ cursor: grab; }
#squishBlob:active{ cursor: grabbing; }

/* ====================================================
   CONFETTI
==================================================== */
.confetti-panel{ position:relative; }
.fire-btn{
  margin-top: 20px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 14px 26px;
  border:none;
  border-radius: 999px;
  background: var(--pink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight:700;
  font-size: 1rem;
  cursor:pointer;
  box-shadow: 0 6px 0 var(--pink-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fire-btn:hover{ transform: translateY(-2px); }
.fire-btn:active{ transform: translateY(4px); box-shadow: 0 2px 0 var(--pink-deep); }
.fire-btn.secondary-btn{
  background: var(--teal);
  box-shadow: 0 6px 0 var(--teal-deep);
  font-size: 0.92rem;
  padding: 11px 20px;
}
.confetti-canvas{
  width: 100%;
  height: 340px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #21226B, #171840);
  display:block;
}

/* ====================================================
   DOODLE WALL
==================================================== */
.doodle-tools{
  margin-top: 20px;
  display:flex;
  align-items:center;
  gap: 18px;
  flex-wrap:wrap;
}
.swatches{ display:flex; gap:8px; }
.swatch{
  width: 30px; height:30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor:pointer;
  padding:0;
  transition: transform 0.12s ease;
}
.swatch:hover{ transform: scale(1.12); }
.swatch.active{ border-color: var(--paper); transform: scale(1.15); }
.tool-btn{
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid rgba(247,247,242,0.3);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-weight:700;
  font-size: 0.85rem;
  cursor:pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tool-btn:hover{ background: rgba(247,247,242,0.1); border-color: var(--paper); }

.doodle-stage{
  position:relative;
  border-radius: var(--radius-lg);
  overflow:hidden;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.doodle-canvas{
  width:100%;
  height: 340px;
  display:block;
  cursor: crosshair;
  touch-action:none;
}
.doodle-placeholder{
  position:absolute;
  top:50%; left:50%;
  transform: translate(-50%,-50%);
  color: rgba(26,27,75,0.28);
  font-family: var(--font-display);
  font-size: 1.4rem;
  pointer-events:none;
}

/* ====================================================
   WHACK-A-MOOD
==================================================== */
.whack-hud{
  margin-top: 20px;
  display:flex;
  flex-direction:column;
  gap: 14px;
  align-items:flex-start;
}
.whack-score{
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight:700;
}
.whack-score span{ color: var(--yellow); font-size: 1.4rem; }
.whack-timer-track{
  width: 200px;
  height: 8px;
  border-radius: 999px;
  background: rgba(247,247,242,0.15);
  overflow:hidden;
}
.whack-timer-fill{
  height:100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--yellow));
  border-radius: 999px;
  transition: width 0.1s linear;
}

.whack-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.whack-hole{
  position:relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #171840, #0F1030);
  box-shadow: inset 0 8px 18px rgba(0,0,0,0.55), inset 0 -3px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  cursor:pointer;
}
.whack-critter{
  position:absolute;
  left:50%;
  bottom:-100%;
  width: 62%;
  height: 62%;
  transform: translateX(-50%);
  border-radius: 45% 45% 50% 50%;
  transition: bottom 0.16s cubic-bezier(.34,1.56,.64,1);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 1.8rem;
}
.whack-critter.up{ bottom: 10%; }
.whack-critter.hit{
  animation: critter-hit 0.35s ease forwards;
}

/* ====================================================
   FOOTER
==================================================== */
.footer{
  text-align:center;
  padding: 40px 24px 60px;
  opacity:0.6;
  font-size: 0.88rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}

/* ====================================================
   TOAST
==================================================== */
.toast{
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  opacity:0;
  pointer-events:none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  white-space:nowrap;
}
.toast.show{
  opacity:1;
  transform: translate(-50%, 0);
}

/* ====================================================
   KEYFRAMES
==================================================== */
@keyframes wobble-in{
  0%{ transform: translateY(40px) rotate(-8deg) scale(0.7); opacity:0; }
  60%{ transform: translateY(-6px) rotate(3deg) scale(1.04); opacity:1; }
  100%{ transform: translateY(0) rotate(0) scale(1); }
}
@keyframes blobmorph{
  0%, 100%{ border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%; }
  50%{ border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%; }
}
@keyframes point-bounce{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(5px); }
}
@keyframes bubble-pop{
  0%{ transform: scale(1); opacity:1; }
  50%{ transform: scale(1.3); opacity:0.7; }
  100%{ transform: scale(0.2); opacity:0; }
}
@keyframes critter-hit{
  0%{ transform: translateX(-50%) scale(1) rotate(0); }
  40%{ transform: translateX(-50%) scale(1.3) rotate(-10deg); }
  100%{ transform: translateX(-50%) scale(0.3) rotate(20deg); opacity:0; bottom:-100%; }
}
