@font-face {
  font-family: "ZCOOL KuaiLe";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/zcool-kuaile-cn.woff") format("woff");
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}
@font-face {
  font-family: "ZCOOL KuaiLe";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/zcool-kuaile-latin.woff") format("woff");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/fredoka-400.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/fredoka-600.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/fredoka-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/nunito-400.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../vendor/fonts/nunito-800.woff2") format("woff2");
}

:root {
  --sky-top: #9ad8ff;
  --sky-mid: #d8f0ff;
  --cream: #fff8ee;
  --paper: #fffdf8;
  --paper-2: #fff3e0;
  --ink: #3a2e24;
  --ink-soft: #5a4a3c;
  --mist: #7a6a5c;
  --gold: #e8a83a;
  --gold-deep: #d4891c;
  --gold-soft: #ffe7a8;
  --mint: #3ec8b0;
  --mint-soft: #c8f5ea;
  --coral: #ff7a6e;
  --coral-soft: #ffd4cc;
  --lavender: #b79be8;
  --ok: #2fb87a;
  --bad: #e25b5b;
  --line: rgba(58, 46, 36, 0.12);
  --shadow: 0 12px 28px rgba(212, 137, 28, 0.12), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  --shadow-soft: 0 8px 20px rgba(58, 46, 36, 0.08);
  --font-display: "ZCOOL KuaiLe", "ZCOOL XiaoWei", "Fredoka", "Nunito", "Noto Sans TC", sans-serif;
  --font-ui: "ZCOOL KuaiLe", "Fredoka", "Nunito", "Noto Sans TC", sans-serif;
  --font-latin: "Fredoka", "Nunito", "ZCOOL KuaiLe", "Noto Sans TC", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-note: "ZCOOL KuaiLe", "Fredoka", "Nunito", "Noto Sans TC", cursive;
  --ease-bounce: cubic-bezier(0.34, 1.45, 0.64, 1);
  font-size: 18px;
}

html.large-type { font-size: 21px; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-synthesis: none;
  letter-spacing: .01em;
}

button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
textarea { resize: vertical; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
}

.nav button, .ghost, .run, .tab, .pad button,
.mission-lamp, .toast, .node, .phase-card, .drawer,
.speech, .luna-say blockquote, .win-card, .tile, .cards li,
.door, .check-box, .hint, .extend, .dad-whisper, .goal,
.pill, .timer, .progress, .music-ctrl, .music-hint, .music-credit,
.show-beats, .p-tab, .tick, .danger, .cta-row label, .scrap,
#journalList, .mission-check-title, .tab, .node b, .node small,
.radio label, .show-card, .kind, .kinds label {
  font-family: var(--font-ui);
}
.kicker, .phase-card .en, .engine, #musicTrack {
  font-family: var(--font-latin);
}

