/* ═══════════════════════════════════════════════════════
   UNICORN FOREST — a warm, magical enchanted wood for Ivy.
   Big tap targets, high contrast, no scary pure-black.
   (Variable names kept from the original reef theme so the whole
   stylesheet re-colours from this one block.)
═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@600;700;800&display=swap');

:root {
  --sun:    #c19bff;   /* magical canopy light (top) */
  --aqua:   #8a5cd6;
  --deep:   #43307a;   /* deep enchanted violet (never pure black) */
  --deepest:#271a47;
  --sand:   #cfe8a6;   /* mossy forest-floor glow */
  --coral:  #ff86bd;   /* warm pink accent */
  --coral-d:#e85d9c;
  --gold:   #ffd75e;   /* magic stars */
  --mint:   #7fe6b0;   /* forest green */
  --ink:    #2a184a;
  --paper:  #fbf7ff;
  --round: 'Baloo 2', system-ui, sans-serif;
  --body:  'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; touch-action: manipulation; cursor: pointer; }
img { -webkit-user-drag: none; user-drag: none; }
html, body { height: 100%; }
body {
  font-family: var(--body);
  color: var(--paper);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;   /* no double-tap zoom; single-finger scroll still works */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;   /* no long-press "Save Image / Copy" popup */
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(225,195,255,0.55), transparent 60%),
    linear-gradient(180deg, var(--sun) 0%, var(--aqua) 32%, var(--deep) 72%, var(--deepest) 100%);
}
/* mossy forest-floor glow */
body::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 16%;
  background: radial-gradient(ellipse 80% 130% at 50% 100%, rgba(207,232,166,0.45), transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── rising bubbles ── */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubbles span {
  position: absolute; bottom: -40px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,247,205,0.92), rgba(255,225,150,0.16) 60%, transparent);
  box-shadow: 0 0 8px rgba(255,235,170,0.5);
  animation: rise linear infinite;
}
.bubbles span:nth-child(1){ left: 8%;  width: 16px; height: 16px; animation-duration: 9s;  animation-delay: 0s; }
.bubbles span:nth-child(2){ left: 20%; width: 10px; height: 10px; animation-duration: 7s;  animation-delay: 2s; }
.bubbles span:nth-child(3){ left: 33%; width: 22px; height: 22px; animation-duration: 11s; animation-delay: 1s; }
.bubbles span:nth-child(4){ left: 47%; width: 8px;  height: 8px;  animation-duration: 6s;  animation-delay: 3s; }
.bubbles span:nth-child(5){ left: 58%; width: 14px; height: 14px; animation-duration: 9.5s;animation-delay: 0.5s; }
.bubbles span:nth-child(6){ left: 67%; width: 19px; height: 19px; animation-duration: 12s; animation-delay: 2.5s; }
.bubbles span:nth-child(7){ left: 78%; width: 11px; height: 11px; animation-duration: 8s;  animation-delay: 1.5s; }
.bubbles span:nth-child(8){ left: 88%; width: 15px; height: 15px; animation-duration: 10s; animation-delay: 4s; }
.bubbles span:nth-child(9){ left: 95%; width: 9px;  height: 9px;  animation-duration: 7.5s;animation-delay: 0.8s; }
.bubbles span:nth-child(10){left: 14%; width: 13px; height: 13px; animation-duration: 10.5s;animation-delay: 3.5s; }
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-104vh) translateX(18px); opacity: 0; }
}

/* ── screens ── */
.screen {
  display: none;
  position: fixed; inset: 0; z-index: 2;
  flex-direction: column; align-items: center;
  padding:
    max(0.8rem, env(safe-area-inset-top))
    1rem
    max(0.8rem, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

/* ═══════════ WELCOME / INTRO ═══════════ */
.welcome-box, .intro-box {
  margin: auto; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  max-width: 560px; width: 100%;
}
.eyebrow {
  font-family: var(--body); font-weight: 800; font-size: 0.72rem;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(255,255,255,0.85); text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.title {
  font-family: var(--round); font-weight: 800;
  font-size: clamp(3rem, 16vw, 5.5rem); line-height: 0.95;
  margin: 0.4rem 0; color: #fff;
  text-shadow: 0 3px 0 var(--aqua), 0 6px 16px rgba(0,0,0,0.35);
}
.title .accent { color: var(--gold); }
.buddy { font-size: clamp(4rem, 22vw, 7rem); filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3)); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0) rotate(-3deg);} 50%{ transform: translateY(-12px) rotate(3deg);} }
.subtitle {
  font-family: var(--round); font-weight: 600;
  font-size: clamp(1.1rem, 4.6vw, 1.5rem); color: #fff;
  margin: 0.6rem 0 1.4rem; max-width: 22ch;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.welcome-stars {
  margin-top: 1rem; font-family: var(--round); font-weight: 700;
  font-size: 1.05rem; color: var(--gold); text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* big primary button */
.btn-big {
  font-family: var(--round); font-weight: 800;
  font-size: clamp(1.3rem, 5.5vw, 1.8rem);
  color: var(--ink); background: linear-gradient(180deg, var(--gold), #ffc73a);
  border: none; border-radius: 999px;
  padding: 1rem 2.4rem; min-height: 64px;
  box-shadow: 0 6px 0 #d89b1e, 0 12px 26px rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-big:active { transform: translateY(4px); box-shadow: 0 2px 0 #d89b1e, 0 6px 14px rgba(0,0,0,0.3); }
.btn-ghost {
  margin-top: 0.9rem; font-family: var(--round); font-weight: 700; font-size: 1.15rem;
  color: #fff; background: rgba(255,255,255,0.16);
  border: 2px solid rgba(255,255,255,0.7); border-radius: 999px;
  padding: 0.7rem 1.8rem; min-height: 52px; backdrop-filter: blur(6px);
}
.btn-ghost:active { transform: scale(0.97); }
.btn-tiny {
  margin-top: 1.6rem; font-family: var(--body); font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6); background: none; border: none;
  text-decoration: underline; text-underline-offset: 3px;
}
/* Forge + castle are real play features now — big, finger-sized, on-screen. */
.map-actions { width: 100%; display: flex; gap: 0.6rem; margin-top: 0.2rem; }
.map-action {
  flex: 1; min-height: 56px; font-family: var(--round); font-weight: 800;
  font-size: 1.05rem; color: #2a184a; border: none; border-radius: 16px;
  padding: 0.6rem 0.4rem; box-shadow: 0 4px 0 rgba(0,0,0,0.18);
}
.map-action.forge  { background: linear-gradient(180deg, #ffe08a, #ffc23d); }
.map-action.castle { background: linear-gradient(180deg, #ffb3d9, #ff86bd); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.28); }
.map-action:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.18); }
/* Forge has crystals waiting to combine → it glows so she notices the loop. */
.map-action.forge.ready { animation: forge-ready 1.4s ease-in-out infinite; }
.map-action.forge b { font-size: 1.15em; }
@keyframes forge-ready {
  0%,100% { box-shadow: 0 4px 0 rgba(0,0,0,0.18), 0 0 0 rgba(255,215,94,0); }
  50%     { box-shadow: 0 4px 0 rgba(0,0,0,0.18), 0 0 16px rgba(255,215,94,0.9); }
}
/* The whole play area jolts when a geode finally cracks open — it really broke. */
.reef-jolt { animation: reef-jolt 0.42s cubic-bezier(0.36,0.07,0.19,0.97); }
@keyframes reef-jolt {
  0%,100% { transform: translate(0,0); }
  15% { transform: translate(-6px,3px); } 30% { transform: translate(6px,-3px); }
  45% { transform: translate(-5px,-2px); } 60% { transform: translate(4px,3px); }
  75% { transform: translate(-3px,1px); } 90% { transform: translate(2px,-1px); }
}
.btn-tiny.margin-top, .map-foot-row .btn-tiny { margin-top: 0; }

.intro-art { font-size: clamp(3.5rem, 18vw, 6rem); filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3)); animation: bob 2.6s ease-in-out infinite; }
.intro-text {
  font-family: var(--round); font-weight: 700;
  font-size: clamp(1.4rem, 6vw, 2.1rem); color: #fff; line-height: 1.3;
  margin: 1.4rem 0 1.8rem; max-width: 18ch;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* ═══════════ PLAY ═══════════ */
#screen-play { justify-content: space-between; }

.hud { width: 100%; max-width: 640px; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.zone-track { display: flex; gap: 0.4rem; align-items: center; }
.zone-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1rem;
  background: rgba(255,255,255,0.14); border: 2px solid rgba(255,255,255,0.25);
  filter: grayscale(0.8) brightness(0.8); opacity: 0.7;
  transition: all 0.3s;
}
.zone-dot.done, .zone-dot.lit { filter: none; opacity: 1; background: rgba(255,215,94,0.22); border-color: var(--gold); }
.zone-dot.current {
  filter: none; opacity: 1; transform: scale(1.2);
  background: rgba(255,255,255,0.28); border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25), 0 0 16px rgba(255,255,255,0.5);
}
.star-counter {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--round); font-weight: 800; font-size: 1.5rem; color: #fff;
  background: rgba(9,48,72,0.45); border: 2px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 0.2rem 0.9rem 0.2rem 0.6rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.star-ico { font-size: 1.3rem; }
/* gem haul (crystals mined toward the castle) — sits next to the star count */
.hud-counts { display: flex; align-items: center; gap: 0.4rem; }
.gem-counter {
  display: flex; align-items: center; gap: 0.3rem;
  font-family: var(--round); font-weight: 800; font-size: 1.4rem; color: #fff;
  background: rgba(127,90,200,0.4); border: 2px solid rgba(199,155,255,0.6);
  border-radius: 999px; padding: 0.2rem 0.8rem 0.2rem 0.55rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.gem-counter.bump { animation: gem-bump 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes gem-bump { 0%,100%{transform:scale(1);} 45%{transform:scale(1.25);} }
.gem-ico { font-size: 1.2rem; }
.fly-gem { position: fixed; z-index: 60; font-size: 1.8rem; pointer-events: none; transition: all 0.8s cubic-bezier(0.4,0,0.2,1); }
.hud-zone {
  text-align: center; font-family: var(--round); font-weight: 700;
  font-size: 1.1rem; color: #fff; margin-top: 0.5rem;
  letter-spacing: 0.02em; text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
/* the castle goal banner: what the next part needs, so mining has a visible aim */
.castle-goal {
  text-align: center; font-family: var(--round); font-weight: 800;
  font-size: 0.95rem; color: var(--gold); margin-top: 0.2rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4); min-height: 1.1em;
}
.castle-goal b { color: #fff; }
/* the sparkly hammer she whacks the geode with */
.q-hammer {
  position: absolute; right: 6%; top: 8%; font-size: clamp(2.6rem, 13vw, 4rem);
  transform: rotate(18deg); transform-origin: bottom right;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4)); pointer-events: none;
}
.q-rock.hit .q-hammer { animation: q-whack 0.18s; }
@keyframes q-whack { 0%{transform:rotate(18deg);} 50%{transform:rotate(-22deg) translateY(8px);} 100%{transform:rotate(18deg);} }
.q-rock-spark {
  position: absolute; left: 10%; top: 12%; font-size: clamp(1.4rem, 7vw, 2.2rem);
  animation: q-sparkle 1.6s ease-in-out infinite; pointer-events: none;
}
@keyframes q-sparkle { 0%,100%{opacity:0.3; transform:scale(0.8) rotate(0deg);} 50%{opacity:1; transform:scale(1.15) rotate(20deg);} }
.q-rock.cracked .q-hammer, .q-rock.cracked .q-rock-spark { display: none; }

.play-main {
  flex: 1; width: 100%; max-width: 640px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; min-height: 0;
}
.q-prompt {
  font-family: var(--round); font-weight: 800;
  font-size: clamp(1.5rem, 6.5vw, 2.2rem); color: #fff; text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* the things being counted */
.q-objects {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.3rem 0.5rem; width: 100%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.22);
  border-radius: 26px; padding: 0.9rem 0.8rem; min-height: 96px;
  backdrop-filter: blur(4px);
}
.q-objects.recognize { background: none; border: none; min-height: 80px; }
.obj-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.2rem 0.35rem; }
.obj {
  font-size: clamp(2rem, 9vw, 3.1rem); line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.25));
  animation: pop 0.35s cubic-bezier(0.34,1.56,0.64,1) backwards;
  transition: transform 0.2s, filter 0.2s;
}
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.obj.gone { opacity: 0.28; filter: grayscale(0.7) drop-shadow(0 3px 5px rgba(0,0,0,0.2)); }
.obj.lit {
  transform: scale(1.35) translateY(-4px);
  filter: drop-shadow(0 0 14px var(--gold)) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
/* Tap-to-count: each creature is a big tap target; tapping it pops a count
   number above it (1, 2, 3 …) and lights it so he sees what he's counted. */
.obj.tappable { cursor: pointer; position: relative; }
.obj.counted {
  transform: scale(1.12) translateY(-2px);
  filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.count-num {
  position: absolute; top: -0.55em; right: -0.35em;
  min-width: 1.35em; height: 1.35em; padding: 0 0.18em;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--round); font-weight: 800; font-size: 0.92rem;
  color: #4a2c00; background: var(--gold);
  border-radius: 999px; border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.35);
  animation: pop 0.3s cubic-bezier(0.34,1.56,0.64,1) backwards;
}
.op-chip {
  font-family: var(--round); font-weight: 800; font-size: 2.2rem; color: var(--gold);
  padding: 0 0.3rem;
  /* Dark outline so the light-yellow +/− stays readable on light backgrounds too. */
  text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.6);
}

