/* ============================================================
   The Great Story — Paper Theatre UI
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  overflow: hidden;
  font-family: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  letter-spacing: .01em;
  background: #26304B;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}

#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- shared paper bits ---------- */
.paper-chip {
  background: #F6EDD2; border-radius: 14px; padding: 8px 16px;
  font-weight: 800; color: #4A3A22; font-size: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  filter: drop-shadow(0 3px 0 rgba(50,60,80,.25));
  border: 0; font-family: inherit; cursor: pointer;
}
button.paper-chip:active { transform: translateY(2px); filter: drop-shadow(0 1px 0 rgba(50,60,80,.25)); }
.region-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #E0623C; color: #FFF3E4; border-radius: 12px;
  padding: 7px 20px 8px; font-size: 15px; font-weight: 800; letter-spacing: 1px;
  white-space: nowrap; max-width: 44vw; overflow: hidden; text-overflow: ellipsis;
  filter: drop-shadow(0 4px 0 rgba(120,40,20,.3)); z-index: 8; pointer-events: none;
  clip-path: polygon(0 8%, 100% 0, 98% 100%, 2% 94%);
}
.soon-chip {
  background: #EFE9DA; color: #8C7E5E; border-radius: 12px;
  padding: 7px 14px; font-size: 14px; font-weight: 800; max-width: 30vw;
  filter: drop-shadow(0 3px 0 rgba(50,60,80,.18));
  transform: rotate(2deg);
}
.stone-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE28A, #F2B437 70%);
  border: 2.5px solid #C9822A; display: inline-block;
}
.flame { color: #F0623E; font-size: 20px; line-height: 1; }

.big-btn {
  background: #F0623E; color: #FFF3E4;
  border: 0; border-radius: 8px 20px 8px 20px;
  font-family: inherit; font-weight: 800; font-size: 24px;
  padding: 16px 44px; cursor: pointer;
  filter: drop-shadow(0 5px 0 rgba(90,30,10,.35));
}
.big-btn:active { transform: translateY(3px); filter: drop-shadow(0 2px 0 rgba(90,30,10,.35)); }
.big-btn.gold { background: #F2B437; color: #4A3A22; filter: drop-shadow(0 5px 0 rgba(120,80,20,.35)); }

/* ---------- HUD ---------- */
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px; z-index: 10; pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-right { display: flex; gap: 10px; }

/* ---------- title screen ---------- */
.title-screen { background: #BFE0E8; align-items: center; justify-content: center; text-align: center; }
.title-screen .stagewrap { position: absolute; inset: 0; }
.title-screen .stagewrap svg { width: 100%; height: 100%; }
.title-card { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.logo {
  font-size: clamp(44px, 9vw, 84px); font-weight: 800; color: #26304B;
  background: #F6EDD2; padding: 18px 44px; border-radius: 12px 30px 12px 30px;
  filter: drop-shadow(0 8px 0 rgba(50,60,80,.28));
  line-height: 1.05; transform: rotate(-1.5deg);
}
.logo small { display: block; font-size: .32em; letter-spacing: .3em; color: #B87A0A; }
.tagline { color: #26304B; font-weight: 700; font-size: 18px; background: rgba(246,237,210,.85); border-radius: 10px; padding: 6px 16px; }

/* ---------- age band picker ---------- */
.band-screen { background: #BFE0E8; align-items: center; justify-content: center; gap: 20px; }
.band-title { font-size: 30px; font-weight: 800; color: #26304B; background:#F6EDD2; padding: 10px 28px; border-radius: 10px 24px 10px 24px; filter: drop-shadow(0 5px 0 rgba(50,60,80,.25)); }
.bands { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 0 20px; }
.band-card {
  background: #F6EDD2; border: 0; border-radius: 18px; padding: 22px 26px;
  width: 210px; cursor: pointer; font-family: inherit; text-align: center;
  filter: drop-shadow(0 6px 0 rgba(50,60,80,.25));
}
.band-card:active { transform: translateY(3px); }
.band-card.selected { outline: 5px solid #F2B437; }
.band-card h3 { margin: 0 0 2px; font-size: 22px; color: #26304B; }
.band-card .ages { color: #B87A0A; font-weight: 800; font-size: 15px; }
.band-card p { margin: 8px 0 0; font-size: 14px; color: #5B647F; font-weight: 600; }

/* ---------- map ---------- */
.map-screen { background: #B8D49A; }
.map-screen svg.map { width: 100%; height: 100%; }
.map-node { cursor: pointer; }
.map-node.locked { cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .map-node.current .pulse { animation: pulse 1.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
  @keyframes pulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.25); opacity: .3; } }
  .lantern-glow { animation: glowpulse 2.4s ease-in-out infinite; }
  @keyframes glowpulse { 0%,100% { opacity: .8; } 50% { opacity: .45; } }
}

/* ---------- story player ---------- */
.story-screen { background: #26304B; }
.stage { flex: 1; position: relative; min-height: 0; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .tap-hint {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  background: #FFF; border-radius: 14px; padding: 8px 18px;
  font-weight: 800; color: #4A3A22; font-size: 17px;
  filter: drop-shadow(0 3px 0 rgba(50,60,80,.25));
}
@media (prefers-reduced-motion: no-preference) {
  .stage .tap-hint.hint-v0 { animation: bob 1.2s ease-in-out infinite; }
  @keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
  .stage .tap-hint.hint-v1 { animation: hint-pulse 1.1s ease-in-out infinite; }
  @keyframes hint-pulse { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.16); } }
  .stage .tap-hint.hint-v2 { animation: hint-sway 1.4s ease-in-out infinite; }
  @keyframes hint-sway { 0%,100% { transform: translateX(-50%) rotate(-5deg) translateY(-2px); } 50% { transform: translateX(-50%) rotate(5deg) translateY(2px); } }
  .stage .tap-hint.hint-v3 { animation: hint-glow 1.4s ease-in-out infinite; }
  @keyframes hint-glow {
    0%,100% { transform: translateX(-50%); box-shadow: 0 0 0 0 rgba(242,180,55,0); }
    50% { transform: translateX(-50%); box-shadow: 0 0 0 9px rgba(242,180,55,.35); }
  }
  .stage .tap-hint.hint-v4 { animation: hint-hop 1.5s ease-in-out infinite; }
  @keyframes hint-hop {
    0%,55%,100% { transform: translateX(-50%) translateY(0) scale(1,1); }
    65% { transform: translateX(-50%) translateY(2px) scale(1.06,.92); }
    80% { transform: translateX(-50%) translateY(-12px) scale(.96,1.06); }
    92% { transform: translateX(-50%) translateY(1px) scale(1.04,.95); }
  }
}
.tap-hint .hint-ico { margin-right: 6px; font-size: 19px; display: inline-block; }
.narration {
  background: #F6EDD2; padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 18px;
  filter: drop-shadow(0 -4px 0 rgba(20,25,50,.2));
}
.narration p { flex: 1; margin: 0; font-size: clamp(16px, 2.4vw, 21px); font-weight: 700; color: #4A3A22; line-height: 1.45; }
.next-btn {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
  background: #F0623E; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 0 rgba(90,30,10,.35));
}
.next-btn:active { transform: translateY(2px); }
.next-btn svg { width: 30px; height: 30px; }
.next-btn.waiting { opacity: .35; pointer-events: none; }

/* ---------- game screens ---------- */
.game-screen { background: #BFE0E8; }
.game-head { text-align: center; padding: 16px 70px 4px; }
.game-prompt {
  display: inline-block; background: #F6EDD2; border-radius: 14px;
  padding: 10px 24px; font-weight: 800; font-size: clamp(17px, 2.6vw, 22px); color: #4A3A22;
  filter: drop-shadow(0 4px 0 rgba(50,60,80,.25));
  max-width: min(640px, 58vw);
}
.game-body { flex: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 18px; padding: 12px 24px calc(20px + env(safe-area-inset-bottom)); min-height: 0; }

.tile {
  background: #F6EDD2; border: 0; border-radius: 16px; cursor: pointer;
  width: clamp(110px, 17vw, 170px); aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  filter: drop-shadow(0 5px 0 rgba(90,70,30,.28));
  font-family: inherit; font-weight: 800; color: #4A3A22; font-size: 15px;
  padding: 8px;
}
.tile svg { width: 70%; height: 60%; }
.tile:active { transform: translateY(3px); }
.tile.correct { background: #CBE7C4; outline: 5px solid #7FB069; }
.tile.wrong { animation: shake .4s; }
.tile.matched { opacity: 0; transform: scale(.6); transition: all .45s; pointer-events: none; }
.tile.facedown .tile-face { visibility: hidden; }
.tile.facedown { background: #E0623C; }
.tile.facedown::after { content: "?"; color: #FFF3E4; font-size: 44px; font-weight: 800; position: absolute; }
.tile { position: relative; }
.tile .tile-face { display: contents; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.pips { position: absolute; top: 72px; right: 16px; display: flex; gap: 8px; background:#F6EDD2; padding: 8px 14px; border-radius: 12px; filter: drop-shadow(0 3px 0 rgba(50,60,80,.25)); z-index: 5;}
.pip { width: 16px; height: 16px; border-radius: 50%; background: #EDE4CC; border: 2.5px solid #C9B478; }
.pip.done { background: #F2B437; border-color: #C9822A; }

/* verse game */
.verse-words { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 720px; }
.word-chip {
  background: #F6EDD2; border: 0; border-radius: 12px; padding: 12px 18px;
  font-family: inherit; font-weight: 800; font-size: clamp(17px, 2.6vw, 24px); color: #4A3A22;
  cursor: pointer; filter: drop-shadow(0 4px 0 rgba(90,70,30,.28));
}
.word-chip:active { transform: translateY(2px); }
.word-chip.used { opacity: .25; pointer-events: none; }
.word-chip.glow { outline: 5px solid #F2B437; }
.verse-built {
  min-height: 54px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  align-items: center; max-width: 760px; padding: 10px 16px;
  background: rgba(246,237,210,.6); border-radius: 14px; border: 3px dashed #C9B478;
}
.verse-built span { font-weight: 800; font-size: clamp(16px, 2.4vw, 22px); color: #26304B; }
.verse-ref { font-weight: 800; color: #5B647F; font-size: 16px; }

/* ---------- reward screen ---------- */
.reward-screen { background: #26304B; align-items: center; justify-content: center; gap: 16px; text-align: center; overflow: hidden; }
.reward-title { font-size: clamp(28px, 5vw, 44px); font-weight: 800; color: #F6EDD2; }
.stars-row { display: flex; gap: 14px; }
.star-big { width: 64px; height: 64px; }
.star-big.dim { opacity: .22; }
@media (prefers-reduced-motion: no-preference) {
  .star-big.earned { animation: starpop .5s cubic-bezier(.2,1.6,.4,1) backwards; }
  .star-big.earned:nth-child(2) { animation-delay: .25s; }
  .star-big.earned:nth-child(3) { animation-delay: .5s; }
  @keyframes starpop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
}
.stone-award { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; color: #FFE28A; }
.stone-award .stone-dot { width: 28px; height: 28px; }

/* friend card reveal */
.card-reveal { perspective: 900px; }
.friend-card {
  width: 210px; height: 270px; border-radius: 18px; position: relative;
  transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3,1.2,.4,1);
  cursor: pointer;
}
.friend-card.flipped { transform: rotateY(180deg); }
.friend-face {
  position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.3));
}
.friend-back { background: #E0623C; color: #FFF3E4; font-size: 60px; font-weight: 800; }
.friend-back small { font-size: 15px; letter-spacing: .1em; }
.friend-front { background: #F6EDD2; transform: rotateY(180deg); padding: 14px; }
.friend-front svg { width: 130px; height: 120px; }
.friend-front .fname { font-weight: 800; font-size: 18px; color: #26304B; text-align: center; }
.friend-front .frarity { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 12px; border-radius: 99px; }
.frarity.common { background: #DCE8DC; color: #3E6E4E; }
.frarity.rare { background: #D6E4F5; color: #2E5A8C; }
.frarity.legendary { background: #FBE9B4; color: #9A6A00; }
.friend-front .ffact { font-size: 11.5px; color: #5B647F; font-weight: 600; text-align: center; line-height: 1.35; }

/* confetti */
.confetti { position: absolute; width: 12px; height: 12px; top: -20px; z-index: 50; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .confetti { animation: fall linear forwards; }
  @keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
}

/* ---------- collection ---------- */
.collection-screen { background: #B8D49A; overflow-y: auto; }
.coll-head { text-align: center; padding: 20px 70px 6px; }
.coll-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px; padding: 16px 24px 40px; max-width: 900px; margin: 0 auto; width: 100%;
}
.coll-card {
  background: #F6EDD2; border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  filter: drop-shadow(0 4px 0 rgba(60,80,40,.25));
}
.coll-card svg { width: 90px; height: 80px; }
.coll-card .fname { font-weight: 800; font-size: 14px; color: #26304B; text-align: center; }
.coll-card.unowned { opacity: .8; }
.coll-card.unowned svg { filter: brightness(0) opacity(.22); }
.coll-card.unowned .fname { color: #8C8E77; }
.coll-count { font-size: 12px; font-weight: 800; color: #B87A0A; }

/* ---------- quests panel ---------- */
.quest-panel {
  position: absolute; top: 70px; right: 14px; z-index: 20;
  background: #F6EDD2; border-radius: 16px; padding: 16px 18px; width: 280px;
  filter: drop-shadow(0 6px 0 rgba(50,60,80,.3));
}
.quest-panel h3 { margin: 0 0 10px; color: #26304B; font-size: 18px; }
.quest { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 2px dashed #D8CCAC; }
.quest .qtext { flex: 1; font-size: 14px; font-weight: 700; color: #4A3A22; }
.quest .qreward { font-size: 13px; font-weight: 800; color: #B87A0A; white-space: nowrap; }
.quest.done .qtext { text-decoration: line-through; opacity: .55; }
.qcheck { width: 22px; height: 22px; border-radius: 7px; border: 3px solid #C9B478; flex-shrink: 0; display:flex; align-items:center; justify-content:center; color:#3E6E4E; font-weight:800; }
.quest.done .qcheck { background: #CBE7C4; border-color: #7FB069; }

/* toast — --toast-slot stacks concurrent toasts instead of overlapping them */
.toast {
  position: absolute; bottom: calc(100px + var(--toast-slot, 0) * 58px); left: 50%; transform: translateX(-50%);
  background: #26304B; color: #FFE28A; font-weight: 800; font-size: 17px;
  padding: 12px 24px; border-radius: 14px; z-index: 60;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.3));
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toastin 2.6s ease forwards; }
  @keyframes toastin { 0% { opacity: 0; transform: translateX(-50%) translateY(16px); } 10%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; } }
}

.back-corner { position: absolute; top: 14px; left: 16px; z-index: 15; }

/* ============================================================
   Ambient motion layer — everything breathes.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .anim-breathe, .anim-bob-soft, .anim-drift, .anim-hover, .anim-rock,
  .anim-glowpulse, .anim-waves, .anim-flap {
    transform-box: fill-box; transform-origin: center;
  }
  .anim-breathe { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
  @keyframes breathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.015,0.985) translateY(1.5px); } }

  .anim-bob-soft { animation: bobsoft 2.8s ease-in-out infinite; }
  .anim-bob-soft:nth-of-type(2n) { animation-delay: .7s; }
  @keyframes bobsoft { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(1.2deg); } }

  .anim-drift { animation: drift 9s ease-in-out infinite alternate; }
  @keyframes drift { from { transform: translateX(-14px); } to { transform: translateX(14px); } }

  .anim-hover { animation: hover 2.2s ease-in-out infinite; }
  @keyframes hover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

  .anim-flap { animation: flap .5s ease-in-out infinite alternate; transform-origin: 20% 90%; }
  @keyframes flap { from { transform: rotate(0); } to { transform: rotate(-24deg); } }

  .anim-rock { animation: rock 5s ease-in-out infinite; transform-origin: 50% 85%; }
  @keyframes rock { 0%,100% { transform: rotate(-1.1deg) translateY(0); } 50% { transform: rotate(1.1deg) translateY(-3px); } }

  .anim-glowpulse { animation: sunpulse 4s ease-in-out infinite; }
  @keyframes sunpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

  .anim-waves { animation: waveslide 3.6s ease-in-out infinite alternate; }
  @keyframes waveslide { from { transform: translateX(-10px); } to { transform: translateX(10px); } }

  .anim-twinkle { animation: twinkle 2.6s ease-in-out infinite; }
  @keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

  .rain-lines { animation: rainfall .7s linear infinite; }
  @keyframes rainfall { from { transform: translateY(-12px); opacity: 1; } to { transform: translateY(26px); opacity: .25; } }

  /* screens fade+rise in */
  .screen { animation: screenin .45s cubic-bezier(.2,.9,.3,1) backwards; }
  @keyframes screenin { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

  /* game tiles & word chips pop in with stagger */
  .tile, .word-chip { animation: tilepop .45s cubic-bezier(.2,1.5,.4,1) backwards; }
  .tile:nth-child(1), .word-chip:nth-child(1) { animation-delay: .03s; }
  .tile:nth-child(2), .word-chip:nth-child(2) { animation-delay: .09s; }
  .tile:nth-child(3), .word-chip:nth-child(3) { animation-delay: .15s; }
  .tile:nth-child(4), .word-chip:nth-child(4) { animation-delay: .21s; }
  .tile:nth-child(5), .word-chip:nth-child(5) { animation-delay: .27s; }
  .tile:nth-child(6), .word-chip:nth-child(6) { animation-delay: .33s; }
  .tile:nth-child(7), .word-chip:nth-child(7) { animation-delay: .39s; }
  .tile:nth-child(8), .word-chip:nth-child(8) { animation-delay: .45s; }
  .tile:nth-child(9), .word-chip:nth-child(9) { animation-delay: .51s; }
  .tile:nth-child(10), .word-chip:nth-child(10) { animation-delay: .57s; }
  .tile:nth-child(11), .word-chip:nth-child(11) { animation-delay: .63s; }
  .tile:nth-child(12), .word-chip:nth-child(12) { animation-delay: .69s; }
  @keyframes tilepop { from { opacity: 0; transform: scale(.4) rotate(-4deg); } to { opacity: 1; transform: none; } }

  /* title */
  .logo { animation: logodrop .7s cubic-bezier(.2,1.4,.4,1) backwards .15s; }
  @keyframes logodrop { from { opacity: 0; transform: rotate(-1.5deg) translateY(-60px) scale(.8); } to { opacity: 1; transform: rotate(-1.5deg); } }
  .big-btn#play, .title-screen .big-btn { animation: playpulse 1.8s ease-in-out infinite; }
  @keyframes playpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

  /* map lanterns flicker */
  .map-node.done path[fill="#FFF3D0"] { animation: flicker 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  @keyframes flicker { 0%,100% { transform: scaleY(1); } 40% { transform: scaleY(1.18) scaleX(.92); } 70% { transform: scaleY(.9); } }
}

/* ============================================================
   Chest · companion · growth · builder · passport · events
   ============================================================ */
.chest {
  position: absolute; right: 18px; bottom: 76px; z-index: 14;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 96px;
}
.chest svg { width: 84px; height: 76px; }
.chest span {
  background: #F6EDD2; border-radius: 10px; padding: 3px 10px;
  font-weight: 800; font-size: 13px; color: #4A3A22;
  filter: drop-shadow(0 2px 0 rgba(50,60,80,.25));
}
.chest.golden span { background: #FFE28A; color: #7A5210; }
@media (prefers-reduced-motion: no-preference) {
  .chest { animation: chestbounce 1.6s ease-in-out infinite; }
  @keyframes chestbounce { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-2deg); } }
}

/* buddy — lives on every screen, reacts to play */
.buddy { position: absolute; left: 18px; bottom: 76px; z-index: 14; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.buddy-fig { pointer-events: auto; cursor: pointer; transform-origin: 50% 90%; }
.buddy-fig.sleeping { filter: saturate(.65) brightness(.92); transform: rotate(9deg); animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .buddy-fig { animation: buddybob 3.4s ease-in-out infinite; }
  .buddy-fig.cheer { animation: buddycheer .55s ease; }
  .buddy-fig.gasp { animation: buddygasp .55s ease; }
  .buddy-fig.jump { animation: buddyjump .75s cubic-bezier(.3,1.6,.5,1); }
  @keyframes buddybob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
  @keyframes buddycheer { 0%,100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-9deg) scale(1.08); } 65% { transform: rotate(8deg) scale(1.08); } }
  @keyframes buddygasp { 0%,100% { transform: translateX(0) scaleY(1); } 25% { transform: translateX(-7px) scaleY(.9); } 55% { transform: translateX(6px) scaleY(.94); } }
  @keyframes buddyjump { 0%,100% { transform: translateY(0) scale(1,1); } 22% { transform: translateY(2px) scale(1.1,.84); } 55% { transform: translateY(-22px) scale(.94,1.1); } 80% { transform: translateY(1px) scale(1.05,.92); } }
}
.buddy-bubble {
  background: #FFF; border-radius: 12px; padding: 7px 13px;
  font-weight: 800; font-size: 14px; color: #4A3A22; max-width: 190px;
  filter: drop-shadow(0 3px 0 rgba(50,60,80,.25));
  margin-bottom: 4px; transition: opacity .6s;
}
.buddy-bubble:empty { display: none; }
.buddy-bubble.gone { opacity: 0; }

/* detail modal */
.modal-back { position: absolute; inset: 0; background: rgba(20,25,50,.55); z-index: 40; display: flex; align-items: center; justify-content: center; }
.detail-modal {
  background: #F6EDD2; border-radius: 22px; padding: 22px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  filter: drop-shadow(0 8px 0 rgba(0,0,0,.3)); position: relative;
  max-width: 380px; text-align: center;
}
.detail-modal .modal-x { position: absolute; top: 10px; right: 10px; padding: 4px 12px; }
.detail-art { background: #EFE7D2; border-radius: 16px; padding: 6px 18px; }
.feed-bar { width: 220px; height: 16px; background: #E5DCC2; border-radius: 99px; overflow: hidden; border: 2.5px solid #C9B478; }
.feed-fill { height: 100%; background: linear-gradient(90deg, #F2B437, #FFD470); border-radius: 99px; transition: width .4s; }
.feed-label { font-weight: 800; font-size: 14px; color: #8C6B2E; }
.detail-modal .fname { font-weight: 800; color: #26304B; }
.detail-modal .ffact { color: #5B647F; font-weight: 600; line-height: 1.4; }

/* event chip + panel */
.event-chip { position: absolute; top: 66px; left: 16px; z-index: 12; border-left: 6px solid var(--evc, #E0623C); font-size: 15px; }
.event-chip.claimable { background: #FFE28A; }
@media (prefers-reduced-motion: no-preference) {
  .event-chip.claimable { animation: chestbounce 1.4s ease-in-out infinite; }
}
.event-bar { height: 14px; background: #E5DCC2; border-radius: 99px; overflow: hidden; border: 2px solid #C9B478; }
.event-fill { height: 100%; border-radius: 99px; transition: width .4s; }

/* builder */
.builder-screen { background: #BFE0E8; }
.yard { flex: 1; position: relative; min-height: 0; cursor: pointer; }
.yard-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.yard-items, .yard-friends { position: absolute; inset: 0; pointer-events: none; }
.placed { position: absolute; transform: translate(-50%, -80%); pointer-events: auto; cursor: pointer; }
.yard-friend { position: absolute; transform: translate(-50%, -50%); }
@media (prefers-reduced-motion: no-preference) {
  .yard-friend { animation: wander 6s ease-in-out infinite alternate; }
  .yard-friend:nth-child(2n) { animation-duration: 8s; animation-delay: 1s; }
  .yard-friend:nth-child(3n) { animation-duration: 7s; animation-delay: 2s; }
  @keyframes wander { from { transform: translate(-50%,-50%) translateX(0); } to { transform: translate(-50%,-50%) translateX(60px); } }
}
.build-tray {
  background: #EAD8AE; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  filter: drop-shadow(0 -4px 0 rgba(50,60,80,.15));
}
.tray-row { display: flex; gap: 10px; overflow-x: auto; align-items: center; }
.tray-label { font-size: 12px; font-weight: 800; color: #8C6B2E; min-width: 90px; }
.decor-tile {
  background: #F6EDD2; border: 0; border-radius: 12px; padding: 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: inherit; cursor: pointer; flex-shrink: 0;
  filter: drop-shadow(0 3px 0 rgba(90,70,30,.25));
}
.decor-tile.selected { outline: 4px solid #F2B437; }
.decor-tile .dname { font-size: 11px; font-weight: 800; color: #4A3A22; }
.decor-tile .dcost, .decor-tile .dcount { font-size: 11px; font-weight: 800; color: #B87A0A; display: inline-flex; align-items: center; gap: 3px; }
.decor-tile .dcount { color: #3E6E4E; }

/* passport */
.passport-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; padding: 14px 24px 40px; max-width: 960px; margin: 0 auto; width: 100%;
}
.book-cell {
  background: #F6EDD2; border-radius: 12px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  filter: drop-shadow(0 3px 0 rgba(60,80,40,.2));
}
.book-cell span { font-size: 12px; font-weight: 800; color: #8C8570; text-align: center; }
.book-cell.stamped span { color: #26304B; }
.book-cell .stamp { width: 34px; height: 34px; }
.stamp-slot { width: 34px; height: 34px; border-radius: 50%; border: 2.5px dashed #C9B478; }

/* ============================================================
   New mini-games: tower stack · star field · coat pattern
   ============================================================ */
.tower-stage {
  position: relative; width: min(90vw, 560px); height: min(52vh, 380px);
  background: #CDE8EE; border-radius: 18px; overflow: hidden;
  filter: drop-shadow(0 6px 0 rgba(50,60,80,.2)); cursor: pointer;
  touch-action: manipulation;
}
.tower-ground { position: absolute; bottom: 0; left: 0; right: 0; height: 14px; background: #C9A85C; }
.tower-block {
  position: absolute; height: 30px; border-radius: 5px;
  background: #B5824D; border: 3px solid #8A5A28;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.25);
}
.tower-block.set { background: #C9975C; }
.tower-block.fall { transition: transform .5s ease-in, opacity .5s; transform: translateY(300px) rotate(24deg); opacity: 0; }

.sky-field {
  position: relative; width: min(90vw, 620px); height: min(50vh, 340px);
  background: #141930; border-radius: 18px; overflow: hidden;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.3));
}
.sky-star {
  position: absolute; width: 44px; height: 44px; background: none; border: 0;
  cursor: pointer; padding: 0;
}
.sky-star svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .sky-star { animation: twinkle 2s ease-in-out infinite; }
  .sky-star:nth-child(2n) { animation-delay: .5s; }
  .sky-star:nth-child(3n) { animation-delay: 1s; }
}
.num-tile { width: clamp(90px, 13vw, 130px); }

.coat-wrap {
  background: #EAD8AE; border-radius: 22px; padding: 26px 30px;
  filter: drop-shadow(0 6px 0 rgba(90,70,30,.3));
}
.coat-pads { display: flex; gap: 16px; }
.coat-pad {
  width: clamp(70px, 14vw, 120px); height: clamp(110px, 24vh, 180px);
  border: 4px solid rgba(60,40,20,.35); border-radius: 14px 14px 40px 40px;
  background: var(--pc); opacity: .55; cursor: pointer;
  transition: opacity .12s, transform .12s;
}
.coat-pad.lit { opacity: 1; transform: scale(1.06); box-shadow: 0 0 30px var(--pc); }
.coat-pad.guide { opacity: 1; outline: 5px dashed #FFF; }
.coat-pad.wrong { animation: shake .4s; }
.coat-pad:active { transform: scale(.97); }

/* ---------- reeds & sea games ---------- */
.reed-field {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  max-width: 720px; background: #5E9CB5; border-radius: 18px; padding: 24px;
  filter: drop-shadow(0 6px 0 rgba(40,70,90,.3));
}
.reed-tuft {
  position: relative; width: clamp(72px, 11vw, 104px); aspect-ratio: 3/4;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.reed-tuft svg { width: 100%; height: 100%; }
.reed-reveal { position: absolute; inset: 0; display: none; }
.reed-tuft.peeked .reed-face { opacity: .18; }
.reed-tuft.peeked .reed-reveal { display: block; }
.reed-tuft.sparkle { outline: 4px dashed #FFE28A; border-radius: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .reed-tuft { transition: transform .15s; }
  .reed-tuft:active { transform: scale(.94); }
}

.sea-wrap {
  display: flex; align-items: stretch; gap: 12px;
  background: #CDE8EE; border-radius: 18px; padding: 16px;
  filter: drop-shadow(0 6px 0 rgba(40,70,90,.3));
}
.sea-wall {
  width: clamp(34px, 6vw, 60px); border-radius: 12px;
  background: repeating-linear-gradient(180deg, #3D85B5 0 18px, #5FB2D9 18px 36px);
}
.sea-grid { display: grid; gap: 10px; }
.sea-tile {
  width: clamp(58px, 10vw, 92px); aspect-ratio: 1;
  border: 3px solid #B5824D; border-radius: 12px;
  background: #E8C989; cursor: pointer; opacity: .8;
  transition: opacity .12s, transform .12s;
}
.sea-tile.lit { background: #FFE28A; opacity: 1; transform: scale(1.06); box-shadow: 0 0 22px #FFD470; }
.sea-tile.guide { outline: 5px dashed #FFF; opacity: 1; }
.sea-tile.stepped { background: #CBE7C4; border-color: #7FB069; opacity: 1; }
.sea-tile.wrong { animation: shake .4s; }

/* ---------- march / glean / sling games ---------- */
.march-stage {
  position: relative; width: min(88vw, 520px); height: min(48vh, 340px);
  background: #E8DBB4; border-radius: 18px; overflow: hidden; cursor: pointer;
  filter: drop-shadow(0 6px 0 rgba(90,70,30,.3)); touch-action: manipulation;
}
.march-target {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 110px; height: 84px;
}
.march-ring {
  position: absolute; left: 50%; top: 50%;
  width: 130px; height: 130px; border-radius: 50%;
  border: 8px solid #E0623C; opacity: 0;
  transform: translate(-50%,-50%) scale(2.4);
}
.march-count {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #F6EDD2; border-radius: 10px; padding: 4px 14px;
  font-weight: 800; color: #4A3A22; font-size: 14px;
  filter: drop-shadow(0 2px 0 rgba(50,60,80,.25));
}
.march-stage.wrongflash { animation: shake .35s; }
@media (prefers-reduced-motion: no-preference) {
  .march-stage.walls-fall { animation: wallsfall .9s ease-in; }
  @keyframes wallsfall { 0% { transform: translateY(0); } 30% { transform: translateY(-10px) rotate(-1deg); } 100% { transform: translateY(6px); } }
}

.glean-field {
  position: relative; width: min(90vw, 620px); height: min(48vh, 330px);
  background: linear-gradient(180deg, #CDE8EE 0 26%, #E8CF7E 26%);
  border-radius: 18px; overflow: hidden;
  filter: drop-shadow(0 6px 0 rgba(90,70,30,.3));
}
.glean-item {
  position: absolute; width: 52px; height: 84px;
  background: none; border: 0; cursor: pointer; padding: 0;
  transform: translate(-50%,-50%);
}
.glean-item svg { width: 100%; height: 100%; }
.glean-item.wrong { animation: shake .4s; }
.glean-basket { margin-top: 12px; font-size: 17px; }

.sling-stage {
  position: relative; width: min(92vw, 640px); height: min(52vh, 360px);
  background: linear-gradient(180deg, #E8DBB4 0 62%, #C2B884 62%);
  border-radius: 18px; overflow: hidden; touch-action: none;
  filter: drop-shadow(0 6px 0 rgba(90,70,30,.3)); cursor: crosshair;
}
.sling-target {
  position: absolute; right: 7%; top: 30%;
  display: flex; align-items: center; justify-content: center;
}
.sling-target svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .sling-target.bobbing { animation: targetbob 2.2s ease-in-out infinite; }
  @keyframes targetbob { 0%,100% { transform: translateY(-34px); } 50% { transform: translateY(34px); } }
}
.sling-pouch { position: absolute; left: 9%; bottom: 12%; width: 76px; height: 76px; }
.sling-pouch svg { width: 100%; height: 100%; }
.sling-aim {
  position: absolute; height: 0; opacity: 0;
  border-top: 5px dotted #8A6B3A; transform-origin: 0 0;
  pointer-events: none;
}
.sling-stone {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #D5D0C4, #8C8578);
  transform: translate(-50%,-50%); pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(60,60,60,.3));
}
.sling-stones {
  position: absolute; left: 14px; top: 12px; color: #6E6258;
  font-size: 20px; letter-spacing: 4px;
  background: #F6EDD2; border-radius: 10px; padding: 3px 12px;
  filter: drop-shadow(0 2px 0 rgba(50,60,80,.25));
}

/* ---------- fire & deep games ---------- */
.fire-field { background: linear-gradient(180deg, #8C93A8 0 30%, #A5977E 30%); }
.fire-altar {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 150px; pointer-events: none;
}
.soak-meter { height: 12px; background: rgba(255,255,255,.4); border-radius: 99px; overflow: hidden; margin-top: 4px; border: 2px solid #4E8BAD; }
.soak-fill { height: 100%; width: 0; background: #4E8BAD; transition: width .3s; }
@media (prefers-reduced-motion: no-preference) {
  .fire-field.fire-falls { animation: firefall 1s ease; }
  @keyframes firefall { 0% { background: #8C93A8; } 40% { background: #FFD470; } 100% { background: linear-gradient(180deg, #F2B437 0 30%, #A5977E 30%); } }
}
.fire-field.fire-falls { background: linear-gradient(180deg, #F2B437 0 30%, #A5977E 30%); }

.deep-sea {
  position: relative; width: min(90vw, 620px); height: min(48vh, 330px);
  background: linear-gradient(180deg, #48708C, #1E3E5C);
  border-radius: 18px; overflow: hidden;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.3));
}
.deep-whale { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 110px; pointer-events: none; }
.deep-whale svg { width: 100%; }
.deep-item {
  position: absolute; right: -70px; width: 64px; height: 54px;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.deep-item svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .deep-item { animation: driftacross linear forwards; }
  @keyframes driftacross { from { transform: translateX(0); } to { transform: translateX(calc(-90vw - 140px)); } }
}
@media (prefers-reduced-motion: reduce) {
  .deep-item { right: auto; left: calc(20% + 55% * var(--slot, 0)); }
}
.deep-item.wrong { animation: shake .4s !important; }

/* ---------- Follow the Star (Christmas) ---------- */
.trail-sky { width: 100%; height: 100%; display: block; border-radius: 18px; }
.trail-star { cursor: pointer; }
.trail-star .starwrap { transform-box: fill-box; transform-origin: center; }
.trail-star.lit polygon { fill: #FFD470; }
.trail-star.lit .trail-ring { opacity: 0 !important; }
.trail-decoy { cursor: pointer; }
.t-wiggle { animation: t-wiggle .4s ease; }
@keyframes t-wiggle { 25% { transform: translateX(-5px) rotate(-4deg); } 75% { transform: translateX(5px) rotate(4deg); } }
.trail-hint { transform-box: fill-box; transform-origin: center; animation: trail-hint 1.1s ease-in-out infinite; }
@keyframes trail-hint { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .t-wiggle, .trail-hint { animation: none; } }

/* ---------- Cast the Net ---------- */
.net-sea {
  position: relative; width: min(100%, 1000px); height: 100%; max-height: 62vh;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(#BFE0E8 0 18%, #5E9BB8 18% 60%, #4E8BAD 60%);
}
.net-boat { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); width: 150px; z-index: 3; }
.net-boat svg { width: 100%; display: block; }
.net-drop {
  position: absolute; left: 39%; width: 22%; top: 21%; height: 0; z-index: 2;
  overflow: hidden; transition: height .5s ease;
  filter: drop-shadow(0 3px 0 rgba(40,70,90,.25));
}
.net-drop svg { width: 100%; height: 58vh; max-height: 420px; }
.net-drop.down { height: 64%; }
.net-fish { position: absolute; width: 62px; margin-left: -31px; z-index: 1; transition: opacity .4s, transform .4s; }
.net-fish svg { width: 100%; display: block; }
.net-fish.caught { opacity: 0; transform: translateY(-60px) scale(.5); }
.net-cast {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 4; font-size: 20px; padding: 12px 34px;
}
.net-cast:active { transform: translateX(-50%) translateY(3px); }
.net-sea .glean-basket { position: absolute; top: 12px; right: 12px; z-index: 4; }

/* ---------- Find the Boy ---------- */
.seek-p { cursor: pointer; }
.seek-found { animation: seek-pop .5s ease; transform-box: fill-box; transform-origin: center; }
@keyframes seek-pop { 30% { transform: scale(1.35); } 60% { transform: scale(.95); } 100% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .seek-found { animation: none; } }

/* ---------- Speak Peace ---------- */
.calm-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 900px); height: 100%; justify-content: center; }
.calm-wrap svg { width: 100%; max-height: 52vh; border-radius: 18px; }
.calm-words { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.calm-word { font-size: 22px; padding: 12px 26px; }
.calm-word.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.calm-wave .starwrap { transform-box: fill-box; transform-origin: bottom center; transition: transform .5s ease, opacity .5s ease; }
.calm-wave .calm-flat { transform: scaleY(.12); opacity: .45; }

/* ---------- Share the Bread ---------- */
.share-p { cursor: pointer; }
.share-hand, .share-handtip, .share-bread { transition: opacity .25s ease; }

/* nest & eggs */
.nest { position: absolute; right: 20px; bottom: 170px; z-index: 14; display: flex; flex-direction: column; align-items: center; }
.nest-eggs { display: flex; gap: 2px; margin-bottom: -14px; z-index: 2; }
.nest-egg { background: none; border: 0; padding: 0; cursor: pointer; position: relative; font-family: inherit; }
.nest-egg .egg-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: #B87A0A; background: #F6EDD2; border-radius: 8px; padding: 1px 6px; filter: drop-shadow(0 2px 0 rgba(90,70,30,.25)); }
@media (prefers-reduced-motion: no-preference) {
  .nest-egg.ready { animation: eggwiggle 1.5s ease-in-out infinite; transform-origin: 50% 90%; }
  .nest-egg.wiggle { animation: eggwiggle .5s ease-in-out 2; transform-origin: 50% 90%; }
  @keyframes eggwiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
}
.hatch-stage { cursor: pointer; }
.hatch-stage.crack1 .egg-art { animation: eggshake .35s ease; }
.hatch-stage.crack2 .egg-art { animation: eggshake .3s ease 2; }
@keyframes eggshake { 0%,100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-8deg) translateY(-3px); } 70% { transform: rotate(8deg) translateY(-2px); } }

/* profiles */
.profile-card { position: relative; }
.profile-card .profile-del {
  position: absolute; top: 6px; right: 6px; border: 0; background: #EFE9DA;
  color: #8C7E5E; border-radius: 8px; width: 26px; height: 26px; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 13px;
}
.name-input {
  font-family: inherit; font-weight: 800; font-size: 22px; color: #26304B;
  background: #F6EDD2; border: 0; border-radius: 14px; padding: 12px 20px;
  width: min(320px, 80vw); text-align: center; outline: none;
  filter: drop-shadow(0 4px 0 rgba(50,60,80,.25));
}
.name-input::placeholder { color: #B5A87E; }
.pick-label { font-weight: 800; color: #26304B; background: #F6EDD2; border-radius: 10px; padding: 6px 16px; filter: drop-shadow(0 3px 0 rgba(50,60,80,.2)); }
.starter.selected { outline: 5px solid #F2B437; }

/* family campfire chip sits under the weekly event chip */
.campfire-chip { position: absolute; top: 112px; left: 16px; z-index: 12; border-left: 6px solid #F0623E; font-size: 15px; }
.campfire-chip.claimable { background: #FFE28A; }

/* diegetic game stage — the story's scene plays behind every game */
.game-stage { position: absolute; inset: 0; }
.game-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-scrim { position: absolute; inset: 0; background: linear-gradient(rgba(24,30,56,.16), rgba(24,30,56,.38)); pointer-events: none; }
.game-screen .game-head, .game-screen .game-body { position: relative; z-index: 2; }
.game-screen .tile { filter: drop-shadow(0 6px 0 rgba(20,25,45,.45)); }
.game-screen .word-chip { filter: drop-shadow(0 4px 0 rgba(20,25,45,.45)); }

/* Light the World flyover */
.map.flying .map-veil { opacity: .58; transition: opacity .9s ease; }
.map-veil { transition: opacity .7s ease; }
.map-node.lit-focus { animation: litpop .62s ease; transform-box: fill-box; transform-origin: center; }
@keyframes litpop { 0% { transform: scale(1); } 45% { transform: scale(1.7); } 100% { transform: scale(1); } }
.light-meter {
  position: absolute; top: 54px; left: 50%; transform: translateX(-50%);
  background: rgba(246,237,210,.92); color: #6E5530; border-radius: 10px;
  padding: 3px 12px; font-size: 12.5px; font-weight: 800; z-index: 8; pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(50,60,80,.2));
}
.light-card {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%,-50%);
  background: #F6EDD2; color: #26304B; border-radius: 18px; z-index: 30;
  padding: 22px 30px; font-size: 21px; font-weight: 800; text-align: center; max-width: 420px;
  filter: drop-shadow(0 8px 0 rgba(0,0,0,.35));
}
.light-card small { display: block; margin-top: 8px; font-size: 14px; color: #8C7358; }

/* "You Tell It" recorder */
.mic-btn {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 50%;
  background: #F6EDD2; border: 3px solid #C9B478; cursor: pointer;
  font-size: 24px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 3px 0 rgba(90,70,30,.3)); font-family: inherit;
}
.mic-btn:active { transform: translateY(2px); }
.mic-btn.has-clip { border-color: #F2B437; background: #FBE9B4; }
.mic-btn.rec { background: #F0623E; border-color: #B93A1F; }
@media (prefers-reduced-motion: no-preference) {
  .mic-btn.rec { animation: recpulse 1s ease-in-out infinite; }
  @keyframes recpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
}
.mic-hint {
  position: absolute; right: 84px; bottom: 116px; z-index: 9;
  background: #FFF; border-radius: 12px; padding: 7px 14px;
  font-weight: 800; color: #4A3A22; font-size: 14px;
  filter: drop-shadow(0 3px 0 rgba(50,60,80,.25));
}
@media (prefers-reduced-motion: no-preference) {
  .mic-hint { animation: micbob 1.3s ease-in-out infinite; }
  @keyframes micbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
}

/* passport atlas */
.passport-sect {
  margin: 14px auto 2px; width: min(920px, 92vw);
  font-weight: 800; font-size: 17px; color: #26304B;
  background: #F6EDD2; border-radius: 12px; padding: 8px 18px;
  filter: drop-shadow(0 3px 0 rgba(50,60,80,.2));
}
.passport-sect small { color: #B87A0A; font-size: 13px; margin-left: 8px; }
.book-cell { cursor: pointer; }
.book-cell.stamped { background: #FBF3D8; outline: 3px solid #F2B437; }
@media (prefers-reduced-motion: no-preference) {
  .book-cell.stamped .stamp { animation: stamppop .4s ease; }
  @keyframes stamppop { 0% { transform: scale(.6) rotate(-14deg); } 100% { transform: scale(1) rotate(0); } }
}

/* Easter dawn game */
.dawn-wrap { position: relative; width: min(680px, 82vw); height: min(52vh, 420px); align-self: center; }
.dawn-gold { position: absolute; inset: 0; border-radius: 20px; background: linear-gradient(rgba(255,214,112,.0), rgba(255,214,112,.55)); opacity: 0; transition: opacity .5s; pointer-events: none; }
.dawn-sun {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  width: 120px; height: 120px; background: none; border: 0; cursor: pointer; padding: 0;
  transition: bottom .5s cubic-bezier(.3,1.4,.5,1); filter: drop-shadow(0 5px 0 rgba(150,110,20,.35));
}
.dawn-sun svg { width: 100%; height: 100%; }
.dawn-ring { position: absolute; inset: -16px; border: 6px solid #FFE28A; border-radius: 50%; opacity: .9; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .dawn-ring { animation: dawnring var(--cycle, 1400ms) ease-in-out infinite; }
  @keyframes dawnring { 0%,100% { transform: scale(.62); opacity: .35; } 50% { transform: scale(1.15); opacity: 1; } }
}
.dawn-sun.shake, .tell-person.shake, .disc-person.shake { animation: shake .4s; }

/* tell-the-news + pentecost people */
.tell-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.tell-person, .disc-person {
  position: relative; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
  width: clamp(72px, 10vw, 104px);
}
.tell-person svg, .disc-person svg { width: 100%; height: auto; }
.told-badge {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%) scale(0);
  background: #FFE28A; color: #7A4E12; border-radius: 10px; padding: 3px 8px;
  font-size: 11px; font-weight: 800; white-space: nowrap;
  filter: drop-shadow(0 2px 0 rgba(120,80,20,.3)); transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
.tell-person.told .told-badge { transform: translateX(-50%) scale(1); }
.tell-person.told svg, .disc-person.lit svg { filter: drop-shadow(0 0 14px rgba(255,214,112,.9)); }

/* pentecost flames */
.flames-wrap { display: flex; flex-direction: column; justify-content: space-between; width: min(760px, 90vw); height: min(56vh, 440px); align-self: center; }
.flame-sky { position: relative; height: 42%; }
.flame-chip { position: absolute; top: 4%; width: 54px; background: none; border: 0; padding: 0; cursor: pointer; filter: drop-shadow(0 4px 0 rgba(120,80,20,.3)); }
.flame-chip svg { width: 100%; height: auto; }
.flame-chip.picked { transform: scale(1.25); filter: drop-shadow(0 0 12px var(--fc, #F2B437)) drop-shadow(0 4px 0 rgba(120,80,20,.3)); }
@media (prefers-reduced-motion: no-preference) {
  .flame-chip { animation: flameflicker 1.1s ease-in-out infinite; }
  @keyframes flameflicker { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07) rotate(2deg); } }
  .flame-chip.picked { animation: none; }
}
.disc-slot { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 34px; display: block; }
.disc-slot svg { width: 100%; }

/* Beautiful Gate: hold-to-lift */
.gate-wrap { display: flex; align-items: center; justify-content: center; gap: 34px; }
.gate-man { width: 130px; }
.gate-man svg { width: 100%; }
.gate-man.leapable { cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .gate-man.leap { animation: gateleap .6s cubic-bezier(.3,1.5,.5,1); }
  @keyframes gateleap { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-34px); } }
}
.gate-meter { position: relative; width: 42px; height: min(300px, 38vh); background: #F6EDD2; border-radius: 12px; overflow: hidden; filter: drop-shadow(0 4px 0 rgba(50,60,80,.25)); }
.gate-zone { position: absolute; left: 0; right: 0; background: #FFE28A; border-top: 3px solid #C9822A; border-bottom: 3px solid #C9822A; }
.gate-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: #7FB069; opacity: .85; }
.big-btn.shake { animation: shake .4s; }

/* Bright Road: junctions */
.road-wrap { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.road-dots { display: flex; align-items: center; gap: 10px; background: #F6EDD2; border-radius: 12px; padding: 8px 16px; filter: drop-shadow(0 3px 0 rgba(50,60,80,.25)); }
.rdot { width: 13px; height: 13px; border-radius: 50%; background: #E5DCC2; border: 2px solid #C9B478; }
.rdot.past { background: #F2B437; border-color: #C9822A; }
.rhouse { font-size: 20px; }
.road-arrows { display: flex; gap: 20px; }
.road-arrow {
  width: clamp(84px, 12vw, 120px); aspect-ratio: 1; border: 0; border-radius: 18px; cursor: pointer;
  background: #F6EDD2; font-size: 44px; font-family: inherit;
  filter: drop-shadow(0 5px 0 rgba(20,25,45,.4));
}
.road-arrow.glow { outline: 6px solid #F2B437; background: #FBE9B4; }
.road-arrow.shake { animation: shake .4s; }
.road-arrow:disabled { cursor: default; }

/* Songs at Midnight: melody stones */
.song-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.song-stone { width: clamp(84px, 12vw, 120px); background: none; border: 0; padding: 0; cursor: pointer; filter: drop-shadow(0 5px 0 rgba(20,25,45,.45)); }
.song-stone svg { width: 100%; }
.song-stone.lit { transform: scale(1.18); filter: drop-shadow(0 0 18px var(--sc)) drop-shadow(0 5px 0 rgba(20,25,45,.45)); }
.song-stone.hint { outline: 5px dashed #FFE28A; border-radius: 20px; }
.song-stone.shake { animation: shake .4s; }

/* Safe to Shore: waves & rope */
.ropes-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; width: min(720px, 88vw); }
.ropes-sea { position: relative; width: 100%; height: min(200px, 26vh); background: rgba(20,30,60,.25); border-radius: 18px; overflow: hidden; }
.ropes-ship { position: absolute; left: 4%; top: 26%; font-size: 56px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); }
.ropes-wave { position: absolute; top: 30%; left: 100%; width: 92px; }
.ropes-wave svg { width: 100%; }

/* Shepherd's Song: the flock */
.flock-field { position: relative; width: min(760px, 90vw); height: min(380px, 50vh); }
.flock-shepherd { position: absolute; left: 6%; top: 26%; width: 90px; filter: drop-shadow(0 4px 0 rgba(50,60,80,.3)); }
.flock-shepherd svg { width: 100%; }
.flock-sheep { position: absolute; width: 74px; background: none; border: 0; padding: 0; cursor: pointer; transform: translate(-50%,-50%); }
.flock-sheep svg { width: 100%; filter: drop-shadow(0 4px 0 rgba(50,60,80,.3)); }
.flock-sheep.wandering svg { filter: drop-shadow(0 0 12px #FFE28A) drop-shadow(0 4px 0 rgba(50,60,80,.3)); }

/* Ask the Ants */
.ants-wrap { display: flex; align-items: stretch; gap: 12px; width: min(780px, 92vw); height: min(360px, 48vh); }
.ants-ground { position: relative; flex: 1; }
.ant-item { position: absolute; width: 56px; background: #F6EDD2; border: 0; border-radius: 14px; padding: 6px; cursor: pointer; filter: drop-shadow(0 4px 0 rgba(20,25,45,.4)); }
.ant-item svg { width: 100%; }
.ant-item.picked { outline: 5px solid #F2B437; transform: scale(1.12); }
.ant-item.shake { animation: shake .4s; }
.ant-hill { align-self: flex-end; width: 150px; background: none; border: 0; padding: 0; cursor: pointer; position: relative; }
.ant-hill svg { width: 100%; }
.hill-count { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #F6EDD2; border-radius: 10px; padding: 2px 10px; font-size: 13px; font-weight: 800; color: #8C5A2A; filter: drop-shadow(0 2px 0 rgba(90,70,30,.3)); }

/* ---------- The Wonder Quiz (Job) ---------- */
.wonder-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.wonder-tile { width: clamp(150px, 24vw, 240px); aspect-ratio: 8 / 5; padding: 6px; }
.wonder-thumb { display: block; width: 100%; height: 100%; border-radius: 10px; overflow: hidden; pointer-events: none; }
.wonder-thumb svg { width: 100%; height: 100%; display: block; }
.wonder-tile.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }

/* ---------- The Season Wheel (Ecclesiastes) ---------- */
.seasons-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.seasons-svg { height: min(58vh, 480px); width: auto; }
.season-quad { cursor: pointer; }
.season-quad.t-wiggle { transform-box: fill-box; transform-origin: center; }
.wheel-spin { transition: transform .7s cubic-bezier(.34,1.3,.5,1); transform-origin: 0 0; }

/* ---------- Bloom the Garden (Song of Songs) ---------- */
.bloom-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 980px); height: 100%; }
.bloom-ribbon { display: flex; gap: 10px; background: #F6EDD2; border-radius: 14px; padding: 8px 16px; filter: drop-shadow(0 3px 0 rgba(50,60,80,.25)); }
.bloom-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #FFF3D0; }
.bloom-dot.done { opacity: .28; transform: scale(.8); }
.bloom-field { position: relative; flex: 1; width: 100%; min-height: 0; }
.bloom-bud { position: absolute; width: 64px; height: 80px; background: none; border: 0; cursor: pointer; padding: 0; filter: drop-shadow(0 3px 0 rgba(60,80,40,.3)); }
.bloom-bud svg { width: 100%; height: 100%; }
.bloom-bud .flower-head { transition: opacity .25s ease; }
.bloom-bud.bloomed { animation: seek-pop .5s ease; }
.bloom-bud.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- The 300 Torches (Gideon) ---------- */
.torch-wrap { display: flex; align-items: center; justify-content: center; gap: 26px; width: 100%; height: 100%; flex-wrap: wrap; }
.torch-valley { height: min(52vh, 400px); width: auto; }
.torch-gauge-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.torch-gauge {
  position: relative; width: 64px; height: min(40vh, 300px);
  background: #2E3650; border-radius: 16px; overflow: hidden;
  filter: drop-shadow(0 4px 0 rgba(20,25,50,.4));
}
.torch-zone { position: absolute; left: 0; right: 0; background: rgba(242,180,55,.55); border-top: 3px solid #F2B437; border-bottom: 3px solid #F2B437; }
.torch-sprite { position: absolute; left: 50%; transform: translate(-50%, 50%); font-size: 34px; filter: drop-shadow(0 0 8px rgba(255,212,112,.9)); }
.tent-flee { transition: transform 1.2s ease-in; }
.tent-flee.flee-l { transform: translateX(-140px); }
.tent-flee.flee-r { transform: translateX(140px); }

/* ---------- Build the Tent (Leviticus) ---------- */
.tent-wrap { display: flex; align-items: center; justify-content: center; gap: 22px; width: 100%; height: 100%; flex-wrap: wrap; }
.tent-diorama { height: min(50vh, 380px); width: auto; }
.tent-tray { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; flex-wrap: wrap; }
.tent-piece {
  display: flex; align-items: center; gap: 8px; background: #F6EDD2; border: 0;
  border-radius: 12px; padding: 6px 12px; cursor: pointer; font-family: inherit;
  font-weight: 800; color: #4A3A22; font-size: 13px;
  filter: drop-shadow(0 3px 0 rgba(90,70,30,.28));
}
.tent-piece svg { width: 44px; height: 46px; }
.tent-piece.used { opacity: .3; pointer-events: none; }
.tent-piece.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.tent-piece.t-wiggle { animation: t-wiggle .4s ease; }
.slot-next rect { animation: glowpulse 1.4s ease-in-out infinite; }

/* ---------- Two Voices (Numbers) ---------- */
.voices-wrap { display: flex; align-items: center; justify-content: center; gap: 24px; width: 100%; flex-wrap: wrap; }
.voice-bin {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #F6EDD2; border: 0; border-radius: 18px; padding: 14px 18px;
  cursor: pointer; font-family: inherit; font-weight: 800; color: #4A3A22; font-size: 15px;
  filter: drop-shadow(0 5px 0 rgba(90,70,30,.28));
}
.voice-bin svg { width: 90px; height: 92px; }
.voice-bin:active { transform: translateY(3px); }
.voice-bin.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.voice-card {
  max-width: 300px; min-height: 70px; font-size: 17px; text-align: center;
  display: flex; align-items: center; justify-content: center;
  transition: transform .4s ease, opacity .4s ease;
}
.voice-card.fly-l { transform: translateX(-160px) scale(.4); opacity: 0; }
.voice-card.fly-r { transform: translateX(160px) scale(.4); opacity: 0; }
.voice-card.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- Write It on the Door (Deuteronomy) ---------- */
.trace-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.trace-door { height: min(56vh, 440px); width: auto; border-radius: 14px; filter: drop-shadow(0 5px 0 rgba(90,60,20,.35)); touch-action: none; }
.trace-dot { transition: fill .15s ease; }

/* ---------- Shape the Clay (Jeremiah) ---------- */
.clay-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.clay-svg { height: min(56vh, 440px); width: auto; touch-action: none; }
.clay-row { cursor: ew-resize; transition: fill .2s ease; }
.clay-locked { animation: seek-pop .4s ease; transform-box: fill-box; transform-origin: center; }

/* ---------- Bone to Its Bone (Ezekiel) ---------- */
.bones-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.bones-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 760px; }
.bone-tile {
  width: clamp(84px, 12vw, 118px); aspect-ratio: 7 / 5; background: #C9B598;
  border: 0; border-radius: 14px; cursor: pointer; padding: 6px;
  filter: drop-shadow(0 4px 0 rgba(120,100,70,.35));
}
.bone-tile svg { width: 100%; height: 100%; }
.bone-tile.picked { outline: 4px solid #F2B437; }
.bone-tile.joined { opacity: .35; pointer-events: none; }
.bone-tile.glowing { outline: 4px dashed #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.bone-tile.t-wiggle { animation: t-wiggle .4s ease; }
.breathe-btn { font-size: 26px; padding: 18px 44px; }

/* ---------- Count the Mercies (Lamentations) ---------- */
.mercy-sky {
  position: relative; width: min(100%, 980px); height: 100%; max-height: 60vh;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(#3A4460 0 30%, #8A6B8C 55%, #F2C494 100%);
}
.mercy-sun { position: absolute; left: 50%; bottom: -14%; transform: translateX(-50%); font-size: 58px; transition: bottom .6s ease; filter: drop-shadow(0 0 14px rgba(255,220,120,.9)); }
.mercy-item {
  position: absolute; width: 62px; height: 64px; background: rgba(246,237,210,.92);
  border: 0; border-radius: 50%; cursor: pointer; padding: 6px;
  filter: drop-shadow(0 3px 0 rgba(40,50,70,.3));
  animation: mercy-fade linear forwards;
}
.mercy-item svg { width: 100%; height: 100%; }
.mercy-worry { background: rgba(140,150,170,.4); }
@keyframes mercy-fade { 0% { opacity: 0; transform: scale(.5); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .mercy-item { animation: none; } }

/* ---------- The Way Home (Hosea) ---------- */
.home-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 900px); height: 100%; }
.home-svg { width: 100%; max-height: 48vh; }
#home-child { transform-box: view-box; }
.home-forks { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.home-fork { font-size: 16px; }
.home-fork.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.home-fork.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- Stand Tall (Daniel 3) ---------- */
.stand-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(100%, 860px); }
.stand-crowd { width: 100%; max-height: 34vh; }
.crowd-inner { transform-box: fill-box; transform-origin: bottom center; transition: transform .5s ease; }
.crowd-inner.bowing { transform: rotate(78deg) translateY(6px); }
.stand-btns { display: flex; gap: 26px; align-items: center; }
.stand-btns.swapped { flex-direction: row-reverse; }
.stand-bow { transition: transform .4s ease; }
.stand-stand.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.stand-bow.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- Hush the Lions (Daniel 6) ---------- */
.hush-den {
  position: relative; width: min(100%, 960px); height: 100%; max-height: 58vh;
  border-radius: 18px; background: radial-gradient(circle at 50% 30%, #4E4658, #3A3444 70%);
}
.hush-lion { position: absolute; width: 108px; height: 96px; background: none; border: 0; cursor: pointer; padding: 0; filter: drop-shadow(0 4px 0 rgba(10,10,20,.45)); touch-action: none; }
.hush-lion svg { width: 100%; height: 100%; }
.hush-lion .hush-ring {
  position: absolute; inset: 6px; border-radius: 50%; border: 4px solid #F2B437;
  opacity: 0; transform: scale(1.15); pointer-events: none;
}
.hush-lion.holding .hush-ring { opacity: 1; animation: hush-close var(--hold-ms, 1000ms) linear forwards; }
@keyframes hush-close { from { transform: scale(1.2); opacity: .5; } to { transform: scale(.85); opacity: 1; } }
.hush-lion.asleep { filter: drop-shadow(0 4px 0 rgba(10,10,20,.45)) saturate(.7); }
.hush-lion.asleep .hush-head { animation: none; }
.hush-den .glean-basket { position: absolute; top: 10px; right: 12px; }
@media (prefers-reduced-motion: reduce) { .hush-lion.holding .hush-ring { animation: none; opacity: 1; } }

/* ---------- Approach the Throne (Esther) ---------- */
.courage-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 880px); }
.courage-meter {
  position: relative; width: min(70%, 420px); height: 30px; background: #4A3858;
  border-radius: 15px; overflow: hidden; filter: drop-shadow(0 3px 0 rgba(40,30,60,.4));
}
.courage-fill { height: 100%; width: 0; background: linear-gradient(90deg, #F2B437, #FFE28A); transition: width .5s ease; }
.courage-meter span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #FFF3E4; letter-spacing: 2px; }
.courage-hall {
  position: relative; width: 100%; height: 90px; border-radius: 14px;
  background: linear-gradient(90deg, #5E4870, #79608C);
  filter: drop-shadow(0 3px 0 rgba(40,30,60,.35));
}
.courage-esther { position: absolute; left: 4%; top: 50%; transform: translateY(-50%); font-size: 40px; transition: left .7s ease; }
.courage-throne { position: absolute; right: 4%; top: 50%; transform: translateY(-50%) rotate(-35deg); font-size: 44px; transition: transform .35s ease; border: 0; background: none; }
.courage-throne.scepter-live { cursor: pointer; }
.courage-throne.lowered { transform: translateY(-50%) rotate(30deg); filter: drop-shadow(0 0 10px rgba(255,220,120,.95)); }

/* ---------- Rebuild the Wall (Nehemiah) ---------- */
.wall-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 940px); }
.wall-svg { width: 100%; max-height: 34vh; }
.wall-tray { display: flex; gap: 16px; transition: opacity .3s; }
.wall-tray.mocked { opacity: .25; pointer-events: none; }
.wall-stone {
  width: 86px; height: 80px; background: #F6EDD2; border: 0; border-radius: 14px;
  cursor: pointer; padding: 8px; filter: drop-shadow(0 4px 0 rgba(90,70,30,.28));
}
.wall-stone svg { width: 100%; height: 100%; }
.wall-stone.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.wall-stone.t-wiggle { animation: t-wiggle .4s ease; }
.wall-mocker { font-size: 16px; background: #E8D9B5; }

/* ---------- Yet I Will Rejoice (Habakkuk) ---------- */
.yet-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 640px; }
.yet-sad { font-size: 20px; background: #E8E2F0; color: #4A3858; padding: 14px 24px; }
.yet-opts { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.yet-opt { font-size: 17px; max-width: 300px; text-align: center; }
.yet-opt.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.yet-opt.yet-gold { background: #F2C94C; }
.yet-opt.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- Three Good Things (Micah) ---------- */
.req-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
.req-bins { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.req-bin { min-width: 130px; }
.req-icon { font-size: 40px; }

/* ---------- Lay the Foundation (Ezra) ---------- */
.temple-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 760px); }
.temple-svg { width: min(100%, 420px); max-height: 40vh; }
.temple-pile { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.temple-stone {
  height: 40px; background: #C9A85C; border: 0; border-radius: 8px; cursor: pointer;
  filter: drop-shadow(0 4px 0 rgba(120,90,30,.3));
}
.temple-stone.used { opacity: .25; pointer-events: none; }
.temple-stone.t-wiggle { animation: t-wiggle .4s ease; }


/* ---------- diegetic tap response ---------- */
.tap-splash {
  position: absolute; z-index: 20; font-size: 46px; pointer-events: none;
  transform: translate(-50%, -50%);
  animation: tap-splash .9s ease-out forwards;
}
@keyframes tap-splash {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  20% { transform: translate(-50%, -60%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(1); opacity: 0; }
}
.stage.stage-pop > svg { animation: stage-pop .45s ease; }
@keyframes stage-pop { 30% { transform: scale(1.015); } 65% { transform: scale(.996); } 100% { transform: scale(1); } }
.tap-flare {
  animation: tap-flare .7s ease !important;
  transform-box: fill-box; transform-origin: center;
}
@keyframes tap-flare {
  30% { transform: scale(1.45) rotate(7deg); }
  60% { transform: scale(.92) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tap-splash, .stage.stage-pop > svg, .tap-flare { animation: none !important; }
}

/* ============================================================
   Production polish pass: grain, transitions, tactile depth
   ============================================================ */
#grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 200;
  opacity: .045; mix-blend-mode: multiply; background-size: 128px 128px;
}
.ui-ico { width: 21px; height: 21px; display: inline-block; vertical-align: -4px; }

/* screen + element entrances */
@media (prefers-reduced-motion: no-preference) {
  .screen { animation: screen-in .4s cubic-bezier(.22,.9,.35,1); }
  @keyframes screen-in { from { opacity: 0; transform: translateY(12px); } }
  .map-node { animation: node-in .55s cubic-bezier(.34,1.45,.5,1) backwards; transform-box: fill-box; transform-origin: center; }
  @keyframes node-in { from { opacity: 0; transform: scale(.35); } }
  .map-toolbar .paper-chip { animation: chip-in .4s cubic-bezier(.3,1.3,.5,1) backwards; }
  .map-toolbar .paper-chip:nth-child(1) { animation-delay: .10s; }
  .map-toolbar .paper-chip:nth-child(2) { animation-delay: .16s; }
  .map-toolbar .paper-chip:nth-child(3) { animation-delay: .22s; }
  .map-toolbar .paper-chip:nth-child(4) { animation-delay: .28s; }
  .map-toolbar .paper-chip:nth-child(5) { animation-delay: .34s; }
  .map-toolbar .paper-chip:nth-child(6) { animation-delay: .40s; }
  .map-toolbar .paper-chip:nth-child(7) { animation-delay: .46s; }
  .map-toolbar .paper-chip:nth-child(8) { animation-delay: .52s; }
  @keyframes chip-in { from { opacity: 0; transform: translateY(16px); } }
  .region-banner { animation: banner-in .5s cubic-bezier(.3,1.3,.5,1) .05s backwards; }
  @keyframes banner-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
}

/* tactile sticker depth on paper UI */
.paper-chip, .tile, .band-card, .wall-stone, .voice-bin, .bone-tile, .tent-piece, .wonder-tile {
  box-shadow: inset 0 2px 0 rgba(255,255,255,.65), inset 0 -3px 0 rgba(90,70,30,.08);
}
.big-btn, .next-btn, .mic-btn {
  box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -3px 0 rgba(0,0,0,.16);
}
.narration { box-shadow: inset 0 3px 0 rgba(255,255,255,.6); }

/* ---------- Carry the Light (Malachi) ---------- */
.beam-wrap { position: relative; display: flex; align-items: center; justify-content: center; width: min(100%, 940px); }
.beam-svg { width: 100%; max-height: 56vh; }
.cold-item, #beam-sun, .warm-decoy { cursor: pointer; }
.cold-art, .warm-art { transition: opacity .35s ease; transform-box: fill-box; transform-origin: center; }
.sun-charged { filter: drop-shadow(0 0 14px rgba(255,220,120,.95)); }
.cold-item.healed .warm-art { animation: seek-pop .5s ease; }
.glowing-soft { animation: glowpulse 1.4s ease-in-out infinite; }
.beam-wrap .glean-basket { position: absolute; top: 10px; right: 12px; }

/* ---------- First Things First (Haggai) ---------- */
.first-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(100%, 860px); }
.first-sites { display: flex; gap: 22px; }
.first-site { background: #F6EDD2; border-radius: 16px; padding: 12px 26px; text-align: center; filter: drop-shadow(0 4px 0 rgba(90,70,30,.28)); }
.first-label { font-weight: 800; font-size: 17px; color: #4A3A22; }
.first-progress { font-weight: 800; font-size: 22px; color: #B87A0A; }
.first-queue { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.first-piece { width: 84px; height: 70px; border: 0; border-radius: 14px; cursor: pointer; padding: 6px; filter: drop-shadow(0 4px 0 rgba(90,70,30,.28)); }
.piece-temple { background: #F6EDD2; }
.piece-house { background: #EFE0D6; }
.first-piece svg { width: 100%; height: 100%; }
.first-piece.used { opacity: .3; pointer-events: none; }
.first-piece.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.first-piece.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- Nothing Breaks the Cord (Romans) ---------- */
.cord-field {
  position: relative; width: min(100%, 960px); height: 100%; max-height: 58vh;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(#26304B, #3E4A78 60%, #33513E);
}
.cord-line {
  position: absolute; left: 50%; top: 54px; bottom: 54px; width: 8px;
  transform: translateX(-50%); border-radius: 4px;
  background: linear-gradient(#FFF3D0, #F2C94C);
  box-shadow: 0 0 14px rgba(255,220,120,.85);
}
.cord-child { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 40px; }
.cord-light { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); font-size: 42px; filter: drop-shadow(0 0 12px rgba(255,230,150,.95)); }
.cord-nothing {
  position: absolute; width: 74px; height: 62px; background: rgba(246,237,210,.14);
  border: 0; border-radius: 50%; cursor: pointer; padding: 8px; z-index: 3;
  filter: drop-shadow(0 3px 0 rgba(10,15,30,.4));
}
.cord-nothing svg { width: 100%; height: 100%; }
.cord-nothing.glowing { outline: 3px dashed #F2B437; }
.cord-words {
  position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 5px; max-width: 40%;
}
.cord-word {
  background: #F6EDD2; color: #4A3A22; border-radius: 10px; padding: 3px 10px;
  font-weight: 800; font-size: 13px; filter: drop-shadow(0 2px 0 rgba(50,60,80,.3));
  animation: chip-in .35s ease backwards;
}
.cord-word-final { background: #F2C94C; font-size: 16px; }

/* ---------- The Love Antidote (1 Corinthians 13) ---------- */
.love-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; width: min(100%, 900px); }
.love-sours, .love-hand { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.love-sour { background: #E8E2F0; color: #4A3858; font-size: 15px; }
.love-sour.healed { background: #F2C94C; color: #4A3A22; pointer-events: none; }
.love-sour.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.love-sour.t-wiggle { animation: t-wiggle .4s ease; }
.love-card { font-size: 15px; }
.love-card.picked { outline: 4px solid #E0623C; transform: translateY(-4px); }
.love-card.used { opacity: .3; pointer-events: none; }

/* ---------- The Fruit Harvest (Galatians) ---------- */
.fruit-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 900px); }
.fruit-grid { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.fruit-tree {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 96px; background: #F6EDD2; border: 0; border-radius: 14px; padding: 8px 4px;
  cursor: pointer; font-family: inherit;
  filter: drop-shadow(0 4px 0 rgba(90,70,30,.28));
}
.fruit-tree svg { width: 62px; height: 66px; }
.fruit-label { font-weight: 800; font-size: 12px; color: #4A3A22; transition: opacity .4s; }
.fruit-label.label-hidden { opacity: 0; }
.fruit-tree.picked-tree { opacity: .35; pointer-events: none; }
.fruit-tree.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.fruit-tree.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- Put On the Armor (Ephesians) ---------- */
.armor-wrap { display: flex; align-items: center; justify-content: center; gap: 24px; width: 100%; flex-wrap: wrap; position: relative; }
.armor-figure { height: min(54vh, 420px); width: auto; }
.armor-slot { cursor: pointer; }
.armor-slot.slot-glow circle { stroke: #F2B437; stroke-width: 4; animation: glowpulse 1.2s ease-in-out infinite; }
.armor-slot.t-wiggle { animation: t-wiggle .4s ease; transform-box: fill-box; transform-origin: center; }
.armor-tray { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; flex-wrap: wrap; }
.armor-piece {
  display: flex; align-items: center; gap: 8px; background: #F6EDD2; border: 0;
  border-radius: 12px; padding: 6px 12px; cursor: pointer; font-family: inherit;
  font-weight: 800; color: #4A3A22; font-size: 13px;
  filter: drop-shadow(0 3px 0 rgba(90,70,30,.28));
}
.armor-piece svg { width: 38px; height: 38px; }
.armor-piece.picked { outline: 4px solid #E0623C; transform: translateY(-3px); }
.armor-piece.used { opacity: .3; pointer-events: none; }
.shield-btn { font-size: 18px; }
.shield-btn.dart-now { animation: glowpulse .5s ease-in-out infinite; outline: 5px solid #E0623C; }

/* ---------- Keep the Song Going (Philippians) ---------- */
.joy-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; width: min(100%, 720px); }
.joy-rooms { display: flex; gap: 24px; font-size: 52px; }
.joy-room { filter: grayscale(1) opacity(.55); transition: filter .6s ease; }
.joy-room.room-bright { filter: none; animation: seek-pop .5s ease; }
.joy-meter { position: relative; width: min(80%, 440px); height: 32px; background: #3E4A78; border-radius: 16px; overflow: hidden; filter: drop-shadow(0 3px 0 rgba(30,40,70,.4)); }
.joy-fill { height: 100%; background: linear-gradient(90deg, #F2B437, #FFE28A); transition: width .3s ease; }
.joy-meter span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #FFF3E4; letter-spacing: 2px; }
.joy-sing { font-size: 22px; }

/* ---------- Hold It All Together (Colossians) ---------- */
.hold-field { position: relative; width: min(100%, 920px); height: 100%; max-height: 58vh; border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 50%, #3E4A78, #1E2440 75%); }
.hold-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.hold-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 52px; filter: drop-shadow(0 0 16px rgba(255,230,150,.95)); }
.hold-thing { position: absolute; width: 58px; height: 58px; font-size: 34px; background: rgba(246,237,210,.12); border: 0; border-radius: 50%; cursor: pointer; }
.hold-thing.glowing { outline: 3px dashed #F2B437; }
.hold-thing.held { background: rgba(242,201,76,.28); filter: drop-shadow(0 0 8px rgba(255,220,120,.8)); }

/* ---------- The Long Walk Home (Philemon) ---------- */
.welcome-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(100%, 820px); }
.welcome-path { display: flex; align-items: center; gap: 14px; }
.welcome-stone {
  width: 62px; height: 52px; border: 0; border-radius: 50% 50% 46% 46%;
  background: #C9CFDD; cursor: pointer; font-weight: 800; font-size: 18px; color: #4A3858;
  filter: drop-shadow(0 4px 0 rgba(60,60,90,.3)); font-family: inherit;
}
.welcome-stone.stepped { background: #F2C94C; }
.welcome-stone.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.welcome-stone.t-wiggle { animation: t-wiggle .4s ease; }
.welcome-door { font-size: 54px; margin-left: 8px; }
.welcome-worry { font-size: 16px; background: #E8E2F0; color: #4A3858; }
.welcome-choices { display: flex; gap: 18px; }
.welcome-choice { font-size: 17px; }
.welcome-choice.glowing { outline: 4px solid #F2B437; animation: glowpulse 1.4s ease-in-out infinite; }
.welcome-choice.t-wiggle { animation: t-wiggle .4s ease; }

/* ---------- The Tiny Rudder (James) ---------- */
.rudder-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 860px); }
.rudder-sea {
  position: relative; width: 100%; height: min(42vh, 320px); border-radius: 18px; overflow: hidden;
  background: linear-gradient(#BFE0E8, #4E8BAD 60%, #3E7294);
}
.rudder-ship { position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%); font-size: 52px; transition: left .35s ease; filter: drop-shadow(0 4px 4px rgba(20,40,60,.4)); }
.rudder-gate {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 44px; border-left: 8px solid #F2B437; border-right: 8px solid #F2B437;
  display: flex; align-items: center; justify-content: center; color: #FFF3E4; font-weight: 800; font-size: 12px;
}
.rudder-controls { display: flex; gap: 16px; align-items: center; }
.rudder-btn { font-size: 24px; padding: 10px 26px; }

/* ---------- Living Stones (1 Peter) ---------- */
.stones-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.stones-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(64px, 84px)); gap: 6px; }
.stone-cell {
  aspect-ratio: 1.6; border-radius: 12px; border: 2.5px dashed rgba(90,74,50,.3); background: rgba(255,248,232,.35);
  font-size: 26px; cursor: pointer; transition: transform .15s, background .2s, border-color .2s;
}
.stone-cell:active { transform: scale(.94); }
.stone-corner { background: linear-gradient(#FFE9A8, #F2B437); border: 3px solid #C9822A; box-shadow: 0 0 18px rgba(242,180,55,.65); }
.stone-set { background: linear-gradient(#E8E2D2, #C9BBA4); border: 3px solid #8A7B5E; animation: stage-pop .3s ease; }
.stone-ok { border-color: #7FB069; background: rgba(184,212,154,.35); }
.stone-shake { animation: stoneShake .4s ease; }
@keyframes stoneShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Pass the Light (1 John) ---------- */
.pl-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(100%, 880px); }
.pl-meter { width: min(60%, 340px); height: 14px; border-radius: 7px; background: rgba(30,42,82,.25); overflow: hidden; }
.pl-fill { height: 100%; width: 100%; border-radius: 7px; background: linear-gradient(90deg, #F2B437, #FFD470); transition: width .2s linear; }
.pl-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pl-kid {
  width: clamp(58px, 9vw, 84px); aspect-ratio: .8; border-radius: 16px; border: 2.5px solid rgba(90,74,50,.25);
  background: linear-gradient(#3A3E6E, #2E3260); font-size: 30px; cursor: pointer; transition: transform .15s, box-shadow .25s;
}
.pl-kid:active { transform: scale(.93); }
.pl-lit { background: linear-gradient(#FFE9A8, #F2B437); border-color: #C9822A; box-shadow: 0 0 20px rgba(255,212,112,.7); animation: stage-pop .3s ease; }

/* ---------- All Things New (Revelation) ---------- */
.an-grid { display: grid; grid-template-columns: repeat(4, minmax(70px, 108px)); gap: 12px; }
.an-card {
  aspect-ratio: 1; border-radius: 18px; font-size: clamp(34px, 5.5vw, 52px); cursor: pointer;
  border: 3px solid rgba(90,74,50,.25); transition: transform .18s, background .4s, box-shadow .4s;
}
.an-card:active { transform: scale(.93); }
.an-old { background: linear-gradient(#9AA0AE, #7B8090); filter: saturate(.55); }
.an-beam { box-shadow: 0 0 0 4px #FFE9A8, 0 0 26px rgba(255,212,112,.85); animation: glowpulse 1.2s ease infinite; }
.an-new { background: linear-gradient(#FFE9A8, #FFD470); filter: none; border-color: #C9822A; animation: stage-pop .35s ease; }
.an-glory { animation: gloryWash 1.6s ease; }
@keyframes gloryWash { 0% { filter: brightness(1); } 40% { filter: brightness(1.35) saturate(1.3); } 100% { filter: brightness(1); } }
@media (max-width: 620px) { .an-grid { grid-template-columns: repeat(3, minmax(70px, 104px)); } }
