/* Brainwave design tokens and shared components. Kid pages use .kid, parent pages use .parent. */
:root {
  --ink: #17144a;
  --ink-2: #4b4680;
  --muted: #6c67a0;
  --night: #17144a;
  --night-2: #0c0a2e;
  --lilac: #c9c4ff;
  --coral: #ff6b5b;
  --coral-d: #c7402f;
  --mint: #2fd3a7;
  --mint-d: #12957a;
  --sun: #ffc23d;
  --sun-d: #c78a00;
  --orange: #ff8a2a;
  --violet: #8b7cff;
  --violet-d: #5c4ed6;
  --line: #e7e6f0;
  --paper: #f6f6fa;
  --r-lg: 28px;
  --r-md: 18px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
}
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

/* ---------- kid ---------- */
body.kid {
  min-height: 100vh;
  color: #fff;
  background-color: var(--night);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1.5px),
    radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.5px);
  background-size:
    120px 120px,
    60px 60px;
  background-position:
    0 0,
    30px 40px;
}
.kid .center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}
.kid .stack {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  position: relative;
}
.kid h1 {
  font:
    700 clamp(40px, 7vw, 64px) / 1.04 Fredoka,
    system-ui,
    sans-serif;
  margin: 0;
}
.kid .lede {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--lilac);
  line-height: 1.45;
}
.kid .fine {
  margin: 0;
  font-size: 15px;
  color: var(--lilac);
  line-height: 1.5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    700 28px Fredoka,
    sans-serif;
  text-decoration: none;
}
.brand img {
  width: 56px;
  height: 56px;
}
.brand .b {
  color: var(--sun);
  -webkit-text-stroke: 2px #1e1650;
  paint-order: stroke fill;
}
.brand .w {
  color: var(--orange);
  -webkit-text-stroke: 2px #1e1650;
  paint-order: stroke fill;
}
.card {
  width: 100%;
  background: #fff;
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: 0 10px 0 var(--night-2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.label {
  font:
    800 14px Nunito,
    sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.big-input {
  font:
    600 30px Fredoka,
    sans-serif;
  color: var(--ink);
  height: 72px;
  padding: 0 22px;
  width: 100%;
  border: 3px solid var(--violet);
  border-radius: var(--r-md);
  outline: none;
}
.big-input:focus {
  border-color: var(--coral);
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 68px;
  border: 0;
  border-radius: var(--r-md);
  font:
    700 24px Fredoka,
    sans-serif;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 6px 0 var(--coral-d);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.08s,
    box-shadow 0.08s;
  width: 100%;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--coral-d);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.btn.mint {
  background: var(--mint);
  box-shadow: 0 6px 0 var(--mint-d);
}
.otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.otp input {
  height: 84px;
  min-width: 0;
  text-align: center;
  font:
    700 42px Fredoka,
    sans-serif;
  color: var(--ink);
  border: 3px solid #dad7ee;
  border-radius: var(--r-md);
  background: #fff;
}
.otp input:focus {
  border-color: var(--coral);
  outline: none;
}
.otp input.filled {
  border-color: var(--violet);
  background: #f1efff;
}
.row-between {
  display: flex;
  justify-content: space-between;
  font:
    700 15px Nunito,
    sans-serif;
  color: var(--ink-2);
}
.err {
  color: #b0302a;
  font-weight: 800;
  font-size: 16px;
  min-height: 22px;
  margin: 0;
}
.pill-link {
  position: absolute;
  left: 28px;
  top: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--lilac);
  text-decoration: none;
  font: 800 17px Nunito;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.icon-badge {
  width: 112px;
  height: 112px;
  border-radius: 32px;
  background: var(--mint);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 0 var(--mint-d);
  transform: rotate(-6deg);
}
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.blob.coral {
  width: 400px;
  height: 400px;
  left: -130px;
  bottom: -150px;
  background: var(--coral);
  box-shadow: inset 0 0 0 60px #ff8a7d;
}
.blob.mint {
  width: 240px;
  height: 240px;
  right: -60px;
  top: -70px;
  border: 50px solid var(--mint);
}
@media (max-width: 700px) {
  .blob {
    display: none;
  }
  .otp input {
    height: 64px;
    font-size: 32px;
  }
}

/* ---------- parent ---------- */
body.parent {
  background: var(--paper);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100vh;
}
.parent .shell {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
}
.parent nav.side {
  flex: 1 1 240px;
  max-width: 260px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.parent nav.side a {
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.parent nav.side a[aria-current='page'] {
  background: #efedff;
  color: #2e2596;
  font-weight: 600;
}
.parent main {
  flex: 999 1 560px;
  min-width: 0;
  padding: 32px clamp(16px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.parent h1 {
  margin: 0;
  font:
    600 28px Inter,
    sans-serif;
  letter-spacing: -0.02em;
}
.parent h2 {
  margin: 0;
  font:
    600 17px Inter,
    sans-serif;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.field input,
.field select {
  font:
    500 15px Inter,
    sans-serif;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d9d7e8;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.pbtn {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font:
    600 14px Inter,
    sans-serif;
  cursor: pointer;
}
.pbtn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid #d9d7e8;
}
.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ptable th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
.ptable td {
  padding: 11px 6px;
  border-bottom: 1px solid #f0eff6;
}
.ok {
  color: #0b6e56;
  font-weight: 600;
}
.bad {
  color: #b0302a;
  font-weight: 600;
}
.signin-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gbtn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d9d7e8;
  font:
    600 16px Inter,
    sans-serif;
  text-decoration: none;
  color: var(--ink);
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--violet-d);
  font:
    800 15px Nunito,
    sans-serif;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- kid app shell ---------- */
.kid-app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 40px) 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar .brand {
  font-size: 24px;
}
.topbar .brand img {
  width: 46px;
  height: 46px;
}
.spacer {
  flex: 1;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 16px;
  font:
    700 18px Fredoka,
    sans-serif;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--sun);
  background: var(--violet);
  color: #fff;
  font:
    700 20px Fredoka,
    sans-serif;
  cursor: pointer;
}
.muted {
  color: #6c67a0;
  font-weight: 700;
}
.kid .muted {
  color: var(--lilac);
}
.small {
  font-size: 13px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.mission {
  grid-column: span 2;
  background: var(--coral);
  border-radius: var(--r-lg);
  padding: 30px 32px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 0 var(--coral-d);
  display: flex;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s;
}
.mission:hover {
  transform: translateY(-2px);
}
.mission::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: #ff8a7d;
}
.mission.mint {
  background: var(--mint);
  box-shadow: 0 8px 0 var(--mint-d);
}
.mission.mint::after {
  background: #6be3c2;
}
.mission-text {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mission h1 {
  font-size: clamp(32px, 4vw, 46px);
}
.mission .tag {
  align-self: flex-start;
  background: var(--night);
  border-radius: 999px;
  padding: 6px 14px;
  font: 800 13px Nunito;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mission #mission-sub {
  font: 700 18px Nunito;
}
.play-btn {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
  flex: none;
}
.level-card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: 0 8px 0 var(--night-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.level-card b {
  font: 700 18px Fredoka;
}
.level-card .muted {
  color: #6c67a0;
  font-size: 14px;
}
.subjects {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.subject {
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 22px;
  text-decoration: none;
  box-shadow: 0 7px 0 var(--night-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.1s;
}
a.subject:hover {
  transform: translateY(-2px);
}
.subject .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.subject .ico {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}
.subject .badge {
  font: 800 13px Nunito;
  border-radius: 999px;
  padding: 5px 10px;
}
.subject h2 {
  margin: 0;
  font:
    700 24px Fredoka,
    sans-serif;
}
.bar {
  height: 10px;
  background: #f1effa;
  border-radius: 6px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 10px;
  border-radius: 6px;
}
.s-math .ico,
.s-math .badge {
  background: #ffe4e0;
  color: #b0302a;
}
.s-math .bar > span {
  background: var(--coral);
}
.s-science .ico,
.s-science .badge {
  background: #d8f7ee;
  color: #0b6e56;
}
.s-science .bar > span {
  background: var(--mint);
}
.s-gk .ico,
.s-gk .badge {
  background: #fff1cc;
  color: #7a5300;
}
.s-gk .bar > span {
  background: var(--sun);
}
.strip {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.week {
  grid-column: span 2;
}
.week b {
  font: 700 18px Fredoka;
  width: 110px;
}
.dots {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
  font: 800 13px Nunito;
  color: var(--lilac);
}
.dots div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px dashed #4b4680;
}
.dot.on {
  background: var(--mint);
  border: 0;
}
.dot.today {
  box-shadow: 0 0 0 4px rgba(255, 194, 61, 0.45);
}
.dot.today:not(.on) {
  border-color: var(--sun);
}
.quote {
  font: 700 16px/1.45 Nunito;
  color: var(--lilac);
}
@media (max-width: 900px) {
  .home-grid,
  .subjects {
    grid-template-columns: 1fr;
  }
  .mission,
  .week {
    grid-column: auto;
  }
}

/* ---------- quiz player ---------- */
body.quiz-body {
  background: #f4f2ff;
  color: var(--ink);
  background-image: none;
}
.play {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px clamp(16px, 3vw, 40px) 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.play-top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 #dad7ee;
  flex: none;
}
.pips {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
}
.pips span {
  height: 14px;
  border-radius: 7px;
  background: #e3e0f5;
}
.pips .ok {
  background: var(--mint);
}
.pips .no {
  background: var(--coral);
}
.pips .now {
  background: var(--violet);
}
.count {
  font: 700 18px Fredoka;
  color: #6c67a0;
  white-space: nowrap;
}
.combo {
  display: inline-flex;
  gap: 6px;
  background: #fff1cc;
  color: #7a5300;
  border-radius: 999px;
  padding: 8px 14px;
  font: 700 16px Fredoka;
}
.play-main {
  display: flex;
  gap: 28px;
  flex: 1;
  flex-wrap: wrap;
}
.qcol {
  flex: 999 1 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.qcard {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 30px 34px;
  box-shadow: 0 8px 0 #dad7ee;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.qtag {
  align-self: flex-start;
  border-radius: 999px;
  padding: 6px 14px;
  font: 800 13px Nunito;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #efedff;
  color: #2e2596;
}
.qtext {
  margin: 0;
  font:
    600 clamp(22px, 2.6vw, 30px) / 1.3 Fredoka,
    sans-serif;
}
.visual {
  font-size: 64px;
  line-height: 1.1;
  letter-spacing: 6px;
}
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 12px 22px;
  border: 3px solid #e3e0f5;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 6px 0 #dad7ee;
  font:
    700 clamp(20px, 2.2vw, 26px) Fredoka,
    sans-serif;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.08s;
}
.choice:active {
  transform: translateY(3px);
}
.choice .k {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: #f1effa;
  color: #4b4680;
  display: grid;
  place-items: center;
  font: 700 20px Fredoka;
}
.choice .e {
  font-size: 34px;
}
.choice.sel {
  border-color: var(--violet);
  background: #f1efff;
  box-shadow: 0 6px 0 var(--violet);
}
.choice.sel .k {
  background: var(--violet);
  color: #fff;
}
.choice.right {
  border-color: var(--mint);
  background: #e2faf3;
  box-shadow: 0 6px 0 var(--mint-d);
}
.choice.right .k {
  background: var(--mint);
  color: #fff;
}
.choice.wrong {
  border-color: var(--coral);
  background: #ffedea;
  box-shadow: 0 6px 0 var(--coral-d);
}
.choice.wrong .k {
  background: var(--coral);
  color: #fff;
}
.choice[disabled] {
  cursor: default;
}
.feedback {
  background: #fff;
  border-radius: 20px;
  padding: 18px 22px;
  font: 600 17px/1.5 Nunito;
  border-left: 0;
  box-shadow: 0 6px 0 #dad7ee;
}
.feedback b {
  font: 700 20px Fredoka;
  display: block;
  margin-bottom: 4px;
}
.side {
  flex: 1 1 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.think {
  background: #fff;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 6px 0 #dad7ee;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.think label {
  font: 700 17px Fredoka;
}
.think textarea {
  font: 600 16px/1.4 Nunito;
  height: 120px;
  padding: 12px;
  border: 2px solid #dad7ee;
  border-radius: 14px;
  resize: none;
}
.side .btn {
  margin-top: auto;
}
.btn.violet {
  background: var(--violet);
  box-shadow: 0 6px 0 var(--violet-d);
}
.results {
  flex: 1;
  display: grid;
  place-items: center;
}
.result-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 36px;
  box-shadow: 0 10px 0 #dad7ee;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}
.result-card h1 {
  margin: 0;
  font: 700 44px Fredoka;
}
.result-card .skills {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.result-card .skills div {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: center;
  font: 700 15px Nunito;
}
@media (max-width: 700px) {
  .choices {
    grid-template-columns: 1fr;
  }
  .side {
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.quiz-body .muted {
  color: #6c67a0;
}