/* ── Arithmetic (add / subtract): three representations ──────────────── */
/* All three lay out the same .obj spans (so tap-to-count works); they differ
   only in arrangement. Stack the optional equation strip above the creatures. */
.q-objects.arith { flex-direction: column; gap: 0.55rem; }
.arith-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.25rem 0.6rem; }
/* Symbolic: the written number sentence, e.g. 3 + 2 = ▢ */
.equation { display: flex; align-items: center; justify-content: center; gap: 0.3rem; font-family: var(--round); font-weight: 800; }
.equation .eq-n { font-size: clamp(1.9rem, 8.5vw, 2.9rem); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.equation .eq-op { font-size: clamp(1.5rem, 6.5vw, 2.2rem); color: var(--gold); text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.6); }
.equation .eq-box {
  font-size: clamp(1.9rem, 8.5vw, 2.7rem); color: var(--gold);
  text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.6);
  min-width: 1.25em; height: 1.25em; display: inline-flex; align-items: center; justify-content: center;
  border: 3px dashed var(--gold); border-radius: 12px;
}
/* Ten-frame arithmetic: shrink the creatures to fit the cells; tint addend #2. */
.arith-frame .tf-obj { font-size: clamp(1.05rem, 5.2vw, 1.6rem); filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25)); }
.tf-cell.tf-a2.filled { background: rgba(120,200,255,0.30); border-color: #6cc6e6; }

/* ── Other counting puzzle types ─────────────────────────────────── */
/* Count out N / ten-frame: the "build a quantity" layouts. */
.q-objects.countout { flex-direction: column; gap: 0.5rem; }
.q-objects.countout .big-numeral { margin-bottom: 0.1rem; }
/* The net: where he drops what he's counted out. */
.net {
  min-height: 56px; min-width: 70%; padding: 0.35rem 0.7rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.15rem 0.3rem;
  background: rgba(255,255,255,0.12); border: 3px dashed rgba(255,255,255,0.5); border-radius: 18px;
}
.net .caught { font-size: clamp(1.3rem, 6vw, 2rem); animation: pop 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.school { opacity: 0.97; }
.school .obj.used { opacity: 0.18; transform: scale(0.8); pointer-events: none; }
/* Ten-frame: a 2×5 grid he fills cell by cell. */
.tenframe {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 6px; background: rgba(255,255,255,0.14); border-radius: 16px;
}
.tf-cell {
  width: clamp(34px, 11vw, 52px); height: clamp(34px, 11vw, 52px);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.2rem, 6vw, 1.9rem); line-height: 1;
  background: rgba(0,0,0,0.18); border: 2px solid rgba(255,255,255,0.4); border-radius: 10px;
}
.tf-cell.filled { background: rgba(255,215,94,0.22); border-color: var(--gold); animation: pop 0.25s cubic-bezier(0.34,1.56,0.64,1); }

/* "Ten and more": a full ten-frame + the extra ones, read as 10 + k. */
.q-objects.teenframe { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 0.7rem; align-items: center; justify-content: center; }
.teen-ten .tf-cell { animation: none; }
.teen-plus { font-family: var(--round); font-weight: 800; font-size: clamp(1.8rem, 8vw, 2.6rem); color: var(--gold); }
.teen-extra { display: flex; flex-wrap: wrap; gap: 4px; max-width: 30vw; }
.teen-extra .obj { font-size: clamp(1.4rem, 7vw, 2.1rem); }

/* Make ten (within 20): two ten-frames — first fills to ten, rest spill over. */
.q-objects.maketen { flex-direction: column; flex-wrap: nowrap; gap: 0.45rem; }   /* never wrap into a side column */
.double-frame { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.df-frame { gap: 3px; padding: 5px; }
.df-frame .tf-cell { width: clamp(26px, 8vw, 42px); height: clamp(26px, 8vw, 42px); border-radius: 8px; }
.df-frame .tf-obj { font-size: clamp(0.9rem, 4.3vw, 1.5rem); }

/* ── Two-step strategy strip (Rose 2026-07-17: break double-digit +/− down) ──
   Each hop is a mini number sentence chip: the live hop glows with its blank,
   a finished hop shows the answer + a tick, the hop ahead waits dimmed. */
.steps-strip { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.step-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--round); font-weight: 800;
  font-size: clamp(1.1rem, 4.6vw, 1.6rem); line-height: 1;
  padding: 0.35rem 0.6rem; border-radius: 14px;
  background: rgba(255,255,255,0.14);
  border: 2px solid rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
}
.step-chip.step-now { background: rgba(255,255,255,0.24); border-color: var(--gold, #ffd75e); box-shadow: 0 0 14px rgba(255,215,94,0.55); }
.step-chip.step-later { opacity: 0.45; }
.step-chip.step-done { opacity: 0.9; }
.step-tok.step-blank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5em; height: 1.5em; border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.7); color: transparent;
}
.step-chip.step-done .step-tok { color: #baf7c6; }
.step-check { color: #baf7c6; }

/* Think-addition: the missing-addend sentence leads (numbers first, Rose 07-31),
   the ten-frame under it supports counting UP. */
.thinkadd-eq {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  font-family: var(--round); font-weight: 800; margin-bottom: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.thinkadd-eq .ta-tok { font-size: clamp(2rem, 9vw, 2.8rem); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.thinkadd-eq .ta-blank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 56px; border-radius: 12px; color: transparent;
  border: 3px dashed var(--gold, #ffd75e); background: rgba(255,215,94,0.14);
  box-shadow: 0 0 14px rgba(255,215,94,0.5); animation: pulse-glow 1.4s ease-in-out infinite;
}
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 10px rgba(255,215,94,0.4); } 50% { box-shadow: 0 0 20px rgba(255,215,94,0.75); } }
.thinkadd-frame { transform: scale(0.82); opacity: 0.95; margin-top: -0.2rem; }
/* the gap she "adds up" into — empty, glowing, up to the total */
.tf-cell.tf-addup { background: rgba(255,215,94,0.14); border-color: var(--gold, #ffd75e); border-style: dashed; }

/* ── Skip counting made VISIBLE (Rose 2026-07-17) ──────────────────────
   Each term is a column: the jump's objects above, the number chip below.
   2s stack cumulative pairs (8 IS four pairs); 5s/10s show one group per
   jump. The tutorial lights columns one by one as the voice counts. */
.seq.skip-vis { display: flex; align-items: flex-end; justify-content: center; gap: clamp(0.4rem, 2.4vw, 0.9rem); flex-wrap: wrap; }
.skip-col { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; transition: transform 0.25s; }
.skip-grp { display: grid; gap: 2px; justify-items: center; font-size: clamp(0.75rem, 3.4vw, 1.1rem); }
.skip-grid2 { grid-template-columns: repeat(2, auto); }
.skip-grid5 { grid-template-columns: repeat(5, auto); font-size: clamp(0.55rem, 2.6vw, 0.85rem); }
.skip-col.lit { transform: scale(1.14); }
.skip-col.lit .seq-chip { background: rgba(255,215,94,0.4); box-shadow: 0 0 14px rgba(255,215,94,0.7); }

/* ── The column-method DRILL (Rose 2026-07-17): the grid is the puzzle ──
   Bigger and solid (main event, not a reference card); the live column glows,
   answered digits drop into the answer row, blanks wait as dashed boxes. */
.col-play {
  border-style: solid; border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.2);
  padding: 0.5rem 0.9rem 0.6rem;
}
.col-play .col-row { grid-template-columns: 1.6rem 2.6rem 2.6rem; line-height: 1.4; }
.col-play .col-dig-cell, .col-play .col-op-cell { font-size: clamp(1.5rem, 6.5vw, 2.2rem); font-weight: 800; }
.col-play .col-hdr-cell { font-size: 0.95rem; }
.col-play .col-row-ans .col-dig-cell {
  min-height: 2.2rem; border-radius: 10px; margin: 0.2rem 0.15rem 0;
  display: flex; align-items: center; justify-content: center;
}
.col-play .col-blank { border: 2px dashed rgba(255,255,255,0.65); }
.col-play .col-got { background: rgba(186,247,198,0.25); color: #eafff0; }
/* the column being worked right now glows gold */
.col-play[data-live="ones"] .col-o:not(.col-hdr-cell),
.col-play[data-live="tens"] .col-t:not(.col-hdr-cell) {
  background: rgba(255,215,94,0.22); border-radius: 10px;
  box-shadow: 0 0 12px rgba(255,215,94,0.5);
}
.col-play[data-live="read"] .col-row-ans .col-dig-cell {
  box-shadow: 0 0 12px rgba(255,215,94,0.6); background: rgba(255,215,94,0.25); color: #fff;
}

/* ── Column-algorithm widget (Rose 2026-07-14) ──────────────────────────
   Secondary reference card shown alongside the double ten-frame: the same
   written column format Rose teaches at home — tens above tens, ones above
   ones. Compact and dashed so it reads as a reference, not the main event. */
.col-add {
  display: inline-flex; flex-direction: column; align-items: stretch;
  background: rgba(255,255,255,0.12);
  border: 1.5px dashed rgba(255,255,255,0.35);
  border-radius: 12px;
  padding: 0.25rem 0.6rem 0.28rem;
  margin: 0 auto;
}
.col-row {
  display: grid;
  grid-template-columns: 1.35rem 1.85rem 1.85rem;
  column-gap: 0;
  text-align: center;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
/* Header row: small "T" / "O" labels */
.col-row-hdr .col-hdr-cell {
  font-size: 0.56rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding-bottom: 0.1rem;
}
.col-row-hdr .col-op-cell { /* empty spacer for operator column */ }
/* Operator cell ("+", "−") in the second-number row */
.col-op-cell {
  font-size: 1rem; font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 0.18rem; line-height: 1.35;
}
/* Digit cells */
.col-dig-cell {
  font-size: 1.15rem; font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0,0,0,0.5);
  font-family: var(--round);
  min-height: 1.35em;
}
/* Dividing line beneath the second number */
.col-line {
  border-top: 2px solid rgba(255,255,255,0.4);
  margin-top: 0.16rem;
}

/* Mining puzzle: a crystal rock Ivy cracks with the hammer, then adds the loot. */
.q-objects.minerock { background: rgba(255,255,255,0.1); }
.q-rock {
  position: relative; border: none; background: none; cursor: pointer; padding: 0;
  width: clamp(140px, 46vw, 210px); height: clamp(140px, 46vw, 210px);
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.4));
}
.q-rock-e { font-size: clamp(7rem, 36vw, 11rem); line-height: 1; filter: drop-shadow(0 0 14px rgba(199,155,255,0.7)); animation: q-glow 1.8s ease-in-out infinite; }
@keyframes q-glow { 0%,100% { filter: drop-shadow(0 0 12px rgba(199,155,255,0.6)); transform: scale(1); } 50% { filter: drop-shadow(0 0 22px rgba(255,215,94,0.8)); transform: scale(1.05); } }
.q-rock.hit { animation: q-shake 0.18s; }
.q-rock.hit .q-rock-e { animation: none; }
.q-rock.crack2 .q-rock-e { filter: brightness(1.1) drop-shadow(0 0 18px rgba(255,215,94,0.8)); }
.q-rock.crack3 .q-rock-e { filter: brightness(1.18) saturate(1.2) drop-shadow(0 0 26px rgba(255,215,94,0.95)); }
.q-rock.cracked { animation: q-pop 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.q-hammer {
  position: absolute; bottom: -2%; left: -12%; width: 46%; height: 46%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(2.6rem, 14vw, 4.2rem); line-height: 1;
  transform-origin: 34% 82%; transform: rotate(-16deg); pointer-events: none;
}
.q-rock.hit .q-hammer { animation: q-whack 0.18s ease-in-out; }
@keyframes q-whack { 0%,100% { transform: rotate(-16deg); } 45% { transform: rotate(30deg); } }
@keyframes q-shake { 0%,100%{ transform: translate(0,0) rotate(0);} 25%{ transform: translate(-5px,2px) rotate(-3deg);} 75%{ transform: translate(5px,-2px) rotate(3deg);} }
@keyframes q-pop { 0%{ transform: scale(1);} 40%{ transform: scale(1.2) rotate(-3deg);} 100%{ transform: scale(1.05);} }
/* the geode breaks + falls away, then the crystals appear big on a clear panel */
.q-rock.falling { animation: q-fall 0.4s ease-in forwards; pointer-events: none; }
@keyframes q-fall { 0%{ transform: scale(1.05); opacity: 1;} 100%{ transform: translateY(56px) scale(0.55) rotate(10deg); opacity: 0;} }
.q-objects.minereveal { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); box-shadow: inset 0 2px 16px rgba(0,0,0,0.16); animation: q-reveal-in 0.42s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes q-reveal-in { 0%{ opacity: 0; transform: scale(0.55);} 100%{ opacity: 1; transform: scale(1);} }
.q-objects.minereveal .obj { font-size: clamp(1.9rem, 9.5vw, 2.9rem); }
.q-objects.minereveal .tf-obj { font-size: clamp(1.1rem, 5.5vw, 1.8rem); }

/* Number bond: a whole circle over two part circles (one hidden as "?"). */
.q-objects.bond { padding: 0.4rem; }
.bond-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bond-legs { position: relative; width: 130px; height: 22px; }
.bond-legs span { position: absolute; top: 0; left: 50%; width: 2px; height: 30px; background: rgba(255,255,255,0.5); transform-origin: top center; }
.bond-legs span:first-child { transform: rotate(34deg); }
.bond-legs span:last-child { transform: rotate(-34deg); }
.bond-parts { display: flex; gap: 2.6rem; }
.bond-circle {
  width: clamp(76px, 22vw, 104px); height: clamp(76px, 22vw, 104px); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.14); border: 3px solid rgba(255,255,255,0.5);
}
.bond-circle.whole { border-color: var(--gold); background: rgba(255,215,94,0.16); }
.bond-circle.part { border-color: var(--mint); background: rgba(127,230,176,0.14); }
.bond-circle.unknown {
  font-family: var(--round); font-weight: 800; font-size: clamp(2.2rem, 11vw, 3.2rem); color: var(--gold);
  border-style: dashed; animation: bob 2.2s ease-in-out infinite;
}
.bond-num { font-family: var(--round); font-weight: 800; font-size: clamp(1.5rem, 7vw, 2.2rem); color: #fff; line-height: 1; }
.bond-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; max-width: 84%; font-size: clamp(0.6rem, 3vw, 0.9rem); }
/* Ten-bonds: a ten-or-more part reads as ten-frame rows (5 wide), not a jumble. */
.bond-dots.dots-big { display: grid; grid-template-columns: repeat(5, auto); justify-content: center; font-size: clamp(0.5rem, 2.4vw, 0.75rem); }

/* Castle build (missing addend): the part rising, the gems she has, the slots
   she still needs (dashed "?"). "How many more" is something she can see. */
.q-objects.buildmore { flex-direction: column; gap: 0.6rem; }
.bm-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.bm-part {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  font-size: clamp(2.6rem, 13vw, 3.8rem); line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
}
.bm-part-name {
  font-family: var(--round); font-weight: 800; font-size: clamp(0.95rem, 4.5vw, 1.35rem);
  color: var(--gold); text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.bm-gems { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; max-width: 92%; }
.bm-gem {
  width: clamp(2rem, 9vw, 2.8rem); height: clamp(2rem, 9vw, 2.8rem);
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
  font-size: clamp(1.3rem, 6vw, 1.9rem); font-family: var(--round); font-weight: 800;
}
.bm-gem.have { background: rgba(127,230,176,0.18); animation: pop 0.4s ease both; }
.bm-gem.need {
  color: var(--gold); background: rgba(255,215,94,0.12);
  border: 3px dashed var(--gold); animation: bob 2.2s ease-in-out infinite;
}
/* crystals spent building the part (greyed); the rest are what's LEFT */
.bm-gem.spent { opacity: 0.3; filter: grayscale(0.8); }

/* What's missing: a row of numbered chips with one hidden. */
.q-objects.seqrow { padding: 0.6rem; }
.seq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem; }
.seq-chip {
  min-width: 1.7em; padding: 0.2em 0.45em; text-align: center;
  font-family: var(--round); font-weight: 800; font-size: clamp(1.6rem, 8vw, 2.6rem);
  color: #fff; background: rgba(255,255,255,0.14); border-radius: 14px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.seq-chip.hidden {
  background: rgba(255,215,94,0.18); border: 3px dashed var(--gold);
  animation: bob 2.2s ease-in-out infinite;
}

/* More or fewer: two tappable reef cards. */
.q-objects.compare { flex-direction: row; gap: 0.8rem; align-items: stretch; }
.cmp-group {
  flex: 1; min-height: 110px; max-width: 46%; padding: 0.5rem;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 0.1rem 0.2rem;
  background: rgba(255,255,255,0.12); border: 3px solid rgba(255,255,255,0.35); border-radius: 20px;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.15s;
}
.cmp-group:active:not(:disabled) { transform: scale(0.97); }
.cmp-group.correct { border-color: var(--mint); box-shadow: 0 0 22px rgba(110,231,183,0.7); }
.cmp-group.wrong { border-color: #ffb6a3; opacity: 0.65; }
.cmp-obj { font-size: clamp(1.1rem, 5vw, 1.7rem); line-height: 1; }
/* 2-digit numeral compare — a big, high-contrast number on a solid card so it
   reads on any (light) scene background; tap the bigger/smaller. */
.q-objects.compare-num { align-items: center; }
.cmp-numeral {
  min-height: 120px; background: rgba(255,255,255,0.92);
  border-color: rgba(124,92,168,0.55);
}
.cmp-big-num {
  font-size: clamp(3rem, 15vw, 5rem); font-weight: 900; line-height: 1;
  color: #4a2f6e; text-shadow: 0 2px 0 rgba(255,255,255,0.9);
}

/* The "Done" commit button for the build puzzles. */
.q-choices.donebar { grid-template-columns: 1fr; }
.choice-done { background: linear-gradient(180deg, #ffe08a, var(--gold)); color: #4a2c00; box-shadow: 0 5px 0 #d4a017, 0 10px 20px rgba(0,0,0,0.25); }
.recognize-cue { font-size: clamp(3rem, 16vw, 5rem); animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); }

/* "Meet the number" teaching turn: big coral numeral + creatures to count */
.q-objects.teaching { flex-direction: column; gap: 0.6rem; background: none; border: none; }
.q-objects.teaching .obj { font-size: clamp(1.5rem, 7vw, 2.3rem); }
.big-numeral {
  font-family: var(--round); font-weight: 800; color: #fff;
  font-size: clamp(3.6rem, 22vw, 6.5rem); line-height: 1;
  width: clamp(92px, 32vw, 150px); height: clamp(92px, 32vw, 150px);
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--coral), var(--coral-d));
  border-radius: 26px;
  box-shadow: 0 8px 0 #b8431f, 0 14px 30px rgba(0,0,0,0.35);
  text-shadow: 0 3px 0 rgba(0,0,0,0.18);
  animation: reveal 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.big-numeral.hint { animation: reveal 0.5s cubic-bezier(0.34,1.56,0.64,1), glow 0.7s ease-in-out infinite alternate; }

/* dive meter (streak pips) */
.dive-meter { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.dive-pip { font-size: 1.4rem; filter: grayscale(1) brightness(1.4); opacity: 0.45; transition: all 0.3s; }
.dive-pip.on { filter: none; opacity: 1; transform: scale(1.15); animation: pip-pop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes pip-pop { 0%{ transform: scale(0.4);} 70%{ transform: scale(1.4);} 100%{ transform: scale(1.15);} }

/* recognition number line — the level's numbers, lighting gold as mastered */
.dive-meter.numberline { gap: 0.3rem; }
.num-chip {
  min-width: 1.7rem; height: 1.7rem; padding: 0 0.3rem;
  display: grid; place-items: center;
  font-family: var(--round); font-weight: 800; font-size: 1rem;
  border-radius: 8px; color: #fff;
  background: rgba(255,255,255,0.16); border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.3s;
}
.num-chip.got {
  color: var(--ink); background: linear-gradient(180deg, var(--gold), #ffc73a);
  border-color: var(--gold); box-shadow: 0 0 10px rgba(255,215,94,0.7);
  animation: pip-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.num-chip.locked { opacity: 0.35; }

/* answer choices — BIG tap targets */
.q-choices {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem; width: 100%; max-width: 440px; margin-top: 0.3rem;
}
.q-choices[data-count="1"] { grid-template-columns: 1fr; max-width: 240px; }
.q-choices[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.q-choices[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.q-choices[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
.choice {
  font-family: var(--round); font-weight: 800;
  font-size: clamp(2.2rem, 10vw, 3rem); color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #e9f6ff);
  border: none; border-radius: 22px;
  min-height: 84px; padding: 0.4rem;
  box-shadow: 0 5px 0 #9fc4d8, 0 10px 20px rgba(0,0,0,0.25);
  transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
}
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #9fc4d8, 0 5px 12px rgba(0,0,0,0.25); }
.choice:disabled { cursor: default; }
/* Number pad waiting for him to finish counting — dimmed, not interactive yet. */
.choice.await-count { opacity: 0.5; filter: saturate(0.7); }
/* "find the number" — the number's name in words (audio-independent cue). */
.find-word { font-family: var(--round); font-weight: 800; text-transform: capitalize;
  font-size: clamp(1.5rem, 8vw, 2.4rem); color: #fff; margin-top: 0.25rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45); letter-spacing: 0.02em; }
.choice.correct {
  background: linear-gradient(180deg, var(--mint), #34d399); color: #053b2b;
  box-shadow: 0 5px 0 #18a06f, 0 0 24px rgba(110,231,183,0.7);
  animation: correct-pop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes correct-pop { 0%{transform:scale(1);} 50%{transform:scale(1.12);} 100%{transform:scale(1);} }
.choice.wrong { background: linear-gradient(180deg, #ffd9cf, #ffb6a3); color: #7a2c19; opacity: 0.85; box-shadow: 0 4px 0 #d98a73; }
.choice.hint-glow {
  background: linear-gradient(180deg, #fff6d8, var(--gold)); color: var(--ink);
  animation: glow 0.7s ease-in-out infinite alternate;
}
@keyframes glow { from { box-shadow: 0 5px 0 #d89b1e, 0 0 10px rgba(255,215,94,0.6);} to { box-shadow: 0 5px 0 #d89b1e, 0 0 28px rgba(255,215,94,0.95);} }
.shake { animation: shake 0.45s ease-in-out; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }

/* "which way?" — two BIG number cards (the real number + its mirror twin). */
.choice-bigcard {
  font-size: clamp(3.4rem, 19vw, 5.6rem); min-height: clamp(130px, 34vw, 190px);
  border-radius: 28px; line-height: 1;
  background: linear-gradient(180deg, #ffffff, #f1e8ff);
  box-shadow: 0 6px 0 #b69ad8, 0 12px 24px rgba(0,0,0,0.28);
}
.choice-bigcard:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 #b69ad8, 0 6px 14px rgba(0,0,0,0.25); }

/* quantity choices — tap the group with the right number of creatures */
.choice-qty { min-height: 92px; padding: 0.5rem 0.4rem; }
/* Five-frame layout: creatures flow in rows of up to 5 ("five and some more")
   so the quantity is SUBITIZABLE — the kid reads 5+2 as seven at a glance
   instead of counting a scattered blob. Makes pick-the-group a real numeral↔
   quantity test, not a counting-accuracy test. Shared with oceanmath. */
.qty-grp {
  display: grid; grid-template-columns: repeat(5, auto); gap: 3px 6px;
  align-items: center; justify-content: center; align-content: center; line-height: 1;
}
.qty-grp span { font-size: clamp(1.1rem, 4.6vw, 1.5rem); filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2)); }

/* ── controls ── */
.controls {
  width: 100%; max-width: 640px;
  display: flex; align-items: center; justify-content: center; gap: 0.9rem;
  padding-top: 0.4rem;
}
.ctrl {
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 1.4rem; display: grid; place-items: center;
  background: rgba(9,48,72,0.45); border: 2px solid rgba(255,255,255,0.4);
  color: #fff; backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25); transition: transform 0.1s, opacity 0.2s;
}
.ctrl:active { transform: scale(0.92); }
.ctrl-big { width: 66px; height: 66px; font-size: 1.8rem; border-color: var(--gold); background: rgba(255,215,94,0.22); }
.ctrl.muted { opacity: 0.4; }
.ctrl.speaking { border-color: var(--gold); animation: glow 0.8s ease-in-out infinite alternate; }

/* ═══════════ CELEBRATE ═══════════ */
#screen-celebrate.active { overflow-y: auto; }
.celebrate-box {
  margin: auto; text-align: center; max-width: 480px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1rem;
}
.celebrate-bubbles { font-size: 1.8rem; letter-spacing: 0.3rem; animation: bob 2.2s ease-in-out infinite; }
.celebrate-emoji {
  font-size: clamp(4.5rem, 26vw, 8rem);
  filter: drop-shadow(0 0 30px rgba(255,215,94,0.8)) drop-shadow(0 8px 16px rgba(0,0,0,0.3));
  animation: reveal 0.7s cubic-bezier(0.34,1.56,0.64,1), bob 2.6s 0.7s ease-in-out infinite;
}
@keyframes reveal { 0%{transform:scale(0) rotate(-20deg);opacity:0;} 70%{transform:scale(1.15) rotate(6deg);} 100%{transform:scale(1) rotate(0);} }
.celebrate-title {
  font-family: var(--round); font-weight: 800;
  font-size: clamp(1.8rem, 8vw, 2.6rem); color: #fff;
  text-shadow: 0 3px 0 var(--coral-d), 0 6px 14px rgba(0,0,0,0.35);
}
.celebrate-text {
  font-family: var(--round); font-weight: 600;
  font-size: clamp(1.1rem, 4.6vw, 1.4rem); color: #fff; max-width: 20ch;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35); margin-bottom: 0.4rem;
}
/* The reward showcase: the submarine (with its new part) + the whole crew. */
.celebrate-sub {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0.1rem; font-size: clamp(1.7rem, 7.5vw, 2.5rem); line-height: 1; margin: 0.2rem 0 0.3rem;
}
/* The hull is the vessel — make it clearly dominate the little parts so it
   reads as a submarine, not just another reef critter. */
.celebrate-sub .sub-hull, .crew-sub .sub-hull { font-size: 2.4em; }
.celebrate-sub .sub-part, .celebrate-sub .sub-hull { animation: pop 0.45s cubic-bezier(0.34,1.56,0.64,1) backwards; }
.celebrate-sub .sub-part.fresh { animation: partSnap 0.7s cubic-bezier(0.34,1.7,0.5,1) 0.5s backwards; }
@keyframes partSnap { 0%{transform:scale(0) translateY(-14px);opacity:0;} 60%{transform:scale(1.4) translateY(0);} 100%{transform:scale(1);opacity:1;} }
.celebrate-crew {
  display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap;
  gap: 0.25rem 0.35rem; font-size: clamp(1.5rem, 6.5vw, 2.1rem); line-height: 1;
  margin-bottom: 0.7rem; max-width: 22rem;
}
.celebrate-crew .crew-chip { animation: crewIn 0.5s cubic-bezier(0.34,1.56,0.64,1) backwards; }
.celebrate-crew .crew-chip.newbie { animation: crewJoin 0.9s cubic-bezier(0.34,1.6,0.5,1) backwards; }
@keyframes crewIn { from{transform:scale(0) translateY(8px);opacity:0;} to{transform:scale(1);opacity:1;} }
@keyframes crewJoin { 0%{transform:scale(0) translateX(60px) rotate(20deg);opacity:0;} 55%{transform:scale(1.35) rotate(-8deg);} 100%{transform:scale(1) translateX(0) rotate(0);opacity:1;} }
.celebrate-crew .crew-chip.bob { animation: crewIn 0.5s cubic-bezier(0.34,1.56,0.64,1) backwards, bob 2.4s 0.6s ease-in-out infinite; }

/* Confetti burst behind the celebrate card (JS injects the pieces). */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.confetti span {
  position: absolute; top: -8%; width: 0.7rem; height: 0.9rem; border-radius: 2px;
  opacity: 0; animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10vh) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(108vh) rotate(720deg); opacity: 0.9; }
}
.celebrate-box { position: relative; z-index: 1; }

/* ═══════════ FINAL CHALLENGE (invite a grown-up) ═══════════ */
.finale-box {
  margin: auto; text-align: center; max-width: 460px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 1.2rem;
}
.finale-badge {
  font-size: clamp(4rem, 22vw, 7rem);
  filter: drop-shadow(0 0 26px rgba(255,215,94,0.85)) drop-shadow(0 8px 16px rgba(0,0,0,0.3));
  animation: reveal 0.7s cubic-bezier(0.34,1.56,0.64,1), bob 2.4s 0.7s ease-in-out infinite;
}
.finale-title {
  font-family: var(--round); font-weight: 800; color: #fff;
  font-size: clamp(1.7rem, 7.5vw, 2.4rem);
  text-shadow: 0 3px 0 var(--coral-d), 0 6px 14px rgba(0,0,0,0.35);
}
.finale-text {
  font-family: var(--round); font-weight: 600; color: #fff; max-width: 18ch;
  font-size: clamp(1.15rem, 5vw, 1.5rem); text-shadow: 0 2px 8px rgba(0,0,0,0.35); margin-bottom: 0.5rem;
}

/* ═══════════ CREW & SUB GALLERY ═══════════ */
#screen-crew.active { display: flex; align-items: flex-start; overflow-y: auto; }
.crew-view { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 1rem 1rem 2rem; }
.crew-title { font-family: var(--round); font-weight: 800; color: #fff; text-align: center; font-size: clamp(1.5rem, 6vw, 2rem); text-shadow: 0 2px 8px rgba(0,0,0,0.35); margin-top: 0.3rem; }
.crew-sub {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.15rem;
  font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 1;
  background: rgba(9,48,72,0.5); border: 2px solid rgba(255,255,255,0.22); border-radius: 20px;
  padding: 0.7rem 0.9rem; width: 100%;
}
.crew-hint { font-family: var(--round); font-weight: 600; color: rgba(255,255,255,0.85); font-size: 1rem; }
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.6rem; width: 100%; }
.crew-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem; cursor: pointer;
  background: rgba(9,48,72,0.5); border: 2px solid rgba(255,255,255,0.22); border-radius: 18px; padding: 0.6rem 0.3rem;
  transition: transform 0.15s, border-color 0.15s;
}
.crew-card:active { transform: scale(0.94); border-color: var(--gold); }
.crew-card.cheer { animation: crewJoin 0.7s cubic-bezier(0.34,1.6,0.5,1); }
.crew-card .crew-face { font-size: clamp(2.2rem, 11vw, 3.2rem); line-height: 1; }
.crew-card .crew-name { font-family: var(--round); font-weight: 700; color: #fff; font-size: 0.8rem; text-align: center; line-height: 1.15; }

/* ═══════════ FRIEND CHEERS DURING PLAY ═══════════ */
.friend-cheer {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 0.2rem; z-index: 60; pointer-events: none;
}
.friend-cheer.show { display: flex; animation: friendPop 1.6s ease-out forwards; }
.friend-cheer .fc-face { font-size: clamp(2.6rem, 13vw, 3.6rem); line-height: 1; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35)); }
.friend-cheer .fc-bubble {
  font-family: var(--round); font-weight: 800; color: var(--coral-d); background: #fff;
  padding: 0.2rem 0.7rem; border-radius: 999px; font-size: 1rem; box-shadow: 0 3px 8px rgba(0,0,0,0.3); order: -1;
}
@keyframes friendPop {
  0% { transform: translateX(-50%) translateY(20px) scale(0.4); opacity: 0; }
  18% { transform: translateX(-50%) translateY(0) scale(1.15); opacity: 1; }
  30% { transform: translateX(-50%) translateY(0) scale(1); }
  78% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-16px) scale(0.85); opacity: 0; }
}

/* ═══════════ WELCOME-BACK STREAK BANNER ═══════════ */
/* A brief, celebratory greeting when a returning explorer reaches the map —
   rewards coming back day after day (Success #2). Fixed overlay, non-interactive. */
.welcome-back {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 0.25rem;
  z-index: 70; pointer-events: none; text-align: center; max-width: 88vw;
}
.welcome-back.show { display: flex; animation: wbPop 4.2s ease-out forwards; }
.welcome-back .wb-title {
  font-family: var(--round); font-weight: 800; color: #fff;
  font-size: clamp(1.3rem, 6.5vw, 2rem);
  background: linear-gradient(180deg, rgba(67,48,122,0.92), rgba(39,26,71,0.92));
  border: 2px solid var(--gold); border-radius: 999px;
  padding: 0.35rem 1.1rem; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.welcome-back .wb-sub {
  font-family: var(--round); font-weight: 800; color: var(--gold);
  font-size: clamp(1rem, 5vw, 1.5rem);
  text-shadow: 0 2px 4px rgba(0,0,0,0.6), 0 0 2px rgba(0,0,0,0.8);
}
@keyframes wbPop {
  0% { transform: translateX(-50%) translateY(-18px) scale(0.5); opacity: 0; }
  10% { transform: translateX(-50%) translateY(0) scale(1.1); opacity: 1; }
  18% { transform: translateX(-50%) translateY(0) scale(1); }
  85% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-12px) scale(0.9); opacity: 0; }
}

/* ═══════════ GROWN-UP REPORT ═══════════ */
.welcome-foot { display: flex; gap: 1.2rem; align-items: center; margin-top: 1.4rem; }
.btn-tiny.danger { color: rgba(255,150,140,0.7); }
#screen-report.active { display: flex; align-items: flex-start; overflow-y: auto; }
.report {
  width: 100%; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0.7rem; padding-bottom: 2rem;
}
.report-title {
  font-family: var(--round); font-weight: 800; color: #fff; text-align: center;
  font-size: clamp(1.5rem, 6vw, 2rem); margin: 0.5rem 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.rep-card {
  background: rgba(9,48,72,0.5); border: 2px solid rgba(255,255,255,0.22);
  border-radius: 18px; padding: 0.9rem 1rem; backdrop-filter: blur(6px);
}
.rep-card h3 {
  font-family: var(--round); font-weight: 700; color: var(--gold);
  font-size: 0.95rem; margin-bottom: 0.6rem; letter-spacing: 0.02em;
}
.rep-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; font-family: var(--body); font-weight: 600; color: #fff; }
.rep-stats b { font-family: var(--round); color: var(--gold); font-size: 1.15rem; }
.rep-numline { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rep-num {
  min-width: 2rem; height: 2rem; padding: 0 0.35rem; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--round); font-weight: 800; font-size: 1rem; color: #fff;
}
.rep-num.got { color: var(--ink); background: linear-gradient(180deg, var(--gold), #ffc73a); box-shadow: 0 0 8px rgba(255,215,94,0.6); }
.rep-num.learning { background: rgba(95,164,217,0.55); border: 1px solid rgba(255,255,255,0.4); }
.rep-num.new { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.5); }
.rep-legend { display: flex; gap: 1rem; margin-top: 0.6rem; font-size: 0.72rem; color: rgba(255,255,255,0.8); align-items: center; }
.rep-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }
.rep-legend .dot.got { background: var(--gold); }
.rep-legend .dot.learning { background: rgba(95,164,217,0.8); }
.rep-legend .dot.new { background: rgba(255,255,255,0.25); }
.rep-skills { display: flex; flex-direction: column; gap: 0.4rem; }
.rep-skill { display: flex; justify-content: space-between; align-items: center; font-family: var(--body); font-weight: 600; color: #fff; }
.rep-status { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.rep-skill.done .rep-status { color: var(--mint); }
.rep-skill.inprogress .rep-status { color: var(--gold); }
.rep-week { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.3rem; height: 92px; }
.wk-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.wk-bar { width: 70%; max-width: 26px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--gold), #ffc73a); }
.wk-bar.empty { background: rgba(255,255,255,0.15); }
.wk-lab { font-size: 0.7rem; color: rgba(255,255,255,0.6); font-weight: 700; }
.wk-val { font-size: 0.7rem; color: rgba(255,255,255,0.85); font-weight: 700; min-height: 0.9rem; }
.rep-reco {
  font-family: var(--round); font-weight: 600; color: #fff; text-align: center;
  background: rgba(255,122,89,0.22); border: 1px solid rgba(255,122,89,0.5);
  border-radius: 14px; padding: 0.7rem 0.9rem; font-size: 0.95rem;
}
.rep-btns { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; margin-top: 0.3rem; }
.rep-btns .btn-ghost, .rep-btns .btn-big { width: 100%; max-width: 320px; }

/* flying star reward */
.fly-star {
  position: fixed; z-index: 50; font-size: 2.4rem; pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.7s cubic-bezier(0.5,0,0.3,1), top 0.7s cubic-bezier(0.5,0,0.3,1), transform 0.7s ease, opacity 0.7s ease;
  filter: drop-shadow(0 0 12px var(--gold));
}

/* art chips (crew, sub parts, rewards, celebration friend, welcome buddy):
   the transparent PNG swapped in for an emoji, sized to 1em so it matches. */
.sub-craft img, .sub-crew img, .dive-reward img, #celebrate-emoji img, .buddy img,
.celebrate-sub img, .celebrate-crew img, .crew-sub img, .crew-card .crew-face img, .friend-cheer .fc-face img,
.castle-base img, .castle-part-chip img, .castle-friend img {
  width: 1em; height: 1em; object-fit: contain; vertical-align: middle;
}
.celebrate-friend img { filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3)); }

/* ── Sparkle the unicorn, bobbing along through the puzzles ── */
.rider {
  position: fixed; left: 0.3rem; bottom: calc(env(safe-area-inset-bottom) + 0.3rem);
  width: clamp(104px, 28vw, 156px); height: auto; z-index: 6; pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.4));
  animation: subswim 3.8s ease-in-out infinite;
}
@keyframes subswim {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-7px) rotate(1.5deg); }
}
/* the travelling map sprite */
.map-sub-img { width: 64px; height: auto; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); }

/* ── number tracing (finger-write the numeral) ── */
.q-objects.trace-mode { background: none; border: none; min-height: 0; padding: 0; }
/* one box per digit; a teen writes the tens box first, then the ones box. */
.trace-multi { display: flex; gap: clamp(0.5rem, 3vw, 1.1rem); align-items: center; justify-content: center; }
.trace-multi.two .trace-field { width: clamp(120px, 38vw, 180px); }
.trace-field.pending { opacity: 0.34; filter: grayscale(0.5); }
.trace-field.pending .trace-start { fill: rgba(255,255,255,0.3); }
.trace-field {
  position: relative; width: clamp(170px, 54vw, 250px); aspect-ratio: 100 / 140;
  touch-action: none; -webkit-user-select: none; user-select: none;
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.24);
  border-radius: 22px; backdrop-filter: blur(4px);
}
.trace-ghost {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--round); font-weight: 800; font-size: 9rem; line-height: 1;
  color: rgba(255,255,255,0.13); pointer-events: none;
}
.trace-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.trace-guide { fill: none; stroke: rgba(255,255,255,0.45); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0.5 17; }
.trace-trail { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(255,215,94,0.85)); pointer-events: none; }
.trace-start { fill: var(--mint); stroke: #fff; stroke-width: 2; }
.trace-dot { fill: rgba(255,255,255,0.22); transition: fill 0.15s; }
.trace-dot.on { fill: var(--gold); }
.trace-field.done { animation: correct-pop 0.5s cubic-bezier(0.34,1.56,0.64,1); border-color: var(--gold); box-shadow: 0 0 24px rgba(255,215,94,0.75); }

/* story slide art: generated image (emoji shows until it loads / if missing) */
.story-img {
  width: clamp(180px, 62vw, 320px); height: auto; max-height: 42vh;
  object-fit: contain; border-radius: 22px;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.35));
  animation: reveal 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

/* ═══════════ FULL-BLEED SCENE BACKGROUND ═══════════ */
#scene-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.6s ease;
}
#scene-bg.on { opacity: 1; }
/* legibility: soften the edges, darken the bottom where text + controls sit */
#scene-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 88% 78% at 50% 34%, transparent 42%, rgba(7,59,92,0.5) 100%),
    linear-gradient(180deg, rgba(7,59,92,0.45) 0%, transparent 22%, transparent 48%, rgba(7,59,92,0.92) 100%);
}
.bubbles { z-index: 1; }          /* float the bubbles over the scene image */
.subtitle { font-size: clamp(1.2rem, 5vw, 1.65rem); }

/* ═══════════ STORY (full-bleed) ═══════════ */
#screen-intro.active { justify-content: flex-end; }
.intro-box { margin-top: auto; margin-bottom: 0; }
.intro-text {
  font-size: clamp(1.55rem, 6.4vw, 2.4rem); line-height: 1.25;
  max-width: 20ch; margin: 0.6rem 0 1.6rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.6);
}

/* ═══════════ DIVE MAP (node-path descent) ═══════════ */
#screen-map.active { display: flex; align-items: center; justify-content: flex-start; overflow-y: auto; }
.map-head { width: 100%; max-width: 520px; text-align: center; padding-top: 0.2rem; }
.map-head .eyebrow { margin-bottom: 0.15rem; }
.map-title {
  font-family: var(--round); font-weight: 800; color: #fff;
  font-size: clamp(1.6rem, 7vw, 2.3rem); margin: 0.1rem 0 0.55rem;
  text-shadow: 0 3px 0 var(--aqua), 0 5px 16px rgba(0,0,0,0.4);
}

/* the submarine being built out + the crew (compact, in the head) */
.sub-build {
  width: 100%; max-width: 360px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  background: rgba(9,48,72,0.42); border: 2px solid rgba(255,255,255,0.22);
  border-radius: 16px; padding: 0.45rem 0.7rem; backdrop-filter: blur(6px);
}
.sub-craft { font-size: clamp(1.5rem, 6.5vw, 2.1rem); line-height: 1; display: flex; align-items: center; gap: 0.1rem; flex-wrap: wrap; justify-content: center; }
.sub-craft .sub-hull { font-size: 1.9em; }   /* the hull leads; parts ride on it */
.sub-craft .sub-part { animation: pop 0.4s cubic-bezier(0.34,1.56,0.64,1) backwards; }
.sub-crew { font-size: clamp(1.1rem, 5vw, 1.5rem); display: flex; gap: 0.2rem; flex-wrap: wrap; justify-content: center; opacity: 0.95; }

/* the descent canvas + flowing path */
.map-canvas { position: relative; width: 100%; max-width: 460px; flex: 0 0 auto; min-height: 58vh; margin: 0.4rem auto 0; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.map-node { position: absolute; transform: translate(-50%, -50%); width: 96px; text-align: center; pointer-events: none; }
.node-disc {
  width: 70px; height: 70px; border-radius: 50%; overflow: hidden; margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.45); background: var(--deep); position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  transition: width 0.35s ease, height 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.node-disc img { width: 100%; height: 100%; object-fit: cover; }
.node-emoji { display: grid; place-items: center; width: 100%; height: 100%; font-size: 1.9rem; }
.map-node.locked .node-disc { border-style: dashed; border-color: rgba(255,255,255,0.28); box-shadow: none; }
.map-node.locked .node-disc img, .map-node.locked .node-emoji { filter: grayscale(0.8) brightness(0.6); opacity: 0.75; }
.map-node.complete .node-disc { border-color: var(--gold); }
.map-node.complete .node-disc::after {
  content: "✓"; position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px; background: var(--gold); color: var(--ink);
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--round); font-weight: 800; font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.map-node.current { pointer-events: auto; cursor: pointer; }
.map-node.current .node-disc {
  width: 84px; height: 84px; border-color: #fff;
  box-shadow: 0 0 26px rgba(255,255,255,0.55), 0 6px 18px rgba(0,0,0,0.45);
  animation: glow 1.4s ease-in-out infinite alternate;
}
.map-node.current:active .node-disc { transform: scale(0.96); }
.map-node.deeper .node-disc { border-style: dashed; opacity: 0.7; }
.node-label {
  margin-top: 0.35rem; font-family: var(--round); font-weight: 700;
  font-size: 0.92rem; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.map-node.locked .node-label, .map-node.deeper .node-label { opacity: 0.6; }

/* the submarine sprite, sailing to the current depth */
.map-sub {
  position: absolute; transform: translate(-50%, -50%); z-index: 5; pointer-events: none;
  transition: left 1.2s cubic-bezier(0.4,0,0.2,1), top 1.2s cubic-bezier(0.4,0,0.2,1);
  animation: bob 1.8s ease-in-out infinite;
}
.map-sub-chip { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); }
.map-sub-chip img { width: 1em; height: 1em; object-fit: contain; }

.map-foot {
  width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem; padding: 0.3rem 0 max(0.4rem, env(safe-area-inset-bottom));
  position: sticky; bottom: 0; z-index: 6;   /* the dive CTA stays reachable while the map scrolls */
}
#map-dive.done { filter: grayscale(0.4); opacity: 0.85; }

/* ── bigger screens ── */
@media (min-width: 700px) {
  .ctrl { width: 60px; height: 60px; font-size: 1.6rem; }
  .ctrl-big { width: 78px; height: 78px; font-size: 2.1rem; }
  .zone-dot { width: 42px; height: 42px; font-size: 1.2rem; }
}
@media (max-height: 640px) {
  .q-objects { min-height: 72px; padding: 0.6rem; }
  .choice { min-height: 70px; }
  .buddy { font-size: 4.5rem; }
}

/* ═══════════════════════════════════════════════════════
   BUILD QUEUE additions — name screen, loot juice, forge, castle, behaviors
═══════════════════════════════════════════════════════ */

/* ── #1 Name your castle ── */
.name-box { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; max-width: 560px; width: 100%; padding: 1rem; }
.name-castle { font-size: clamp(4rem, 20vw, 6.5rem); filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3)); animation: bob 2.6s ease-in-out infinite; }
.name-title { font-family: var(--round); font-weight: 800; font-size: clamp(1.6rem, 7vw, 2.4rem); color: #fff; margin: 0.4rem 0; text-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.name-hint { font-family: var(--round); font-weight: 600; color: #fff; font-size: 1.05rem; margin-bottom: 1.1rem; text-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; width: 100%; max-width: 460px; margin-bottom: 1rem; }
.name-choice {
  font-family: var(--round); font-weight: 800; font-size: clamp(1.05rem, 4.6vw, 1.4rem);
  color: var(--ink); background: linear-gradient(180deg, #ffffff, #efe2ff);
  border: none; border-radius: 20px; min-height: 84px; padding: 0.6rem;
  box-shadow: 0 5px 0 #b69ad8, 0 10px 20px rgba(0,0,0,0.25); transition: transform 0.1s, box-shadow 0.1s;
}
.name-choice:active { transform: translateY(3px); box-shadow: 0 2px 0 #b69ad8, 0 5px 12px rgba(0,0,0,0.25); }
.name-chosen { grid-column: 1 / -1; font-family: var(--round); font-weight: 800; font-size: clamp(1.6rem, 7vw, 2.4rem); color: var(--gold); text-shadow: 0 2px 10px rgba(0,0,0,0.4); animation: crewJoin 0.7s cubic-bezier(0.34,1.6,0.5,1); padding: 1.4rem 0; }

/* ── #2 Loot luck juice ── */
.loot-banner { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; animation: crewJoin 0.5s cubic-bezier(0.34,1.6,0.5,1); }
.loot-big { font-size: clamp(3rem, 16vw, 5rem); filter: drop-shadow(0 4px 10px rgba(255,215,94,0.6)); }
.loot-word { font-family: var(--round); font-weight: 800; color: var(--gold); font-size: clamp(1.1rem, 5vw, 1.6rem); text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
/* Crack reveal — what the crystals are FOR. White on a dark pill so it reads on
   the LIGHT reveal panel (gold-on-light pitfall). */
.loot-forge-hint { font-family: var(--round); font-weight: 800; color: #fff; font-size: clamp(0.95rem, 4.2vw, 1.25rem); background: rgba(0,0,0,0.45); padding: 0.35rem 0.8rem; border-radius: 14px; margin-top: 0.2rem; }
.loot-spark { position: fixed; z-index: 9999; font-size: 1.8rem; pointer-events: none; transition: transform 1s ease-out, opacity 1s ease-out; }

/* ── #3 The magic forge ── */
.forge-view { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; padding: 1rem; max-height: 100%; overflow-y: auto; }
.forge-title { font-family: var(--round); font-weight: 800; font-size: clamp(1.5rem, 6.5vw, 2.2rem); color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.forge-recipe { font-family: var(--round); font-weight: 700; font-size: clamp(1rem, 4.6vw, 1.4rem); color: #fff; background: rgba(0,0,0,0.25); padding: 0.5rem 1rem; border-radius: 16px; }
.forge-recipe b { color: var(--gold); text-shadow: 0 1px 2px rgba(0,0,0,0.55); }
/* The cauldron — a big, obvious drop target she drags crystals into. */
.forge-cauldron {
  position: relative; width: 100%; max-width: 360px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.8rem; border-radius: 26px;
  background: rgba(120,70,180,0.28); border: 4px dashed rgba(255,215,94,0.7);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.forge-cauldron.ready { background: rgba(255,215,94,0.30); box-shadow: 0 0 26px rgba(255,215,94,0.7); }
.forge-cauldron.fused { border-style: solid; }
.forge-cauldron-pot { font-size: clamp(3rem, 16vw, 5rem); line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); }
.forge-tally { display: flex; gap: 0.8rem; font-family: var(--round); font-weight: 800; font-size: clamp(1.1rem, 5vw, 1.5rem); color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
.forge-tally .done { color: #b6ff8a; }
.forge-drops { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem; min-height: 1.2em; }
.forge-drop { font-size: clamp(1.5rem, 7vw, 2.2rem); animation: forgePop 0.35s ease both; cursor: pointer; }
/* The source tray of draggable crystals. */
.forge-tray { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem; width: 100%; max-width: 460px; min-height: 70px; padding: 0.5rem; border-radius: 20px; background: rgba(0,0,0,0.18); }
.forge-gem {
  font-size: clamp(2.2rem, 11vw, 3.2rem); line-height: 1; cursor: grab;
  padding: 0.15rem; border-radius: 14px; touch-action: none; user-select: none;
  transition: opacity 0.2s; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.forge-gem.spent { display: none; }
.forge-ghost { font-size: clamp(2.2rem, 11vw, 3.2rem); line-height: 1; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5)); transform: scale(1.15); }
.forge-out { font-size: clamp(4rem, 22vw, 7rem); animation: crewJoin 0.7s cubic-bezier(0.34,1.6,0.5,1); filter: drop-shadow(0 0 16px var(--gold)); }
.forge-prompt { font-family: var(--round); font-weight: 800; font-size: clamp(1.2rem, 5.2vw, 1.6rem); color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.forge-choices { display: grid; grid-template-columns: 1fr; gap: 0.6rem; width: 100%; max-width: 460px; }
.forge-choices .btn-big { grid-column: 1 / -1; }
/* Inventory strip (shown in #forge-recipe on the picker) — what she owns, raw + forged. */
.forge-inv-label { color: #fff; margin-right: 0.3rem; }
.forge-inv-item { display: inline-block; background: rgba(0,0,0,0.28); padding: 0.15rem 0.55rem; border-radius: 12px; margin: 0.15rem 0.2rem; white-space: nowrap; }
/* Recipe cards on the picker: inputs → output, big tap targets. Ready = glowing
   + tappable; locked = dimmed (not enough crystals yet). */
.forge-recipe-card {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; min-height: 64px; padding: 0.6rem 1rem; border-radius: 20px;
  font-family: var(--round); font-weight: 800; color: #fff;
  border: 3px solid rgba(255,255,255,0.25); background: rgba(120,70,180,0.30);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.forge-recipe-card.ready { border-color: var(--gold); background: rgba(255,215,94,0.22); box-shadow: 0 0 18px rgba(255,215,94,0.5); animation: forgeCardPulse 1.6s ease-in-out infinite; }
.forge-recipe-card.ready:active { transform: scale(0.96); }
.forge-recipe-card.locked { opacity: 0.45; cursor: default; }
.forge-recipe-card .frc-in, .forge-recipe-card .frc-out { font-size: clamp(1.2rem, 6vw, 1.7rem); text-shadow: 0 2px 3px rgba(0,0,0,0.6); }
.forge-recipe-card .frc-arrow { font-size: clamp(1.3rem, 6.5vw, 1.9rem); color: var(--gold); text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.forge-recipe-card .frc-out { font-size: clamp(2rem, 9vw, 2.8rem); }
@keyframes forgeCardPulse { 0%,100% { box-shadow: 0 0 14px rgba(255,215,94,0.4); } 50% { box-shadow: 0 0 24px rgba(255,215,94,0.75); } }

/* ── #4 Inside the castle ── */
.castle-view { width: 100%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 1rem 1rem 2rem; max-height: 100%; overflow-y: auto; }
.castle-title { font-family: var(--round); font-weight: 800; font-size: clamp(1.5rem, 6.5vw, 2.2rem); color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.4); text-align: center; }
.castle-hint { font-family: var(--round); font-weight: 600; color: #fff; font-size: 1rem; text-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.castle-yard { position: relative; width: 100%; min-height: 300px; background: rgba(0,0,0,0.18); border-radius: 24px; padding: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; overflow: hidden; }
.castle-keep { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 0.1rem; cursor: pointer; }
.castle-keep.pulse { animation: crewJoin 0.7s cubic-bezier(0.34,1.6,0.5,1); }
.castle-base { font-size: clamp(3.5rem, 18vw, 6rem); cursor: pointer; position: relative; }
.castle-part-chip { font-size: clamp(1.6rem, 8vw, 2.6rem); cursor: pointer; position: relative; padding: 0.2rem; }
.castle-friends { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem; }
/* Big, finger-friendly tap targets — a 4-year-old's aim is approximate. */
.castle-friend { position: relative; font-size: clamp(2.6rem, 14vw, 4rem); cursor: pointer; padding: 0.4rem 0.5rem; }
.castle-friend.react { animation: friendHop 0.6s ease; }
/* Tap → POP BIG: a springy scale-up + wiggle that clearly reads as "bigger!".
   Higher specificity than .behave-roam so it overrides the roam while it plays. */
.castle-base.pop, .castle-part-chip.pop, .castle-friend.pop {
  animation: popBig 0.85s cubic-bezier(0.34, 1.7, 0.5, 1);
  position: relative; z-index: 5;
}
/* Celebrate-screen showcase pieces are tap toys too (same payoff as the gallery). */
.celebrate-sub .sub-part, .celebrate-crew .crew-chip { position: relative; cursor: pointer; }
.celebrate-sub .sub-part.pop, .celebrate-crew .crew-chip.pop { animation: popBig 0.85s cubic-bezier(0.34, 1.7, 0.5, 1); z-index: 5; }
/* End-of-zone fun rating (faces) + optional grown-up note. */
.zone-rate { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; margin: 0.2rem 0 0.1rem; width: 100%; }
.zone-rate-q { font-family: var(--round); font-weight: 800; color: #fff; font-size: clamp(1rem, 4.6vw, 1.3rem); text-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.zone-rate-faces { display: flex; gap: 0.6rem; }
.zone-face {
  position: relative;
  font-size: clamp(2rem, 10vw, 3rem); line-height: 1; cursor: pointer;
  background: rgba(255,255,255,0.12); border: 3px solid transparent; border-radius: 18px;
  padding: 0.2rem 0.45rem; transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.zone-face:active { transform: scale(0.9); }
.zone-face.picked { border-color: var(--gold); background: rgba(255,215,94,0.25); transform: scale(1.12); }
/* Faces-first: the big continue button holds back for a beat (so a face tap
   captures the fun rating), then fades in as a no-stuck fallback. Stays in flow
   (opacity only) so the layout doesn't jump when it appears. */
#celebrate-btn { transition: opacity 0.45s ease, transform 0.45s ease; }
#screen-celebrate.awaiting-rate #celebrate-btn { opacity: 0; transform: translateY(8px); pointer-events: none; }
/* The faces invite a tap (they double as the "keep going" action) with a gentle
   staggered bob; tapping cheers with a bounce + sparkles. */
.zone-rate-faces .zone-face { animation: zf-invite 1.6s ease-in-out infinite; }
.zone-rate-faces .zone-face:nth-child(2) { animation-delay: 0.2s; }
.zone-rate-faces .zone-face:nth-child(3) { animation-delay: 0.4s; }
.zone-face.cheer { animation: zf-cheer 0.5s ease forwards; }
@keyframes zf-invite { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes zf-cheer { 0% { transform: scale(1); } 35% { transform: scale(1.35) rotate(-6deg); } 70% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1.12); } }
.zf-spark {
  position: absolute; left: 50%; top: 30%; pointer-events: none;
  font-size: 0.9rem; opacity: 0;
  animation: zf-spark-fly 0.8s ease-out forwards;
}
@keyframes zf-spark-fly {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0) * 40px), -34px) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .zone-rate-faces .zone-face { animation: none; }
}
.zone-note { width: 100%; max-width: 340px; font-family: var(--round); }
.zone-note summary { list-style: none; text-align: center; cursor: pointer; font-weight: 700; color: rgba(255,255,255,0.8); font-size: 0.85rem; padding: 0.2rem; }
.zone-note summary::-webkit-details-marker { display: none; }
.zone-note textarea { width: 100%; margin-top: 0.3rem; border-radius: 12px; border: 2px solid rgba(255,255,255,0.35); padding: 0.45rem; font-family: var(--body); font-size: 0.95rem; resize: vertical; }

/* Castle tap confetti — a transient overlay on TOP of the yard (never replaces it). */
.castle-confetti { z-index: 8; border-radius: 24px; }
/* Themed emoji bursting up from a tapped friend/part. */
.castle-burst {
  position: absolute; z-index: 9; pointer-events: none;
  font-size: clamp(1.4rem, 7vw, 2.2rem); transform: translate(-50%, -50%);
  animation: castleBurst 1.2s ease-out forwards;
}
@keyframes castleBurst {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0) * 90px), -160%) scale(var(--sc, 1)); }
}
@keyframes popBig {
  0%   { transform: scale(1) rotate(0); }
  30%  { transform: scale(1.9) rotate(-9deg); }
  55%  { transform: scale(1.55) rotate(7deg); }
  78%  { transform: scale(1.75) rotate(-4deg); }
  100% { transform: scale(1) rotate(0); }
}
.castle-bubble { position: absolute; top: -1.4rem; left: 50%; transform: translateX(-50%); font-family: var(--round); font-weight: 800; font-size: 0.85rem; color: var(--ink); background: #fff; padding: 0.15rem 0.5rem; border-radius: 10px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }

/* ── #5 friend behaviors ── */
.behave-bob { animation: bob 2.4s ease-in-out infinite; display: inline-block; }
.behave-hop { animation: friendHop 1.2s ease-in-out infinite; display: inline-block; }
.behave-roam { animation: roam 3.2s ease-in-out infinite; display: inline-block; }
@keyframes friendHop { 0%,100%{ transform: translateY(0); } 30%{ transform: translateY(-14px) rotate(-6deg); } 60%{ transform: translateY(-4px) rotate(4deg); } }
@keyframes roam { 0%,100%{ transform: translateX(calc(var(--roam, 0) * -10px)) translateY(0); } 50%{ transform: translateX(calc(var(--roam, 0) * 10px)) translateY(-8px); } }
@keyframes forgePop { 0%{ transform: scale(0); } 70%{ transform: scale(1.15); } 100%{ transform: scale(1); } }

/* ── Carrying on the column grid: the carry row + regroup glow ── */
.col-row-carry { grid-template-columns: 1.6rem 2.6rem 2.6rem; }
.col-play .col-carry-cell {
  min-height: 1.2rem; text-align: center;
  font-size: 1.05rem; font-weight: 800; color: var(--gold, #ffd75e);
}
.col-play .col-carried { animation: carryPop 0.55s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes carryPop {
  from { transform: translateY(1.3rem) scale(1.6); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
/* regroup hop: the ones column (where the ten comes from) and the carry slot
   (where it lands) glow together */
.col-play[data-live="regroup"] .col-o:not(.col-hdr-cell),
.col-play[data-live="regroup"] .col-carry-cell.col-t {
  background: rgba(255,215,94,0.28); border-radius: 8px;
}
.col-play[data-live="tens"] .col-carry-cell.col-t { background: rgba(255,215,94,0.28); border-radius: 8px; }

/* ── Number line (0–30): decade anchors + the star to read ── */
.numline {
  position: relative; display: flex; justify-content: space-between; align-items: flex-end;
  width: 100%; max-width: 540px; margin: 0.9rem auto 0.2rem; padding: 0 0.2rem;
}
.numline::before {
  content: ''; position: absolute; left: 1.5%; right: 1.5%; bottom: 1.45rem;
  height: 4px; border-radius: 2px; background: rgba(255,255,255,0.6);
}
.nl-tick { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; flex: 1; }
.nl-star { font-size: clamp(1.2rem, 5vw, 1.7rem); line-height: 1.2; min-height: 1.5em; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)); }
.nl-target .nl-star { animation: pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }
.nl-bar { width: 3px; height: 0.55rem; border-radius: 2px; background: rgba(255,255,255,0.75); }
.nl-decade .nl-bar { height: 0.95rem; width: 4px; background: #fff; }
.nl-num { font-weight: 800; font-size: clamp(0.9rem, 3.8vw, 1.2rem); color: #fff; min-height: 1.3em; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }

/* ── Sparkle dash: node badge, HUD, result, and the friend's earned trick ── */
/* THE speed-round fix (Rose 2026-07-30: "where are the speed rounds?"):
   .map-node has pointer-events:none with only .current re-enabled, so real
   TAPS never reached cleared zones — speed dives were unreachable by finger
   since 07-24 (JS-driven verification bypassed pointer-events and missed it). */
.map-node.complete { cursor: pointer; pointer-events: auto; }
.map-node.complete::before { animation: speedPulse 2.2s ease-in-out infinite; }
@keyframes speedPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.map-node.complete::before {
  content: '⚡'; position: absolute; top: -0.5rem; right: -0.25rem; z-index: 2;
  font-size: 1.15rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.45));
}
.speed-hud {
  position: fixed; top: 4.7rem; right: 0.8rem; z-index: 40;
  background: rgba(74,42,110,0.78); border-radius: 14px; padding: 0.35rem 0.75rem;
  font-family: var(--round); font-weight: 800; font-size: 1.05rem; color: var(--gold);
}
.speed-result { text-align: center; padding: 1.2rem 0.6rem; }
.speed-time { font-family: var(--round); font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 800; color: var(--paper); }
.speed-note { font-family: var(--round); font-size: clamp(1.1rem, 5vw, 1.5rem); font-weight: 800; color: var(--gold); margin-top: 0.45rem; }
.trick-fly { position: fixed; left: 0; top: 42%; z-index: 70; pointer-events: none; animation: trickLeap 2.5s ease-in-out forwards; }
.trick-face { font-size: 3.4rem; line-height: 1; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35)); }
.trick-face img { width: 4.5rem; height: 4.5rem; object-fit: contain; }
@keyframes trickLeap {
  0%   { transform: translateX(-16vw) translateY(0)      rotate(0deg); }
  25%  { transform: translateX(22vw)  translateY(-9vh)   rotate(180deg); }
  50%  { transform: translateX(55vw)  translateY(2vh)    rotate(360deg); }
  75%  { transform: translateX(86vw)  translateY(-7vh)   rotate(540deg); }
  100% { transform: translateX(116vw) translateY(0)      rotate(720deg); }
}
.crew-card.has-trick { position: relative; }
.crew-card.has-trick::after { content: '🌟'; position: absolute; top: 0.3rem; right: 0.4rem; font-size: 1.2rem; }

/* number-line tutorial: ticks light one by one as the voice counts along */
.nl-tick.nl-lit .nl-dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); transform: scale(1.25); }
.nl-tick.nl-lit .nl-num { color: var(--gold); }

/* ════════════════════════════════════════════════════════════════
   CANDLE & INK (forest) — design pass 2026-07-28, shared with oceanmath
   One calm system: candle primaries, ink glass panels, warm-gold
   wayfinding, bright gold for REWARDS ONLY. Shared with unicornmath —
   same layer, re-colored through the tokens below.
════════════════════════════════════════════════════════════════ */
:root {
  --candle: #fdf6e8;                 /* primary fill + headline text */
  --warm:   #f4b87a;                 /* wayfinding accent */
  --ink2:   #221540;                 /* text on candle */
  --surf1:  #221540; --surf2: #130b26;             /* surface gradient */
  --glassd: rgba(28,16,52,0.62);      /* question panel glass */
  --glassp: rgba(28,16,52,0.6);       /* pill glass */
  --glassb: rgba(19,11,38,0.7);       /* bottom-sheet glass */
  --hairline: rgba(253,246,232,0.3);
  --hairline-dim: rgba(253,246,232,0.2);
  /* retint the legacy tokens the old rules lean on */
  --deep: #221540; --deepest: #130b26; --ink: #221540; --paper: #fdf6e8;
}

/* ── surfaces ── */
body {
  background: linear-gradient(180deg, var(--surf1) 0%, var(--surf2) 100%);
}
body::after {              /* stardust replaces the sandy seabed glow */
  height: 100%;
  opacity: 0.55;
  background:
    radial-gradient(circle at 12% 12%, rgba(253,246,232,0.65) 0, transparent 1.3px),
    radial-gradient(circle at 86% 8%,  rgba(253,246,232,0.55) 0, transparent 1.4px),
    radial-gradient(circle at 8% 40%,  rgba(253,246,232,0.4)  0, transparent 1px),
    radial-gradient(circle at 92% 36%, rgba(244,184,122,0.5)  0, transparent 1.2px),
    radial-gradient(circle at 15% 88%, rgba(253,246,232,0.45) 0, transparent 1.1px),
    radial-gradient(circle at 55% 62%, rgba(253,246,232,0.35) 0, transparent 1px),
    radial-gradient(circle at 82% 90%, rgba(244,184,122,0.45) 0, transparent 1.2px);
}
#scene-bg::after {         /* scrim over scene art — critical for contrast */
  background: linear-gradient(180deg,
    rgba(28,16,52,0.78) 0%, rgba(28,16,52,0.3) 22%, transparent 45%,
    rgba(28,16,52,0.65) 72%, rgba(28,16,52,0.95) 100%);
}

/* ── type ── */
.eyebrow {
  font-family: var(--body); font-weight: 800; font-size: 12px;
  letter-spacing: 0.36em; text-transform: uppercase; color: var(--warm);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.title {
  font-family: var(--round); font-weight: 700;
  font-size: clamp(3rem, 13vw, 4rem); line-height: 0.95; color: var(--candle);
  text-shadow: 0 2px 2px rgba(0,0,0,0.5), 0 6px 22px rgba(0,0,0,0.45);
}
.title .accent { color: var(--warm); text-shadow: inherit; display: block; }

/* section ornament: hairline rule with a centered ✦ */
.rule-orn {
  width: 190px; display: flex; align-items: center; gap: 8px;
  color: var(--warm); font-size: 10px; margin: 0.9rem auto 0;
}
.rule-orn span { flex: 1; height: 1px; }
.rule-orn span:first-child { background: linear-gradient(90deg, transparent, var(--warm)); }
.rule-orn span:last-child  { background: linear-gradient(90deg, var(--warm), transparent); }

/* ── buttons ── */
.btn-big {
  font-family: var(--round); font-weight: 700;
  font-size: clamp(1.2rem, 5vw, 1.44rem); color: var(--ink2);
  background: var(--candle); border: none; border-radius: 999px;
  padding: 0.95rem 2.7rem; min-height: 60px;
  box-shadow: 0 8px 26px rgba(253,246,232,0.2);
  text-shadow: none; transition: transform 0.12s;
}
.btn-big:active { transform: scale(0.97); box-shadow: 0 6px 18px rgba(253,246,232,0.16); }
.btn-big.done { background: rgba(253,246,232,0.25); color: var(--candle); box-shadow: none; }
.btn-ghost, .map-action {
  font-family: var(--body); font-weight: 800; font-size: 0.85rem;
  color: var(--candle); background: var(--glassp);
  border: 1px solid rgba(253,246,232,0.5); border-radius: 999px;
  padding: 0.7rem 1.4rem; min-height: 46px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: none; text-shadow: none; transition: transform 0.12s;
}
.btn-ghost:active, .map-action:active { transform: scale(0.97); }
.btn-tiny {
  font-family: var(--body); font-weight: 700; font-size: 0.8rem;
  color: rgba(253,246,232,0.65); background: none; border: none;
  text-decoration: underline; text-underline-offset: 3px;
  box-shadow: none; padding: 0.5rem 0.8rem;
}
.btn-tiny.danger { color: rgba(255,160,140,0.85); }
.map-action.home { color: rgba(253,246,232,0.65); background: rgba(19,11,38,0.35); border-color: rgba(253,246,232,0.3); text-decoration: none; }

/* control circles */
.ctrl {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(253,246,232,0.45); background: rgba(28,16,52,0.55);
  color: var(--candle); font-size: 1.15rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: none; transition: transform 0.12s;
}
.ctrl:active { transform: scale(0.94); }
.ctrl-big {
  width: 64px; height: 64px; font-size: 1.5rem;
  border: 1.5px solid var(--warm); background: rgba(244,184,122,0.2);
}
.ctrl.off { opacity: 0.45; }

/* ── counters ── */
.star-counter, .gem-counter {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--glassp); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 7px 16px;
  font-family: var(--round); font-weight: 700; font-size: 1.05rem;
  color: var(--candle); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: none;
}

/* ── welcome ── */
.welcome-box { text-align: center; }
.welcome-box .buddy { filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5)); }
.subtitle {
  font-family: var(--round); font-weight: 600; font-size: 1.3rem;
  color: var(--candle); text-shadow: 0 2px 8px rgba(0,0,0,0.6); max-width: 24ch;
  margin-left: auto; margin-right: auto;
}
.welcome-stars {
  font-family: var(--body); font-weight: 800; font-size: 0.9rem;
  color: var(--gold); text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ── play HUD ── */
.hud-row { align-items: center; }
.zone-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--glassp); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 7px 16px; max-width: 70%;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud-zone {
  font-family: var(--body); font-weight: 800; font-size: 0.75rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--warm);
  text-shadow: none; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zone-track { display: inline-flex; gap: 4px; flex: none; }
.tier-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(253,246,232,0.3); }
.tier-dot.on { background: var(--warm); }
.q-prompt {
  font-family: var(--round); font-weight: 700;
  font-size: clamp(1.35rem, 6vw, 1.7rem); color: var(--candle);
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
.q-objects {
  background: var(--glassd); border: 1px solid var(--hairline-dim);
  border-radius: 26px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.equation { color: var(--candle); }
.equation .eq-n { color: var(--candle); background: none; }
.equation .eq-op { color: var(--warm); background: none; }
.equation .eq-box {
  min-width: 46px; height: 46px; border: 2.5px dashed var(--warm);
  border-radius: 12px; color: var(--warm); background: none; box-shadow: none;
}
.dive-meter .dive-pip, .dive-meter .dive-pip.on { font-size: 17px; }
.dive-meter .dive-pip { filter: grayscale(1); opacity: 0.4; }
.dive-meter .dive-pip.on { filter: none; opacity: 1; }

/* answer cards */
.choice {
  font-family: var(--round); font-weight: 700; font-size: clamp(1.9rem, 9vw, 2.5rem);
  color: var(--ink2); background: var(--candle);
  border: none; border-radius: 22px; min-height: 88px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  text-shadow: none; transition: transform 0.12s;
}
.choice:active { transform: scale(0.97); }
.choice:disabled { opacity: 0.55; }
.choice.correct { background: #7fe6b0; color: var(--ink2); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.choice.wrong { background: #f3a08c; color: var(--ink2); }
.choice.await-count { opacity: 0.35; }
.choice.hint-glow { box-shadow: 0 0 0 4px rgba(244,184,122,0.7), 0 8px 24px rgba(0,0,0,0.35); }
.choice-done { background: var(--candle); color: var(--ink2); }

/* ── map: postcard & chart (3a) ── */
#screen-map { padding-top: 0; }
.map-hero {
  position: absolute; left: 0; right: 0; top: 0; height: 250px; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.map-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19,11,38,0.55) 0%, transparent 35%,
    transparent 55%, rgba(34,21,64,0.85) 88%, var(--surf1) 100%);
}
.map-head { position: relative; z-index: 1; padding-top: max(1.2rem, env(safe-area-inset-top)); }
.map-head-row {
  width: 100%; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 0.6rem; text-align: left;
}
.map-head .eyebrow { font-size: 11px; letter-spacing: 0.32em; margin-bottom: 2px; }
.map-title {
  font-family: var(--round); font-weight: 700; font-size: clamp(1.5rem, 7vw, 1.9rem);
  color: var(--candle); text-shadow: 0 2px 8px rgba(0,0,0,0.7); line-height: 1.1;
}
.sub-build { display: none; }         /* the build showcase lives in crew/celebrate now */
.map-canvas { z-index: 1; }
.map-svg path#map-path-done { stroke: var(--warm); }
.map-svg path#map-path-pending { stroke: rgba(253,246,232,0.55); stroke-dasharray: 2 10; }

/* nodes */
.map-node .node-label {
  font-family: var(--body); font-weight: 800; font-size: 12px;
  color: rgba(253,246,232,0.85); text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.map-node.complete .node-disc {
  width: 62px; height: 62px; border: 2px solid var(--warm);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}
.map-node.complete::after {          /* the ✓ badge (top-right of the disc) */
  content: "✓"; position: absolute; top: -4px; right: 12px; z-index: 2;
  width: 18px; height: 18px; background: var(--warm); color: var(--surf1);
  border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; font-family: var(--body);
}
.map-node.complete::before { right: auto; left: 8px; top: -8px; }   /* ⚡ speed badge moves top-left */
.map-node.current .node-disc {
  width: 92px; height: 92px; border: 3px solid var(--candle);
  box-shadow: 0 0 0 4px rgba(244,184,122,0.5), 0 0 34px rgba(244,184,122,0.55), 0 8px 20px rgba(0,0,0,0.5);
  animation: none;
}
.map-node.current .node-label {
  display: inline-block; background: var(--candle); color: var(--ink2);
  padding: 3px 14px; border-radius: 999px; font-size: 13px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35); text-shadow: none;
}
.map-node.locked { opacity: 0.7; }
.map-node.locked .node-disc {
  width: 54px; height: 54px; border: 2px dashed rgba(253,246,232,0.5);
  background: rgba(253,246,232,0.06); box-shadow: none;
}
.map-node.locked .node-disc img { opacity: 0.6; }
.map-node.locked .node-lock {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.map-node.locked .node-label { color: rgba(253,246,232,0.55); }
.map-node.deeper .node-disc { border: 2px dashed rgba(253,246,232,0.4); background: rgba(253,246,232,0.05); }
.map-sub { z-index: 3; margin-left: -58px; margin-top: -10px; }
.map-sub .map-sub-img, .map-sub img { width: 68px; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.6)); }

/* bottom sheet */
.map-foot { gap: 0.6rem; }
.map-sheet {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--glassb); border: 1px solid rgba(253,246,232,0.22);
  border-radius: 24px; padding: 13px 16px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.map-buddy { width: 54px; height: 54px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
.map-teaser {
  flex: 1; text-align: left; font-family: var(--round); font-weight: 700;
  font-size: 1.05rem; line-height: 1.15; color: var(--candle);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.map-sheet .btn-big { flex: none; padding: 0.8rem 1.7rem; min-height: 52px; font-size: 1.15rem; }
.map-foot-row { display: flex; justify-content: center; gap: 10px; }

/* ── celebrate ── */
.celebrate-box { background: none; border: none; box-shadow: none; }
.celebrate-title {
  font-family: var(--round); font-weight: 700; font-size: clamp(1.6rem, 8vw, 2rem);
  color: var(--candle); text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.celebrate-text { font-family: var(--round); font-weight: 600; color: rgba(253,246,232,0.9); text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.celebrate-emoji { filter: drop-shadow(0 0 34px rgba(255,215,94,0.7)) drop-shadow(0 10px 20px rgba(0,0,0,0.45)); }
.celebrate-sub, .celebrate-crew {
  background: var(--glassp); border: 1px solid var(--hairline-dim); border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: none;
}
.zone-rate-q { font-family: var(--body); font-weight: 800; color: rgba(253,246,232,0.85); text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.zone-face {
  font-size: 38px; background: rgba(19,11,38,0.55);
  border: 1.5px solid rgba(253,246,232,0.35); border-radius: 20px;
  padding: 8px 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: none; transition: transform 0.12s;
}
.zone-face:active { transform: scale(0.94); }
.zone-face.picked { border-color: var(--warm); background: rgba(244,184,122,0.2); }
.finale-box {
  background: var(--glassb); border: 1px solid var(--hairline-dim); border-radius: 26px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.finale-title { font-family: var(--round); font-weight: 700; color: var(--candle); }

/* ── forge ── */
#screen-forge {
  background: linear-gradient(180deg, var(--surf1) 0%, var(--surf2) 100%);
}
#screen-forge::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(244,184,122,0.16), transparent 55%);
}
.forge-title {
  font-family: var(--round); font-weight: 700; font-size: clamp(1.5rem, 7vw, 1.9rem);
  color: var(--candle); text-shadow: none;
}
.forge-eyebrow { margin-bottom: 2px; }
.forge-inv span, .forge-inv .inv-chip {
  background: var(--glassp); border: 1px solid var(--hairline-dim);
  border-radius: 999px; color: var(--candle);
}
.forge-recipe {
  background: var(--glassp); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 0.6rem 1.3rem;
  font-family: var(--round); font-weight: 700; color: var(--candle);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.forge-recipe b { color: var(--gold); }
.forge-cauldron {
  width: clamp(170px, 52vw, 218px); height: clamp(170px, 52vw, 218px);
  border: 2.5px dashed rgba(244,184,122,0.75); border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(244,184,122,0.18), rgba(244,184,122,0.05) 70%);
  box-shadow: none;
}
.forge-cauldron.ready { border-color: var(--gold); }
.forge-tally { font-family: var(--body); font-weight: 800; font-size: 14px; color: var(--warm); }
.forge-tray {
  background: var(--glassd); border: 1px solid var(--hairline-dim);
  border-radius: 22px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#forge-back { background: none; border: 1px solid rgba(253,246,232,0.35); color: var(--candle); box-shadow: none; font-size: 1rem; min-height: 48px; padding: 0.7rem 1.6rem; }

/* ── glass panels everywhere else (name / intro / report / crew / banners) ── */
.name-box, .intro-box, .crew-view, .report .rep-card, .rep-reco {
  background: var(--glassb); border: 1px solid var(--hairline-dim);
  border-radius: 26px; box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.name-choice {
  background: var(--candle); color: var(--ink2); border: none; border-radius: 999px;
  font-family: var(--round); font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  text-shadow: none;
}
.name-choice:active { transform: scale(0.97); }
.crew-card {
  background: rgba(253,246,232,0.08); border: 1px solid var(--hairline-dim);
  border-radius: 22px; box-shadow: none;
}
.crew-title, .name-title, .report-title {
  font-family: var(--round); font-weight: 700; color: var(--candle); text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.welcome-back {
  background: var(--glassb); border: 1px solid var(--hairline);
  border-radius: 24px; box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.speed-hud {
  background: var(--glassp); border: 1px solid var(--hairline);
  color: var(--warm); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.speed-time { color: var(--candle); }
.speed-note { color: var(--gold); }

/* number line + flash retints (warm wayfinding; gold stays on reward moments) */
.numline::before { background: rgba(253,246,232,0.55); }
.nl-dot { background: var(--candle); }
.nl-num { color: var(--candle); }
.nl-tick.nl-hidden .nl-dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.nl-tick.nl-lit .nl-dot { background: var(--warm); box-shadow: 0 0 10px var(--warm); }
.nl-tick.nl-lit .nl-num { color: var(--warm); }
.flash-q { color: var(--warm); }

/* tenframes / column grid: ink glass + warm live-column glow */
.tenframe .tf-cell { background: rgba(253,246,232,0.07); border: 1.5px solid rgba(253,246,232,0.25); box-shadow: none; }
.tenframe .tf-cell.filled { background: rgba(253,246,232,0.14); }
.num-chip { background: rgba(253,246,232,0.1); border: 1px solid var(--hairline-dim); color: var(--candle); }
.num-chip.got { background: var(--gold); color: var(--ink2); border-color: var(--gold); }
.num-chip.locked { opacity: 0.35; }

@media (prefers-reduced-motion: reduce) {
  .btn-big, .choice, .ctrl, .btn-ghost, .map-action { transition: none; }
}

/* unicorn-only: gem counter wears the pink secondary accent */
.gem-counter { border-color: rgba(255,134,189,0.5); }
.hud-counts { display: flex; gap: 6px; }
.castle-goal { font-family: var(--body); font-weight: 800; color: var(--warm); text-shadow: 0 1px 4px rgba(0,0,0,0.7); }

/* ghost pills win over the legacy colored map-action variants */
.map-action.forge, .map-action.crew, .map-action.castle, .map-action.forge.ready {
  background: var(--glassp); border: 1px solid rgba(253,246,232,0.5);
  color: var(--candle); box-shadow: none; white-space: nowrap;
}
.map-action.forge b { color: var(--gold); font-weight: 800; }
.map-action.forge.ready { border-color: var(--warm); background: rgba(244,184,122,0.16); }
.ctrl.speaking { border-color: var(--warm); box-shadow: 0 0 12px rgba(244,184,122,0.55); animation: none; }

/* teach card + narrow-screen polish (Candle & Ink) */
.big-numeral {
  background: var(--candle); color: var(--ink2); border: none;
  border-radius: 22px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); text-shadow: none;
}
.big-numeral.hint { background: var(--candle); color: var(--ink2); }
.map-actions { flex-wrap: wrap; }
@media (max-width: 430px) {
  .map-action { padding: 0.6rem 1rem; font-size: 0.8rem; }
  .map-sheet { padding: 11px 12px; gap: 9px; }
  .map-sheet .btn-big { padding: 0.7rem 1.3rem; font-size: 1.05rem; }
}
.map-foot-row .map-action { flex: none; }


/* map: the scene continues behind the chart, desaturated (Rose + kids 2026-07-31) */
.map-hero { display: none; }
body:has(#screen-map.active) #scene-bg { filter: saturate(0.4) brightness(0.55); }


/* 2-digit take-away: numbers lead, objects support (Rose 2026-07-31) */
.q-objects.numbers-first .equation { font-size: clamp(2rem, 9vw, 2.6rem); }
.q-objects.numbers-first .equation .eq-box { min-width: 56px; height: 56px; }
.q-objects.numbers-first .double-frame { transform: scale(0.8); opacity: 0.92; margin-top: -0.3rem; }
.q-objects.numbers-first .col-add { transform: scale(1.08); }