/* ---------- Daylight HQ sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(520px 320px at 86% 8%, rgba(255, 231, 140, 0.7), transparent 58%),
    radial-gradient(640px 380px at 12% 100%, rgba(255, 176, 160, 0.28), transparent 55%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, var(--cream) 78%);
}
.sky .sun {
  position: absolute;
  top: 36px;
  right: 8%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff7c8 0 28%, #ffd76a 46%, #f0b429 100%);
  box-shadow: 0 0 0 14px rgba(255, 215, 106, 0.28), 0 0 60px 12px rgba(255, 196, 80, 0.45);
  animation: sunPulse 6s ease-in-out infinite;
  pointer-events: none;
}
.sky .sun::after {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(255, 215, 106, .35) 10%, transparent 14% 33%, rgba(255, 231, 140, .3) 36%, transparent 40% 58%, rgba(255, 215, 106, .28) 62%, transparent 66% 100%);
  animation: sunSpin 18s linear infinite;
  pointer-events: none;
}
.sky .cloud {
  position: absolute;
  background: #fff;
  border-radius: 40px;
  opacity: 0.82;
  filter: drop-shadow(0 8px 10px rgba(80, 140, 180, 0.12));
  animation: cloudDrift 28s linear infinite;
}
.sky .cloud::before,
.sky .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.sky .c1 { width: 140px; height: 42px; top: 70px; left: -160px; animation-duration: 36s; }
.sky .c1::before { width: 54px; height: 54px; top: -28px; left: 22px; }
.sky .c1::after { width: 70px; height: 70px; top: -36px; left: 58px; }
.sky .c2 { width: 110px; height: 34px; top: 150px; left: -200px; animation-duration: 44s; animation-delay: -12s; opacity: .7; }
.sky .c2::before { width: 42px; height: 42px; top: -22px; left: 16px; }
.sky .c2::after { width: 56px; height: 56px; top: -28px; left: 44px; }
.sky .c3 { width: 160px; height: 46px; top: 28px; left: -220px; animation-duration: 52s; animation-delay: -22s; opacity: .55; }
.sky .c3::before { width: 60px; height: 60px; top: -30px; left: 28px; }
.sky .c3::after { width: 76px; height: 76px; top: -40px; left: 70px; }
.sky .c4 { width: 90px; height: 28px; top: 210px; left: -180px; animation-duration: 40s; animation-delay: -18s; opacity: .48; }
.sky .c4::before { width: 36px; height: 36px; top: -18px; left: 12px; }
.sky .c4::after { width: 48px; height: 48px; top: -24px; left: 36px; }
.sky-para { position: absolute; inset: 0; will-change: transform; }
.sky .sparkle {
  position: absolute;
  width: 8px; height: 8px;
  background: #fff6b0;
  border-radius: 50%;
  box-shadow: 0 0 10px #ffe27a;
  animation: twinkle 3.2s ease-in-out infinite;
}
.sky .sparkle.s1 { top: 18%; left: 22%; animation-delay: 0s; }
.sky .sparkle.s2 { top: 28%; left: 68%; animation-delay: .8s; }
.sky .sparkle.s3 { top: 12%; left: 48%; animation-delay: 1.4s; }
.sky .sparkle.s4 { top: 8%; left: 78%; width: 6px; height: 6px; animation-delay: 2s; }
.sky .sparkle.s5 { top: 34%; left: 12%; width: 5px; height: 5px; animation-delay: .4s; background: #ffd4cc; }
.sky .sparkle.s6 { top: 22%; left: 88%; width: 7px; height: 7px; animation-delay: 1.1s; background: #c8f5ea; }
.bits { position: absolute; inset: 0; pointer-events: none; }
.bits i {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 215, 106, .8);
  animation: bitFloat 9s linear infinite;
  opacity: .0;
}
.bits i.star {
  width: 0; height: 0; background: none; border-radius: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 8px solid #ffd76a;
  box-shadow: none;
}
.bits i.heart {
  width: 8px; height: 8px; background: #ff7a6e; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: none;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes sunSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 280px)); }
}
@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.7); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes bitFloat {
  0% { opacity: 0; transform: translate3d(0, 18px, 0) scale(.6); }
  12% { opacity: .85; }
  80% { opacity: .55; }
  100% { opacity: 0; transform: translate3d(18px, -110px, 0) scale(1.1); }
}
@keyframes titleShine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes btnShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes barSpark {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

.wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Chrome ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.1rem;
  background: rgba(255, 253, 248, 0.78);
  border-bottom: 2px solid rgba(232, 168, 58, 0.18);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  transition: transform .2s var(--ease-bounce);
}
.brand:hover { transform: scale(1.04); }
.brand:active { transform: scale(.97); }
.brand .mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 32%, #fff7c8 0 38%, transparent 40%),
    linear-gradient(160deg, #ffd76a, #e8a83a);
  box-shadow: 0 0 0 4px rgba(232, 168, 58, .22);
  animation: sunPulse 5s ease-in-out infinite;
}
.brand b {
  font-family: var(--font-display);
  font-size: 1.22rem;
  letter-spacing: .02em;
  display: block;
  white-space: nowrap;
  background: linear-gradient(90deg, #9a5a10, #e8a83a, #2aa38c, #e86b62, #9a5a10);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: titleShine 8s linear infinite;
}
.brand small { color: var(--mist); font-size: .72rem; }

.nav { display: flex; gap: .35rem; margin-left: .4rem; flex-wrap: wrap; }
.nav button, .ghost, .run, .tab, .pad button {
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--paper);
  padding: .4rem .9rem;
  color: var(--ink);
  transition: transform .16s var(--ease-bounce), box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.nav button:hover, .ghost:hover, .tab:hover, .pad button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-soft);
  border-color: var(--gold);
}
.nav button:active, .ghost:active, .run:active, .tab:active, .pad button:active {
  transform: translateY(1px) scale(.96);
}
.nav button.on {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(212, 137, 28, 0.2);
}

.music-ctrl {
  display: flex;
  align-items: center;
  gap: .35rem;
  position: relative;
  flex-shrink: 0;
}
.music-ctrl.is-off #musicVol,
.music-ctrl.is-off #musicTrack { opacity: .42; }
.music-ctrl #musicVol {
  width: 72px;
  height: 22px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
  vertical-align: middle;
}
.music-ctrl #musicTrack {
  max-width: 6.8rem;
  height: 30px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
  padding: 0 .4rem;
  cursor: pointer;
}
.music-credit {
  font-size: .62rem;
  font-weight: 700;
  color: var(--mist);
  white-space: nowrap;
  letter-spacing: .02em;
}
.music-hint {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  font-size: .68rem;
  font-weight: 700;
  color: #5a3d18;
  background: #fff1c4;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  padding: .18rem .65rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-soft);
  animation: chipPop .4s var(--ease-bounce);
}
@media (max-width: 900px) {
  .music-credit { display: none; }
}
@media (max-width: 720px) {
  .music-ctrl #musicVol { width: 56px; }
  .music-ctrl #musicTrack { max-width: 5.6rem; font-size: .66rem; }
  .music-hint { white-space: normal; max-width: 10.5rem; line-height: 1.25; }
}

.spacer { flex: 1; }
.engine {
  font-size: .75rem;
  color: var(--mint);
  letter-spacing: .06em;
  font-weight: 700;
}
.engine.ready { animation: chipPop .45s var(--ease-bounce); }
@keyframes chipPop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

.progress { width: min(180px, 26vw); }
.progress span { display: block; font-size: .7rem; color: var(--mist); margin-bottom: .15rem; }
.bar {
  height: 8px;
  background: #ffe9c4;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(232, 168, 58, .2);
}
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), #fff1a8, var(--mint));
  background-size: 200% 100%;
  animation: btnShine 2.8s ease-in-out infinite;
  transition: width .6s var(--ease-bounce);
  position: relative;
}
.bar i::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
  animation: barSpark 2.4s ease-in-out infinite;
}

main { flex: 1; padding: 1.15rem 1.2rem 3rem; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Views ---------- */
main > section { animation: viewIn .45s var(--ease-bounce); }
main > section.view-enter { animation: viewIn .45s var(--ease-bounce); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ---------- Hero / Luna ---------- */
.hero {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: 1.4rem;
}
.luna-mascot {
  position: relative;
  width: 168px;
  animation: lunaIdle 3.4s ease-in-out infinite;
  filter: drop-shadow(0 14px 16px rgba(232, 168, 58, 0.22));
}
.luna-mascot img,
.luna-mascot .luna-svg { width: 168px; display: block; }
.luna-mascot.talking { animation: lunaTalk .55s var(--ease-bounce) 3; }
.luna-mascot.celebrate { animation: lunaWin .85s var(--ease-bounce) 2; }
.luna-mascot.wink .luna-eye.right { animation: lunaWink .55s ease; }
.luna-mascot .antenna {
  position: absolute; left: 50%; top: 2px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: antennaBlink 2.4s ease-in-out infinite;
}
.luna-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: lunaBlink 4.4s ease-in-out infinite;
}
.luna-eye.right { animation-delay: .12s; }
.luna-spark { animation: twinkle 2.6s ease-in-out infinite; }
.luna-antenna-ball { transform-origin: center; transform-box: fill-box; animation: antennaBlink 2.4s ease-in-out infinite; }
.luna-arm.left { transform-origin: 26px 94px; animation: armWave 2.8s ease-in-out infinite; }
.luna-arm.right { transform-origin: 134px 94px; animation: armWave 2.8s ease-in-out infinite reverse; }
.luna-smile-big { display: none; }
.luna-mascot.celebrate .luna-smile { display: none; }
.luna-mascot.celebrate .luna-smile-big { display: block; }
.luna-mascot.celebrate .luna-blush { opacity: .7; }
.luna-hearts {
  position: absolute; inset: 0; pointer-events: none;
}
.luna-hearts i {
  position: absolute; left: 50%; top: 28%;
  width: 10px; height: 10px;
  background: #ff7a6e;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg) scale(0);
  opacity: 0;
}
.luna-mascot.celebrate .luna-hearts i {
  animation: heartPop .9s var(--ease-bounce) forwards;
}
.luna-mascot.celebrate .luna-hearts i:nth-child(1) { margin-left: -28px; animation-delay: 0s; }
.luna-mascot.celebrate .luna-hearts i:nth-child(2) { margin-left: 8px; animation-delay: .12s; background: #e8a83a; }
.luna-mascot.celebrate .luna-hearts i:nth-child(3) { margin-left: -8px; top: 12%; animation-delay: .22s; background: #3ec8b0; }
@keyframes lunaIdle {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1.4deg); }
}
@keyframes lunaTalk {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-10px) rotate(-6deg); }
  60% { transform: translateY(-4px) rotate(5deg); }
}
@keyframes lunaWin {
  0% { transform: translateY(0) rotate(0) scale(1); }
  28% { transform: translateY(-22px) rotate(-10deg) scale(1.1); }
  55% { transform: translateY(-4px) rotate(8deg) scale(1.04); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
@keyframes lunaBlink {
  0%, 38%, 44%, 100% { transform: scaleY(1); }
  41% { transform: scaleY(0.08); }
}
@keyframes lunaWink {
  0%, 100% { transform: scaleY(1); }
  40%, 70% { transform: scaleY(0.08); }
}
@keyframes armWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes heartPop {
  0% { opacity: 0; transform: rotate(-45deg) translateY(8px) scale(.2); }
  40% { opacity: 1; transform: rotate(-45deg) translateY(-10px) scale(1.15); }
  100% { opacity: 0; transform: rotate(-45deg) translateY(-28px) scale(.6); }
}
@keyframes antennaBlink {
  0%, 70%, 100% { opacity: 1; transform: scale(1); }
  80% { opacity: .35; transform: scale(.7); }
}

.speech {
  background: var(--paper);
  border: 3px solid #ffe0a3;
  border-radius: 10px 28px 28px 28px;
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow);
  position: relative;
}
.speech::after {
  content: "";
  position: absolute;
  left: -14px; top: 28px;
  border: 10px solid transparent;
  border-right-color: #ffe0a3;
}
.speech h1, .shine-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin: 0 0 .3rem;
  background: linear-gradient(90deg, #9a5a10 0%, #e8a83a 25%, #1f9d88 50%, #e86b62 75%, #9a5a10 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: titleShine 7s linear infinite;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.7));
}
.lesson-head h2.shine-title { font-size: 2.05rem; margin: .15rem 0; }
.shine-kicker {
  background: linear-gradient(90deg, #c97812, #e8a83a, #2aa38c, #c97812);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: titleShine 9s linear infinite;
}
.speech p { margin: 0; color: var(--ink-soft); }

.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: end; margin: 1rem 0 1.6rem; }
.cta-row label { display: grid; gap: .25rem; font-size: .8rem; color: var(--mist); }
.cta-row input {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: .6rem .75rem;
  min-width: 12rem;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.cta-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232, 168, 58, .18); }

