/**
 * Kids World — daylit pastoral shell for /kids/ + story library hero.
 * Calm, KJV. Not neon; not midnight-with-yellow-chip.
 * v: 20260427kidsbest2
 */
body.kids-world-surface.kids-battle-page {
  --kw-sun: #fff4dd;
  --kw-paper: #fffbf3;
  --kw-cream: #f8eeda;
  --kw-sky-top: #a8d4f0;
  --kw-sky-mid: #dbeafe;
  --kw-grass: #bfe9c2;
  --kw-lav: #e9d5ff;
  --kw-gold: #d97706;
  --kw-ink: #1e293b;
  --kw-ink-muted: #475569;
  background:
    var(--kw-paper);
  color: var(--kw-ink);
}
body.kids-world-surface .sky-page-backdrop {
  display: none;
}
body.kids-world-surface::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 130% 70% at 10% 5%, rgba(255, 248, 220, 0.98) 0%, transparent 48%),
    radial-gradient(ellipse 90% 55% at 85% 10%, rgba(255, 235, 200, 0.55) 0%, transparent 40%),
    radial-gradient(ellipse 100% 45% at 50% 0%, rgba(255, 220, 160, 0.35) 0%, transparent 50%),
    linear-gradient(180deg, var(--kw-sky-top) 0%, var(--kw-sky-mid) 32%, #ecfdf5 70%, #e6f4e8 100%),
    radial-gradient(ellipse 80% 45% at 50% 100%, rgba(74, 222, 128, 0.14) 0%, transparent 55%);
  opacity: 0.95;
}
/* Hub arrival: one gentle sun-wash (honors reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  body.kids-hero-first-seconds::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 110% 55% at 50% 0%, rgba(255, 250, 220, 0.72) 0%, rgba(255, 243, 200, 0.28) 45%, transparent 70%);
    animation: kids-first-seconds-sun 5.2s ease-out forwards;
  }
  @keyframes kids-first-seconds-sun {
    from { opacity: 0.9; }
    to { opacity: 0; }
  }
}
body.kids-world-surface .app-shell,
body.kids-world-surface .app-content,
body.kids-world-surface .content-inner {
  position: relative;
  z-index: 1;
}
body.kids-world-surface .top-bar,
body.kids-world-surface .kids-battle-header {
  background: linear-gradient(180deg, rgba(255, 251, 240, 0.96) 0%, rgba(255, 248, 230, 0.92) 100%);
  border-bottom: 3px solid rgba(217, 119, 6, 0.32);
  box-shadow: 0 2px 18px rgba(120, 80, 40, 0.07);
}
body.kids-world-surface .brand-title,
body.kids-world-surface .tdb-header-heartbeat,
body.kids-world-surface .tdb-header-tag-cite {
  color: var(--kw-ink);
}
body.kids-world-surface .tdb-header-heartbeat {
  font-size: 0.7rem;
  opacity: 0.85;
}
body.kids-world-surface .kids-subtitle,
body.kids-world-surface .kids-header-nav a,
body.kids-world-surface .kids-bc-whole-site {
  color: #0e7490;
}
body.kids-world-surface .kids-parent-link-mobile {
  color: #0c4a6e;
  background: rgba(14, 165, 233, 0.12);
  border-color: #38bdf8;
}
body.kids-world-surface .footer-fade-in,
body.kids-world-surface .bottom-nav a {
  color: var(--kw-ink-muted);
}

/* Wonder strip — first screen */
.kids-wonder {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}
.kids-wonder .kids-play-zone-inner {
  max-width: 100%;
}
.kids-buddy-block--top {
  background: linear-gradient(180deg, rgba(255, 250, 235, 0.94) 0%, rgba(255, 245, 225, 0.88) 100%);
  border: 2px solid rgba(217, 119, 6, 0.25);
  box-shadow: 0 8px 28px rgba(90, 60, 30, 0.07);
}
.kids-buddy-bubble--with-mascot,
.kids-buddy-bubble--solo {
  background: linear-gradient(165deg, rgba(255, 252, 245, 0.98) 0%, rgba(255, 237, 213, 0.45) 100%);
  border-color: rgba(14, 116, 144, 0.22);
}
.kids-bubble-hi,
.kids-bubble-voice,
.kids-bubble-name,
.kids-buddy-name,
.kids-buddy-name-strong {
  color: var(--kw-ink);
}
.kids-bubble-voice {
  color: var(--kw-ink-muted);
}
.kids-buddy-title {
  color: #0d9488;
}
.kids-shepherd-hero-wrap {
  display: block;
  line-height: 0;
  border-radius: 20px;
  box-shadow: 0 6px 22px rgba(160, 100, 40, 0.18);
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 60%);
}
.kids-shepherd-hero-img {
  display: block;
  width: min(200px, 70vw);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 251, 240, 0.9) 0%, rgba(255, 245, 220, 0.4) 100%);
}
/* One big story CTA + 3 “sidekick” taps + “More” */
.kids-magic-hero-cta {
  margin: 0.5rem 0 0.25rem;
}
.kids-magic-hero-cta .kids-magic-story {
  width: 100%;
  min-height: 84px;
}
.kids-magic-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin: 0.55rem 0 0.4rem;
}
@media (max-width: 360px) {
  .kids-magic-trio {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}
.kids-magic-trio .kids-magic-btn {
  min-height: 60px;
  font-size: clamp(0.95rem, 3.2vw, 1.1rem);
}
.kids-magic-more {
  margin: 0.35rem 0 0.2rem;
  border-radius: 18px;
  border: 2px dashed rgba(217, 119, 6, 0.32);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.65) 0%, rgba(255, 245, 230, 0.5) 100%);
  padding: 0.2rem 0.45rem 0.5rem;
}
.kids-magic-more-summary,
.kids-magic-more .kids-magic-more-summary {
  list-style: none;
  cursor: pointer;
  font-family: "Bangers", cursive, system-ui, sans-serif;
  font-size: clamp(1.15rem, 4.2vw, 1.45rem);
  letter-spacing: 0.04em;
  text-align: center;
  color: #92400e;
  padding: 0.4rem 0.25rem;
  border-radius: 12px;
}
.kids-magic-more-summary small,
.kids-magic-more .kids-magic-more-summary small {
  display: block;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #78716c;
  font-style: normal;
  margin-top: 0.1rem;
}
.kids-magic-more > summary::-webkit-details-marker {
  display: none;
}
.kids-magic-more[open] {
  border-style: solid;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(255, 252, 245, 0.95);
}
.kids-magic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0.45rem 0 0.15rem;
}
.kids-magic-grid--more {
  margin-top: 0.2rem;
}
@media (min-width: 400px) {
  .kids-magic-grid--more {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.kids-magic-grid .kids-magic-little {
  grid-column: 1 / -1;
  max-width: 18rem;
  margin: 0 auto;
}
.kids-magic-story {
  display: block;
  width: 100%;
  min-height: 84px;
  font-size: clamp(1.35rem, 4.5vw, 1.8rem);
  line-height: 1.12;
  background: linear-gradient(180deg, #fff7c2 0%, #fde68a 44%, #f59e0b 100%);
  border: 4px solid rgba(180, 83, 9, 0.28);
  box-shadow: 0 5px 0 rgba(120, 53, 15, 0.2);
  border-radius: 22px;
}
.kids-magic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 64px;
  padding: 0.65rem 0.5rem;
  border-radius: 20px;
  font-family: "Bangers", cursive, system-ui, sans-serif;
  font-size: clamp(1.05rem, 3.8vw, 1.2rem);
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  color: #0f172a;
  border: 3px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.kids-magic-btn small {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.85;
  font-style: normal;
  display: block;
}
.kids-magic-btn:hover,
.kids-magic-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  outline: none;
}
.kids-magic-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
.kids-magic-surprise,
.kids-magic-random {
  background: linear-gradient(180deg, #fef08a 0%, #facc15 50%, #eab308 100%);
  border-color: rgba(120, 53, 15, 0.2);
  color: #0f172a;
}
button.kids-magic-btn {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  width: 100%;
  font-family: "Bangers", cursive, system-ui, sans-serif;
}
button.kids-magic-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.kids-magic-color {
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 50%, #0ea5e9 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.kids-magic-game {
  background: linear-gradient(180deg, #d8b4fe 0%, #a78bfa 50%, #8b5cf6 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.kids-magic-journey {
  background: linear-gradient(180deg, #86efac 0%, #4ade80 50%, #22c55e 100%);
  color: #0f172a;
}
.kids-magic-loop {
  background: linear-gradient(180deg, #ffedd5 0%, #fdba74 50%, #fb923c 100%);
  color: #0f172a;
}
.kids-magic-shelf {
  background: linear-gradient(180deg, #fce7f3 0%, #f9a8d4 50%, #ec4899 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.kids-magic-little {
  background: linear-gradient(180deg, #fef3c7 0%, #fed7aa 50%, #fdba74 100%);
  color: #451a03;
  border-color: rgba(120, 53, 15, 0.18);
}
.kids-wonder-kidline {
  margin: 0.35rem auto 0.5rem;
  max-width: 24ch;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  color: #0f766e;
  line-height: 1.25;
}
body.kids-world-surface .kids-play-hero-sub {
  color: var(--kw-ink-muted);
  font-size: 0.8rem;
}
body.kids-world-surface .kids-today-adventure {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.92) 0%, rgba(255, 248, 235, 0.85) 100%);
  border: 2px dashed rgba(217, 119, 6, 0.35);
}
body.kids-world-surface .kids-today-adventure-h,
body.kids-world-surface .kids-today-adventure-line,
body.kids-world-surface .kids-today-adventure-go {
  color: var(--kw-ink);
}
body.kids-world-surface .kids-faith-trail-badge {
  background: rgba(255, 250, 240, 0.92);
  color: #0f766e;
  border: 2px solid rgba(217, 119, 6, 0.4);
  box-shadow: 0 2px 0 rgba(217, 119, 6, 0.2);
  font-size: 0.85rem;
}
body.kids-world-surface .kids-share-streak {
  background: linear-gradient(180deg, #e0f7fa, #c8e9ed);
  color: #0e7490;
  border: 2px solid rgba(14, 116, 144, 0.35);
  font-size: 0.85rem;
}
body.kids-world-surface .kids-battle-title,
body.kids-world-surface .kids-battle-tagline {
  color: var(--kw-ink);
  text-shadow: none;
}
body.kids-world-surface .kids-family-kids-crossnav a {
  color: #0d9488;
}

/* Family / grown-up deck: still calm, not the “kid first paint” */
.kids-family-deck {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 3px solid rgba(14, 165, 233, 0.2);
}
body.kids-world-surface .kids-family-deck .glass,
body.kids-world-surface .kids-family-deck [class*="glass"] {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.9) 0%, rgba(255, 248, 235, 0.82) 100%);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--kw-ink);
  box-shadow: 0 4px 20px rgba(80, 50, 20, 0.06);
}
body.kids-world-surface .kids-family-deck .section-note,
body.kids-world-surface .kids-family-deck .kids-section-title {
  color: var(--kw-ink);
}
body.kids-world-surface .kids-family-deck a {
  color: #0d9488;
  font-weight: 700;
}

/* Skip to family tools */
.kids-to-families-cta {
  display: block;
  text-align: center;
  margin: 0.4rem 0 0.15rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0369a1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.kids-to-families-cta:hover,
.kids-to-families-cta:focus-visible {
  color: #0c4a6e;
  outline: none;
}

/* Shepherd’s Pasture (progress) */
.kids-pasture-card {
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem 0.7rem;
  border-radius: 16px;
  border: 2px solid rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
  text-align: center;
}
.kids-pasture-title {
  margin: 0 0 0.35rem;
  font-family: "Bangers", cursive, system-ui, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #14532d;
}
.kids-pasture-illu {
  position: relative;
  height: 72px;
  margin: 0 auto;
  max-width: 12rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #c8e6f4 0%, #a7e3a5 100%);
  overflow: hidden;
}
.kids-pasture-illu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: linear-gradient(180deg, transparent, #4ade80);
  border-radius: 0 0 10px 10px;
}
.kids-pasture-bloom {
  position: absolute;
  bottom: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.45);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  z-index: 1;
}
.kids-pasture-bloom.pt-a {
  left: 20%;
  background: linear-gradient(180deg, #fbcfe8, #f472b6);
  box-shadow: 0 0 0 1px rgba(190, 24, 93, 0.35);
}
.kids-pasture-bloom.pt-b {
  left: 42%;
  bottom: 14px;
  background: linear-gradient(180deg, #ddd6fe, #8b5cf6);
  box-shadow: 0 0 0 1px rgba(91, 33, 182, 0.25);
}
.kids-pasture-bloom.pt-c {
  left: 55%;
  bottom: 9px;
  width: 8px;
  height: 8px;
  background: linear-gradient(180deg, #fef08a, #eab308);
  box-shadow: 0 0 0 1px rgba(161, 98, 7, 0.35);
}
.kids-pasture-bloom.pt-d {
  left: 72%;
  bottom: 11px;
  width: 9px;
  height: 9px;
  background: linear-gradient(180deg, #ddd6fe, #7c3aed);
  box-shadow: 0 0 0 1px rgba(91, 33, 182, 0.35);
}
.kids-pasture-sheep,
.kids-pasture-sheep2,
.kids-pasture-sheep3,
.kids-pasture-flower1,
.kids-pasture-flower2,
.kids-pasture-tree {
  position: absolute;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #94a3b8;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.kids-pasture-sheep {
  left: 12%;
  width: 22px;
  height: 16px;
  border-radius: 40% 40% 45% 45%;
}
.kids-pasture-sheep2 {
  left: auto;
  right: 32%;
  width: 16px;
  height: 12px;
  border-radius: 40% 40% 45% 45%;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  z-index: 1;
}
.kids-pasture-sheep3 {
  left: 6%;
  bottom: 6px;
  width: 14px;
  height: 11px;
  border-radius: 42% 42% 48% 48%;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.12);
}
@media (prefers-reduced-motion: no-preference) {
  .kids-pasture-card[data-token-bloom="3"] .kids-pasture-sheep2,
  .kids-pasture-card[data-token-bloom="4"] .kids-pasture-sheep2,
  .kids-pasture-card[data-token-bloom="5"] .kids-pasture-sheep2 {
    animation: kids-pasture-sheep2-nod 3.2s ease-in-out infinite;
  }
}
@keyframes kids-pasture-sheep2-nod {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1px) rotate(-2deg); }
}
.kids-pasture-flower1 {
  left: 38%;
  width: 10px;
  height: 10px;
  background: #f9a8d4;
  border-color: #db2777;
}
.kids-pasture-flower2 {
  left: 52%;
  width: 10px;
  height: 10px;
  background: #fde68a;
  border-color: #b45309;
}
.kids-pasture-tree {
  right: 10%;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 24px solid #15803d;
  background: none;
  border-radius: 0;
  bottom: 8px;
  z-index: 1;
}
/* Fruit cluster beside the tree — only at fullest token bloom */
.kids-pasture-fruit {
  position: absolute;
  right: 9.5%;
  bottom: 30px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 4px 4px 0 #b91c1c, -3px 6px 0 #ea580c, 0 -3px 0 #f59e0b;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  z-index: 2;
}
.kids-pasture-card[data-token-bloom="5"] .kids-pasture-fruit {
  opacity: 1;
  transform: scale(1);
}
/* Gentle brook at max bloom — “living water” stillness, not a toy splash */
.kids-pasture-brook {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 9px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0) 0%,
    rgba(56, 189, 248, 0.32) 18%,
    rgba(14, 165, 233, 0.38) 50%,
    rgba(56, 189, 248, 0.32) 82%,
    rgba(56, 189, 248, 0) 100%
  );
  opacity: 0;
  transform: scaleY(0.3);
  transform-origin: bottom center;
  transition: opacity 0.55s ease, transform 0.55s ease;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.kids-pasture-card[data-token-bloom="5"] .kids-pasture-brook {
  opacity: 0.95;
  transform: scaleY(1);
}
@media (prefers-reduced-motion: no-preference) {
  .kids-pasture-card[data-token-bloom="5"] .kids-pasture-brook {
    animation: kids-pasture-brook-shimmer 5s ease-in-out infinite;
  }
}
@keyframes kids-pasture-brook-shimmer {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}
/* Wooden fence when pasture deepens (see kids-play-zone data-pasture-fence) */
.kids-pasture-fence {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 7px;
  background: repeating-linear-gradient(
    90deg,
    #a16207 0,
    #a16207 3px,
    #fde68a 3px,
    #fde68a 5px
  );
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 -1px 0 rgba(120, 53, 15, 0.35);
  opacity: 0;
  transform: scaleY(0.35);
  transform-origin: bottom center;
  transition: opacity 0.55s ease, transform 0.55s ease;
  z-index: 2;
  pointer-events: none;
}
.kids-pasture-card[data-pasture-fence="1"] .kids-pasture-fence {
  opacity: 0.95;
  transform: scaleY(1);
}
.kids-pasture-card[data-stage="1"] .kids-pasture-flower1,
.kids-pasture-card[data-stage="2"] .kids-pasture-flower1,
.kids-pasture-card[data-stage="2"] .kids-pasture-flower2,
.kids-pasture-card[data-stage="3"] .kids-pasture-flower1,
.kids-pasture-card[data-stage="3"] .kids-pasture-flower2,
.kids-pasture-card[data-stage="3"] .kids-pasture-sheep,
.kids-pasture-card[data-stage="4"] .kids-pasture-flower1,
.kids-pasture-card[data-stage="4"] .kids-pasture-flower2,
.kids-pasture-card[data-stage="4"] .kids-pasture-sheep,
.kids-pasture-card[data-stage="4"] .kids-pasture-tree,
.kids-pasture-card[data-stage="5"] .kids-pasture-flower1,
.kids-pasture-card[data-stage="5"] .kids-pasture-flower2,
.kids-pasture-card[data-stage="5"] .kids-pasture-sheep,
.kids-pasture-card[data-stage="5"] .kids-pasture-tree {
  opacity: 1;
}
/* Sheep tokens: extra wildflowers + friend sheep appear as tokens grow (device-local). */
.kids-pasture-card[data-token-bloom="1"] .pt-a,
.kids-pasture-card[data-token-bloom="2"] .pt-a,
.kids-pasture-card[data-token-bloom="3"] .pt-a,
.kids-pasture-card[data-token-bloom="4"] .pt-a,
.kids-pasture-card[data-token-bloom="5"] .pt-a {
  opacity: 1;
  transform: scale(1);
}
.kids-pasture-card[data-token-bloom="2"] .pt-b,
.kids-pasture-card[data-token-bloom="3"] .pt-b,
.kids-pasture-card[data-token-bloom="4"] .pt-b,
.kids-pasture-card[data-token-bloom="5"] .pt-b {
  opacity: 1;
  transform: scale(1);
}
.kids-pasture-card[data-token-bloom="3"] .kids-pasture-sheep2,
.kids-pasture-card[data-token-bloom="4"] .kids-pasture-sheep2,
.kids-pasture-card[data-token-bloom="5"] .kids-pasture-sheep2 {
  opacity: 1;
}
.kids-pasture-card[data-token-bloom="4"] .pt-c,
.kids-pasture-card[data-token-bloom="5"] .pt-c {
  opacity: 1;
  transform: scale(1);
}
.kids-pasture-card[data-token-bloom="2"] .pt-d,
.kids-pasture-card[data-token-bloom="3"] .pt-d,
.kids-pasture-card[data-token-bloom="4"] .pt-d,
.kids-pasture-card[data-token-bloom="5"] .pt-d {
  opacity: 1;
  transform: scale(1);
}
.kids-pasture-card[data-token-bloom="3"] .kids-pasture-sheep3,
.kids-pasture-card[data-token-bloom="4"] .kids-pasture-sheep3,
.kids-pasture-card[data-token-bloom="5"] .kids-pasture-sheep3,
.kids-pasture-card[data-stage="3"] .kids-pasture-sheep3,
.kids-pasture-card[data-stage="4"] .kids-pasture-sheep3,
.kids-pasture-card[data-stage="5"] .kids-pasture-sheep3 {
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .kids-pasture-card[data-token-bloom="4"] .kids-pasture-sheep3,
  .kids-pasture-card[data-token-bloom="5"] .kids-pasture-sheep3 {
    animation: kids-pasture-sheep3-hop 2.8s ease-in-out infinite;
  }
}
@keyframes kids-pasture-sheep3-hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.kids-pasture-card[data-token-bloom="5"] .kids-pasture-illu::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 10%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(254, 243, 199, 0.55) 42%, transparent 72%);
  opacity: 0.88;
  pointer-events: none;
  z-index: 0;
}
.kids-sheep-tokens {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  line-height: 1.35;
}
.kids-pasture-note {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #166534;
}
.kids-pasture-pct-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Corner: play zone in world mode */
body.kids-world-surface .kids-play-zone--shepherdfield {
  background: linear-gradient(145deg, rgba(255, 250, 240, 0.96) 0%, rgba(255, 243, 224, 0.78) 100%);
  border-color: rgba(217, 119, 6, 0.3);
  box-shadow: 0 8px 32px rgba(70, 45, 20, 0.07);
}
body.kids-world-surface .kids-play-zone--shepherdfield::before,
body.kids-world-surface .kids-play-zone--shepherdfield::after {
  opacity: 0.35;
}
body.kids-world-surface .kids-weekly-verse-reveal[open] .kids-weekly-verse-card,
body.kids-world-surface .kids-weekly-verse-reveal .kids-weekly-verse-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(14, 165, 233, 0.3);
}
body.kids-world-surface .kids-corner-breadcrumb,
body.kids-world-surface .kids-corner-page-nav--compact,
body.kids-world-surface .kids-corner-explorer-badge {
  font-size: 0.72rem;
  opacity: 0.8;
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-corner-breadcrumb a {
  color: #0369a1;
}
body.kids-world-surface .kids-corner-page-nav a {
  padding: 0.28rem 0.45rem;
  font-size: 0.7rem;
}

/* Story library secondary hero tames instructional tone */
body.kids-world-surface .kids-battle-hero .kids-battle-tagline {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--kw-ink-muted);
}
@media (prefers-reduced-motion: reduce) {
  .kids-magic-btn,
  .kids-buddy-block--top .kids-play-zone-mascot,
  .kids-buddy-block--top .kids-shepherd-hero-img {
    transition: none;
    animation: none;
  }
}

body.kids-world-surface .kids-footer {
  color: var(--kw-ink-muted);
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid rgba(14, 165, 233, 0.2);
}
body.kids-world-surface .kids-footer a {
  color: #0369a1;
}
body.kids-world-surface .kids-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 3px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 -2px 16px rgba(15, 23, 42, 0.08);
}
body.kids-world-surface .kids-bottom-nav a {
  color: #0c4a6e;
}
body.kids-world-surface .kids-bottom-nav a:hover,
body.kids-world-surface .kids-bottom-nav a.active,
body.kids-world-surface .kids-bottom-nav a[aria-current="page"] {
  color: #0f172a;
  background: rgba(14, 165, 233, 0.12);
}

