/* ==========================================================================
   World English Adventure — main stylesheet
   iPad-first (portrait & landscape), also fine on desktop for parents.
   ========================================================================== */

:root {
  --ink: #073B4C;
  --ink-soft: #35586B;
  --cream: #FFF7EC;
  --paper: #FFFDF8;
  --pink: #FF8FA3;
  --pink-soft: #FFE1E7;
  --yellow: #FFD166;
  --yellow-soft: #FFF0C9;
  --green: #06D6A0;
  --green-soft: #D6F7ED;
  --sky: #4CC9F0;
  --sky-soft: #DDF4FC;
  --purple: #9B5DE5;
  --purple-soft: #EDE1FB;
  --orange: #F4845F;
  --orange-soft: #FDE4DA;
  --red: #EF476F;
  --teal: #0FB5BA;
  --accent: var(--sky);
  --accent-soft: var(--sky-soft);
  --radius: 18px;
  --shadow: 0 4px 14px rgba(7, 59, 76, 0.12);
  --tap: 48px;
}

.accent-red    { --accent: #EF476F; --accent-soft: #FBDCE4; }
.accent-orange { --accent: #F4845F; --accent-soft: #FDE4DA; }
.accent-yellow { --accent: #E8B931; --accent-soft: #FFF0C9; }
.accent-green  { --accent: #06B98B; --accent-soft: #D6F7ED; }
.accent-teal   { --accent: #0FB5BA; --accent-soft: #D8F3F4; }
.accent-blue   { --accent: #2FA8D8; --accent-soft: #DDF4FC; }
.accent-purple { --accent: #9B5DE5; --accent-soft: #EDE1FB; }
.accent-pink   { --accent: #F76C8A; --accent-soft: #FFE1E7; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Maru Gothic ProN",
    "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(rgba(76, 201, 240, 0.10) 2px, transparent 2px);
  background-size: 28px 28px;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

img, svg { max-width: 100%; height: auto; }

button { font-family: inherit; }

a { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 6px;
}

.ja, .q-ja { color: var(--ink-soft); }
body.no-ja .ja-hint-text { display: none; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 20px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(7, 59, 76, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  touch-action: manipulation;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(7,59,76,0.25); }
.btn-primary { background: var(--accent, var(--sky)); color: #fff; }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-gold { background: linear-gradient(180deg, #FFD166, #F4A93F); }
.btn-big { font-size: 21px; min-height: 58px; padding: 12px 28px; }
.btn-small { min-height: 38px; font-size: 15px; padding: 6px 14px; box-shadow: none; }
.btn-icon {
  min-width: var(--tap);
  padding: 8px;
  font-size: 22px;
  border-radius: 14px;
}
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row.center { justify-content: center; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 2px solid rgba(7, 59, 76, 0.12);
  backdrop-filter: blur(6px);
}
.topbar-title { font-size: 20px; font-weight: 800; flex: 1; }
.topbar-mid { flex: 1; min-width: 0; }
.topbar-mid .topbar-title { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-stats { font-weight: 800; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.topbar-tools { display: flex; gap: 8px; }
.lv-badge {
  background: var(--purple-soft);
  border: 2px solid var(--purple);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
}
.flag { font-size: 24px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--paper);
  border: 2.5px solid rgba(7, 59, 76, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 14px auto;
  max-width: 860px;
}

/* ------------------------------------------------------------------ home */
.page-home { overflow-x: hidden; }
.home-hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 30px 20px 40px;
  text-align: center;
  position: relative;
}
.home-sky { position: absolute; inset: 0; pointer-events: none; }
.cloud {
  position: absolute;
  width: 90px; height: 34px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 20px -12px 0 -4px #fff, -22px -10px 0 -6px #fff;
  opacity: 0.9;
}
.c1 { top: 40px; left: -10px; }
.c2 { top: 110px; right: -14px; transform: scale(1.2); }
.c3 { top: 320px; left: 6%; transform: scale(0.8); }
.tw { position: absolute; color: var(--yellow); font-size: 22px; animation: twinkle 2.4s ease-in-out infinite; }
.t1 { top: 70px; right: 18%; }
.t2 { top: 200px; left: 10%; animation-delay: 0.8s; }
.t3 { top: 30px; left: 30%; animation-delay: 1.4s; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }

.home-lumo { width: 130px; margin-top: 10px; }
.lumo-bubble {
  position: relative;
  display: inline-block;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 10px 18px;
  margin: 8px auto 6px;
  max-width: 480px;
}
.lumo-bubble::before {
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-bottom-color: var(--ink);
}
.lumo-bubble .en { font-weight: 800; }
.lumo-bubble .ja { font-size: 14px; }

.app-title {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 0;
  margin-top: 10px;
  text-shadow: 3px 3px 0 var(--yellow);
}
.app-title span { color: var(--sky); }
.app-title.small { font-size: 26px; text-shadow: 2px 2px 0 var(--yellow); }
.app-sub { font-weight: 700; color: var(--ink-soft); margin-bottom: 20px; }

.home-stats { display: flex; justify-content: center; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.stat {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 8px 18px;
  min-width: 110px;
  box-shadow: var(--shadow);
}
.stat-num { display: block; font-size: 22px; font-weight: 900; }
.stat-label { font-size: 13px; color: var(--ink-soft); font-weight: 700; }

.home-nav { display: flex; flex-direction: column; gap: 14px; align-items: center; margin-top: 10px; }
.home-nav .btn-big { min-width: 300px; }
.home-foot { margin-top: 34px; }
.parent-link { color: var(--ink-soft); font-size: 15px; }

.adventure-home {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 14px 44px;
}
.home-world {
  position: relative;
  min-height: 420px;
  border: 3px solid rgba(7, 59, 76, 0.78);
  border-radius: 24px;
  overflow: hidden;
  background: #dff7fa;
  box-shadow: var(--shadow);
}
.home-forest {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-title-block {
  position: absolute;
  left: clamp(18px, 5vw, 52px);
  top: clamp(22px, 6vw, 60px);
  max-width: min(560px, 86%);
  text-align: left;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.55);
}
.home-greeting {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid rgba(7,59,76,0.6);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 900;
}
.home-hero-avatar {
  position: absolute;
  right: clamp(18px, 7vw, 92px);
  bottom: 0;
  width: clamp(170px, 31vw, 300px);
  z-index: 2;
}
.home-buddy-new {
  position: absolute;
  left: clamp(16px, 7vw, 84px);
  bottom: 22px;
  width: clamp(96px, 15vw, 148px);
  filter: drop-shadow(0 5px 5px rgba(7,59,76,0.18));
}
.today-mission {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin: 16px 0 10px;
  padding: 16px 20px;
}
.mission-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.today-mission h2 {
  font-size: 28px;
  line-height: 1.25;
}
.mission-badges,
.nature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mission-badges span,
.nature-tags span {
  background: var(--green-soft);
  border: 2px solid rgba(7,59,76,0.55);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 900;
}
.home-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.home-actions .btn {
  min-width: 0;
  width: 100%;
  white-space: normal;
  line-height: 1.25;
}
.friend-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin: 18px 0 6px;
}
.friend-strip figure {
  text-align: center;
  background: rgba(255,255,255,0.76);
  border: 2px solid rgba(7,59,76,0.25);
  border-radius: 16px;
  padding: 8px 4px;
}
.friend-strip img {
  height: 72px;
  width: auto;
}
.friend-strip figcaption {
  font-size: 12px;
  font-weight: 900;
}

/* ------------------------------------------------------------------ setup */
.setup-wrap { max-width: 620px; margin: 0 auto; padding: 30px 20px 60px; text-align: center; }
.setup-lumo { width: 110px; }
.setup-lead { margin: 12px 0 20px; }
.setup-form { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.setup-form label { font-weight: 800; display: flex; flex-direction: column; gap: 6px; }
.en-hint { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.setup-form input, .setup-form select, .type-input, textarea {
  font-family: inherit;
  font-size: 19px;
  padding: 12px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.pin-label small { font-weight: 500; color: var(--ink-soft); }
.form-errors {
  background: var(--pink-soft);
  border: 2.5px solid var(--red);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ map */
.map-wrap { position: relative; max-width: 900px; margin: 0 auto; padding: 20px 14px 110px; }
.map-adventure-head {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  align-items: center;
  min-height: 190px;
  border: 3px solid rgba(7,59,76,0.75);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 18px;
}
.map-adventure-head > img:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}
.map-adventure-head > div,
.map-hero-avatar {
  position: relative;
  z-index: 1;
}
.map-adventure-head h2 {
  font-size: 26px;
  line-height: 1.3;
}
.map-hero-avatar {
  width: 116px;
  align-self: end;
  justify-self: end;
}
.map-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.55; pointer-events: none; }
.map-bg img { width: 100%; height: 100%; object-fit: cover; }
.day-path {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}
.day-node-wrap:nth-child(4n+2) { transform: translateY(12px); }
.day-node-wrap:nth-child(4n) { transform: translateY(-6px); }
.day-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--paper);
  border: 3px solid var(--accent);
  border-radius: 20px;
  padding: 12px 8px 14px;
  min-height: 128px;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.day-node.done { background: var(--accent-soft); }
.day-node.locked { border-style: dashed; opacity: 0.65; background: #f2efe8; }
.day-node.current { animation: pulse 1.8s ease-in-out infinite; border-width: 4px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.node-day { font-weight: 900; font-size: 15px; color: var(--ink-soft); }
.node-flag { font-size: 34px; line-height: 1.2; }
.node-country { font-weight: 800; font-size: 15px; }
.node-theme { font-size: 12px; color: var(--ink-soft); }
.node-star { position: absolute; top: -12px; right: -8px; font-size: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25)); }
.node-here {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  padding: 2px 10px; white-space: nowrap;
}
.map-goal {
  position: relative;
  text-align: center;
  margin-top: 26px;
  font-weight: 700;
}
.map-goal img { width: 90px; }

/* ------------------------------------------------------------------ bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  background: var(--paper);
  border-top: 2.5px solid rgba(7, 59, 76, 0.15);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  font-size: 22px; text-decoration: none;
  min-width: 64px; min-height: var(--tap);
  border-radius: 12px; padding: 2px 6px;
}
.bottom-nav a span { font-size: 11px; font-weight: 700; }

/* ------------------------------------------------------------------ lesson framework */
.page-day { padding-bottom: 30px; }
.lesson-root { max-width: 820px; margin: 0 auto; padding: 12px 14px 60px; }
.day-visual-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: end;
  max-width: 980px;
  min-height: 250px;
  margin: 14px auto 0;
  border: 3px solid rgba(7,59,76,0.74);
  border-radius: 24px;
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}
.day-visual-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.day-visual-copy {
  position: relative;
  z-index: 1;
  margin: 18px;
  max-width: 650px;
  background: rgba(255,255,255,0.82);
  border: 2px solid rgba(7,59,76,0.45);
  border-radius: 18px;
  padding: 14px 16px;
}
.day-kicker {
  font-size: 12px;
  font-weight: 900;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0;
}
.day-visual-copy h2 {
  font-size: 30px;
  line-height: 1.2;
}
.day-buddy {
  position: relative;
  z-index: 1;
  width: 140px;
  align-self: end;
  justify-self: center;
  margin: 0 12px 8px 0;
  filter: drop-shadow(0 5px 4px rgba(7,59,76,0.18));
}
.progress-dots { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.dot {
  width: 12px; height: 12px;
  border-radius: 999px;
  border: 2px solid var(--ink-soft);
  background: #fff;
}
.dot.done { background: var(--green); border-color: var(--green); }
.dot.current { background: var(--yellow); border-color: var(--ink); transform: scale(1.25); }

.lesson-section { animation: fadein 0.35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sec-head { text-align: center; margin: 10px 0 6px; }
.sec-head .sec-title { font-size: 24px; font-weight: 900; }
.sec-head .sec-ja { font-size: 14px; color: var(--ink-soft); font-weight: 700; }

.lumo-strip { display: flex; align-items: flex-end; gap: 10px; margin: 8px 0; }
.lumo-strip img { width: 84px; flex-shrink: 0; }
.lumo-strip .lumo-bubble { margin: 0; text-align: left; }
.lumo-strip .lumo-bubble::before {
  top: 50%; left: -18px; margin: -8px 0 0;
  border: 8px solid transparent;
  border-right-color: var(--ink);
}

.companion-call {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  max-width: 760px;
  margin: 6px auto 12px;
}
.companion-call img {
  width: 86px;
  filter: drop-shadow(0 4px 3px rgba(7,59,76,0.18));
}
.companion-bubble {
  position: relative;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.companion-bubble::before {
  content: "";
  position: absolute;
  left: -16px;
  bottom: 22px;
  border: 8px solid transparent;
  border-right-color: var(--ink);
}
.companion-bubble .en {
  font-weight: 900;
}
.companion-bubble .soft {
  color: var(--ink-soft);
  font-size: 0.94em;
}
.speak-btn.tiny {
  min-width: 34px;
  min-height: 34px;
  font-size: 15px;
}
.nature-burst {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, 18px) scale(0.94);
  opacity: 0;
  background: #fff;
  border: 3px solid var(--green);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  box-shadow: var(--shadow);
  font-weight: 900;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.nature-burst.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.nature-burst img {
  width: 46px;
  height: 46px;
}
.q-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,253,248,0.96)),
    radial-gradient(circle at 14% 0%, rgba(6,214,160,0.12), transparent 40%);
}
.q-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(7,59,76,0.13);
  border-radius: 14px;
  pointer-events: none;
}

.scene-art, .q-svg { text-align: center; margin: 10px 0; }
.scene-art svg, .q-svg svg { max-height: 220px; width: auto; max-width: 100%; }

.next-bar { display: flex; justify-content: center; gap: 12px; margin: 22px 0 8px; flex-wrap: wrap; }

.section-intro { text-align: center; font-weight: 700; margin: 6px 0; }

.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--sky-soft);
  font-size: 20px;
  cursor: pointer;
  vertical-align: middle;
}
.speak-btn.speaking { background: var(--yellow); animation: pulse 0.8s infinite; }

/* ------------------------------------------------------------------ questions */
.q-card { margin-top: 10px; }
.q-count { text-align: center; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.q-prompt { font-size: 22px; font-weight: 800; text-align: center; margin: 8px 0; }
.q-ja { text-align: center; font-size: 14px; margin-bottom: 8px; }

.choices { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0; }
.choices.two-col { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choices.pic { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice-btn {
  min-height: 56px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  font-size: 20px;
  font-weight: 800;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.choice-btn svg { max-height: 110px; }
.choice-btn.pic-choice { flex-direction: column; padding: 12px; }
.choice-btn.correct { background: var(--green-soft); border-color: var(--green); }
.choice-btn.correct::after { content: "⭕"; font-size: 18px; }
.choice-btn.wrong-pick { background: #f4f1ea; border-style: dashed; opacity: 0.7; }
.choice-btn.wrong-shake { animation: shake 0.4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.feedback {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 10px 0;
}
.feedback.good { background: var(--green-soft); border: 2.5px solid var(--green); }
.feedback.try { background: var(--yellow-soft); border: 2.5px solid var(--yellow); }
.feedback .ja { display: block; font-size: 13px; font-weight: 700; }

.hint-box {
  background: var(--sky-soft);
  border: 2.5px dashed var(--ink-soft);
  border-radius: 14px;
  padding: 10px 14px;
  margin: 10px 0;
  font-weight: 700;
}
.hint-box::before { content: "💡 "; }
.explain-box {
  background: var(--purple-soft);
  border: 2.5px solid var(--purple);
  border-radius: 14px;
  padding: 10px 14px;
  margin: 10px 0;
  font-weight: 700;
}

/* tiles: sentence building / scramble */
.tiles, .build-area { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; min-height: 54px; }
.build-area {
  background: #fff;
  border: 2.5px dashed var(--ink-soft);
  border-radius: 14px;
  padding: 10px;
}
.tile {
  min-height: 50px;
  min-width: 50px;
  padding: 8px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow-soft);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(7,59,76,0.3);
}
.tile.letter { text-transform: none; font-size: 24px; padding: 8px 14px; }
.tile.in-build { background: var(--green-soft); }
.tile.ghost { opacity: 0.25; pointer-events: none; }

/* match */
.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-item {
  min-height: 54px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  font-size: 17px;
  font-weight: 800;
  padding: 8px 12px;
  cursor: pointer;
}
.match-item.sel { background: var(--yellow); }
.match-item.locked { background: var(--green-soft); border-color: var(--green); opacity: 0.9; pointer-events: none; }
.match-item.locked::after { content: " ✓"; }

/* sort */
.sort-items { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0; }
.sort-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.sort-box {
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  min-height: 120px;
  padding: 8px;
}
.sort-box.target { border-color: var(--purple); background: var(--purple-soft); }
.sort-box h4 { text-align: center; font-size: 16px; border-bottom: 2px dashed var(--ink-soft); padding-bottom: 4px; margin-bottom: 6px; }
.sort-box .tile { display: inline-flex; margin: 3px; font-size: 16px; padding: 4px 10px; min-height: 40px; }

/* order */
.order-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.order-item {
  display: flex; align-items: center; gap: 10px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 18px;
}
.order-item .ord-num {
  min-width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sky-soft);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 15px;
}
.order-item .ord-text { flex: 1; }
.order-item .ord-btns { display: flex; gap: 6px; }
.order-item .ord-btns .btn-icon { min-height: 40px; min-width: 40px; font-size: 17px; }

/* type input */
.type-row { display: flex; gap: 10px; align-items: stretch; margin: 12px 0; }
.type-row .type-input { flex: 1; font-size: 22px; }
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.bank-chip {
  border: 2px dashed var(--ink-soft);
  background: var(--yellow-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  cursor: pointer;
  min-height: 40px;
}

/* spelling */
.spell-word-show { text-align: center; font-size: 44px; font-weight: 900; letter-spacing: 0; margin: 8px 0; }
.spell-word-show.trace {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink-soft);
  opacity: 0.6;
}
.spell-hidden { text-align: center; font-size: 30px; margin: 8px 0; letter-spacing: 0; color: var(--ink-soft); }

/* syllable */
.syll-parts { display: flex; justify-content: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.syll-part {
  border: 3px solid var(--orange);
  background: var(--orange-soft);
  border-radius: 14px;
  font-size: 26px;
  font-weight: 900;
  padding: 8px 18px;
  animation: popin 0.35s ease backwards;
}
.syll-part:nth-child(2) { animation-delay: 0.15s; }
.syll-part:nth-child(3) { animation-delay: 0.3s; }
.syll-part:nth-child(4) { animation-delay: 0.45s; }
@keyframes popin { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ------------------------------------------------------------------ vocab cards */
.vocab-stage { position: relative; }
.vcard {
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
  touch-action: pan-y;
}
.vcard-art svg { max-height: 170px; }
.vcard-word { font-size: 40px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 12px; }
.vcard-mean { font-size: 19px; font-weight: 700; }
.vcard-ja { font-size: 15px; color: var(--ink-soft); }
.vcard-ex {
  margin-top: 10px;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  flex-wrap: wrap;
}
.rate-row { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.rate-btn { border-radius: 16px; font-size: 16px; }
.rate-btn.know.on { background: var(--green-soft); border-color: var(--green); }
.rate-btn.again.on { background: var(--sky-soft); border-color: var(--sky); }
.rate-btn.hard.on { background: var(--pink-soft); border-color: var(--red); }
.vc-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.vc-count { font-weight: 800; color: var(--ink-soft); }

/* ------------------------------------------------------------------ reading */
.reading-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin: 10px 0;
}
.reading-toolbar .btn { min-height: 42px; font-size: 14px; padding: 6px 12px; box-shadow: none; }
.reading-toolbar .btn.on { background: var(--accent-soft); border-color: var(--accent); }
.rd-body { margin-top: 8px; }
.rd-body.size-1 { font-size: 20px; }
.rd-body.size-2 { font-size: 25px; }
.rd-body.size-3 { font-size: 30px; }
.rd-sentence {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff;
  border: 2.5px solid rgba(7,59,76,0.35);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 10px 0;
  line-height: 1.8;
}
.rd-sentence.current { border-color: var(--yellow); background: var(--yellow-soft); }
.rd-sentence .rd-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 2px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
  margin-top: 4px;
}
.rd-text { flex: 1; }
.rd-word { cursor: pointer; border-radius: 6px; padding: 0 1px; }
.rd-word.vocab-word { background: linear-gradient(transparent 65%, var(--yellow) 65%); font-weight: 800; }
.rd-word:active { background: var(--sky-soft); }
.rd-ja { display: block; font-size: 0.72em; color: var(--ink-soft); margin-top: 4px; }
.chunk-pill {
  display: inline-block;
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
  padding: 2px 12px;
  margin: 3px 4px 3px 0;
  background: #fff;
}
.waw-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.waw-chip {
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 0.8em;
  border: 2.5px solid;
}
.waw-chip .waw-label { display: block; font-size: 11px; font-weight: 900; letter-spacing: 0; }
.waw-chip.who { border-color: #2FA8D8; background: var(--sky-soft); border-style: solid; }
.waw-chip.action { border-color: var(--red); background: var(--pink-soft); border-style: double; border-width: 5px; }
.waw-chip.where { border-color: #06B98B; background: var(--green-soft); border-style: dashed; }
.waw-chip.when { border-color: var(--purple); background: var(--purple-soft); border-style: dotted; }
.word-pop {
  position: fixed;
  left: 50%; bottom: 90px; transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 10px 18px;
  font-weight: 800;
  box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: center;
  max-width: 92vw;
}
.word-pop .ja { color: #cde; font-size: 14px; }
.read-check { display: flex; justify-content: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ grammar */
.gram-example {
  background: #fff;
  border: 2.5px solid rgba(7,59,76,0.4);
  border-radius: 16px;
  padding: 14px;
  margin: 10px 0;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  line-height: 2.1;
}
.gp { padding: 2px 6px; border-radius: 8px; margin: 0 2px; display: inline-block; }
.gp-subject { border-bottom: 4px solid #2FA8D8; }
.gp-verb { border: 3px solid var(--red); border-radius: 10px; }
.gp-object { border-bottom: 4px dotted var(--orange); }
.gp-adjective { text-decoration: underline wavy var(--purple) 2.5px; }
.gp-place { background: var(--green-soft); border: 2px dashed #06B98B; }
.gp-time { background: var(--purple-soft); border: 2px dotted var(--purple); }
.gp-focus { background: var(--yellow); border-radius: 8px; }
.gram-legend { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 13px; font-weight: 800; margin: 6px 0; }

/* ------------------------------------------------------------------ writing */
.writing-area textarea { min-height: 130px; font-size: 21px; line-height: 1.9; }
.checklist { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.check-btn {
  border: 2.5px solid var(--ink-soft);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}
.check-btn.on { background: var(--green-soft); border-color: var(--green); }
.check-btn.on::before { content: "✓ "; }
.model-box {
  background: var(--sky-soft);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  margin: 10px 0;
}

/* ------------------------------------------------------------------ speaking */
.sp-line {
  position: relative;
  background: #fff;
  border: 2.5px solid rgba(7,59,76,0.4);
  border-radius: 16px;
  padding: 12px 14px 12px 76px;
  margin: 10px 0;
  min-height: 86px;
}
.sp-line.current { border-color: var(--yellow); background: var(--yellow-soft); }
.sp-line.listening { box-shadow: 0 0 0 4px rgba(76,201,240,0.22); }
.sp-listener {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 52px;
  height: 52px;
}
.sp-q, .sp-a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-q { font-weight: 800; }
.sp-a { margin-top: 6px; padding-left: 16px; font-weight: 700; color: var(--ink-soft); }
.sp-who {
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 10px;
  border: 2px solid var(--ink);
}
.sp-who.parent { background: var(--purple-soft); }
.sp-who.kid { background: var(--yellow-soft); }
.rec-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.sp-practice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-left: 16px; }
.sp-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0 16px;
}
.hint-chip {
  min-height: 36px;
  border: 2px solid rgba(7,59,76,0.45);
  border-radius: 999px;
  background: var(--sky-soft);
  padding: 4px 12px;
  font-weight: 900;
  cursor: pointer;
}
.hint-chip.on {
  background: var(--yellow);
  border-color: var(--ink);
}

/* ------------------------------------------------------------------ reward */
.reward-stage { text-align: center; padding: 10px 0 30px; }
.star-big { font-size: 90px; animation: starpop 0.9s ease backwards; display: inline-block; }
@keyframes starpop {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  70% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.chest { font-size: 74px; cursor: pointer; display: inline-block; animation: bounce 1.4s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.reward-items { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin: 16px 0; }
.reward-item {
  background: #fff;
  border: 3px solid var(--yellow);
  border-radius: 20px;
  padding: 14px;
  width: 170px;
  animation: popin 0.5s ease backwards;
}
.reward-item:nth-child(2) { animation-delay: 0.25s; }
.reward-item svg { max-height: 110px; }
.reward-item .rw-name { font-weight: 800; font-size: 14px; }
.exp-pop { font-size: 22px; font-weight: 900; color: var(--purple); margin: 8px 0; }
.teaser-box {
  background: var(--sky-soft);
  border: 2.5px dashed var(--ink);
  border-radius: 16px;
  padding: 12px 16px;
  margin: 14px auto;
  max-width: 560px;
  font-weight: 700;
}
.teaser-box .label { font-weight: 900; }
.parent-tip-box {
  margin: 20px auto 0;
  max-width: 560px;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 2px dashed rgba(7,59,76,0.3);
  padding-top: 10px;
  text-align: left;
}
.parent-tip-box .label { font-weight: 800; }

.exp-bar {
  height: 18px;
  background: #eee7da;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}
.exp-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--sky)); }
.exp-num { font-size: 13px; color: var(--ink-soft); font-weight: 700; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 12px; height: 12px;
  border-radius: 3px;
  animation: fall 2.8s linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

/* overlays */
.overlay {
  position: fixed; inset: 0;
  z-index: 70;
  background: rgba(7, 59, 76, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 480px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
  text-align: center;
  animation: popin 0.3s ease;
}
.overlay-card img { width: 110px; }
.overlay-card h2 { margin: 8px 0; }
.break-icons { font-size: 34px; display: flex; justify-content: center; gap: 16px; margin: 10px 0; }

/* ------------------------------------------------------------------ rewards & passport pages */
.rewards-wrap, .passport-wrap { max-width: 900px; margin: 0 auto; padding: 14px 14px 110px; }
.level-card { display: flex; gap: 16px; align-items: center; }
.level-lumo { width: 100px; flex-shrink: 0; }
.section-heading { text-align: center; margin: 18px 0 8px; font-size: 20px; }
.sticker-grid, .stamp-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.sticker-slot, .stamp-slot {
  background: var(--paper);
  border: 2.5px solid rgba(7,59,76,0.5);
  border-radius: 18px;
  padding: 12px;
  text-align: center;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sticker-slot.empty, .stamp-slot.empty { border-style: dashed; background: rgba(255,255,255,0.5); }
.sticker-art svg, .stamp-art svg { width: 92px; height: 92px; }
.sticker-art.mystery {
  width: 92px; height: 92px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 900;
  color: rgba(7,59,76,0.25);
  border: 3px dashed rgba(7,59,76,0.25);
  border-radius: 999px;
}
.sticker-name, .stamp-country { font-weight: 800; font-size: 13px; }
.sticker-day, .stamp-date { font-size: 12px; color: var(--ink-soft); }
.stamp-art.empty-ring {
  width: 92px; height: 92px;
  border: 3px dashed rgba(7,59,76,0.3);
  border-radius: 999px;
}
.passport-cover {
  background: linear-gradient(160deg, #12406b, #0b5d8a);
  color: #fff;
  text-align: center;
}
.passport-cover .ja { color: #cfe8f7; }
.passport-cover .en { color: #fff; }
.passport-emblem { font-size: 48px; }

.empty-review { text-align: center; }
.section-lumo { width: 110px; }

/* ------------------------------------------------------------------ offline */
.offline-wrap { max-width: 560px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.offline-lumo { width: 120px; }
.offline-wrap h1 { margin: 14px 0; font-size: 26px; }
.offline-wrap .btn-row { margin-top: 24px; }

/* ------------------------------------------------------------------ parent */
.page-parent { background-image: none; background: #f6f3ec; }
.parent-login-wrap { max-width: 460px; margin: 0 auto; padding: 60px 20px; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.pin-form { display: flex; flex-direction: column; gap: 12px; }
.pin-form input { font-size: 30px; text-align: center; letter-spacing: 0; }
.parent-topbar { flex-wrap: wrap; }
.parent-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.parent-nav .btn { min-height: 40px; font-size: 14px; padding: 6px 14px; box-shadow: none; }
.parent-main { max-width: 1080px; margin: 0 auto; padding: 10px 14px 60px; }
.parent-main .card { max-width: none; }
.parent-main h2 { font-size: 19px; margin-bottom: 10px; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 12px; }
.kpi {
  background: #fff;
  border: 2px solid rgba(7,59,76,0.3);
  border-radius: 14px;
  padding: 10px 16px;
  min-width: 130px;
  text-align: center;
}
.kpi-num { display: block; font-size: 22px; font-weight: 900; }
.kpi span:last-child { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.tendency-list { padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.note-small { font-size: 12px; color: var(--ink-soft); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 14px; }
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; }
.bar-label { font-size: 14px; font-weight: 800; }
.bar-track { height: 16px; background: #eee7da; border-radius: 999px; overflow: hidden; border: 1.5px solid rgba(7,59,76,0.35); }
.bar-fill { height: 100%; background: var(--sky); border-radius: 999px; }
.bar-num { font-size: 13px; font-weight: 700; white-space: nowrap; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th, .mini-table td { border-bottom: 1.5px solid rgba(7,59,76,0.15); padding: 6px 8px; text-align: left; }
.table-scroll { overflow-x: auto; }
.day-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.day-table th, .day-table td { border-bottom: 1.5px solid rgba(7,59,76,0.15); padding: 6px 8px; text-align: left; }
.day-table tr.status-done { background: rgba(6, 214, 160, 0.07); }
.hour-bars { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; padding: 10px 0; }
.hour-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 130px; min-width: 46px; }
.hour-fill { width: 22px; background: var(--purple); border-radius: 6px 6px 0 0; min-height: 3px; }
.hour-label { font-size: 11px; font-weight: 800; margin-top: 4px; }
.hour-num { font-size: 10px; color: var(--ink-soft); }
.writing-item { border-top: 1.5px dashed rgba(7,59,76,0.25); padding: 10px 0; }
.writing-text { background: #fff; border-radius: 10px; padding: 8px 12px; border: 1.5px solid rgba(7,59,76,0.2); white-space: pre-wrap; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; font-size: 15px; padding: 8px 10px; }
.settings-form { display: flex; flex-direction: column; gap: 10px; }
.settings-form label { font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.settings-form select,
.settings-form input[type="range"] { font-size: 16px; }
.settings-form select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #fff;
}
.voice-panel {
  border-top: 2px dashed rgba(7,59,76,0.18);
  margin-top: 8px;
  padding-top: 12px;
}
.voice-panel h3 { margin: 0 0 8px; font-size: 17px; }
.voice-actions,
.voice-test {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.voice-sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.voice-sliders input[type="range"] {
  width: 100%;
  accent-color: var(--sky);
}
.range-value {
  color: var(--purple);
  font-weight: 900;
}
.character-admin h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}
.character-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.character-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: #fff;
  border: 2px solid rgba(7,59,76,0.18);
  border-radius: 14px;
  padding: 10px;
}
.character-row img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.character-row label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
}
.character-row input,
.character-row select {
  width: 100%;
  min-height: 36px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
}
.note-form { display: flex; flex-direction: column; gap: 8px; }
.note-form textarea { font-size: 15px; }
.notes-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.notes-list li { background: #fff; border-radius: 10px; padding: 8px 12px; border: 1.5px solid rgba(7,59,76,0.2); font-size: 14px; }
.print-day-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.print-day-list .btn { width: 100%; justify-content: flex-start; font-size: 14px; box-shadow: none; }

/* ------------------------------------------------------------------ certificate (screen) */
.cert-toolbar { display: flex; gap: 10px; justify-content: center; padding: 14px; }
.certificate { max-width: 820px; margin: 0 auto 40px; padding: 0 14px; }
.cert-border {
  background: #fffdf6;
  border: 6px double var(--ink);
  border-radius: 8px;
  outline: 3px solid var(--yellow);
  outline-offset: -14px;
  text-align: center;
  padding: 46px 30px;
}
.cert-small { letter-spacing: 0; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; font-size: 13px; }
.cert-title { font-size: 38px; font-weight: 900; margin: 6px 0 0; }
.cert-sub { color: var(--ink-soft); font-weight: 700; margin-bottom: 18px; }
.cert-name {
  font-size: 42px;
  font-weight: 900;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
  padding: 0 30px 4px;
  margin: 10px 0 18px;
}
.cert-body { margin: 8px auto; max-width: 560px; font-weight: 700; }
.cert-rank { font-size: 24px; font-weight: 900; color: #B8860B; }
.cert-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0; flex-wrap: wrap; }
.cert-stats div { display: flex; flex-direction: column; font-weight: 700; font-size: 13px; }
.cert-stat-num { font-size: 22px; font-weight: 900; }
.cert-strengths { margin: 10px auto; max-width: 520px; font-weight: 700; }
.cert-strengths .label { color: var(--ink-soft); font-size: 13px; }
.cert-date { margin-top: 14px; font-weight: 700; }
.cert-signs { display: flex; justify-content: center; gap: 40px; margin-top: 34px; flex-wrap: wrap; }
.sign-line { border-top: 2px solid var(--ink); min-width: 220px; padding-top: 6px; font-size: 13px; font-weight: 700; }
.cert-lumo img { width: 90px; margin-top: 16px; }

/* ------------------------------------------------------------------ worksheet (screen preview) */
.worksheet {
  background: #fff;
  max-width: 820px;
  margin: 14px auto;
  padding: 28px;
  border: 1.5px solid rgba(7,59,76,0.3);
  border-radius: 6px;
}
.ws-header { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }
.ws-header h1 { font-size: 19px; }
.ws-theme { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.ws-nameline { font-size: 14px; font-weight: 700; align-self: flex-end; }
.ws-section { margin-top: 18px; }
.ws-section h2 { font-size: 16px; border-left: 6px solid var(--ink); padding-left: 8px; margin-bottom: 8px; }
.ws-note { font-size: 14px; margin-bottom: 6px; }
.ws-ja { font-size: 12px; color: var(--ink-soft); }
.ws-vocab { width: 100%; border-collapse: collapse; }
.ws-vocab td { border: 1.5px solid rgba(7,59,76,0.35); padding: 6px 8px; font-size: 14px; vertical-align: middle; }
.ws-vocab-art svg { width: 52px; height: 52px; }
.ws-vocab-word { font-size: 19px; font-weight: 900; }
.ws-vocab-line { width: 34%; }
.ws-line { border-bottom: 2px solid rgba(7,59,76,0.55); height: 34px; margin: 8px 0; }
.ws-q { margin: 10px 0; }
.ws-q-prompt { font-weight: 800; font-size: 15px; }
.ws-choices { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin-top: 4px; }
.ws-tile { border: 1.5px solid var(--ink); border-radius: 8px; padding: 2px 10px; font-weight: 800; }
.ws-pic-row { display: flex; gap: 20px; flex-wrap: wrap; }
.ws-pic { text-align: center; font-size: 14px; }
.ws-pic svg { width: 84px; height: 84px; }
.ws-match { display: flex; gap: 60px; }
.ws-match ul { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 700; }
.ws-sort-boxes { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.ws-box { border: 2px solid var(--ink); border-radius: 10px; min-width: 200px; min-height: 90px; padding: 6px; font-size: 13px; font-weight: 800; }
.ws-writeline { font-size: 14px; font-weight: 700; margin-top: 6px; }
.ws-spelling-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.ws-spell-word { font-size: 24px; font-weight: 900; letter-spacing: 0; }
.ws-spell-word.trace { color: rgba(7,59,76,0.28); }
.ws-spell-boxes { display: flex; gap: 4px; }
.ws-spell-box { width: 30px; height: 34px; border: 1.5px solid rgba(7,59,76,0.6); border-radius: 6px; }
.ws-reading-art { text-align: center; }
.ws-reading-art svg { max-height: 130px; }
.ws-reading p { font-size: 16px; line-height: 2; }
.ws-sent-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  border: 1.5px solid var(--ink); font-size: 11px; font-weight: 900;
  margin-right: 6px;
}
.ws-footer { display: flex; gap: 14px; margin-top: 22px; }
.ws-stamp-box, .ws-comment-box {
  flex: 1;
  border: 2px dashed rgba(7,59,76,0.5);
  border-radius: 12px;
  min-height: 100px;
  padding: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ inquiry, speaking assessment, presentation */
.quick-response-box,
.presentation-slide,
.inspection-item,
.eval-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quick-response-box {
  max-width: 900px;
  margin: 0 auto 110px;
  padding: 0 14px;
}
.qr-head h3 {
  font-size: 24px;
  margin-bottom: 4px;
}
.qr-modes,
.btn-row,
.next-bar,
.inspection-checks,
.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.qr-modes .on,
.hint-chip:focus,
.hint-chip:hover {
  background: var(--yellow);
  color: var(--ink);
}
.qr-card {
  min-height: 360px;
}
.q-count,
.q-ja,
.note-small {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}
.q-prompt {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.25;
}
.qr-wait {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  width: fit-content;
  background: #e8f8fb;
  border: 2px solid rgba(7,59,76,0.18);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 900;
}
.qr-wait strong {
  font-size: 28px;
  color: #0b7fab;
}
.type-input,
.inspection-checks input[type="text"],
.inspection-checks input:not([type]),
.presentation-slide input,
.presentation-slide textarea,
.settings-form input,
.settings-form textarea,
.settings-form select,
.inline-form input {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}
.qr-result .feedback,
.feedback {
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 900;
}
.feedback.good {
  background: #dcfce7;
  color: #14532d;
}
.feedback.bad {
  background: #fee2e2;
  color: #7f1d1d;
}
.danger-card {
  border-color: #b91c1c;
  background: #fff5f5;
}
.success-card {
  border-color: #16a34a;
  background: #f0fdf4;
}
.hint-chip,
.check-btn {
  border: 2px solid rgba(7,59,76,0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}
.mini-card {
  background: #fff;
  border: 2px solid rgba(7,59,76,0.16);
  border-radius: 8px;
  padding: 12px;
}
.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.photo-strip figure {
  margin: 0;
  display: grid;
  gap: 6px;
  background: #fff;
  border: 2px solid rgba(7,59,76,0.18);
  border-radius: 8px;
  padding: 8px;
}
.photo-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #eef7f8;
}
.photo-strip figcaption {
  font-weight: 900;
  color: var(--ink-soft);
}
.presentation-slide {
  border: 2px solid rgba(7,59,76,0.14);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin: 12px 0;
}
.presentation-slide h3 {
  font-size: 18px;
}
.reset-form-card,
.reset-confirm {
  max-width: 760px;
}
.reset-counts,
.reset-keep {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 10px 0;
}
.reset-counts li,
.reset-keep li {
  background: #fff;
  border: 2px solid rgba(7,59,76,0.14);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
}
.reset-counts li {
  border-left: 7px solid #b91c1c;
}
.reset-keep li {
  border-left: 7px solid #16a34a;
}
.inspection-grid {
  display: grid;
  grid-template-columns: minmax(130px, 200px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.inspection-art {
  background: #fffdf6;
  border: 2px solid rgba(7,59,76,0.16);
  border-radius: 8px;
  padding: 8px;
}
.inspection-art svg {
  width: 100%;
  height: auto;
  display: block;
}
.eval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.eval-panel {
  background: #fff;
  border: 2px solid rgba(7,59,76,0.16);
  border-radius: 8px;
  padding: 12px;
}

/* ------------------------------------------------------------------ a11y / motion */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 560px) {
  .app-title { font-size: 34px; }
  .today-mission h2 { font-size: 22px; }
  .map-adventure-head h2 { font-size: 21px; }
  .day-visual-copy h2 { font-size: 22px; }
  .cert-title { font-size: 27px; }
  .cert-name { font-size: 31px; }
  .home-world { min-height: 430px; }
  .home-title-block { top: 18px; left: 16px; right: 16px; max-width: none; }
  .home-hero-avatar { width: 176px; right: 8px; }
  .home-buddy-new { width: 92px; left: 14px; bottom: 24px; }
  .today-mission { grid-template-columns: 1fr; }
  .home-actions { grid-template-columns: 1fr 1fr; }
  .home-actions .btn-big { font-size: 17px; padding: 10px 12px; }
  .day-visual-hero { grid-template-columns: 1fr 96px; min-height: 300px; border-radius: 18px; margin-left: 10px; margin-right: 10px; }
  .day-visual-copy { margin: 12px; padding: 12px; }
  .day-buddy { width: 92px; }
  .map-adventure-head { grid-template-columns: 1fr 82px; }
  .map-hero-avatar { width: 80px; }
  .companion-call { grid-template-columns: 66px 1fr; }
  .companion-call img { width: 64px; }
  .sp-line { padding-left: 12px; padding-top: 74px; }
  .sp-listener { left: 14px; top: 12px; }
  .bar-row { grid-template-columns: 90px 1fr; }
  .bar-num { grid-column: 2; }
  .match-cols { gap: 8px; }
  .level-card { flex-direction: column; text-align: center; }
  .inspection-grid { grid-template-columns: 1fr; }
  .q-prompt { font-size: 23px; }
  .photo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  body { font-size: 19px; }
}

/* Day 1 simplified child experience: one screen, one question, one main action. */
.day1-simple-child-ui .day-topbar {
  min-height: 56px;
}
.day1-simple-child-ui .topbar-title {
  font-size: clamp(18px, 2.6vw, 27px);
}
.day1-simple-child-ui #progress-dots {
  display: none;
}
.day1-simple-child-ui .lesson-root {
  max-width: none;
  padding: 0;
}
.day1-simple {
  --simple-ink: #17324d;
  --simple-paper: rgba(255, 253, 248, .97);
  --simple-line: #17324d;
  color: var(--simple-ink);
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-rows: auto 1fr;
}
.simple-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  max-width: 1180px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 8px 16px;
  font-size: .86rem;
  font-weight: 900;
}
.simple-progress-track {
  height: 12px;
  overflow: hidden;
  border: 2px solid rgba(23,50,77,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}
.simple-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8fa3, #ffd166, #06d6a0);
  transition: width .35s ease;
}
.simple-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, .62fr);
  gap: 14px;
  width: min(100%, 1180px);
  height: min(720px, calc(100vh - 128px));
  min-height: 560px;
  margin: 0 auto 12px;
  padding: 0 14px 14px;
}
.simple-comic-scene,
.simple-action-panel {
  min-width: 0;
  border: 4px solid var(--simple-line);
  border-radius: 16px;
  background: var(--simple-paper);
  box-shadow: 0 16px 34px rgba(23,50,77,.16);
}
.simple-comic-scene {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}
.simple-comic-scene .comic-svg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}
.def-scene-frame {
  min-height: 0;
  overflow: hidden;
}
.def-scene-frame .comic-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.def-town-map {
  display: grid;
  grid-template-columns: repeat(11, minmax(54px, 1fr));
  gap: 4px;
  padding: 8px;
  background: linear-gradient(90deg, #e8fff5, #fff7cf);
  border-bottom: 4px solid var(--simple-line);
}
.def-map-node {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  justify-items: center;
  gap: 1px;
  border: 2px solid rgba(23,50,77,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.65);
  font-size: .64rem;
  font-weight: 900;
  text-align: center;
}
.def-map-node.is-done {
  background: #e8fff5;
}
.def-map-node.is-current {
  border-color: #17324d;
  background: #fff1f5;
  box-shadow: inset 0 0 0 3px #ffd166;
}
.def-map-icon {
  font-size: 1.1rem;
}
.def-map-label,
.def-map-party {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.def-map-party {
  color: #e44c73;
  font-size: .58rem;
}
.def-hotspots {
  position: absolute;
  inset: 74px 0 0;
  pointer-events: none;
}
.def-hotspot {
  position: absolute;
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  border: 5px solid #17324d;
  border-radius: 50%;
  background: rgba(255, 209, 102, .34);
  box-shadow: 0 0 0 8px rgba(255,209,102,.22), 0 10px 22px rgba(23,50,77,.18);
  pointer-events: auto;
}
.def-hotspot::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #ffd166;
  animation: replayPulse 1.4s ease-out infinite;
}
.def-drag-game {
  display: grid;
  gap: 12px;
  min-height: 0;
}
.def-drag-tray,
.def-drop-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}
.def-draggable,
.def-drop-zone,
.def-placed-chip {
  border: 4px solid var(--simple-line);
  border-radius: 14px;
  font-weight: 950;
}
.def-draggable {
  min-height: 58px;
  background: #fff7cf;
  box-shadow: 0 7px 0 rgba(23,50,77,.12);
}
.def-draggable.is-selected {
  background: #ffe1ea;
  box-shadow: inset 0 0 0 4px #ffd166;
}
.def-drop-zone {
  display: grid;
  min-height: 110px;
  align-content: center;
  gap: 8px;
  padding: 12px;
  background: #e8fff5;
}
.def-placed-chip {
  display: inline-grid;
  min-height: 34px;
  align-items: center;
  padding: 4px 8px;
  background: #fff;
  font-size: .82rem;
}
.def-sequence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}
.simple-action-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 12px;
  padding: clamp(12px, 2vw, 22px);
  overflow: hidden;
}
.simple-bubble {
  position: relative;
  padding: 14px 16px 16px;
  border: 4px solid var(--simple-line);
  border-radius: 18px 18px 18px 6px;
  background: #fffdf8;
}
.simple-bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -20px;
  width: 28px;
  height: 28px;
  background: #fffdf8;
  border-left: 4px solid var(--simple-line);
  border-bottom: 4px solid var(--simple-line);
  transform: rotate(-18deg);
}
.simple-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin: 0 0 4px;
}
.simple-speaker {
  min-width: 0;
  margin: 0;
  color: #93642e;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
}
.simple-speaker-button {
  position: relative;
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  border: 4px solid var(--simple-line);
  border-radius: 50%;
  background: #fff7cf;
  color: var(--simple-ink);
  box-shadow: 0 5px 0 rgba(23,50,77,.13);
}
.simple-speaker-button:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 rgba(23,50,77,.13);
}
.simple-speaker-button .speaker-glyph {
  font-size: 1.2rem;
  line-height: 1;
}
.simple-speaker-button .speaker-wave {
  position: absolute;
  inset: -7px;
  border: 3px solid rgba(255,143,163,.55);
  border-radius: 50%;
  opacity: 0;
}
.simple-speaker-button[data-state="loading"] {
  background: #eaf8ff;
}
.simple-speaker-button[data-state="playing"] {
  background: #ffe1ea;
}
.simple-speaker-button[data-state="playing"] .speaker-wave {
  animation: replayPulse 1s ease-out infinite;
}
.simple-speaker-button[data-state="error"] {
  background: #fff1f1;
}
@keyframes replayPulse {
  0% { transform: scale(.82); opacity: .65; }
  100% { transform: scale(1.18); opacity: 0; }
}
.simple-line {
  margin: 0 0 6px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 850;
  line-height: 1.22;
}
.simple-bubble h2 {
  margin: 0;
  color: #e44c73;
  font-size: clamp(1.35rem, 3.4vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}
.simple-main-button,
.simple-soft-button,
.simple-picture-choice,
.simple-text-choice,
.simple-hint-chip {
  border: 4px solid var(--simple-line);
  border-radius: 14px;
  color: var(--simple-ink);
  font-weight: 950;
  box-shadow: 0 8px 0 rgba(23,50,77,.14);
}
.simple-main-button {
  display: grid;
  min-height: 68px;
  padding: 14px 20px;
  place-items: center;
  background: #ffd166;
  font-size: clamp(1.12rem, 2.4vw, 1.45rem);
  text-decoration: none;
}
.simple-main-button.mic-circle {
  width: min(220px, 50vw);
  min-height: min(220px, 50vw);
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, #fff6c8, #ffd166 62%, #f4a650);
  font-size: clamp(1.12rem, 2.6vw, 1.48rem);
}
.simple-soft-button {
  min-height: 58px;
  padding: 10px 16px;
  background: #fffdf8;
  font-size: clamp(1rem, 2vw, 1.18rem);
}
.simple-two-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
}
.simple-mic {
  --voice-level: .12;
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 0;
}
.simple-mic-status {
  margin: 0;
  text-align: center;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 950;
}
.simple-wave {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 10px;
  width: min(260px, 70%);
  height: 86px;
  margin: 0 auto;
}
.simple-wave span {
  display: block;
  min-height: 18px;
  height: calc(22px + var(--voice-level) * 72px);
  border-radius: 999px;
  background: linear-gradient(#ff8fa3, #ffd166);
  border: 3px solid var(--simple-line);
  animation: simpleWave .44s ease-in-out infinite alternate;
}
.simple-wave span:nth-child(2) { animation-delay: .08s; }
.simple-wave span:nth-child(3) { animation-delay: .16s; }
.simple-wave span:nth-child(4) { animation-delay: .24s; }
@keyframes simpleWave {
  from { transform: scaleY(.72); }
  to { transform: scaleY(1.08); }
}
.character-breath {
  transform-origin: 50% 80%;
  animation: characterBreath 4.8s ease-in-out infinite;
}
.talk-mouth {
  transform-origin: center;
  animation: softTalk 2.2s ease-in-out infinite;
}
@keyframes characterBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes softTalk {
  0%, 65%, 100% { transform: scaleY(1); }
  35% { transform: scaleY(1.18); }
}
.simple-heard,
.simple-reply,
.simple-feedback {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8fff5;
  border: 3px solid rgba(47,180,124,.35);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 900;
  line-height: 1.25;
}
.simple-reply {
  background: #fff1f5;
  border-color: rgba(255,143,163,.5);
}
.simple-hints {
  padding: 10px;
  border-radius: 12px;
  background: #f4fbff;
  border: 3px solid rgba(23,50,77,.16);
}
.simple-hints p {
  margin: 0 0 8px;
  font-weight: 900;
}
.simple-hint-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 8px;
}
.simple-hint-chip {
  min-height: 48px;
  background: #fff;
  padding: 8px;
}
.simple-type-fallback {
  display: grid;
  gap: 10px;
}
.simple-type-input {
  width: 100%;
  min-height: 56px;
  border: 4px solid rgba(23,50,77,.24);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1.14rem;
  font-weight: 800;
}
.simple-picture-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}
.simple-picture-choice {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  background: #fff;
}
.simple-picture-choice:active,
.simple-text-choice:active,
.simple-main-button:active,
.simple-soft-button:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 rgba(23,50,77,.14);
}
.choice-comic {
  display: block;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #f8fcff;
}
.choice-comic svg {
  width: 100%;
  height: 100%;
  display: block;
}
.simple-picture-choice strong {
  display: block;
  font-size: clamp(.95rem, 1.8vw, 1.18rem);
  line-height: 1.05;
}
.simple-text-choices {
  display: grid;
  gap: 10px;
}
.simple-text-choice {
  min-height: 70px;
  padding: 12px;
  background: #fff;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.15;
}
.simple-success {
  display: grid;
  gap: 16px;
  align-self: center;
  padding: 18px;
  border: 4px solid #ffd166;
  border-radius: 16px;
  background: #fff7cf;
  text-align: center;
}
.simple-success p {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-weight: 950;
}
.simple-reading-count {
  justify-self: center;
  min-width: 76px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #17324d;
  color: #fff;
  text-align: center;
  font-weight: 950;
}
@media (prefers-reduced-motion: reduce) {
  .simple-progress-track span,
  .simple-wave span,
  .simple-speaker-button .speaker-wave,
  .character-breath,
  .talk-mouth {
    animation: none;
    transition: none;
  }
}
@media (max-width: 1024px) {
  .simple-stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.05fr) auto;
    height: calc(100vh - 122px);
    min-height: 640px;
  }
  .simple-action-panel {
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .simple-comic-scene {
    min-height: 330px;
  }
  .simple-picture-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .def-town-map {
    grid-template-columns: repeat(6, minmax(48px, 1fr));
  }
  .simple-picture-choice {
    min-height: 132px;
  }
}
@media (max-width: 760px) {
  .day1-simple-child-ui .day-topbar {
    min-height: 50px;
  }
  .simple-progress {
    padding: 6px 10px;
  }
  .simple-stage {
    height: auto;
    min-height: calc(100vh - 110px);
    padding: 0 8px 10px;
    gap: 8px;
  }
  .simple-comic-scene {
    min-height: 310px;
  }
  .simple-action-panel {
    padding: 10px;
  }
  .simple-bubble {
    padding: 10px 12px 12px;
  }
  .simple-speaker-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .simple-picture-choices {
    grid-template-columns: 1fr;
  }
  .def-town-map {
    grid-template-columns: repeat(4, minmax(48px, 1fr));
    padding: 5px;
  }
  .def-map-node {
    min-height: 44px;
    font-size: .56rem;
  }
  .def-hotspots {
    inset: 120px 0 0;
  }
  .def-hotspot {
    width: 58px;
    min-width: 58px;
    height: 58px;
    min-height: 58px;
  }
  .def-sequence-grid {
    grid-template-columns: 1fr;
  }
  .simple-picture-choice {
    grid-template-columns: 120px 1fr;
    grid-template-rows: 112px;
    align-items: center;
    text-align: left;
  }
  .simple-main-button.mic-circle {
    width: 164px;
    min-height: 164px;
  }
}

/* Parent-only audio diagnostics. */
.audio-debug-page input,
.audio-debug-page select {
  width: 100%;
  min-height: 42px;
}
.debug-list {
  display: grid;
  grid-template-columns: minmax(130px, .52fr) 1fr;
  gap: 8px 12px;
}
.debug-list dt {
  font-weight: 900;
}
.debug-meter {
  height: 24px;
  overflow: hidden;
  border: 2px solid rgba(7,59,76,.2);
  border-radius: 999px;
  background: #dce9f1;
}
.debug-meter > div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54d17a, #ffd166, #ff8fa3);
  transition: width .08s linear;
}
.debug-output {
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #102133;
  color: #eaffff;
  white-space: pre-wrap;
}
.debug-events {
  max-height: 220px;
  overflow: auto;
  padding-left: 1.1em;
}

/* Day 1 raster story mode */
.day1-raster-mode .lesson-root {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 14px 22px;
}
.day1-raster-shell {
  position: relative;
  min-height: min(760px, calc(100vh - 92px));
  color: #17324d;
}
.adventure-town-map {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
  margin: 0 0 8px;
}
.town-map-node {
  min-height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(23, 50, 77, .18);
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2px 4px;
}
.town-map-node.done { background: #d7f7dc; border-color: #3fbf7f; }
.town-map-node.active {
  background: #fff3b0;
  border-color: #f5b942;
  box-shadow: 0 0 0 4px rgba(245, 185, 66, .18);
}
.mode-label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: #17324d;
  color: #fffdf8;
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 6px 0 rgba(23, 50, 77, .14);
}
.art-stage {
  position: relative;
  overflow: hidden;
  min-height: min(650px, calc(100vh - 258px));
  border: 4px solid #17324d;
  border-radius: 18px;
  background: #b9ecff;
  box-shadow: 0 14px 30px rgba(23, 50, 77, .18);
}
.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.scene-effects {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.scene-effects-sakura_path::before,
.scene-effects-world_star::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255, 143, 163, .85) 0 4px, transparent 5px),
    radial-gradient(circle at 78% 18%, rgba(255, 209, 220, .9) 0 5px, transparent 6px),
    radial-gradient(circle at 55% 35%, rgba(255, 255, 255, .85) 0 3px, transparent 4px);
  background-size: 240px 180px;
  animation: petalDrift 11s linear infinite;
}
.scene-effects-world_star::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  font-size: clamp(78px, 12vw, 144px);
  color: #ffd166;
  text-shadow: 0 0 28px #fffdf8, 0 0 54px #ffd166;
  animation: starPulse 1.8s ease-in-out infinite;
}
.scene-character,
.scene-animal {
  position: absolute;
  z-index: 8;
  object-fit: contain;
  filter: drop-shadow(0 12px 0 rgba(23, 50, 77, .16));
  pointer-events: none;
}
.scene-character.character-left { left: 5%; bottom: 2%; height: 48%; }
.scene-character.character-center { left: 33%; bottom: 2%; height: 46%; }
.scene-character.character-right { right: 5%; bottom: 2%; height: 48%; }
.scene-character.character-top { left: 46%; top: 4%; height: 26%; }
.scene-character.character-top-small { left: 48%; top: 7%; height: 20%; }
.scene-character.character-right-small { right: 8%; bottom: 8%; height: 28%; }
.scene-animal.animal-right { right: 8%; bottom: 5%; height: 34%; }
.scene-animal.animal-right-small { right: 10%; bottom: 8%; height: 23%; }
.scene-animal.animal-top-small { right: 24%; top: 10%; height: 17%; }
.scene-animal.animal-front-small { left: 58%; bottom: 0; height: 18%; }
.mode-card {
  position: absolute;
  z-index: 13;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 28px));
  background: rgba(255, 253, 248, .94);
  border: 4px solid #17324d;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 0 rgba(23, 50, 77, .18);
}
.story-page,
.mission-card,
.question-card,
.action-card,
.result-card {
  display: grid;
  gap: 12px;
}
.mission-card {
  text-align: center;
  align-content: center;
  min-height: 170px;
}
.mission-symbol {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  background: #ffd166;
  border: 4px solid #17324d;
  font-size: 42px;
}
.question-card h2,
.mission-card h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}
.speech-bubble {
  position: relative;
  background: #fffdf8;
  border: 4px solid #17324d;
  border-radius: 18px;
  padding: 12px 70px 12px 16px;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 52px;
  width: 34px;
  height: 34px;
  background: #fffdf8;
  border-right: 4px solid #17324d;
  border-bottom: 4px solid #17324d;
  transform: rotate(45deg);
}
.speech-bubble p {
  margin: 4px 0;
  font-size: clamp(18px, 2.6vw, 26px);
  line-height: 1.22;
}
.question-speaker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}
.simple-speaker-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 3px solid #17324d;
  background: #fff3b0;
  display: inline-grid;
  place-items: center;
  font-size: 23px;
  cursor: pointer;
}
.simple-speaker-button.is-playing {
  animation: replayPulse .9s ease-in-out infinite;
  background: #d7f7dc;
}
.simple-speaker-button.has-error { background: #ffd1dc; }
.main-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.primary-action,
.secondary-action,
.hint-button,
.drop-zone {
  min-height: 52px;
  border-radius: 999px;
  border: 3px solid #17324d;
  background: #ff8fa3;
  color: #17324d;
  font-weight: 950;
  font-size: 18px;
  padding: 10px 22px;
  cursor: pointer;
  text-decoration: none;
}
.secondary-action,
.hint-button { background: #fffdf8; }
.one-line-instruction {
  margin: 0;
  text-align: center;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
}
.picture-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.picture-choice-card {
  border: 4px solid #17324d;
  border-radius: 14px;
  background: #fffdf8;
  padding: 8px;
  min-height: 168px;
  font-size: 18px;
  font-weight: 950;
  cursor: pointer;
}
.picture-choice-card img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(23, 50, 77, .14);
}
.kid-mic-panel {
  display: grid;
  gap: 10px;
  place-items: center;
}
.big-mic-button {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 5px solid #17324d;
  background: #9ce3fb;
  font-size: 52px;
  cursor: pointer;
  box-shadow: 0 10px 0 rgba(23, 50, 77, .18);
}
.kid-mic-panel[data-mic-state="listening"] .big-mic-button {
  animation: replayPulse 1s ease-in-out infinite;
  background: #d7f7dc;
}
.mic-simple-state {
  font-size: 24px;
  font-weight: 950;
}
.mic-button-label {
  font-size: 18px;
  font-weight: 950;
  color: #17324d;
  cursor: pointer;
}
.mic-permission-help {
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 3px solid #c2571f;
  border-radius: 14px;
  background: #fff3e6;
  font-size: 15px;
  font-weight: 800;
  color: #17324d;
}
.mic-permission-help.hidden { display: none; }
.kid-mic-panel[data-mic-state="denied"] .big-mic-button { background: #ffd9d9; }
.voice-meter {
  height: 42px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.voice-meter span {
  width: 12px;
  height: 34px;
  transform-origin: center bottom;
  border-radius: 999px;
  background: #17324d;
  transform: scaleY(.16);
  transition: transform .08s linear;
}
.heard-output {
  margin: 0;
  min-height: 30px;
  font-size: 19px;
  font-weight: 800;
}
.typed-fallback.hidden { display: none; }
.typed-fallback {
  display: flex;
  gap: 8px;
  width: min(420px, 100%);
}
.typed-answer,
.friend-name-input,
.reflection-input,
.reflection-select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 3px solid #17324d;
  padding: 8px 12px;
  font-size: 18px;
}
.scene-hotspot {
  position: absolute;
  left: 58%;
  top: 40%;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 4px solid #17324d;
  background: rgba(255, 209, 102, .92);
  font-size: 44px;
  cursor: pointer;
  animation: starPulse 1.4s ease-in-out infinite;
}
.drag-tray,
.sequence-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.drag-token,
.sequence-card {
  min-height: 72px;
  min-width: 92px;
  border: 3px solid #17324d;
  border-radius: 14px;
  background: #fff3b0;
  font-weight: 950;
  cursor: pointer;
}
.drop-zone {
  display: block;
  margin: 0 auto;
  background: #d7f7dc;
}
.result-card { text-align: center; }
.result-visual {
  height: 82px;
  position: relative;
}
.sparkle {
  position: absolute;
  font-size: 36px;
  color: #ffd166;
  animation: starPulse 1.2s ease-in-out infinite;
}
.sparkle-one { left: 28%; top: 12px; }
.sparkle-two { left: 50%; top: 0; }
.sparkle-three { right: 28%; top: 18px; }
.heard-line,
.world-change-line {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}
.friend-naming {
  position: absolute;
  z-index: 13;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-height: calc(100% - 24px);
  overflow-y: auto;
}
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.friend-candidate {
  min-height: 48px;
  border-radius: 999px;
  border: 3px solid #17324d;
  background: #fff3b0;
  font-weight: 950;
}
.friend-name-label,
.reflection-action label {
  display: grid;
  gap: 5px;
  font-weight: 900;
}
.art-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.art-preview-card {
  margin: 0;
  border: 1px solid rgba(23, 50, 77, .18);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.art-preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.art-preview-card figcaption {
  padding: 8px;
  font-weight: 900;
}
@keyframes replayPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: .88; }
  50% { transform: scale(1.14); opacity: 1; }
}
@keyframes petalDrift {
  0% { background-position: 0 0, 40px 20px, 80px 50px; }
  100% { background-position: 240px 180px, 280px 200px, 320px 230px; }
}
@media (max-width: 820px) {
  .day1-raster-mode .lesson-root { padding: 6px 8px 14px; }
  .adventure-town-map { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .town-map-node { font-size: 10px; }
  .art-stage { min-height: min(690px, calc(100vh - 246px)); }
  .mode-card {
    width: calc(100% - 18px);
    bottom: 10px;
    padding: 12px;
  }
  .scene-character.character-left,
  .scene-character.character-right,
  .scene-character.character-center { height: 34%; bottom: 34%; }
  .scene-animal.animal-right { bottom: 36%; height: 24%; }
  .scene-animal.animal-right-small { bottom: 37%; }
  .scene-animal.animal-front-small { bottom: 34%; }
  .scene-character.character-right-small { bottom: 38%; height: 22%; }
  .picture-choice-grid { grid-template-columns: 1fr; }
  .picture-choice-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: center;
    min-height: 90px;
  }
  .picture-choice-card img { height: 74px; }
}
.reduce-motion .scene-effects-sakura_path::before,
.reduce-motion .scene-effects-world_star::before,
.reduce-motion .scene-effects-world_star::after,
.reduce-motion .simple-speaker-button.is-playing,
.reduce-motion .kid-mic-panel[data-mic-state="listening"] .big-mic-button,
.reduce-motion .scene-hotspot,
.reduce-motion .sparkle {
  animation: none;
}

/* ---- Day1 v4: simplified child compass nav ---- */
.adventure-compass {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  min-height: 44px;
}
.compass-node {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 16px;
  border-radius: 999px;
  border: 3px solid rgba(23, 50, 77, .2);
  background: rgba(255, 255, 255, .8);
  font-size: 18px;
  font-weight: 900;
}
.compass-node.now {
  background: #fff3b0;
  border-color: #f5b942;
  box-shadow: 0 0 0 4px rgba(245, 185, 66, .16);
}
.compass-node.next { opacity: .75; }
.compass-arrow { font-size: 16px; color: #17324d; opacity: .6; }
.compass-map-button {
  margin-left: auto;
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 3px solid #17324d;
  background: #fffdf8;
  font-size: 24px;
  cursor: pointer;
}
.trail-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(23, 50, 77, .4);
  display: grid;
  place-items: center;
}
.trail-overlay-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(560px, calc(100% - 40px));
  background: #fffdf8;
  border: 4px solid #17324d;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(23, 50, 77, .3);
}
.trail-overlay-card .town-map-node { min-height: 48px; font-size: 14px; }
.friend-naming-hint {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #47639c;
}

/* ---- parent art comparison ---- */
.art-compare-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.art-compare-row h3 { margin: 14px 0 6px; }
.art-compare-row h3 small { font-weight: 500; color: #5a6a86; margin-left: 8px; }
.art-preview-card.is-legacy { outline: 3px solid #d95f4e; }
.art-preview-card.is-new { outline: 3px solid #3fbf7f; }
.art-missing {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  color: #5a6a86;
  background: #f2ecdf;
}

/* ---- Day1 v5: background-first layout (bottom panel, staged hints) ---- */
.day1-raster-mode .art-stage {
  min-height: min(780px, calc(100vh - 150px));
}
.stage-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity .4s;
}
.stage-top > * { pointer-events: auto; }
.stage-top .mode-label {
  margin: 0;
  min-height: 36px;
  padding: 4px 14px;
  font-size: clamp(14px, 1.9vw, 20px);
  box-shadow: 0 3px 0 rgba(23, 50, 77, .18);
  background: rgba(23, 50, 77, .92);
}
.stage-top .adventure-compass {
  margin: 0;
  flex: 1;
  min-height: 36px;
}
.stage-top .compass-node {
  min-height: 36px;
  padding: 2px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, .88);
}
.stage-top .compass-map-button {
  width: 44px;
  height: 44px;
  font-size: 18px;
  background: rgba(255, 253, 248, .92);
}
.look-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 3px solid #17324d;
  background: rgba(255, 253, 248, .92);
  font-size: 20px;
  cursor: pointer;
}
.look-mode .look-button { background: #ffd166; }
.look-mode .bottom-panel,
.look-mode .stage-top .mode-label,
.look-mode .stage-top .adventure-compass,
.look-mode .hint-spotlight-layer,
.look-mode .friend-naming {
  opacity: 0;
  pointer-events: none;
}
.bottom-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 13;
  display: flex;
  flex-direction: column;
  max-height: 30%;
  background: rgba(255, 253, 248, .87);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 3px solid #17324d;
  border-radius: 18px 18px 0 0;
  transition: max-height .25s ease, opacity .4s;
}
.mode-your-turn- .bottom-panel { max-height: 46%; }
.panel-handle {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 24px;
  border-radius: 12px 12px 0 0;
  border: 3px solid #17324d;
  border-bottom: none;
  background: rgba(255, 253, 248, .92);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.bottom-panel .panel-body {
  overflow-y: auto;
  padding: 10px 16px 12px;
}
.bottom-panel.collapsed { max-height: 22px; }
.bottom-panel.collapsed .panel-body { display: none; }
.panel-block { display: grid; gap: 8px; }
.panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-row h2 {
  margin: 0;
  flex: 1;
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.2;
}
.panel-row .mission-symbol {
  width: 44px;
  height: 44px;
  min-width: 44px;
  font-size: 24px;
  margin: 0;
}
.panel-row .one-line-instruction { flex: 1; text-align: left; font-size: clamp(17px, 2.2vw, 24px); }
.question-card .question-speaker { font-size: 15px; font-weight: 900; color: #47639c; }
.bottom-panel .speech-bubble {
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bottom-panel .speech-bubble::after { display: none; }
.bottom-panel .speech-bubble p {
  flex: 1;
  margin: 0;
  font-size: clamp(16px, 2.2vw, 23px);
  line-height: 1.25;
}
.bottom-panel .main-actions { justify-content: center; gap: 10px; }
.bottom-panel .primary-action,
.bottom-panel .secondary-action { min-height: 46px; font-size: 17px; padding: 8px 20px; }
.bottom-panel .kid-mic-panel { gap: 6px; }
.bottom-panel .big-mic-button {
  width: 76px;
  height: 76px;
  font-size: 30px;
}
.bottom-panel .voice-meter span { height: 22px; }
.bottom-panel .heard-output { min-height: 22px; font-size: 16px; }
.bottom-panel .picture-choice-card { min-height: 0; padding: 6px; font-size: 15px; }
.bottom-panel .picture-choice-card img { height: 76px; }
.bottom-panel .drag-token, .bottom-panel .sequence-card { min-height: 56px; min-width: 76px; }
.ja-hint-collapsed {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #47639c;
}
.ja-hint-collapsed.hidden { display: none; }

/* staged hint system */
.support-row {
  border-top: 2px dashed rgba(23, 50, 77, .18);
  padding-top: 6px;
  display: grid;
  gap: 6px;
}
.support-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.staged-hint-button, .ja-hint-button {
  min-height: 44px;
  font-size: 15px;
  padding: 6px 14px;
}
.hint-dots { display: inline-flex; gap: 4px; }
.hint-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(23, 50, 77, .12);
  border: 2px solid rgba(23, 50, 77, .28);
}
.hint-dot.used { background: #ffd166; border-color: #f2b83c; }
.skip-link {
  margin-left: auto;
  min-height: 44px;
  background: none;
  border: none;
  color: #47639c;
  font-size: 14px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.hint-output {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #47639c;
}
.hint-word-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.hint-word-card {
  min-height: 44px;
  border-radius: 12px;
  border: 3px solid #17324d;
  background: #fff3b0;
  font-weight: 900;
  font-size: 16px;
  padding: 6px 14px;
  cursor: pointer;
}
.hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  border-radius: 999px;
  border: 3px solid #17324d;
  background: #d7f7dc;
  font-weight: 900;
  font-size: 16px;
  padding: 6px 16px;
  cursor: pointer;
  justify-self: start;
}
.hint-chip.hint-model { background: #ffd7e2; }
.together-button { justify-self: center; }
.hint-spotlight-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  transition: opacity .4s;
}
.hint-spotlight {
  position: absolute;
  width: 170px;
  height: 170px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 243, 176, .8) 0%, rgba(255, 209, 102, .38) 45%, transparent 70%);
  animation: hotspotPulse 1.6s ease-in-out infinite;
}
.hint-look-guide .scene-characters img[data-character="Lumo"] {
  animation: replayPulse 1.6s ease-in-out infinite;
}
.hint-hidden { visibility: hidden; }

/* the tap target sits on the world itself */
.art-stage > .scene-hotspot {
  position: absolute;
  z-index: 9;
  transform: translate(-50%, -50%);
}

/* RESULT: world first, UI joins after a moment */
.result-quiet .bottom-panel,
.result-quiet .stage-top {
  opacity: 0;
  pointer-events: none;
}

/* retry offer for "do it later" missions */
.retry-list { display: grid; gap: 8px; }
.retry-mission-button {
  min-height: 48px;
  border-radius: 12px;
  border: 3px solid #17324d;
  background: #fff3b0;
  font-weight: 900;
  font-size: 16px;
  text-align: left;
  padding: 8px 14px;
  cursor: pointer;
}

/* keep YOUR TURN panel compact so hints stay in reach */
.bottom-panel .kid-mic-panel { grid-template-columns: auto 1fr; align-items: center; justify-items: start; text-align: left; }
.bottom-panel .big-mic-button { width: 64px; height: 64px; font-size: 26px; grid-row: 1 / span 2; }
.bottom-panel .mic-simple-state { font-size: 15px; font-weight: 900; }
.bottom-panel .voice-meter { display: inline-flex; gap: 4px; }
.bottom-panel .voice-meter span { height: 16px; width: 9px; }
.bottom-panel .heard-output { grid-column: 1 / -1; min-height: 0; }
.bottom-panel .typed-fallback { grid-column: 1 / -1; }
.bottom-panel .panel-block .one-line-instruction { margin: 0; }
.hint-focus-strong .hint-spotlight {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 243, 176, .92) 0%, rgba(255, 209, 102, .5) 45%, transparent 72%);
}

/* find-missions start subtle: the child has to look for the twinkle */
.scene-hotspot-subtle {
  background: rgba(255, 243, 176, .34);
  border-color: rgba(23, 50, 77, .25);
  color: rgba(255, 253, 248, .85);
  font-size: 30px;
  animation: subtleTwinkle 2.6s ease-in-out infinite;
}
.scene-hotspot-subtle.hint-revealed {
  background: rgba(255, 209, 102, .92);
  border-color: #17324d;
  color: #fffdf8;
  font-size: 44px;
  animation: starPulse 1.4s ease-in-out infinite;
}
@keyframes subtleTwinkle {
  0%, 100% { opacity: .45; transform: translate(-50%, -50%) scale(0.94); }
  50% { opacity: .85; transform: translate(-50%, -50%) scale(1.02); }
}
/* the collapsed panel is a full-width 44px reopen target */
.bottom-panel.collapsed { max-height: 44px; min-height: 44px; cursor: pointer; }
.panel-handle { top: -24px; width: 96px; height: 30px; }
@keyframes hotspotPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .92; }
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}
.scene-hotspot-subtle.hint-revealed { animation: hotspotPulse 1.4s ease-in-out infinite; }

/* 30-day map extras */
.node-skipped {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff3b0;
  border: 2px solid #f2b83c;
  font-size: 11px;
  font-weight: 900;
  color: #17324d;
}
.node-review-link {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  color: #47639c;
  text-decoration: none;
  margin-top: 2px;
}

/* ---- Listening-first flow ---- */
.question-subtitle {
  margin: 0;
  flex: 1;
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.2;
  transition: opacity .6s, filter .6s;
}
.question-subtitle.subtitle-pending { opacity: 0; filter: blur(6px); }
.listening-hint-line {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #47639c;
  opacity: .85;
}
.question-recall {
  display: grid;
  gap: 4px;
  border-bottom: 2px dashed rgba(23, 50, 77, .16);
  padding-bottom: 6px;
}
.question-recall-text {
  flex: 1;
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 900;
  line-height: 1.2;
}
.instruction-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.instruction-line strong { font-size: clamp(15px, 1.9vw, 20px); }
.instruction-line .instruction-ja { font-size: 13px; font-weight: 800; color: #47639c; }
.audio-history-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: 2.5px solid rgba(23, 50, 77, .4);
  background: #fffdf8;
  font-size: 16px;
  cursor: pointer;
}
.audio-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(23, 50, 77, .35);
  display: grid;
  place-items: center;
}
.audio-history-card { display: grid; gap: 8px; grid-template-columns: 1fr; }

/* action controls stay visible but wait for the instruction audio */
.awaiting-audio .kid-mic-panel,
.awaiting-audio .picture-choice-grid,
.awaiting-audio .drag-tray,
.awaiting-audio .drop-zone,
.awaiting-audio .sequence-row,
.awaiting-audio .sorting-buckets {
  pointer-events: none;
  opacity: .55;
  transition: opacity .3s;
}

/* clear correct / incorrect feedback (never color-only) */
.result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 4px 0;
}
.result-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 30px;
  font-weight: 950;
  border: 4px solid #17324d;
}
.result-banner.ok .result-mark { background: #d7f7dc; color: #1f7a4d; }
.result-banner.retry .result-mark { background: #fff3b0; color: #8a6210; }
.result-banner-words { display: grid; line-height: 1.1; }
.result-banner-words strong { font-size: clamp(22px, 3vw, 32px); letter-spacing: .5px; }
.result-banner-words span { font-size: 14px; font-weight: 900; color: #47639c; }
.choice-shake { animation: choiceShake .5s ease-in-out; }
.choice-shake::after { content: '↻'; position: absolute; font-size: 28px; font-weight: 950; color: #8a6210; }
.picture-choice-card { position: relative; }
.choice-correct { outline: 5px solid #3fbf7f; }
.choice-correct::after { content: '✓'; position: absolute; top: 4px; right: 8px; font-size: 30px; font-weight: 950; color: #1f7a4d; }
@keyframes choiceShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* tangible tap target: a real marker, not a faint dot */
.scene-hotspot-marker {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid rgba(23, 50, 77, .75);
  background: radial-gradient(circle at 42% 36%, rgba(255,253,248,.95), rgba(255,209,102,.9));
  box-shadow: 0 6px 14px rgba(23, 50, 77, .3);
  cursor: pointer;
  animation: markerBob 2.2s ease-in-out infinite;
}
.scene-hotspot-marker .marker-star { font-size: 34px; color: #e8933c; text-shadow: 0 2px 0 #fffdf8; }
.timeout-cue-soft .scene-hotspot-marker { animation: markerBob 1.1s ease-in-out infinite; box-shadow: 0 0 0 8px rgba(255, 209, 102, .35), 0 6px 14px rgba(23,50,77,.3); }
.timeout-cue-strong .scene-hotspot-marker { box-shadow: 0 0 0 14px rgba(255, 209, 102, .5), 0 6px 18px rgba(23,50,77,.35); }
@keyframes markerBob {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.06); }
}
.scene-hotspot-marker.hint-revealed {
  box-shadow: 0 0 0 12px rgba(255, 209, 102, .5), 0 6px 18px rgba(23, 50, 77, .35);
  animation: hotspotPulse 1.2s ease-in-out infinite;
}
/* RESULT panels need room for banner + reply + next button */
.mode-great-job- .bottom-panel,
.mode-let-s-try-again- .bottom-panel { max-height: 46%; }
.bottom-panel .result-visual { height: 44px; }
.bottom-panel .result-card { gap: 6px; }

/* ---- Math Adventure ---- */
.adventure-chooser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.adventure-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 18px 14px;
  border: 4px solid #17324d;
  border-radius: 20px;
  text-decoration: none;
  color: #17324d;
  box-shadow: 0 8px 0 rgba(23, 50, 77, .16);
  min-height: 44px;
}
.adventure-card.english { background: linear-gradient(160deg, #bfe3f0, #d7f7dc); }
.adventure-card.math { background: linear-gradient(160deg, #fff3b0, #ffd7e2); }
.adventure-card-icon { font-size: 40px; }
.adventure-card-title { font-size: 22px; font-weight: 950; }
.adventure-card-sub { font-size: 14px; font-weight: 800; color: #47639c; }

.math-groups-layer {
  position: absolute;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 86%;
}
.math-group {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 4px;
  align-content: center;
  justify-items: center;
  padding: 10px 12px;
  background: rgba(255, 253, 248, .92);
  border: 4px solid #17324d;
  border-radius: 18px;
  box-shadow: 0 6px 0 rgba(23, 50, 77, .18);
  min-width: 44px;
  min-height: 44px;
}
.math-obj { font-size: 30px; line-height: 1.1; }
.math-obj.small { font-size: 16px; }
.math-group.mini { padding: 4px 6px; border-width: 2.5px; gap: 2px; box-shadow: none; }
.math-group-tappable { cursor: pointer; }
.math-group-tappable:active { transform: scale(.96); }
.math-group.group-found { outline: 5px solid #3fbf7f; opacity: .82; }
.math-group.group-found::after { content: '✓'; position: absolute; font-size: 26px; font-weight: 950; color: #1f7a4d; }
.math-group-hint { animation: replayPulse 1.2s ease-in-out infinite; box-shadow: 0 0 0 8px rgba(255, 209, 102, .45); }
.math-groups-layer button { position: relative; }

.math-number-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.math-number-tile {
  min-width: 76px;
  min-height: 60px;
  border-radius: 16px;
  border: 4px solid #17324d;
  background: #fff3b0;
  font-size: 32px;
  font-weight: 950;
  cursor: pointer;
  position: relative;
}
.math-equation-display {
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 950;
  letter-spacing: 2px;
}
.math-equation-grid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.math-equation-card {
  min-width: 120px;
  min-height: 60px;
  border-radius: 16px;
  border: 4px solid #17324d;
  background: #d7f7dc;
  font-size: 26px;
  font-weight: 950;
  cursor: pointer;
  position: relative;
}
.math-picture-grid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.math-picture-card {
  border: 4px solid #17324d;
  border-radius: 16px;
  background: #fffdf8;
  padding: 8px;
  cursor: pointer;
  position: relative;
  min-height: 44px;
}
.math-mini-picture { display: flex; gap: 6px; flex-wrap: wrap; max-width: 240px; justify-content: center; }
.math-progress-line { margin: 0; text-align: center; font-size: 24px; font-weight: 950; }
.math-action { text-align: center; }

/* ---- Math home & drill ---- */
.math-home, .drill-home { display: grid; gap: 16px; align-content: start; }
.today-drill-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 4px solid #17324d;
  border-radius: 20px;
  background: linear-gradient(160deg, #fff3b0, #ffe9a8);
  box-shadow: 0 8px 0 rgba(23, 50, 77, .16);
}
.today-drill-card.done { background: linear-gradient(160deg, #d7f7dc, #c2eecb); }
.today-drill-head { display: flex; align-items: center; gap: 12px; }
.today-drill-icon { font-size: 40px; }
.today-drill-head h2 { margin: 0; font-size: 22px; font-weight: 950; color: #17324d; }
.today-drill-ja { font-size: 14px; font-weight: 900; color: #47639c; margin-left: 6px; }
.today-drill-head p { margin: 2px 0 0; font-size: 15px; font-weight: 800; color: #17324d; }
.today-drill-card .primary-action { justify-self: center; min-width: 220px; text-align: center; }
.math-chooser .adventure-card-emoji { font-size: 40px; }
.math-chooser .adventure-card h2 { margin: 0; font-size: 22px; font-weight: 950; }
.math-chooser .adventure-card-en { margin: 0; font-size: 14px; font-weight: 800; color: #47639c; }
.math-chooser .adventure-card-ja { margin: 0; font-size: 14px; font-weight: 800; color: #17324d; text-align: center; }
.drill-resume-note { text-align: center; font-size: 15px; font-weight: 900; color: #17324d; }
.drill-resume-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px 16px;
  border: 4px dashed #47639c;
  border-radius: 18px;
  background: #eef4ff;
  font-weight: 900;
  color: #17324d;
}
.drill-resume-card p { margin: 0; }
.drill-section-title { margin: 4px 0 0; text-align: center; font-size: 20px; font-weight: 950; color: #17324d; }

/* op picker */
.drill-op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.drill-op-card {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 10px;
  border: 4px solid #17324d;
  border-radius: 18px;
  text-decoration: none;
  color: #17324d;
  box-shadow: 0 7px 0 rgba(23, 50, 77, .16);
  min-height: 44px;
}
.drill-op-card:active { transform: translateY(3px); box-shadow: 0 4px 0 rgba(23, 50, 77, .16); }
.drill-op-card.op-add { background: linear-gradient(160deg, #ffe1e1, #ffd0d8); }
.drill-op-card.op-sub { background: linear-gradient(160deg, #d9ecff, #c8e2ff); }
.drill-op-card.op-mul { background: linear-gradient(160deg, #fff3b0, #ffeaa0); }
.drill-op-card.op-div { background: linear-gradient(160deg, #e8ddff, #dcd0ff); }
.drill-op-card.op-mix { background: linear-gradient(160deg, #d7f7dc, #c5f0e8); }
.drill-op-symbol { font-size: 34px; font-weight: 950; line-height: 1; }
.drill-op-emoji { font-size: 26px; }
.drill-op-en { font-size: 16px; font-weight: 950; }
.drill-op-ja { font-size: 13px; font-weight: 800; color: #47639c; }

/* count picker */
.drill-count-picker { display: grid; gap: 8px; justify-items: center; }
.drill-count-picker h3 { margin: 0; font-size: 16px; font-weight: 950; color: #17324d; }
.drill-count-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.drill-count-btn {
  min-width: 84px;
  min-height: 52px;
  border: 4px solid #17324d;
  border-radius: 16px;
  background: #fffdf8;
  font-size: 16px;
  font-weight: 950;
  color: #17324d;
  cursor: pointer;
}
.drill-count-btn.selected { background: #ffd166; box-shadow: 0 0 0 4px rgba(255, 209, 102, .4); }
.drill-count-btn:disabled { opacity: .35; cursor: default; }

/* play screen */
.drill-op-banner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 8px 14px 0;
  padding: 8px 16px;
  border: 4px solid #17324d;
  border-radius: 18px;
  background: #fffdf8;
}
.drill-op-banner-sym { font-size: 30px; font-weight: 950; }
.drill-op-banner-name { font-size: 22px; font-weight: 950; color: #17324d; }
.drill-op-banner-ja { font-size: 15px; font-weight: 800; color: #47639c; }
.drill-op-banner.op-add { background: linear-gradient(160deg, #ffe1e1, #ffd0d8); }
.drill-op-banner.op-sub { background: linear-gradient(160deg, #d9ecff, #c8e2ff); }
.drill-op-banner.op-mul { background: linear-gradient(160deg, #fff3b0, #ffeaa0); }
.drill-op-banner.op-div { background: linear-gradient(160deg, #e8ddff, #dcd0ff); }
.drill-op-banner.op-mix, .drill-op-banner.op-today { background: linear-gradient(160deg, #d7f7dc, #c5f0e8); }
.drill-root { display: grid; align-content: start; gap: 10px; padding: 10px 14px 20px; }
.drill-loading { display: grid; gap: 14px; justify-items: center; padding: 40px 0; font-size: 18px; font-weight: 900; color: #17324d; }
.drill-title-ja { font-size: 13px; font-weight: 800; color: #47639c; margin-left: 6px; }
.drill-panel { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; width: 100%; }
.drill-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drill-progress { font-size: 16px; font-weight: 950; color: #47639c; }
.drill-op-badge {
  padding: 4px 12px;
  border: 3px solid #17324d;
  border-radius: 999px;
  background: #fffdf8;
  font-size: 16px;
  font-weight: 950;
}
.drill-streak { font-size: 16px; font-weight: 950; color: #c2571f; }
.drill-streak.hidden { visibility: hidden; }
.drill-question-display {
  text-align: center;
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 950;
  color: #17324d;
  letter-spacing: 2px;
  padding: 14px 10px;
  border: 4px solid #17324d;
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 6px 0 rgba(23, 50, 77, .14);
  transition: opacity .5s ease, filter .5s ease;
}
.drill-question-display.subtitle-pending { opacity: 0; filter: blur(6px); }
.drill-listen-label { margin: 0; text-align: center; font-size: 15px; font-weight: 900; color: #47639c; }
.drill-feedback { min-height: 40px; display: grid; justify-items: center; gap: 8px; }
.drill-banner { padding: 6px 0; }
.drill-banner .result-en { margin: 0; font-size: clamp(20px, 3vw, 28px); font-weight: 950; color: #17324d; letter-spacing: .5px; }
.drill-banner .result-ja { margin: 0; font-size: 14px; font-weight: 900; color: #47639c; }
.result-correct .result-mark { background: #d7f7dc; color: #1f7a4d; }
.result-incorrect .result-mark { background: #fff3b0; color: #8a6210; }
.drill-banner.fade-out { opacity: 0; transition: opacity .6s ease; }
.drill-streak-pop { font-size: 20px; font-weight: 950; color: #c2571f; animation: popin .4s ease; }
.drill-walkthrough { display: grid; gap: 4px; justify-items: center; }
.drill-walkthrough-title { margin: 0; font-size: 17px; font-weight: 950; color: #47639c; }
.drill-walkthrough-eq { margin: 0; font-size: clamp(26px, 5vw, 38px); font-weight: 950; color: #1f7a4d; }

/* input: keypad, choices, mic */
.drill-input-area { display: grid; gap: 8px; justify-items: center; }
.drill-input-area.input-locked { pointer-events: none; opacity: .75; }
.drill-entry {
  min-width: 140px;
  min-height: 54px;
  border: 4px solid #17324d;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  font-size: 34px;
  font-weight: 950;
  color: #17324d;
  line-height: 1.5;
}
.drill-keypad { display: grid; grid-template-columns: repeat(3, minmax(72px, 96px)); gap: 8px; }
.drill-key {
  min-height: 58px;
  border: 4px solid #17324d;
  border-radius: 16px;
  background: #fffdf8;
  font-size: 26px;
  font-weight: 950;
  color: #17324d;
  cursor: pointer;
}
.drill-key:active { transform: translateY(2px); }
.drill-key-ok { background: #3fbf7f; color: #fff; }
.drill-key-del { background: #ffd7e2; }
.drill-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(110px, 150px)); gap: 10px; }
.drill-choice-btn {
  min-height: 64px;
  border: 4px solid #17324d;
  border-radius: 18px;
  background: #fffdf8;
  font-size: 30px;
  font-weight: 950;
  color: #17324d;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(23, 50, 77, .14);
}
.drill-choice-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(23, 50, 77, .14); }
.drill-mic { display: grid; gap: 8px; justify-items: center; }

/* hints */
.drill-support { justify-content: center; }
.drill-hint-area { display: grid; justify-items: center; }
.drill-hint-box {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 3px dashed #47639c;
  border-radius: 16px;
  background: #f4f8ff;
  max-width: 540px;
}
.drill-hint-ja { flex-basis: 100%; margin: 0; text-align: center; font-size: 14px; font-weight: 900; color: #47639c; }
.drill-hint-plus { font-size: 26px; font-weight: 950; color: #17324d; }
.drill-hint-big { margin: 0; font-size: 18px; font-weight: 950; color: #17324d; }
.drill-hint-eq { margin: 0; font-size: 20px; font-weight: 950; color: #1f7a4d; }
.drill-obj-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 320px; }
.drill-obj { font-size: 24px; line-height: 1.15; }
.drill-obj-removed { opacity: .3; filter: grayscale(1); text-decoration: line-through; }
.drill-obj-more { font-size: 16px; font-weight: 950; color: #47639c; align-self: center; }
.drill-hint-groups { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.drill-obj-group {
  padding: 6px 8px;
  border: 3px solid #17324d;
  border-radius: 14px;
  background: #fffdf8;
  max-width: 150px;
}
.drill-columns p { margin: 2px 0; font-size: 16px; font-weight: 900; color: #17324d; }
.drill-table-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.drill-table-cell {
  padding: 4px 8px;
  border: 2.5px solid #47639c;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  color: #17324d;
}
.drill-table-cell.highlight { background: #ffd166; border-color: #17324d; }
.drill-number-line { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; }
.drill-nl-tick {
  min-width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 2.5px solid #47639c;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  color: #17324d;
}
.drill-nl-tick.start { background: #d9ecff; border-color: #17324d; }
.drill-nl-tick.target { background: #d7f7dc; border-color: #1f7a4d; }
.drill-nl-note { flex-basis: 100%; margin: 2px 0 0; text-align: center; font-size: 14px; font-weight: 900; color: #47639c; }
.pulse-cue { animation: replayPulse 1.2s ease-in-out infinite; }

/* result screen */
.drill-result { display: grid; gap: 10px; justify-items: center; padding: 20px 14px; }
.drill-result-score { margin: 0; font-size: clamp(40px, 9vw, 64px); font-weight: 950; color: #17324d; }
.drill-result-title { margin: 0; font-size: 26px; font-weight: 950; color: #1f7a4d; }
.drill-result-star, .drill-result-streak { margin: 0; font-size: 19px; font-weight: 950; color: #c2571f; animation: popin .4s ease; }
.drill-result-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  padding: 5px 12px;
  border: 3px solid #17324d;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 950;
  color: #17324d;
  background: #fffdf8;
}
.chip-independent { background: #d7f7dc; }
.chip-hinted { background: #fff3b0; }
.chip-together { background: #d9ecff; }
.chip-skipped { background: #eee; }
.drill-result-time, .drill-result-note { margin: 0; font-size: 15px; font-weight: 900; color: #47639c; }
.drill-result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* parent drill settings */
.drill-tables-check { display: flex; gap: 8px 14px; flex-wrap: wrap; }
.check-inline { display: flex; flex-direction: row !important; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.check-inline input[type="checkbox"] { width: 20px; height: 20px; }

/* parent test-mode reset tools */
.test-tools-grid { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.test-tools-grid form { margin: 0; }
.test-tools-grid .btn { display: grid; gap: 2px; justify-items: center; min-height: 52px; }
.test-tools-undo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