.run {
  background-image: linear-gradient(110deg, #ffe27a 0%, #ffd76a 28%, #fff3c0 46%, #e8a83a 72%, #ffb347 100%);
  background-size: 220% 100%;
  animation: btnShine 2.6s ease-in-out infinite;
  color: #3a2e24;
  border: 0;
  font-weight: 800;
  padding: .65rem 1.35rem;
  box-shadow: 0 6px 0 #d4891c, 0 10px 18px rgba(212, 137, 28, .25);
}
.run:hover { transform: translateY(-3px) scale(1.03); }
.run:active { transform: translateY(3px) scale(.97); box-shadow: 0 2px 0 #d4891c; animation: none; }
.run:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.phase-rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; }
.phase-card {
  text-align: left;
  padding: 1rem;
  border-radius: 22px;
  border: 3px solid var(--line);
  background: var(--paper);
  min-height: 10.4rem;
  box-shadow: var(--shadow-soft);
  animation: cardPop .5s var(--ease-bounce) both;
}
.phase-card:nth-child(1) { animation-delay: .02s; }
.phase-card:nth-child(2) { animation-delay: .08s; }
.phase-card:nth-child(3) { animation-delay: .14s; }
.phase-card:nth-child(4) { animation-delay: .2s; }
.phase-card:nth-child(5) { animation-delay: .26s; }
.phase-card:hover { transform: translateY(-4px) rotate(-.4deg); }
.phase-card .roman { font-family: var(--font-display); color: var(--gold-deep); font-size: 1.25rem; }
.phase-card strong { display: block; font-size: 1.15rem; margin-top: .2rem; }
.phase-card .en { color: var(--mist); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.phase-card p { color: var(--ink-soft); font-size: .85rem; }
.mood-gold { background: linear-gradient(180deg, #fff, #fff6dc); border-color: #ffd76a; }
.mood-teal { background: linear-gradient(180deg, #fff, var(--mint-soft)); border-color: #7ee0c8; }
.mood-rose { background: linear-gradient(180deg, #fff, var(--coral-soft)); border-color: #ffb3aa; }
.mood-violet { background: linear-gradient(180deg, #fff, #eee4ff); border-color: #c8b0f0; }
.mood-silver { background: linear-gradient(180deg, #fff, #eef4f8); border-color: #c8d4dc; }
@keyframes cardPop {
  from { opacity: 0; transform: translateY(12px) scale(.94); }
  to { opacity: 1; transform: none; }
}

.scrap {
  margin-top: 1.4rem;
  padding: 1rem 1.15rem;
  background: #fff1c8;
  color: var(--ink);
  border-radius: 6px 18px 10px 18px;
  font-family: var(--font-note);
  font-size: 1.3rem;
  transform: rotate(-.5deg);
  box-shadow: 4px 6px 0 rgba(232, 168, 58, .18);
}

/* ---------- Map ---------- */
.map-phase { margin-bottom: 1.6rem; }
.map-phase header { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; }
.map-phase header span { font-family: var(--font-display); color: var(--gold-deep); font-size: 1.45rem; }
.map-phase h2 { margin: 0; font-size: 1.2rem; }
.map-phase header p { margin: 0; color: var(--mist); }
.nodes { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .7rem; }
.node {
  width: 7.6rem;
  min-height: 6.4rem;
  padding: .55rem;
  border-radius: 18px;
  background: var(--paper);
  border: 2px solid var(--line);
  text-align: left;
  box-shadow: var(--shadow-soft);
  animation: nodePop .45s var(--ease-bounce) both;
}
.node:nth-child(4n) { animation-delay: .04s; }
.node:nth-child(4n+1) { animation-delay: .08s; }
.node:nth-child(4n+2) { animation-delay: .12s; }
.node:nth-child(4n+3) { animation-delay: .16s; }
.node .dot {
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--paper-2); font-size: .7rem; margin-bottom: .25rem;
  font-weight: 800;
}
.node b { display: block; font-size: .82rem; }
.node small { color: var(--mist); font-size: .7rem; }
.node .live { display: inline-block; margin-top: .25rem; font-size: .65rem; color: #1a8f7a; font-style: normal; font-weight: 800; }
.node.open { border-color: var(--mint); background: #f3fffb; }
.node.open:hover { transform: translateY(-4px) scale(1.04); }
.node.open .dot {
  background: #c8f5ea;
  color: #146857;
  box-shadow: 0 0 0 4px rgba(62, 200, 176, .22);
  animation: unlockPulse 1.8s ease-in-out infinite;
}
.node.done { border-color: var(--gold); background: #fff8dc; box-shadow: 0 0 16px rgba(232, 168, 58, .28); }
.node.done .dot { background: var(--gold); color: #3a2e24; animation: doneTwinkle 2.2s ease-in-out infinite; }
.node.just-unlocked { animation: unlockPop .7s var(--ease-bounce); }
.node.locked {
  opacity: .5;
  cursor: not-allowed;
  filter: grayscale(.35);
  background: repeating-linear-gradient(-45deg, #f6efe4, #f6efe4 8px, #efe4d4 8px, #efe4d4 16px);
  border-style: dashed;
}
.node.locked .dot { background: #ddd2c4; color: #8a7a6c; }
.path { width: 18px; height: 4px; background: linear-gradient(90deg, #ffd76a, #7ee0c8); border-radius: 99px; }
@keyframes nodePop {
  from { opacity: 0; transform: scale(.7) translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes unlockPop {
  0% { transform: scale(.8) rotate(-6deg); }
  45% { transform: scale(1.12) rotate(4deg); }
  100% { transform: none; }
}
@keyframes unlockPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(62, 200, 176, .18); transform: scale(1); }
  50% { box-shadow: 0 0 0 7px rgba(62, 200, 176, .08); transform: scale(1.08); }
}
@keyframes doneTwinkle {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.lesson-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; flex-wrap: wrap; }
.kicker { color: var(--gold-deep); letter-spacing: .14em; font-size: .72rem; text-transform: uppercase; font-weight: 800; }
.lesson-head h2 { font-family: var(--font-display); font-size: 2.05rem; margin: .15rem 0; }
.lesson-head .sub { color: var(--mist); margin: 0; }
.pill {
  display: inline-block;
  background: var(--mint-soft);
  color: #146857;
  border-radius: 99px;
  padding: .15rem .65rem;
  font-size: .72rem;
  font-weight: 800;
}

.timer {
  display: flex; align-items: center; gap: .7rem;
  background: var(--paper);
  border: 2px solid #ffe0a3;
  padding: .5rem .8rem; border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.timer.phase-tick { animation: phaseGlow .7s ease; }
.timer strong { display: block; font-size: .9rem; }
.timer span { color: var(--mist); font-size: .72rem; }
.moon-wrap {
  width: 36px; height: 36px; border-radius: 50%;
  background: #ffe9c4; overflow: hidden; position: relative;
}
.moon {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #ffd76a calc(var(--p) * 100%), transparent 0);
}
@keyframes phaseGlow {
  0% { box-shadow: 0 0 0 0 rgba(62, 200, 176, .0); }
  40% { box-shadow: 0 0 0 8px rgba(62, 200, 176, .22); }
  100% { box-shadow: none; }
}

.tabs { display: flex; gap: .4rem; margin: 1rem 0 .8rem; flex-wrap: wrap; }
.tab { background: var(--paper); }
.tab.on { background: var(--ink); color: #fff8ee; border-color: var(--ink); }
.tab.done { box-shadow: inset 0 -3px 0 var(--ok); }
.tab small { display: block; font-size: .68rem; opacity: .7; }

.mission-rail {
  margin: .35rem 0 .2rem;
}
.mission-check-title {
  margin: 0 0 .35rem;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--mist);
  font-weight: 700;
}
.mission-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}
.mission-lamp {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  text-align: left;
  background: var(--paper);
  border: 2px solid #ead7b4;
  border-radius: 16px;
  padding: .45rem .7rem;
  position: relative;
  overflow: hidden;
  transition: transform .18s var(--ease-bounce), box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.mission-lamp:hover { transform: translateY(-2px); }
.mission-lamp:active { transform: scale(.98); }
.mission-lamp b {
  display: inline-grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  color: var(--gold-deep);
  background: #fff1c8;
}
.mission-lamp small { color: var(--mist); font-size: .72rem; }
.mission-lamp.here { border-color: var(--ink); background: #fff8dc; }
.mission-lamp.on {
  border-color: var(--ok);
  background: linear-gradient(180deg, #f3fff9, var(--mint-soft));
  box-shadow: 0 0 0 3px rgba(47, 184, 122, .18), 0 8px 18px rgba(232, 168, 58, .22);
}
.mission-lamp.on.here {
  border-color: #146857;
  background: linear-gradient(180deg, #e8fff6, #bff3e4);
  box-shadow: 0 0 0 3px rgba(47, 184, 122, .28), 0 8px 18px rgba(232, 168, 58, .22);
}
.mission-lamp.on b {
  background: var(--gold);
  color: #3a2e24;
  box-shadow: 0 0 12px rgba(255, 215, 106, .8);
  animation: lampGlow 1.5s ease-in-out infinite;
}
.mission-lamp.on::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 106, .45), transparent 70%);
  pointer-events: none;
}
.mission-lamp.pop { animation: lampPop .6s var(--ease-bounce); }
.show-beats { list-style: none; padding: 0; margin: .4rem 0 .8rem; display: grid; gap: .35rem; }
.show-beats li {
  background: #fff8dc; border-radius: 12px; padding: .4rem .7rem;
  border: 2px solid #ead7b4;
}
.show-beats li.on { background: var(--mint-soft); border-color: #7ee0c8; box-shadow: 0 0 12px rgba(62, 200, 176, .28); }

.luna-say { display: grid; grid-template-columns: 84px 1fr; gap: .8rem; align-items: start; margin-bottom: 1rem; }
.luna-say .luna-mascot { width: 84px; animation-duration: 3.8s; }
.luna-say img, .luna-say .luna-svg { width: 84px; }
.luna-say blockquote {
  margin: 0; padding: .85rem 1rem;
  background: var(--paper);
  border-left: 5px solid var(--gold);
  border-radius: 0 18px 18px 0;
  box-shadow: var(--shadow-soft);
}
.dad-whisper { grid-column: 2; color: var(--mist); font-size: .85rem; margin: 0; }
.goal { grid-column: 2; color: #146857; margin: .2rem 0 0; font-weight: 700; }

.work {
  background: var(--paper);
  border: 3px solid #ffe0a3;
  border-radius: 24px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.work.block-intro { animation: workspaceIn .55s var(--ease-bounce); }
@keyframes workspaceIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.ed-bar, .term header { display: flex; align-items: center; gap: .5rem; }
.ed-bar { margin-bottom: .4rem; }
.file { font-family: var(--font-mono); font-size: .75rem; color: #1a8f7a; font-weight: 700; }
.ed-bar small { color: var(--mist); margin-left: auto; }
.editor {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  border: 2px solid #ead7b4;
  border-radius: 14px;
  overflow: hidden;
  min-height: 220px;
  background: #fffaf0;
}
.gutter {
  margin: 0; padding: .7rem .3rem;
  background: #fff1d4; color: #a08060;
  font-family: var(--font-mono); font-size: .82rem; line-height: 1.55;
  text-align: right; overflow: hidden;
}
#codeBox {
  border: 0; background: transparent; color: var(--ink);
  font-family: var(--font-mono); font-size: .92rem; line-height: 1.55;
  padding: .7rem .75rem; min-height: 220px; outline: none;
}
html.large-type #codeBox { font-size: 1.12rem; }

.radio { margin-bottom: .7rem; }
.radio label { display: flex; justify-content: space-between; color: var(--mist); font-size: .8rem; }
.radio textarea, #journalBox, #dadNote {
  width: 100%; background: #fffaf0; border: 2px solid #ead7b4;
  border-radius: 12px; padding: .55rem .7rem; color: var(--ink);
}
.term { margin-top: .65rem; background: #14352f; border-radius: 14px; border: 2px solid #1a8f7a; }
.term header { padding: .4rem .65rem; border-bottom: 1px solid rgba(255,255,255,.12); color: #c8f5ea; font-size: .75rem; font-family: var(--font-ui); }
.term pre {
  margin: 0; padding: .7rem;
  min-height: 6rem; white-space: pre-wrap;
  font-family: var(--font-mono); font-size: .85rem; color: #d8ffe8;
}
.check-box, .hint, .extend { color: var(--ink-soft); font-size: .88rem; }
.check-box .run, .check-box .ghost { margin-left: .45rem; }
.extend { margin-top: .8rem; }

.door-stage { margin-top: .8rem; display: flex; align-items: end; gap: .8rem; }
.door {
  width: 72px; height: 96px; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #ffb3aa, var(--coral));
  border: 3px solid #e25b5b; display: grid; place-items: center;
  color: #fff; font-weight: 800;
  transition: transform .45s var(--ease-bounce);
}
.door-stage.open .door { transform: perspective(200px) rotateY(-55deg); background: var(--mint); border-color: #1a8f7a; }
.door-stage.alarm .door { animation: buzz .2s linear 4; background: var(--bad); }
@keyframes buzz { from { transform: translateX(-2px); } to { transform: translateX(2px); } }

.kitchen { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.kit-grid { display: grid; gap: 6px; }
.tile {
  aspect-ratio: 1; border-radius: 12px;
  background: #fff1d4; display: grid; place-items: center;
  font-size: .75rem; color: #8a6a40;
  box-shadow: inset 0 0 0 2px #ead7b4;
}
.tile.chair { background: #e8c8b0; }
.tile.water { background: #c8ebff; color: #1a5f88; }
.tile.cat { background: #ffd4cc; }
.tile.luna { background: var(--gold); color: #3a2e24; font-size: 1.2rem; font-weight: 800; }
.pad { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.cards { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.cards li {
  background: #fff1c8; color: var(--ink); border-radius: 10px;
  padding: .2rem .5rem; font-size: .85rem; border: 2px solid #ffd76a;
}
.cards button { border: 0; background: none; color: var(--coral); }
.kit-bar { display: flex; gap: .4rem; flex-wrap: wrap; }

.hospital .p-tabs { display: flex; gap: .4rem; margin-bottom: .6rem; }
.p-tab { background: var(--paper); }
.p-tab.on { border-color: var(--gold); background: var(--gold-soft); }
.p-tab.ok { color: var(--ok); }
.clip { background: #fff1c8; color: var(--ink); padding: .8rem 1rem; border-radius: 6px 16px; margin-bottom: .7rem; }
.clip h3 { margin: 0 0 .3rem; font-family: var(--font-display); }
.kinds { display: grid; gap: .3rem; }

.show-card {
  margin-top: 1rem; padding: 1.05rem;
  background: var(--mint-soft); border-radius: 20px;
  border: 2px solid #7ee0c8;
}
.show-actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.badge-card {
  padding: 1rem; border-radius: 20px; background: var(--paper);
  border: 2px solid var(--line); opacity: .5;
  transition: transform .2s var(--ease-bounce), opacity .2s ease;
}
.badge-card.on {
  opacity: 1; border-color: var(--gold); background: #fff8dc;
  box-shadow: var(--shadow);
  animation: badgeShine .7s var(--ease-bounce);
  position: relative;
  overflow: hidden;
}
.badge-card.on::after {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 36%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: barSpark 2.8s ease-in-out infinite;
  pointer-events: none;
}
.badge-card .ico { font-size: 1.7rem; color: var(--gold-deep); display: inline-block; }
.badge-card.on .ico { animation: badgeSpin .8s var(--ease-bounce); }
.badge-card h3 { margin: .3rem 0; font-family: var(--font-display); }
.badge-card small { color: var(--mist); font-family: var(--font-ui); font-size: .75rem; }
@keyframes badgeShine {
  from { transform: scale(.86) rotate(-4deg); }
  to { transform: none; }
}
@keyframes badgeSpin {
  from { transform: scale(.4) rotate(-40deg); }
  to { transform: none; }
}

#journalList article {
  background: #fff1c8; color: var(--ink); padding: .85rem 1.05rem;
  border-radius: 6px 18px; margin-bottom: .7rem;
  font-family: var(--font-note); font-size: 1.25rem;
  animation: cardPop .4s var(--ease-bounce);
}
#journalList header { font-family: var(--font-ui); font-size: .75rem; color: #8a6a40; }

.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 92vw);
  background: var(--paper); border-left: 3px solid #ffe0a3;
  z-index: 20; padding: 1rem; overflow: auto;
  box-shadow: -12px 0 30px rgba(58, 46, 36, .12);
  animation: drawerIn .28s var(--ease-bounce);
}
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.backdrop { position: fixed; inset: 0; background: rgba(80, 50, 20, .28); z-index: 19; }
.drawer h2 { font-family: var(--font-display); }
.drawer label { display: block; margin: .7rem 0 .25rem; color: var(--mist); font-size: .8rem; }
.drawer select, #dadNote { width: 100%; background: #fffaf0; border: 2px solid #ead7b4; border-radius: 12px; padding: .5rem; color: var(--ink); }
.danger { color: var(--bad); background: transparent; border: 2px solid var(--bad); border-radius: 99px; padding: .4rem .8rem; margin-top: 1rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--ink); color: #fff8ee; padding: .6rem 1.1rem;
  border-radius: 999px; z-index: 30; box-shadow: var(--shadow);
  animation: toastIn .35s var(--ease-bounce);
}
@keyframes toastIn { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

#burst { position: fixed; inset: 0; pointer-events: none !important; z-index: 40; overflow: hidden; }
#burst i {
  position: absolute; top: 28%;
  width: 10px; height: 10px;
  animation: confetti 1.35s ease-out forwards;
}
#burst i.sq { border-radius: 2px; }
#burst i.round { border-radius: 50%; }
#burst i.star {
  width: 0; height: 0; background: none;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--gold);
}
#burst i.heart {
  width: 12px; height: 12px;
  background: #ff7a6e;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
#burst i.glow {
  width: 14px; height: 14px;
  background: #fff6b0;
  border-radius: 50%;
  box-shadow: 0 0 12px #ffd76a;
}
@keyframes confetti {
  0% { transform: translate3d(0, 0, 0) rotate(0) scale(1); opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), 320px, 0) rotate(540deg) scale(.25); opacity: 0; }
}

#winPop {
  position: fixed;
  inset: 0;
  z-index: 41;
  pointer-events: none !important;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(255, 247, 200, .35), transparent 55%);
}
#winPop[hidden] { display: none; }
#winPop .win-card {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: .06em;
  padding: .55rem 1.5rem .7rem;
  color: #9a5a10;
  background: linear-gradient(180deg, #fffce8, #ffe7a8);
  border: 4px solid #e8a83a;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(232, 168, 58, .35), 0 0 0 8px rgba(255, 215, 106, .2);
  animation: winBanner .55s var(--ease-bounce);
}
@keyframes winBanner {
  from { transform: scale(.6) rotate(-6deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); }
  to { transform: none; opacity: 1; }
}
@keyframes lampPop {
  0% { transform: scale(.9) rotate(-3deg); }
  45% { transform: scale(1.08) rotate(2deg); }
  100% { transform: none; }
}
@keyframes lampGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 106, .55); }
  50% { box-shadow: 0 0 18px rgba(255, 215, 106, .95); }
}

.block-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(200px, .55fr);
  gap: .8rem;
  align-items: stretch;
}
.block-stage.is-waiting {
  grid-template-columns: minmax(0, 1fr) minmax(160px, .38fr);
}
.blockly-host {
  position: relative;
  height: min(62vh, 560px);
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid #ffe0a3;
  background: #fffdf6;
}
.blockly-host .blockly-fallback,
.blockly-retry {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .55rem;
  margin: 0;
  padding: 1.2rem 1.4rem;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(255, 215, 106, .35), transparent 70%),
    #fffdf6;
  color: var(--ink);
  z-index: 3;
}
.blockly-retry strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
}
.blockly-retry p { margin: 0; color: var(--ink-soft); max-width: 28rem; }
.blockly-retry .retry-detail { font-size: .85rem; color: var(--mist); }
.blockly-host .blocklySvg {
  display: block;
}
.py-bridge {
  background: #14352f;
  border: 3px solid #1a8f7a;
  border-radius: 18px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  animation: pyReveal .5s ease both;
}
.block-stage.is-waiting .py-bridge {
  min-height: 0;
  max-height: 180px;
}
@keyframes pyReveal { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.py-bridge header {
  padding: .5rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  color: #ffe7a8;
  font-size: .78rem;
  font-weight: 800;
  font-family: var(--font-ui);
}
.py-bridge header small { color: #c8f5ea; font-weight: 400; }
.py-bridge pre {
  margin: 0;
  padding: .75rem;
  flex: 1;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: #d8ffe8;
  white-space: pre-wrap;
  overflow: auto;
}
.type-bridge { margin-top: .75rem; }
.type-bridge label {
  display: block;
  color: var(--ink);
  font-size: .85rem;
  margin-bottom: .35rem;
  font-weight: 700;
}
.type-bridge textarea {
  width: 100%;
  min-height: 8rem;
  background: #fffaf0;
  border: 2px solid #ead7b4;
  border-radius: 12px;
  padding: .6rem .7rem;
  font-family: var(--font-mono);
  color: var(--ink);
}

.blocklyToolboxDiv {
  background: #fff8ee !important;
  color: var(--ink) !important;
  border-right: 2px solid #ffe0a3 !important;
  font-family: var(--font-ui) !important;
}
.blocklyTreeRow { color: var(--ink) !important; font-family: var(--font-ui) !important; }
.blocklyTreeLabel {
  color: var(--ink) !important;
  font-family: var(--font-ui) !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
}
.blocklyHtmlInput,
.blocklyHtmlTextAreaInput {
  font-family: var(--font-mono) !important;
}
.blocklyFlyoutBackground { fill: #fff3e0 !important; }
.blocklyMainBackground { stroke: none !important; }
.blocklyScrollbarHandle { fill: #3ec8b0 !important; }
.blocklyText,
.blocklyDropdownText,
.blocklyFlyoutLabelText {
  font-family: var(--font-ui) !important;
}
.blocklyWidgetDiv, .blocklyDropDownDiv {
  z-index: 25;
  font-family: var(--font-ui);
}
.blocklyWidgetDiv .goog-menuitem,
.blocklyDropDownDiv .goog-menuitem,
.blocklyWidgetDiv .goog-menuitem-content,
.blocklyDropDownDiv .goog-menuitem-content {
  font-family: var(--font-ui) !important;
}

.tick { display: flex; gap: .5rem; align-items: center; margin-bottom: .8rem; }

@media (max-width: 900px) {
  .phase-rail { grid-template-columns: 1fr 1fr; }
  .hero, .luna-say, .kitchen, .block-stage { grid-template-columns: 1fr; }
  .hero img, .luna-say img, .luna-mascot, .luna-mascot img, .luna-mascot .luna-svg, .luna-say .luna-svg { width: 110px; }
  .blockly-host { min-height: 320px; height: 52vh; }
  .py-bridge { min-height: 220px; }
  .block-stage.is-waiting { grid-template-columns: 1fr; }
  .block-stage.is-waiting .py-bridge { max-height: 140px; }
}
@media (max-width: 640px) {
  .phase-rail { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sky .cloud, .sky .sun, .sky .sun::after,
  .sparkle, .bits i, .luna-spark, .luna-antenna-ball, .luna-arm,
  .luna-eye, .luna-hearts i, .antenna,
  .bar i, .bar i::after, .run, .badge-card.on::after,
  .node.open .dot, .node.done .dot, .mission-lamp.on b,
  .brand b, .shine-title, .speech h1, .shine-kicker {
    animation: none !important;
  }
  .luna-mascot, .luna-mascot.idle, .luna-mascot.talking, .luna-mascot.celebrate {
    animation: none !important;
  }
  .phase-card, .node, .work.block-intro, .py-bridge {
    animation: none !important;
  }
  main > section, main > section.view-enter {
    animation: viewInSoft .22s ease both;
  }
  .nav button, .ghost, .run, .tab, .pad button, .brand, .node.open, .mission-lamp {
    transition: background .15s ease, border-color .15s ease, color .15s ease;
  }
  .nav button:hover, .ghost:hover, .tab:hover, .pad button:hover, .run:hover, .brand:hover {
    transform: none;
  }
  .bits, .sparkle { opacity: .35; }
  #burst, #winPop { animation: none; }
}
@keyframes viewInSoft {
  from { opacity: 0; }
  to { opacity: 1; }
}