body.kids-world-surface .kids-weekly-verse-reveal {
  margin-top: 0.75rem;
  border-radius: 14px;
  border: 2px solid rgba(14, 165, 233, 0.25);
  background: rgba(255, 255, 255, 0.65);
  padding: 0.15rem 0.5rem 0.65rem;
}
body.kids-world-surface .kids-weekly-verse-reveal > summary {
  cursor: pointer;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  color: #0c4a6e;
  padding: 0.5rem 0.25rem;
  list-style: none;
}
body.kids-world-surface .kids-weekly-verse-reveal > summary::-webkit-details-marker {
  display: none;
}

/* ── Pass: storybook shell + duo CTA + Shepherd motion + story modal helpers ── */
body.kids-world-surface .kids-battle-inner,
body.kids-world-surface .content-inner.kids-battle-inner {
  position: relative;
  border-radius: 22px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 12px 40px rgba(60, 40, 15, 0.08);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
body.kids-world-surface .kids-battle-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(255, 220, 150, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 100%, rgba(180, 220, 180, 0.2) 0%, transparent 50%);
  z-index: 0;
}
body.kids-world-surface .kids-hub-play,
body.kids-world-surface .kids-play-zone {
  position: relative;
  z-index: 1;
}
body.kids-world-surface .kids-wonder::after,
body.kids-world-surface .kids-play-zone--shepherdfield::after {
  content: "";
  position: absolute;
  width: 52px;
  height: 52px;
  top: 6px;
  right: 4px;
  pointer-events: none;
  opacity: 0.45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='none' stroke='%2322774d' stroke-width='2' d='M8 48c8-20 20-8 24-20 4 12 20 0 24 16'/%3E%3C/svg%3E") center/contain no-repeat;
  z-index: 2;
}
body.kids-world-surface .kids-wonder::before,
body.kids-world-surface .kids-play-zone--shepherdfield::before {
  content: "";
  position: absolute;
  width: 40px;
  height: 28px;
  bottom: 8px;
  left: 6px;
  pointer-events: none;
  opacity: 0.35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'%3E%3Cellipse cx='20' cy='24' rx='18' ry='8' fill='%23fff' fill-opacity='0.5'/%3E%3Cellipse cx='44' cy='18' rx='16' ry='7' fill='%23fff' fill-opacity='0.4'/%3E%3C/svg%3E") center/contain no-repeat;
  z-index: 0;
}
.kids-magic-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0.5rem 0 0.25rem;
}
.kids-sound-fx-row {
  margin: 0.35rem 0 0.15rem;
  text-align: center;
}
.kids-sound-fx-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #57534e;
  cursor: pointer;
  display: inline-block;
  max-width: 22rem;
  line-height: 1.35;
}
.kids-sound-fx-label input {
  margin-right: 0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: middle;
}
.kids-sheep-run {
  height: 28px;
  margin: 0.15rem 0 0.2rem;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 251, 235, 0) 0%, rgba(255, 245, 220, 0.7) 50%, rgba(255, 251, 235, 0) 100%);
}
.kids-sheep-run-emoji {
  position: absolute;
  left: -10%;
  font-size: 1.15rem;
  line-height: 1;
  animation: kids-sheep-scoot 2.4s ease-in-out 0.4s 1 both;
}
.kids-sheep-run-emoji--late {
  font-size: 1.05rem;
  opacity: 0.88;
  animation: kids-sheep-scoot 2.6s ease-in-out 1.15s 1 both;
}
@keyframes kids-sheep-scoot {
  0% { left: -10%; }
  100% { left: 110%; }
}
.kids-companion-sheep-shout {
  margin: 0.2rem 0 0.15rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  min-height: 0;
}
.kids-sheep-name-row {
  margin: 0.1rem 0 0.35rem;
  text-align: center;
}
.kids-sheep-name-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #57534e;
  margin: 0 0 0.2rem;
  line-height: 1.35;
}
.kids-companion-sheep-input {
  max-width: 16rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 12px;
  border: 2px solid rgba(245, 158, 11, 0.35);
  background: rgba(255, 251, 235, 0.92);
  color: #0f172a;
  font-size: 0.95rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 700;
  min-height: 44px;
}
.kids-ambient-fx-row {
  margin: 0.1rem 0 0.25rem;
  text-align: center;
}
.kids-ambient-fx-cb {
  margin-right: 0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: middle;
}
.kids-shepherd-idle {
  animation: kids-shepherd-breathe 3.2s ease-in-out infinite;
}
@keyframes kids-shepherd-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.kids-shepherd-welcome {
  animation: kids-shepherd-wavein 0.7s ease-out 1 both;
}
@keyframes kids-shepherd-wavein {
  0% { transform: translateY(8px) scale(0.96); opacity: 0.85; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
/* First hub visit this load: a touch more “arrival” without loud motion */
@media (prefers-reduced-motion: no-preference) {
  .kids-shepherd-hero-wrap.kids-shepherd-welcome.kids-shepherd-arrival {
    animation: kids-shepherd-wavein 0.7s ease-out 1 both, kids-shepherd-arrival 2.2s ease-out 1 both;
  }
  @keyframes kids-shepherd-arrival {
    0% { filter: drop-shadow(0 0 0 rgba(251, 191, 36, 0)); }
    35% { filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.45)); }
    100% { filter: drop-shadow(0 0 0 rgba(251, 191, 36, 0)); }
  }
  .kids-pasture-just-bloomed .kids-pasture-illu {
    animation: kids-pasture-bloom-pulse 0.6s ease-out 1 both;
  }
  .kids-pasture-just-bloomed {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
    animation: kids-pasture-card-bloom 1.1s ease-out 1 both;
  }
  @keyframes kids-pasture-bloom-pulse {
    0% { box-shadow: inset 0 0 0 0 rgba(250, 204, 21, 0); }
    50% { box-shadow: inset 0 0 0 3px rgba(250, 204, 21, 0.35); }
    100% { box-shadow: inset 0 0 0 0 rgba(250, 204, 21, 0); }
  }
  @keyframes kids-pasture-card-bloom {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.25); }
    100% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  }
  /* First time hitting max token-bloom: brook + fruit fully alive — celebratory, still calm */
  .kids-pasture-peak-celebrate {
    position: relative;
    overflow: visible;
    border-color: color-mix(in srgb, #22c55e 35%, #0ea5e9 20%, transparent) !important;
  }
  .kids-pasture-peak-celebrate .kids-pasture-illu {
    animation: kids-pasture-peak-illu 2.2s ease-out 1 both;
  }
  @keyframes kids-pasture-peak-illu {
    0% { transform: translateY(0) scale(1); }
    45% { transform: translateY(-3px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
  }
  .kids-pasture-peak-celebrate {
    animation: kids-pasture-peak-aura 3.1s ease-out 1 both;
  }
  @keyframes kids-pasture-peak-aura {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.22); }
    35% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.14), 0 10px 30px rgba(34, 197, 94, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
  }
  /* Soft sparkles over the illu (card ::before — illu ::after is the grass line) */
  .kids-pasture-peak-celebrate::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 2.5rem;
    width: 11.5rem;
    height: 70px;
    margin-left: -5.75rem;
    pointer-events: none;
    z-index: 4;
    background-image:
      radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.95) 0%, transparent 38%),
      radial-gradient(circle at 78% 22%, rgba(255, 253, 232, 0.92) 0%, transparent 40%),
      radial-gradient(circle at 52% 58%, rgba(255, 255, 255, 0.8) 0%, transparent 35%),
      radial-gradient(circle at 88% 48%, rgba(254, 240, 199, 0.85) 0%, transparent 32%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    animation: kids-pasture-peak-sparkle 2.1s ease-out 1 both;
  }
  @keyframes kids-pasture-peak-sparkle {
    0% {
      opacity: 0;
      transform: scale(0.86);
    }
    18% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: scale(1.06);
    }
  }
  .kids-pasture-peak-celebrate .kids-pasture-sheep {
    animation: kids-pasture-peak-sheep-hop 0.78s ease-out 1 both !important;
  }
  @keyframes kids-pasture-peak-sheep-hop {
    0%,
    100% {
      transform: translateY(0);
    }
    35% {
      transform: translateY(-6px);
    }
    60% {
      transform: translateY(-2px);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .kids-pasture-peak-celebrate,
  .kids-pasture-peak-celebrate::before,
  .kids-pasture-peak-celebrate .kids-pasture-illu,
  .kids-pasture-peak-celebrate .kids-pasture-sheep {
    animation: none !important;
  }
  .kids-pasture-peak-celebrate {
    outline: 2px solid color-mix(in srgb, #22c55e 50%, #0ea5e9 35%);
    outline-offset: 2px;
  }
}
.kids-pasture-shell--compact {
  margin: 0 auto 1rem;
  max-width: 26rem;
  width: 100%;
}
.kids-pasture-card--straggler {
  max-width: 100%;
}
.kids-shepherd-dance {
  animation: kids-shepherd-dancek 0.5s ease-in-out 4 alternate;
}
@keyframes kids-shepherd-dancek {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-4px) rotate(-3deg); }
}
.kids-magic-btn.kids-magic-mini {
  background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #1e1b4b;
  border-color: rgba(67, 56, 202, 0.25);
}
.kids-magic-btn.kids-magic-night {
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 100%);
  color: #fef9c3;
  border-color: rgba(99, 102, 241, 0.5);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
