/* ============================================================ BloomTracks */
:root {
  --purple: #5b3cc4;
  --purple-2: #7c5cff;
  --purple-soft: #efeaff;
  --ink: #2d2a3e;
  --muted: #6b6785;
  --bg: #fbf9ff;
  --card: #ffffff;
  --line: #e7e1f7;
  --yellow: #ffc93c;
  --coral: #ff6b6b;
  --teal: #2ec4b6;
  --green: #3bb273;
  --blue: #4d96ff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(91, 60, 196, 0.12);
  --shadow-lg: 0 24px 60px rgba(91, 60, 196, 0.18);
  --font-head: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--purple); }
img, svg { max-width: 100%; }
button { font: inherit; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.page { padding-top: 36px; padding-bottom: 60px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.4em;
  border: 0; border-radius: 999px;
  background: var(--purple); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  box-shadow: 0 5px 0 #43299b;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
}
.btn:hover { background: #6a4ad6; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #43299b; }
.btn:focus-visible, .choice:focus-visible, .key:focus-visible, .tab:focus-visible, .island:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-lg { font-size: 1.2rem; padding: .8em 1.7em; }
.btn-sm { font-size: .95rem; padding: .45em 1.1em; box-shadow: 0 3px 0 #43299b; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--purple); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--purple-soft); }
.btn-danger { background: var(--coral); box-shadow: 0 3px 0 #d94848; }
.btn-danger:hover { background: #f25757; }
.btn-coin { background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 #d9a21a; }
.btn-coin:hover { background: #ffd35f; }
.icon-btn {
  width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 50%;
  background: var(--purple-soft); cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { background: #e2d9ff; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; color: var(--purple); }
.brand.light { color: #fff; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { padding: .5em .8em; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; }
.nav-link:hover { background: var(--purple-soft); }
body[data-mode~="kid"] .site-header { display: none; }

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 85% 20%, #ffe9a8 0, transparent 30%),
    radial-gradient(circle at 10% 90%, #d6f5f1 0, transparent 35%),
    linear-gradient(180deg, #f3eeff 0%, var(--bg) 100%);
  padding: 60px 0 80px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.pill { display: inline-block; background: #fff; color: var(--purple); padding: .35em 1em; border-radius: 999px; font-weight: 800; font-size: .9rem; box-shadow: var(--shadow); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); color: var(--ink); }
.hl { color: var(--purple-2); position: relative; white-space: nowrap; }
.hl::after { content: ''; position: absolute; left: 0; right: 0; bottom: .08em; height: .28em; background: var(--yellow); opacity: .55; border-radius: 6px; z-index: -1; }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0; }
.cta-row.center { justify-content: center; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-weight: 700; color: var(--muted); }

.hero-art { position: relative; height: 440px; }
.blob { position: absolute; inset: 30px 20px; background: linear-gradient(135deg, #c9b8ff, #ffd6e8); border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; animation: morph 12s ease-in-out infinite; }
.hero-main { position: absolute; left: 50%; top: 50%; margin: -140px 0 0 -140px; }
.hero-side { position: absolute; }
.hero-side.one { left: 0; bottom: 10px; }
.hero-side.two { right: 0; top: 0; animation-delay: -1.5s; }
.bubble {
  position: absolute; background: #fff; padding: .4em .9em; border-radius: 16px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.b1 { left: 4%; top: 12%; color: var(--purple); }
.b2 { right: 6%; bottom: 22%; color: var(--coral); animation-delay: -1s; }
.b3 { left: 30%; bottom: 0; color: var(--teal); animation-delay: -2s; }
.b4 { right: 26%; top: 2%; color: #d99300; animation-delay: -3s; }

/* ---------------------------------------------------------------- sections */
.section { padding: 80px 0; }
.section.tinted { background: #f4f0ff; }
.section-title { font-size: clamp(1.9rem, 3.5vw, 2.6rem); text-align: center; }
.section-title.left, .section-sub.left { text-align: left; }
.section-sub { text-align: center; color: var(--muted); font-size: 1.1rem; margin-bottom: 40px; }

.subject-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.subject-card { background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); border-top: 8px solid var(--purple-2); }
.subject-card.reading { border-top-color: var(--coral); }
.subject-icon { font-size: 2.6rem; }
.subject-card h3 { font-size: 1.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--purple-soft); padding: .3em .8em; border-radius: 999px; font-weight: 700; font-size: .92rem; }
.reading .chip { background: #ffeaea; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { position: relative; background: #fff; border-radius: var(--radius); padding: 30px 24px 24px; box-shadow: var(--shadow); }
.step-num { position: absolute; top: -14px; left: 24px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); font-family: var(--font-head); font-weight: 800; }
.step-icon { font-size: 2.2rem; margin-bottom: 6px; }
.step h3 { font-size: 1.3rem; }
.step p { color: var(--muted); margin: 0; }

.try-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: center; }
.try-buddy { text-align: center; }
.demo { min-height: 420px; }
.demo-tag { display: inline-block; background: var(--purple-soft); color: var(--purple); font-weight: 800; font-size: .85rem; padding: .25em .8em; border-radius: 999px; margin-bottom: 10px; }

.bloomie-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.bloomie { background: #fff; border-radius: 50%; padding: 10px; box-shadow: var(--shadow); transition: transform .2s; }
.bloomie:hover { transform: translateY(-6px) rotate(-3deg); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; gap: 28px; }
.plan { position: relative; background: #fff; border-radius: var(--radius); padding: 34px 30px; box-shadow: var(--shadow); border: 3px solid transparent; }
.plan.featured { border-color: var(--purple-2); }
.plan-tag { position: absolute; top: -15px; right: 24px; background: var(--coral); color: #fff; font-weight: 800; font-size: .85rem; padding: .3em .9em; border-radius: 999px; }
.price { font-family: var(--font-head); font-size: 2.6rem; font-weight: 800; color: var(--purple); }
.price span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 26px; }
.plan li { padding: 6px 0 6px 30px; position: relative; }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 900; }

.faq details { background: #fff; border-radius: 16px; padding: 16px 22px; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(91, 60, 196, .07); }
.faq summary { cursor: pointer; font-weight: 800; font-size: 1.08rem; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

.site-footer { background: #2a1f63; color: #d8d0ff; padding: 50px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: 1.1rem; }
.site-footer a:not(.brand) { display: block; color: #d8d0ff; text-decoration: none; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.copyright { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9rem; }

/* ------------------------------------------------------------------- cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }

/* -------------------------------------------------------------------- auth */
.auth-page { display: grid; place-items: center; min-height: calc(100vh - 70px); }
.auth-card { width: 100%; max-width: 440px; text-align: center; }
.auth-card form { text-align: left; margin-top: 18px; }
.auth-switch { margin: 18px 0 0; }

label, .label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 14px; }
.label { margin-bottom: 6px; }
input:not([type=radio]):not([type=checkbox]), select {
  display: block; width: 100%; margin-top: 6px;
  padding: .7em .9em; border: 2px solid var(--line); border-radius: 14px;
  font: inherit; font-weight: 600; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--purple-2); box-shadow: 0 0 0 4px var(--purple-soft); }
.form-error { color: #d63b3b; font-weight: 700; min-height: 1.2em; margin-bottom: 10px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.swatch { margin: 0; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); transition: transform .15s; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.12); }
.swatch input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------------------------------------------------------- parent dashboard */
.page-head h1 { font-size: 2.3rem; }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; margin: 24px 0 34px; align-items: start; }
.kid-card { display: flex; flex-direction: column; gap: 16px; }
.kid-card-top { display: flex; align-items: center; gap: 12px; }
.kid-card-name { flex: 1; min-width: 0; }
.kid-card-name h3 { font-size: 1.5rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.mini-stats div { background: var(--purple-soft); border-radius: 14px; padding: 8px 2px; }
.mini-stats b { display: block; font-family: var(--font-head); font-size: 1.3rem; }
.mini-stats span { font-size: .72rem; font-weight: 700; color: var(--muted); }
.kid-card .btn-block { margin-top: auto; }
.edit-form { background: #faf8ff; border: 2px dashed var(--line); border-radius: 16px; padding: 14px; }
.row-btns { display: flex; gap: 10px; justify-content: space-between; }
.add-kid { border: 3px dashed var(--line); box-shadow: none; background: #fff; }
.add-kid.highlight { border-color: var(--purple-2); box-shadow: var(--shadow-lg); }

.report-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.report-head h2 { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { border: 0; background: var(--purple-soft); color: var(--purple); padding: .45em 1.1em; border-radius: 999px; font-weight: 800; cursor: pointer; }
.tab.active { background: var(--purple); color: #fff; }
.tip { background: #fff8e1; border-radius: 14px; padding: 12px 16px; }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.report-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 8px; border-bottom: 2px solid var(--line); }
.report-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.subj-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--purple-2); }
.subj-dot.reading { background: var(--coral); }
.sub-head { margin-top: 26px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: grid; grid-template-columns: 2fr 1fr 1fr .7fr .7fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.empty-report { display: flex; align-items: center; gap: 18px; }
.empty-report p { margin: 0; }

.level-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.level-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ddd5f5; }
.level-dots i.on { background: var(--purple-2); }
.star-row { display: inline-flex; gap: 1px; vertical-align: middle; }

/* --------------------------------------------------------------- kid mode */
body[data-mode~="kid"] {
  background:
    radial-gradient(circle at 10% 10%, #fff3c4 0, transparent 25%),
    radial-gradient(circle at 90% 80%, #d6f5f1 0, transparent 30%),
    #f6f1ff;
  min-height: 100vh;
}
.kid-bar { background: var(--purple); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 4px 0 #43299b; }
.kid-bar-inner { display: flex; align-items: center; gap: 14px; height: 68px; }
.kid-id { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; min-width: 0; }
.kid-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet { display: flex; gap: 8px; margin-left: auto; }
.pill-stat { background: #fff; color: var(--ink); border-radius: 999px; padding: .3em .85em; font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.pill-stat.bump { animation: bump .45s ease; }
.kid-links { display: flex; gap: 4px; }
.kid-link { display: flex; align-items: center; gap: 4px; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .14); border: 0; border-radius: 999px; padding: .4em .8em; font-weight: 800; font-size: .95rem; cursor: pointer; }
.kid-link:hover { background: rgba(255, 255, 255, .26); }

.kid-home { padding-top: 26px; padding-bottom: 60px; }
.kid-hello { display: flex; align-items: center; gap: 16px; justify-content: center; margin-bottom: 20px; }
.speech { position: relative; background: #fff; padding: 16px 22px; border-radius: 22px; font-size: 1.25rem; font-weight: 700; box-shadow: var(--shadow); max-width: 420px; }
.speech::before { content: ''; position: absolute; left: -12px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right: 14px solid #fff; border-left: 0; }

.subject-tabs { display: flex; justify-content: center; gap: 14px; margin-bottom: 10px; }
.subject-tab { border: 0; cursor: pointer; padding: .55em 1.6em; border-radius: 999px; font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.subject-tab.active.math { background: var(--purple-2); color: #fff; box-shadow: 0 5px 0 #43299b; }
.subject-tab.active.reading { background: var(--coral); color: #fff; box-shadow: 0 5px 0 #d94848; }
.scope-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--muted); margin: 14px 0 26px; cursor: pointer; }
.scope-toggle input { width: 20px; height: 20px; accent-color: var(--purple); }

.island-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 22px; }
.island {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 12px 18px; border-radius: 30px;
  background: #fff; text-decoration: none; color: var(--ink);
  box-shadow: 0 8px 0 #e2daf7, var(--shadow);
  transition: transform .18s ease;
  animation: pop .45s backwards; animation-delay: calc(var(--i) * 40ms);
}
.island:nth-child(even) { transform: translateY(14px); }
.island:hover { transform: translateY(-6px) rotate(-1.5deg); }
.island-emoji { font-size: 3rem; width: 86px; height: 86px; display: grid; place-items: center; border-radius: 50%; background: var(--purple-soft); }
.reading .island-emoji { background: #ffeaea; }
.island-name { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; text-align: center; line-height: 1.1; }
.island.recommended { box-shadow: 0 8px 0 #f2c94c, 0 0 0 4px var(--yellow), var(--shadow-lg); }
.badge { position: absolute; top: -10px; right: 14px; background: var(--teal); color: #fff; font-weight: 800; font-size: .8rem; padding: .2em .7em; border-radius: 999px; }
.badge.go { background: var(--coral); animation: wiggle 2s ease-in-out infinite; }

/* ------------------------------------------------------------- practice */
.play-bar { background: #fff; box-shadow: 0 2px 0 var(--line); position: sticky; top: 0; z-index: 40; }
.play-bar-inner { display: flex; align-items: center; gap: 14px; height: 66px; }
.progress { flex: 1; height: 18px; background: var(--purple-soft); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--green)); border-radius: 999px; transition: width .4s ease; }
.play .pill-stat { background: #fff8e1; }
.play-main { display: grid; grid-template-columns: 220px 1fr; gap: 26px; padding-top: 28px; padding-bottom: 60px; align-items: start; }
.buddy { position: sticky; top: 96px; text-align: center; }
.buddy-info { display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 18px; padding: 12px; box-shadow: var(--shadow); font-weight: 700; color: var(--muted); }
.buddy-info b { color: var(--ink); font-family: var(--font-head); font-size: 1.15rem; }

.q-card { background: #fff; border-radius: 28px; padding: 28px; box-shadow: var(--shadow-lg); }
.q-prompt { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.q-prompt h2 { font-size: 1.75rem; margin: 4px 0 0; }
.q-prompt h2.long { font-size: 1.35rem; font-family: var(--font-body); font-weight: 800; line-height: 1.4; }
.say { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; background: var(--purple-soft); font-size: 1.3rem; }
.say:hover { background: #e2d9ff; }
.say.small { width: auto; height: auto; border-radius: 999px; padding: .35em .9em; font-size: .9rem; font-weight: 800; color: var(--purple); margin-bottom: 8px; }
.say-big { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; border: 0; cursor: pointer; background: var(--purple-soft); border-radius: 28px; padding: 18px 34px; font-size: 3rem; box-shadow: 0 6px 0 #d8cdfb; }
.say-big span { font-size: 1rem; font-weight: 800; color: var(--purple); }
.say-big:active { transform: translateY(3px); box-shadow: 0 3px 0 #d8cdfb; }
.passage { background: #fffaf0; border-left: 6px solid var(--yellow); border-radius: 14px; padding: 14px 18px; margin-bottom: 16px; }
.passage p { font-size: 1.15rem; line-height: 1.7; margin: 0; }

.q-visual { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 10px 0 22px; }
.big-eq { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: .02em; }
.blank { display: inline-block; min-width: 1.3em; text-align: center; color: var(--purple-2); background: var(--purple-soft); border-radius: 12px; padding: 0 .2em; }
.emoji-grid { display: grid; grid-template-columns: repeat(5, auto); gap: 6px 10px; font-size: 2.4rem; justify-content: center; }
.dot-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; max-width: 520px; }
.dot-row b { font-size: 1.6rem; margin: 0 6px; }
.dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; }
.dot.a { background: var(--purple-2); }
.dot.b { background: var(--coral); }
.dot.gone { background: #e8e3f5; position: relative; }
.dot.gone::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--coral); font-weight: 900; font-size: 14px; }
.groups { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.group { display: flex; flex-wrap: wrap; gap: 4px; max-width: 90px; padding: 8px; border: 2px dashed #cfc4f2; border-radius: 14px; justify-content: center; }
.group .dot { width: 14px; height: 14px; }
.vert { display: inline-grid; grid-template-columns: auto auto; column-gap: 14px; font-family: var(--font-head); font-weight: 800; font-size: 3rem; line-height: 1.1; text-align: right; font-variant-numeric: tabular-nums; }
.vert-line { border-top: 5px solid var(--ink); }
.vert-line.blank { background: none; border-radius: 0; color: var(--purple-2); }
.pattern { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 2.4rem; }
.pattern.nums span { font-family: var(--font-head); font-weight: 800; font-size: 2rem; background: #fff8e1; border-radius: 14px; padding: 0 .5em; }
.pattern.nums .blank { background: var(--purple-soft); }
.picture { font-size: 5.5rem; line-height: 1; }
.word-blank { font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; letter-spacing: .06em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; font-family: var(--font-head); font-weight: 800; margin: 0 .1em; }
.frac span:first-child { border-bottom: 3px solid currentColor; padding: 0 .2em; }

.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choice {
  min-height: 74px; padding: 12px; border: 3px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--ink); cursor: pointer;
  font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; line-height: 1.2;
  box-shadow: 0 5px 0 var(--line);
  transition: transform .1s, border-color .15s, background .15s;
}
.choice:hover:not(:disabled) { border-color: var(--purple-2); background: #faf8ff; transform: translateY(-2px); }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.choice:disabled { cursor: default; }
.choice.correct { border-color: var(--green); background: #e7f8ec; box-shadow: 0 5px 0 #a6dfb7; animation: pop .35s; opacity: 1; }
.choice.wrong { border-color: var(--coral); background: #ffecec; box-shadow: 0 5px 0 #f7b9b9; opacity: .75; }
.passage ~ .q-answer .choice, .q-prompt h2.long ~ * .choice { font-size: 1.2rem; font-family: var(--font-body); }

.numpad-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.num-display { min-width: 200px; text-align: center; font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; padding: .1em .6em; border: 3px solid var(--purple-2); border-radius: 18px; background: #faf8ff; letter-spacing: .05em; }
.num-display.empty { color: #c4b8f0; }
.num-display.correct { border-color: var(--green); background: #e7f8ec; color: #1f7a45; }
.num-display.revealed { border-color: var(--coral); background: #fff3f3; }
.numpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.key { height: 64px; border: 0; border-radius: 18px; background: var(--purple-soft); font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; cursor: pointer; box-shadow: 0 4px 0 #d8cdfb; color: var(--ink); }
.key:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #d8cdfb; }
.key.alt { background: #fff1e0; box-shadow: 0 4px 0 #f5d2a6; }
.key.go { background: var(--green); color: #fff; box-shadow: 0 4px 0 #2a8c57; }
.key:disabled { opacity: .5; cursor: default; }

.q-feedback { min-height: 10px; margin-top: 18px; }
.fb { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-radius: 18px; font-size: 1.08rem; animation: slide-up .3s ease; }
.fb.good { background: #e7f8ec; color: #1f6b3e; }
.fb.hint { background: #fff8e1; color: #6b4e00; }
.fb.explain { background: #eef4ff; color: #22427a; }
.fb strong { font-family: var(--font-head); font-size: 1.2rem; }

.results { max-width: 640px; margin: 0 auto; text-align: center; grid-column: 1 / -1; }
.result-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 6px; }
.result-stars span { animation: star-in .6s cubic-bezier(.2, 1.6, .4, 1) backwards; animation-delay: var(--d); }
.result-stars span:nth-child(2) svg { transform: translateY(-14px) scale(1.15); }
.results h1 { font-size: 2.6rem; color: var(--purple); }
.result-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0 10px; }
.result-chips span { background: var(--purple-soft); padding: .4em 1em; border-radius: 999px; font-weight: 800; }
.results-buddy { margin: 10px 0; }

/* -------------------------------------------------------------------- shop */
.shop { padding-top: 28px; padding-bottom: 60px; }
.shop-layout { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
.shop-preview { text-align: center; position: sticky; top: 96px; }
.shop-preview h2 { font-size: 1.5rem; margin-top: 8px; }
.shop-tabs { margin-bottom: 18px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border-radius: 22px; padding: 14px 10px 16px; box-shadow: var(--shadow); border: 3px solid transparent; font: inherit; color: var(--ink); cursor: default; }
button.item { cursor: pointer; }
.item b { font-family: var(--font-head); font-size: 1.05rem; }
.item.wearing { border-color: var(--green); background: #f3fcf5; }
.item small { font-weight: 700; }

/* -------------------------------------------------------------- misc / fx */
.loading { min-height: 60vh; display: grid; place-content: center; text-align: center; color: var(--muted); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow-lg); animation: slide-up .3s ease; transition: opacity .4s, transform .4s; max-width: calc(100vw - 32px); text-align: center; }
.toast.good { background: var(--green); }
.toast.bad { background: #d63b3b; }
.toast.out { opacity: 0; transform: translate(-50%, 12px); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }

.bob { animation: bob 3s ease-in-out infinite; }
.bob-slow { animation: bob 4.5s ease-in-out infinite; }
.jump { animation: jump .6s ease; }
.pop-in { animation: pop .35s ease; }
.shake { animation: shake .4s ease; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes jump { 0% { transform: translateY(0); } 40% { transform: translateY(-22px) scale(1.05); } 100% { transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 70% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes slide-up { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-8deg); } 20% { transform: rotate(8deg); } 30% { transform: rotate(0); } }
@keyframes morph { 0%, 100% { border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; } 50% { border-radius: 58% 42% 55% 45% / 42% 58% 42% 58%; } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.toast { animation-name: slide-up-toast; }
@keyframes slide-up-toast { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .hero-grid, .try-grid { grid-template-columns: 1fr; }
  .hero-art { height: 380px; max-width: 460px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: 1fr 1fr; }
  .play-main { grid-template-columns: 1fr; }
  .buddy { position: static; display: flex; align-items: center; gap: 12px; text-align: left; }
  .buddy-art svg { width: 76px; height: 76px; }
  .buddy-info { flex: 1; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-preview { position: static; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hide-sm { display: none; }
  .brand { font-size: 1.3rem; }
  .brand img { width: 32px; height: 32px; }
  .section { padding: 56px 0; }
  .subject-cards, .steps, .plans, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 50px; }
  .hero-art { height: 320px; }
  .hero-main { transform: scale(.78); }
  .hero-side { transform: scale(.75); }
  .q-card { padding: 20px 16px; border-radius: 22px; }
  .q-prompt h2 { font-size: 1.4rem; }
  .choice { font-size: 1.4rem; min-height: 64px; }
  .choices.three { grid-template-columns: 1fr; }
  .numpad { grid-template-columns: repeat(3, 68px); }
  .key { height: 56px; }
  .kid-link span, .wallet .star { display: none; }
  .kid-bar-inner { gap: 8px; }
  .kid-id { font-size: 1.1rem; }
  .kid-hello { flex-direction: column; text-align: center; }
  .speech::before { display: none; }
  .island-map { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .island:nth-child(even) { transform: none; }
  .island-emoji { width: 70px; height: 70px; font-size: 2.4rem; }
  .island-name { font-size: 1.05rem; }
  .subject-tab { font-size: 1.1rem; padding: .5em 1.1em; }
  .activity li { grid-template-columns: 1fr 1fr; }
  .empty-report { flex-direction: column; text-align: center; }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Error card actions */
.row-center { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .6rem; }