body.kids-world-surface[data-kids-season="easter"] {
  --kw-sun: #fff8f0;
}
body.kids-world-surface[data-kids-season="winter"]::before {
  filter: saturate(0.95);
}
body.kids-world-surface[data-kids-season="summer"]::before {
  --kw-sky-top: #93c5fd;
  --kw-sky-mid: #e0f2fe;
}
body.kids-world-surface[data-kids-season="autumn"]::before {
  --kw-sun: #fff1e0;
  filter: saturate(1.02);
}
body.kids-world-surface[data-kids-season="lent"]::before {
  --kw-sky-mid: #e2e8f0;
}
body.kids-world-surface[data-kids-season="harvest"] .kids-pasture-illu {
  filter: sepia(0.08);
}
/* Parent dashboard: same sunlit paper when world surface is on */
body.kids-world-surface.kids-parent-dashboard {
  min-height: 100vh;
}
body.kids-world-surface.kids-parent-dashboard .app-shell,
body.kids-world-surface.kids-parent-dashboard .content-inner {
  color: var(--kw-ink);
}
/* Root coloring page: soft pasture paper behind existing layout */
body.tdb-kids-coloring-page.kids-world-surface {
  --kw-ink: #0f172a;
}
body.tdb-kids-coloring-page.kids-world-surface::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #e0f2fe 0%, #fef9c3 40%, #fefce8 100%);
  opacity: 0.5;
}
body.tdb-kids-coloring-page.kids-world-surface .app-shell,
body.tdb-kids-coloring-page.kids-world-surface .app-content,
body.tdb-kids-coloring-page.kids-world-surface .content-inner {
  position: relative;
  z-index: 1;
}
/* Magic button rows: small warm “bloom” dot per kind (hub + library grids) */
.kids-wonder .kids-magic-btn,
.kids-magic-grid .kids-magic-btn,
.kids-magic-hero-cta .kids-magic-btn,
.kids-magic-duo .kids-magic-btn {
  position: relative;
  padding-left: 2.05rem;
}
.kids-wonder .kids-magic-btn::before,
.kids-magic-grid .kids-magic-btn::before,
.kids-magic-hero-cta .kids-magic-btn::before,
.kids-magic-duo .kids-magic-btn::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  margin-top: -0.4rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef9c3, #d97706);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
  opacity: 0.9;
  pointer-events: none;
}
.kids-wonder .kids-magic-btn.kids-magic-story::before,
.kids-magic-grid .kids-magic-btn.kids-magic-story::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-story::before,
.kids-magic-duo .kids-magic-btn.kids-magic-story::before {
  background: radial-gradient(circle at 30% 30%, #bae6fd, #0369a1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.kids-wonder .kids-magic-btn.kids-magic-color::before,
.kids-magic-grid .kids-magic-btn.kids-magic-color::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-color::before,
.kids-magic-duo .kids-magic-btn.kids-magic-color::before {
  background: radial-gradient(circle at 30% 30%, #fbcfe8, #be185d);
}
.kids-wonder .kids-magic-btn.kids-magic-game::before,
.kids-magic-grid .kids-magic-btn.kids-magic-game::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-game::before,
.kids-magic-duo .kids-magic-btn.kids-magic-game::before {
  background: radial-gradient(circle at 30% 30%, #fde68a, #b45309);
}
.kids-wonder .kids-magic-btn.kids-magic-shelf::before,
.kids-wonder .kids-magic-btn.kids-magic-shelf-ink::before,
.kids-magic-grid .kids-magic-btn.kids-magic-shelf::before,
.kids-magic-grid .kids-magic-btn.kids-magic-shelf-ink::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-shelf::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-shelf-ink::before,
.kids-magic-duo .kids-magic-btn.kids-magic-shelf::before,
.kids-magic-duo .kids-magic-btn.kids-magic-shelf-ink::before {
  background: radial-gradient(circle at 30% 30%, #dcfce7, #16a34a);
}
.kids-wonder .kids-magic-btn.kids-magic-journey::before,
.kids-magic-grid .kids-magic-btn.kids-magic-journey::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-journey::before,
.kids-magic-duo .kids-magic-btn.kids-magic-journey::before {
  background: radial-gradient(circle at 30% 30%, #e9d5ff, #7c3aed);
}
.kids-wonder .kids-magic-btn.kids-magic-loop::before,
.kids-magic-grid .kids-magic-btn.kids-magic-loop::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-loop::before,
.kids-magic-duo .kids-magic-btn.kids-magic-loop::before {
  background: radial-gradient(circle at 30% 30%, #a5f3fc, #0e7490);
}
.kids-wonder .kids-magic-btn.kids-magic-little::before,
.kids-magic-grid .kids-magic-btn.kids-magic-little::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-little::before,
.kids-magic-duo .kids-magic-btn.kids-magic-little::before {
  background: radial-gradient(circle at 30% 30%, #fef3c7, #ea580c);
}
.kids-wonder .kids-magic-btn.kids-magic-night::before,
.kids-magic-grid .kids-magic-btn.kids-magic-night::before,
.kids-magic-hero-cta .kids-magic-btn.kids-magic-night::before,
.kids-magic-duo .kids-magic-btn.kids-magic-night::before {
  background: radial-gradient(circle at 30% 30%, #a5b4fc, #312e81);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}
.kids-story-ls-intro {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 250, 235, 0.98) 0%, rgba(224, 242, 254, 0.45) 100%);
  border: 2px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 4px 14px rgba(90, 60, 30, 0.06);
}
.kids-story-ls-intro-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}
.kids-story-ls-intro-fig {
  flex: 0 0 auto;
}
.kids-story-ls-intro-mascot {
  display: block;
  width: 72px;
  height: auto;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 251, 240, 0.95) 0%, rgba(255, 245, 220, 0.5) 100%);
  box-shadow: 0 4px 14px rgba(120, 80, 40, 0.12);
}
.kids-story-ls-intro-text {
  flex: 1 1 12rem;
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.4;
  color: #0f172a;
}
@media (prefers-reduced-motion: no-preference) {
  .kids-story-modal--tada .kids-story-ls-intro {
    animation: kids-story-ls-pop 0.75s ease-out 1 both;
  }
  .kids-story-modal-content--tada {
    animation: kids-modal-sheet-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) 1 both;
  }
}
@keyframes kids-story-ls-pop {
  0% { transform: translateY(8px) scale(0.97); opacity: 0.72; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes kids-modal-sheet-in {
  0% { transform: translateY(12px) scale(0.982); opacity: 0.86; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.kids-story-kjv-plain {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(14, 116, 144, 0.35);
}
.kids-story-kjv-plain-label {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f766e;
}
.kids-kjv-plain-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}
.kids-kjv-plain-btn {
  flex: 1 1 8rem;
  min-height: 44px;
  border-radius: 12px;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  border: 2px solid rgba(15, 118, 110, 0.3);
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
  cursor: pointer;
}
.kids-kjv-plain-btn.is-on,
.kids-kjv-plain-btn:focus-visible {
  background: rgba(15, 118, 110, 0.15);
  outline: none;
}
.kids-kjv-plain-body {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #1e293b;
}
.kids-kjv-plain-body[hidden] {
  display: none;
}
.kids-story-wonder-q {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
  border-left: 4px solid rgba(217, 119, 6, 0.45);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #422006;
}
/* All stories A–Z: table ink on daylit world shell */
body.kids-world-surface .kids-all-stories-table,
body.kids-world-surface .kids-all-stories-table td {
  color: var(--kw-ink);
  border-bottom-color: rgba(30, 41, 59, 0.12);
}
body.kids-world-surface .kids-all-stories-table th {
  color: #b45309;
  border-bottom-color: rgba(180, 83, 9, 0.28);
}
body.kids-world-surface .kids-all-stories-table a {
  color: #0369a1;
}
body.kids-world-surface .kids-all-stories-teaser {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-all-stories-badge {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 251, 235, 0.95);
  color: #92400e;
}
/* Match & mini-game pages: shared pasture skin */
body.kids-world-surface.kids-mini-game .match-hero,
body.kids-world-surface.kids-mini-game .mini-game-hero {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.95) 0%, rgba(255, 245, 230, 0.85) 100%) !important;
  border: 1px solid rgba(217, 119, 6, 0.22) !important;
  color: #1e293b !important;
}
@media (prefers-reduced-motion: reduce) {
  .kids-sheep-run-emoji,
  .kids-shepherd-idle,
  .kids-shepherd-welcome,
  .kids-shepherd-dance,
  .kids-shepherd-hero-wrap.kids-shepherd-arrival,
  .kids-pasture-just-bloomed,
  .kids-pasture-just-bloomed .kids-pasture-illu,
  .kids-pasture-card[data-token-bloom="3"] .kids-pasture-sheep2,
  .kids-pasture-card[data-token-bloom="4"] .kids-pasture-sheep2,
  .kids-pasture-card[data-token-bloom="5"] .kids-pasture-sheep2,
  .kids-pasture-card[data-token-bloom="4"] .kids-pasture-sheep3,
  .kids-pasture-card[data-token-bloom="5"] .kids-pasture-sheep3,
  .kids-pasture-card[data-token-bloom="5"] .kids-pasture-brook {
    animation: none !important;
  }
  .kids-story-modal--tada .kids-story-ls-intro,
  .kids-story-modal-content--tada {
    animation: none !important;
  }
}

/* Optional recorded “Little Shepherd” read-aloud (m4a), distinct from device TTS */
body.kids-world-surface .kids-story-shepherd-audio-btn.kids-speak-btn {
  display: block;
  width: 100%;
  max-width: 18rem;
  margin: 0.4rem 0 0.15rem;
  border-color: rgba(21, 128, 61, 0.45);
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.95) 0%, rgba(187, 247, 208, 0.55) 100%);
  color: #14532d;
  font-weight: 600;
  letter-spacing: 0.01em;
}
body.kids-world-surface .kids-story-shepherd-audio-btn.kids-speak-btn[aria-pressed="true"] {
  border-color: rgba(4, 120, 87, 0.55);
  background: linear-gradient(180deg, rgba(187, 247, 208, 0.98) 0%, rgba(134, 239, 172, 0.55) 100%);
}
body.kids-world-surface .kids-story-shepherd-audio-btn.kids-speak-btn:hover {
  border-color: rgba(21, 128, 61, 0.55);
}

/* Sub-pages: same voice, less vertical space */
body.kids-world-surface .kids-shepherd-compact {
  border: 1px solid rgba(217, 119, 6, 0.22);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.98) 0%, rgba(255, 245, 230, 0.9) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
body.kids-world-surface .kids-shepherd-compact .kids-buddy-mascot-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
}
body.kids-world-surface .kids-shepherd-compact .kids-shepherd-hero-img {
  width: 112px;
  max-width: 100%;
  height: auto;
  display: block;
}
body.kids-world-surface .kids-shepherd-compact .kids-buddy-bubble--with-mascot {
  flex: 1 1 12rem;
  max-width: 22rem;
  margin: 0;
}
body.kids-world-surface .kids-shepherd-compact .kids-bubble-hi {
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
}
body.kids-world-surface .kids-shepherd-compact .kids-bubble-voice {
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0;
}
body.kids-coloring-shepherd .kids-shepherd-compact {
  margin: 0 0 1rem;
}

/* ---- Mascot image: always warm cream bg regardless of theme ---- */
.kids-shepherd-hero-img,
.dark-mode .kids-shepherd-hero-img,
html[data-theme="dark"] .kids-shepherd-hero-img {
  background: linear-gradient(180deg, #fffbf0 0%, #fef3c7 100%) !important;
  border-radius: 18px !important;
}
.kids-shepherd-hero-wrap,
.dark-mode .kids-shepherd-hero-wrap,
html[data-theme="dark"] .kids-shepherd-hero-wrap {
  background: radial-gradient(ellipse 80% 60% at 50% 28%, rgba(255,255,255,0.65) 0%, transparent 65%) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Kids World Surface — comprehensive text legibility overrides
   All kids pages use kids-world-surface (cream/paper bg).
   These rules correct every element that was styled for the dark
   sky background and would otherwise be invisible on light paper.
   ═══════════════════════════════════════════════════════════════ */

/* Header subtitle: override kids-battle.css !important yellow */
body.kids-world-surface .kids-subtitle {
  color: #92400e !important;
}

/* Footer nav links (separate from .kids-footer a) */
body.kids-world-surface .kids-footer-nav a {
  color: #0369a1;
}

/* Section titles: yellow → warm amber */
body.kids-world-surface .kids-section-title {
  color: #92400e;
}

/* Buddy tagline (light slate → readable ink) */
body.kids-world-surface .kids-buddy-tagline {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-buddy-tagline strong {
  color: var(--kw-ink);
}

/* Kicker labels: yellow → dark amber */
body.kids-world-surface .kids-age-lane-kicker,
body.kids-world-surface .kids-weekly-card-kicker,
body.kids-world-surface .kids-offline-kit-title,
body.kids-world-surface .kids-verse-action-kicker {
  color: #b45309;
}

/* Age-lane / weekly cards: dark navy → warm paper */
body.kids-world-surface .kids-age-lane,
body.kids-world-surface .kids-weekly-card {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(255, 245, 230, 0.9));
  border-color: rgba(217, 119, 6, 0.22);
}
body.kids-world-surface .kids-age-lane h3 {
  color: #92400e;
}
body.kids-world-surface .kids-age-lane p,
body.kids-world-surface .kids-weekly-card span:last-child,
body.kids-world-surface .kids-first-steps-lead,
body.kids-world-surface .kids-weekly-paths-lead {
  color: var(--kw-ink-muted);
}

/* Preview cards: dark → light */
body.kids-world-surface .kids-preview-card {
  background: rgba(255, 252, 245, 0.95);
  border-color: rgba(217, 119, 6, 0.18);
}

/* Story-of-day elements */
body.kids-world-surface .kids-story-of-day-title {
  color: #92400e;
}
body.kids-world-surface .kids-story-of-day-caption {
  color: #475569;
}
body.kids-world-surface .kids-story-of-day-cta {
  color: #0e7490;
}

/* Play zone text inside the shepherdfield cream zone */
body.kids-world-surface .kids-play-zone--shepherdfield .kids-play-zone-kicker {
  color: #b45309;
}
body.kids-world-surface .kids-play-zone--shepherdfield .kids-play-zone-title {
  color: var(--kw-ink);
  text-shadow: none;
}
body.kids-world-surface .kids-play-zone--shepherdfield .kids-play-zone-lead {
  color: var(--kw-ink-muted);
}

/* Disclosure/details summaries: yellow or light slate → readable */
body.kids-world-surface .kids-play-more > summary {
  color: #92400e;
}
body.kids-world-surface .kids-play-more {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(255, 250, 235, 0.6);
}
body.kids-world-surface .kids-play-extra-lanes > summary,
body.kids-world-surface .kids-kjv-extra > summary,
body.kids-world-surface .kids-tech-hint > summary,
body.kids-world-surface .kids-lanes-details > summary {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-play-extra-lanes,
body.kids-world-surface .kids-tech-hint,
body.kids-world-surface .kids-lanes-details,
body.kids-world-surface .kids-kjv-extra {
  background: rgba(255, 252, 245, 0.55);
  border-color: rgba(30, 41, 59, 0.12);
}
body.kids-world-surface .kids-grownup-long > summary {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-grownup-long {
  background: rgba(255, 252, 245, 0.45);
  border-color: rgba(30, 41, 59, 0.1);
}
body.kids-world-surface .kids-quick-themes > summary,
body.kids-world-surface .kids-gj-details > summary {
  color: #92400e;
}
body.kids-world-surface .kids-quick-themes,
body.kids-world-surface .kids-gj-details {
  background: rgba(255, 250, 235, 0.5);
  border-color: rgba(217, 119, 6, 0.15);
}
body.kids-world-surface .kids-classroom-details > summary {
  color: #92400e;
}
body.kids-world-surface .kids-classroom-details {
  background: rgba(255, 250, 240, 0.7);
  border-color: rgba(217, 119, 6, 0.28);
}

/* Weekly verse card on world surface */
body.kids-world-surface .kids-weekly-verse-card h3 {
  color: #b45309;
}
body.kids-world-surface .kids-weekly-verse-line {
  color: var(--kw-ink);
}
body.kids-world-surface .kids-weekly-verse-ref {
  color: #b45309;
}
body.kids-world-surface .kids-chant-hint {
  color: var(--kw-ink-muted);
}

/* Weekly verse easy / KJV strip */
body.kids-world-surface .kids-weekly-verse-easy {
  background: rgba(14, 116, 144, 0.07);
  border-color: rgba(14, 116, 144, 0.2);
  color: #0c4a6e;
}
body.kids-world-surface .kids-verse-easy-k {
  color: #0e7490;
}

/* Progress labels */
body.kids-world-surface .kids-progress-eyebrow {
  color: #64748b;
}
body.kids-world-surface .kids-progress-pct-line {
  color: #475569;
}
body.kids-world-surface .kids-play-progress label {
  color: var(--kw-ink);
}

/* Pills and tags on light backgrounds */
body.kids-world-surface .kids-play-tier-pill {
  background: rgba(180, 83, 9, 0.1);
  color: #92400e;
  border-color: rgba(180, 83, 9, 0.3);
}
body.kids-world-surface .kids-kjv-pill {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
  border-color: rgba(14, 116, 144, 0.3);
}
body.kids-world-surface .kids-faith-trail-badge,
body.kids-world-surface .kids-corner-explorer-badge {
  color: #92400e;
  background: rgba(255, 250, 235, 0.92);
  border-color: rgba(217, 119, 6, 0.45);
}

/* Search input on world surface */
body.kids-world-surface .kids-search-input {
  background: rgba(255, 255, 255, 0.9);
  color: var(--kw-ink);
  border-color: rgba(217, 119, 6, 0.45);
}

/* Match-buddies page: inline styles need specific overrides */
body.kids-world-surface.kids-mini-game .match-hero h1 {
  color: #92400e;
}
body.kids-world-surface.kids-mini-game .match-hero p {
  color: var(--kw-ink-muted);
}
body.kids-world-surface.kids-mini-game .match-col h2 {
  color: #64748b;
}

/* Corner Explorer badge on corner page */
body.kids-world-surface .kids-corner-explorer-badge {
  color: #92400e;
  background: rgba(255, 250, 235, 0.92);
  border-color: rgba(217, 119, 6, 0.4);
}

/* Breadcrumb / page nav (light opacity → clearer) */
body.kids-world-surface .kids-corner-breadcrumb,
body.kids-world-surface .kids-corner-page-nav--compact {
  opacity: 1;
}

/* kids-corner.css elements that lose contrast on world surface */
body.kids-world-surface .kids-corner-armor-hint {
  color: #b45309;
}
body.kids-world-surface .kids-activity-text {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .loop-quick-start-kicker {
  color: #b45309;
}
body.kids-world-surface .loop-quick-start-card {
  background: rgba(255, 252, 245, 0.92);
  border-color: rgba(217, 119, 6, 0.22);
}
body.kids-world-surface .loop-quick-start-card h3 {
  color: var(--kw-ink);
}
body.kids-world-surface .loop-quick-start-card p:last-of-type {
  color: var(--kw-ink-muted);
}
/* Filter chips on world surface */
body.kids-world-surface .loop-filter-chip {
  color: var(--kw-ink);
}
body.kids-world-surface .loop-filter-chip.is-active {
  color: #92400e;
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.5);
}
/* Loop status notes */
body.kids-world-surface .loop-filter-status,
body.kids-world-surface .loop-progress-gentle-note {
  color: var(--kw-ink-muted);
}

/* kids-hub-play.css: lib-cache-hint */
body.kids-world-surface .kids-lib-cache-hint {
  color: #64748b;
}

/* Parent dashboard text (kids-hub-play.css parent deck) */
body.kids-world-surface .kids-parent-today h2,
body.kids-world-surface .kids-parent-devotion h2 {
  color: var(--kw-ink);
}
body.kids-world-surface .kids-parent-today-summary {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-parent-streak-line {
  color: #b45309;
}
body.kids-world-surface .kids-devotion-ol {
  color: var(--kw-ink-muted);
}
body.kids-world-surface .kids-devotion-verse {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
  color: var(--kw-ink);
}
body.kids-world-surface .kids-devotion-verse cite {
  color: #b45309;
}
body.kids-world-surface .kids-parent-badge-row .kids-badge,
body.kids-world-surface .kids-parent-badge-row .kids-library-badge {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.32);
  color: #92400e;
}

/* Porch polish — welcome band reads on busy sky (May 2026) */
body.kids-world-surface .kids-site-porch {
  display: block;
  max-width: 38rem;
  margin: 0.65rem auto 0.85rem;
  padding: 0.65rem 0.85rem 0.7rem;
  border-radius: 14px;
  border: 1px solid rgba(14, 116, 144, 0.22);
  background: color-mix(in srgb, rgba(255, 251, 243, 0.94) 88%, rgba(255, 255, 255, 0.72));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 6px 22px rgba(30, 64, 80, 0.06);
  line-height: 1.55;
  font-size: clamp(0.9rem, 2.1vw, 1rem);
  color: var(--kw-ink-muted);
  text-align: center;
}
