/* AI Quest — Cartoon / Educational Style (KS2–KS3 friendly) */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&family=Baloo+2:wght@600;700;800&display=swap');

:root {
  --paper: #FFF8EA;
  --paper-2: #FFFFFF;
  --paper-3: #FFF1D6;
  --ink: #1F2A4A;
  --ink-2: #4A5780;
  --ink-3: #7B86A8;
  --line: #1F2A4A;
  --line-soft: rgba(31, 42, 74, 0.18);

  --blue: #4FB7F5;
  --blue-d: #1F8FD3;
  --green: #6FD66E;
  --green-d: #3FB13F;
  --yellow: #FFD23F;
  --yellow-d: #E8B100;
  --orange: #FF8F3F;
  --orange-d: #E36A0E;
  --pink: #FF7BB1;
  --pink-d: #E04E8E;
  --purple: #B084EE;
  --purple-d: #7E55C9;
  --teal: #4ED7C8;
  --teal-d: #1FA597;
  --red: #FF6B6B;

  --display: 'Baloo 2', 'Fredoka', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --rounded: 'Fredoka', system-ui, sans-serif;

  --shadow: 0 4px 0 var(--line);
  --shadow-lg: 0 6px 0 var(--line);
  --shadow-sm: 0 2px 0 var(--line);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 8% 12%, rgba(79, 183, 245, 0.18), transparent 40%),
    radial-gradient(circle at 92% 88%, rgba(255, 143, 63, 0.18), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(176, 132, 238, 0.10), transparent 60%);
  background-attachment: fixed;
}

/* sprinkle pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, var(--yellow) 2px, transparent 3px),
    radial-gradient(circle at 80% 70%, var(--pink) 2px, transparent 3px),
    radial-gradient(circle at 50% 90%, var(--green) 2px, transparent 3px),
    radial-gradient(circle at 10% 80%, var(--blue) 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, var(--orange) 2px, transparent 3px);
  background-size: 600px 600px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; min-height: 100vh; }

/* ─── Shell ─────────────────────────────────────────────────── */
.shell { max-width: 1380px; margin: 0 auto; padding: 24px 32px 80px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  background: var(--paper-2);
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--yellow);
  border: 3px solid var(--line);
  display: grid; place-items: center;
  box-shadow: inset 0 -4px 0 var(--yellow-d);
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  color: var(--line);
  position: relative;
}
.brand-mark svg { display: block; }
.brand-meta { display: flex; flex-direction: column; line-height: 1.05; }
.brand-meta b { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--ink); }
.brand-meta span { font-size: 12px; color: var(--ink-3); font-weight: 700; }

.nav { display: flex; gap: 6px; padding: 4px; background: var(--paper-3); border: 2px solid var(--line); border-radius: 14px; }
.nav button {
  appearance: none; border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 120ms;
  white-space: nowrap;
}
.nav button:hover { color: var(--ink); }
.nav button.active { background: var(--blue); color: white; box-shadow: inset 0 -3px 0 var(--blue-d); border: 2px solid var(--line); }

.player-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.player-chip .av {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid var(--line);
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  box-shadow: inset 0 -3px 0 var(--pink-d);
}
.player-chip .xp-num { color: var(--orange-d); }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  border: 3px solid var(--line);
  border-radius: 28px;
  padding: 36px 44px;
  background: linear-gradient(165deg, #BFE7FF 0%, #FFE9C2 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 32px;
}
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; position: relative; z-index: 1; align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-grid > * { position: relative; z-index: 2; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: white;
  background: var(--orange);
  border: 2px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.eyebrow .star { font-size: 14px; }

.h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 5.5vw, 72px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 16px 0 12px;
}
.h1 em {
  font-style: normal;
  background: var(--yellow);
  padding: 2px 14px 6px;
  border-radius: 14px;
  border: 3px solid var(--line);
  display: inline-block;
  box-shadow: var(--shadow-sm);
  line-height: 1.05;
  margin: 4px 0;
}
.lede {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 560px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  padding: 12px 20px;
  background: var(--green);
  color: white;
  border: 3px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 100ms, box-shadow 100ms;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.cta:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.cta.secondary { background: white; color: var(--ink); }
.cta.purple { background: var(--purple); }

/* hero illustration */
.guide-stage {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  min-height: 280px;
}
.guide-platform {
  position: absolute;
  bottom: -10px;
  width: 80%;
  height: 28px;
  background: rgba(31, 42, 74, 0.15);
  border-radius: 50%;
  filter: blur(4px);
}

/* ─── Section heading ──────────────────────────────────────── */
.section { margin: 56px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.section-head .label {
  font-family: var(--display);
  font-size: 13px;
  color: white;
  background: var(--purple);
  border: 2px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-block;
}
.section-head h2 { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -0.01em; margin: 8px 0 0; color: var(--ink); }
.section-head .right { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink-3); }

/* ─── Mission grid ─────────────────────────────────────────── */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1100px) { .mission-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .mission-grid { grid-template-columns: 1fr; } }

.mcard {
  position: relative;
  background: var(--card-bg, white);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 320px;
}
.mcard:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--line); }
.mcard:active { transform: translateY(2px); box-shadow: var(--shadow-sm); }

.mcard .top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.mcard .badge-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: white;
  background: var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}
.mcard .icon-pop {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: white;
  border: 3px solid var(--line);
  display: grid; place-items: center;
  color: var(--accent-d, var(--blue-d));
  box-shadow: inset 0 -4px 0 var(--accent-d, var(--blue-d));
}
.mcard h3 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  line-height: 1.05;
  color: var(--ink);
}
.mcard .sub { font-size: 14px; color: var(--ink-2); font-weight: 700; margin-bottom: 16px; }

.mcard .lvl-pips { display: flex; gap: 6px; margin-bottom: 14px; }
.lvl-pip {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 42, 74, 0.12);
  border: 2px solid var(--line);
  position: relative;
}
.lvl-pip.on { background: var(--green); box-shadow: inset 0 -3px 0 var(--green-d); }

.mcard .meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  border-top: 2px dashed var(--line-soft);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
}
.mcard .xp-chip {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  color: var(--line);
  background: var(--yellow);
  border: 2px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: inset 0 -3px 0 var(--yellow-d);
}
.mcard .lock-stamp {
  position: absolute; top: 16px; right: 90px;
  background: white; border: 2px solid var(--line);
  border-radius: 999px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--ink-3);
  box-shadow: var(--shadow-sm);
}
.mcard .check-stamp {
  position: absolute; top: 16px; right: 90px;
  background: var(--green); border: 2px solid var(--line);
  border-radius: 999px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: white;
  box-shadow: var(--shadow-sm);
}

/* card backgrounds — accent-tinted */
.mcard.tone-blue   { --card-bg: #DEF2FF; --accent: var(--blue);   --accent-d: var(--blue-d); }
.mcard.tone-orange { --card-bg: #FFEAD2; --accent: var(--orange); --accent-d: var(--orange-d); }
.mcard.tone-yellow { --card-bg: #FFF3C2; --accent: var(--yellow); --accent-d: var(--yellow-d); }
.mcard.tone-purple { --card-bg: #ECE0FF; --accent: var(--purple); --accent-d: var(--purple-d); }
.mcard.tone-pink   { --card-bg: #FFE0EC; --accent: var(--pink);   --accent-d: var(--pink-d); }
.mcard.tone-green  { --card-bg: #DCF6DA; --accent: var(--green);  --accent-d: var(--green-d); }
.mcard.tone-teal   { --card-bg: #D5F5EF; --accent: var(--teal);   --accent-d: var(--teal-d); }

.mcard .ribbon {
  position: absolute;
  top: 14px; left: -6px;
  background: var(--accent, var(--blue));
  color: white;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 10px;
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-3deg);
}

/* ─── Pillars (Pedagogy) ──────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: white;
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.pillar .ic {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  background: var(--p-bg, var(--blue));
  border: 3px solid var(--line);
  color: white;
  box-shadow: inset 0 -4px 0 var(--p-d, var(--blue-d));
}
.pillar h4 { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--ink); }
.pillar p { font-size: 15px; font-weight: 600; color: var(--ink-2); line-height: 1.5; margin: 0; }

/* ─── Loop ──────────────────────────────────────────────────── */
.loop-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .loop-row { grid-template-columns: 1fr 1fr; } }
.loop-step {
  position: relative;
  padding: 18px 16px;
  background: white;
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.loop-step .ix {
  width: 36px; height: 36px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--loop-bg, var(--blue));
  color: white;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  display: grid; place-items: center;
  border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 var(--loop-d, var(--blue-d));
}
.loop-step .nm { font-family: var(--display); font-weight: 800; font-size: 16px; margin-bottom: 4px; color: var(--ink); }
.loop-step .ds { font-size: 13px; color: var(--ink-2); line-height: 1.4; font-weight: 600; }

/* ─── Stat row ──────────────────────────────────────────────── */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  padding: 14px 18px;
  background: white;
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 110px;
}
.stat .k { font-family: var(--display); font-size: 12px; color: var(--ink-3); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.stat .v small { font-size: 13px; color: var(--ink-3); font-weight: 700; margin-left: 4px; }

/* ─── Lesson detail ─────────────────────────────────────────── */
.lesson-shell { display: grid; grid-template-columns: 280px 1fr; gap: 28px; }
@media (max-width: 1000px) { .lesson-shell { grid-template-columns: 1fr; } }

.side {
  position: sticky;
  top: 20px;
  align-self: start;
  background: white;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.side .label {
  font-family: var(--display); font-size: 13px;
  color: white;
  background: var(--purple);
  border: 2px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 14px;
  font-weight: 700;
}
.side ol { list-style: none; padding: 0; margin: 0; }
.side ol li {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  display: flex; gap: 10px; align-items: center;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 120ms;
  margin-bottom: 4px;
}
.side ol li .num-pill {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 2px solid var(--line);
  font-size: 11px;
  display: grid; place-items: center;
  color: var(--ink);
  flex-shrink: 0;
  font-weight: 800;
}
.side ol li:hover { background: var(--paper-3); }
.side ol li.active { background: var(--yellow); color: var(--ink); border: 2px solid var(--line); padding: 8px 10px; box-shadow: inset 0 -3px 0 var(--yellow-d); }
.side ol li.active .num-pill { background: white; }
.side ol li.done .num-pill { background: var(--green); color: white; }

.next-up {
  margin-top: 18px;
  padding: 14px;
  background: var(--paper-3);
  border: 2px dashed var(--line-soft);
  border-radius: 12px;
}
.next-up .lab { font-family: var(--display); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.next-up .nm { font-family: var(--display); font-size: 16px; font-weight: 800; color: var(--ink); margin-top: 2px; }

/* lesson hero */
.lesson-hero {
  position: relative;
  border: 3px solid var(--line);
  border-radius: 24px;
  padding: 32px 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--lh-bg, #DEF2FF);
}
.lesson-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.6) 80px, transparent 90px),
    radial-gradient(circle at 90% 60%, rgba(255,255,255,0.4) 50px, transparent 60px);
  pointer-events: none;
}
.lesson-hero .crumb {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  background: white;
  border: 2px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  margin-bottom: 18px;
  cursor: pointer;
  position: relative;
}
.lesson-hero .crumb:hover { background: var(--paper-3); }
.lesson-hero .lh-tag {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  background: var(--lh-tag, var(--blue));
  color: white;
  border: 2px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.lesson-hero h1 {
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 6px;
  position: relative;
  color: var(--ink);
}
.lesson-hero .lh-sub {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 0 0 22px;
  position: relative;
}
.lesson-hero .lh-stats { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.kpi {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex; gap: 8px; align-items: center;
  box-shadow: var(--shadow-sm);
}
.kpi .k { color: var(--ink-3); font-size: 11px; text-transform: uppercase; }
.kpi .v { color: var(--ink); }
.kpi.xp .v { color: var(--orange-d); }

/* mission brief */
.brief-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: white;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.brief-card .robot-portrait {
  width: 96px; height: 96px;
  flex-shrink: 0;
  background: var(--paper-3);
  border: 3px solid var(--line);
  border-radius: 20px;
  display: grid; place-items: center;
  box-shadow: inset 0 -4px 0 var(--yellow-d);
}
.brief-card .body { flex: 1; }
.brief-card .speech-tag {
  font-family: var(--display); font-size: 11px; letter-spacing: 0.05em;
  background: var(--orange); color: white;
  font-weight: 800;
  padding: 3px 10px; border-radius: 6px;
  display: inline-block;
  border: 2px solid var(--line);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.brief-card .ttl { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 4px; color: var(--ink); }
.brief-card p { color: var(--ink-2); margin: 0; line-height: 1.55; font-weight: 600; }

/* level cards */
.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 880px) { .levels-grid { grid-template-columns: 1fr; } }

.level-card {
  position: relative;
  background: var(--lvl-bg, #DEF2FF);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.level-card .lvl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.level-card .lvl-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  color: white;
  background: var(--lvl-color);
  padding: 5px 12px;
  border-radius: 999px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.level-card .lvl-type {
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
  background: white;
  border: 2px solid var(--line);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
}
.level-card h4 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--ink);
}
.level-card .lvl-sub { font-size: 14px; color: var(--ink-2); font-weight: 700; margin-bottom: 14px; }
.level-card ul { list-style: none; padding: 0; margin: 0 0 14px; flex: 1; }
.level-card ul li {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 0 8px 26px;
  position: relative;
  line-height: 1.45;
}
.level-card ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 11px;
  width: 16px; height: 16px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 50%;
  box-shadow: inset 0 -2px 0 var(--lvl-color);
}
.level-card .lvl-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  gap: 8px;
}
.level-card .success { color: var(--ink-2); flex: 1; }
.level-card .award {
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 var(--yellow-d);
  white-space: nowrap;
}

/* level tones */
.tone-l1 { --lvl-bg: #DEF2FF; --lvl-color: var(--blue); }
.tone-l2 { --lvl-bg: #ECE0FF; --lvl-color: var(--purple); }
.tone-l3 { --lvl-bg: #DCF6DA; --lvl-color: var(--green); }

/* two-col panels */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: white;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.panel .label {
  font-family: var(--display); font-size: 12px;
  color: white;
  background: var(--teal);
  border: 2px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.panel .label.theory { background: var(--orange); }
.panel .label.obj { background: var(--green); }
.panel .label.assess { background: var(--purple); }
.panel .label.vocab { background: var(--blue); }
.panel h3 { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px; color: var(--ink); }
.panel p { font-size: 15px; font-weight: 600; color: var(--ink-2); line-height: 1.55; margin: 0 0 12px; }

.term-list { display: grid; gap: 8px; margin-top: 14px; }
.term-list .term {
  padding: 10px 14px;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.term-list .term b { font-family: var(--display); font-size: 15px; font-weight: 800; color: var(--ink); }
.term-list .term span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; font-weight: 600; }

.obj-list { list-style: none; padding: 0; margin: 0; }
.obj-list li {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  padding: 10px 0 10px 32px;
  position: relative;
  line-height: 1.5;
}
.obj-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 8px;
  width: 22px; height: 22px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  box-shadow: inset 0 -2px 0 var(--green-d);
}

/* assessment table */
.assess-table {
  width: 100%; border-collapse: separate; border-spacing: 0 6px;
  font-size: 14px;
}
.assess-table td {
  padding: 12px 14px;
  background: var(--paper-3);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  font-weight: 600;
}
.assess-table td:first-child { border-left: 2px solid var(--line); border-radius: 12px 0 0 12px; }
.assess-table td:last-child {
  border-right: 2px solid var(--line);
  border-radius: 0 12px 12px 0;
  text-align: right;
  font-family: var(--display);
  font-weight: 800;
  color: var(--orange-d);
}
.assess-table .method { color: var(--ink-3); font-weight: 700; font-size: 13px; }

/* vocab cloud */
.vocab-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-cloud span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}
.vocab-cloud span:nth-child(3n) { background: #DEF2FF; }
.vocab-cloud span:nth-child(3n+1) { background: #FFF3C2; }
.vocab-cloud span:nth-child(3n+2) { background: #FFE0EC; }

/* streak callout */
.streak-callout {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF3C2, #FFE0EC);
  border: 2px solid var(--line);
  display: flex; gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.streak-callout .ic-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--line);
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 var(--orange-d);
}
.streak-callout .lab { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--ink); }
.streak-callout .desc { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }

/* rewards strip */
.rewards-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 780px) { .rewards-strip { grid-template-columns: repeat(2, 1fr); } }
.reward-cell {
  background: white;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-sm);
}
.reward-cell .ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--rw-bg, var(--blue));
  border: 2px solid var(--line);
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 var(--rw-d, var(--blue-d));
}
.reward-cell .lbl { font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); font-weight: 700; }
.reward-cell .val { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--ink); }

/* continue card */
.continue-card {
  margin-top: 32px;
  display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 22px 24px;
  background: linear-gradient(135deg, #DEF2FF, #ECE0FF);
  border: 3px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.continue-card .lab { font-family: var(--display); font-size: 12px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
.continue-card .nm { font-family: var(--display); font-size: 22px; font-weight: 800; margin-top: 4px; color: var(--ink); }

/* ─── Try-It blocks ────────────────────────────────────────── */
.tryit {
  margin-top: 16px;
  padding: 22px;
  background: white;
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.tryit-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.tryit-head .label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  color: white;
  background: var(--green);
  border: 2px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.tryit-head .reset {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  background: white; border: 2px solid var(--line);
  color: var(--ink); padding: 6px 14px; border-radius: 999px; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.tryit-head .reset:hover { background: var(--paper-3); }

/* drag-drop */
.dd-deck {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--paper-3);
  border: 2px dashed var(--line-soft);
  border-radius: 14px;
  min-height: 56px;
}
.dd-card {
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.dd-card:hover { transform: translateY(-1px); }
.dd-card.dragging { opacity: 0.4; }
.dd-card.correct { background: var(--green); color: white; box-shadow: inset 0 -3px 0 var(--green-d); }
.dd-card.wrong { background: var(--red); color: white; }

.dd-bins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dd-bin {
  padding: 14px;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 14px;
  min-height: 100px;
  display: flex; flex-direction: column; gap: 6px;
}
.dd-bin.over { background: #FFF3C2; border-style: dashed; }
.dd-bin .bin-lbl {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.dd-score {
  margin-top: 14px;
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center;
}
.dd-score .pill {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 14px;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}
.dd-score .pill.win { background: var(--green); color: white; box-shadow: inset 0 -3px 0 var(--green-d); }
.dd-score .pill.xp { background: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow-d); }

/* scatter */
.scatter-svg {
  width: 100%;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 14px;
  display: block;
}
.scatter-controls {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}
@media (max-width: 600px) { .scatter-controls { grid-template-columns: 1fr; } }
.slider-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.slider-row input[type="range"] { flex: 1; accent-color: var(--orange); }
.slider-row b { color: var(--orange-d); min-width: 28px; text-align: right; font-weight: 800; }

.scatter-stat { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.scatter-stat .pill { font-family: var(--display); font-weight: 800; font-size: 13px; padding: 6px 12px; background: white; border: 2px solid var(--line); border-radius: 999px; }

/* training */
.train-graph { width: 100%; background: var(--paper-3); border: 2px solid var(--line); border-radius: 14px; }
.train-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.train-meta .pill { font-family: var(--display); font-weight: 700; font-size: 13px; padding: 6px 12px; background: white; border: 2px solid var(--line); border-radius: 999px; }
.train-meta .pill b { color: var(--orange-d); margin-left: 4px; }
.train-btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.train-btns button {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 16px;
  background: white; border: 2px solid var(--line);
  color: var(--ink); border-radius: 12px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 6px;
}
.train-btns button.primary { background: var(--green); color: white; box-shadow: 0 3px 0 var(--line); }
.train-btns button:hover { transform: translateY(-1px); }

/* annotation */
.anno-card {
  display: flex; gap: 12px; align-items: center;
  padding: 14px;
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 14px;
  margin-bottom: 8px;
}
.anno-card .txt { flex: 1; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--ink-2); }
.anno-options { display: flex; gap: 6px; }
.anno-options button {
  appearance: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  padding: 7px 12px;
  background: white; border: 2px solid var(--line);
  color: var(--ink-2); border-radius: 10px; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.anno-options button.pos.on { background: var(--green); color: white; box-shadow: inset 0 -3px 0 var(--green-d); }
.anno-options button.neg.on { background: var(--red); color: white; }
.anno-options button.neu.on { background: var(--blue); color: white; box-shadow: inset 0 -3px 0 var(--blue-d); }
.anno-progress { font-family: var(--display); font-weight: 700; font-size: 13px; margin-top: 12px; color: var(--ink-2); }
.anno-progress b { color: var(--green-d); }

/* confusion matrix */
.cm-grid { display: grid; gap: 6px; }
.cm-cell {
  padding: 14px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 12px;
  text-align: center;
  font-family: var(--display);
}
.cm-cell.diag { background: var(--green); color: white; box-shadow: inset 0 -3px 0 var(--green-d); }
.cm-cell.off { background: #FFE0EC; }
.cm-cell .num { font-size: 22px; font-weight: 800; display: block; }
.cm-cell .lab { font-size: 10px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; }
.cm-axis { font-family: var(--display); font-size: 12px; color: var(--ink-3); padding: 8px 4px; font-weight: 700; }

/* prompt sandbox */
.prompt-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.prompt-tabs button {
  appearance: none; border: 2px solid var(--line);
  background: white; color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 13px;
  padding: 8px 14px; border-radius: 12px; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.prompt-tabs button.active { background: var(--purple); color: white; box-shadow: inset 0 -3px 0 var(--purple-d); }
.prompt-out {
  background: var(--paper-3);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.55;
  min-height: 120px;
}
.prompt-out .you { color: var(--blue-d); font-weight: 700; }
.prompt-out .ai { color: var(--ink); margin-top: 10px; }
.prompt-stars { display: flex; gap: 2px; }
.prompt-stars button {
  appearance: none; background: transparent; border: 0;
  color: rgba(31, 42, 74, 0.25); font-size: 24px; cursor: pointer;
  padding: 0 2px;
}
.prompt-stars button.on { color: var(--yellow-d); }

/* ─── Achievements / Badges ────────────────────────────────── */
.badges-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; }
@media (max-width: 1000px) { .badges-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .badges-row { grid-template-columns: repeat(2, 1fr); } }

.badge {
  text-align: center;
  padding: 22px 14px 18px;
  background: white;
  border: 3px solid var(--line);
  border-radius: 20px;
  position: relative;
  box-shadow: var(--shadow);
}
.badge .medallion {
  width: 84px; height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bd-bg, var(--blue));
  border: 3px solid var(--line);
  display: grid; place-items: center;
  color: white;
  position: relative;
  box-shadow: inset 0 -5px 0 var(--bd-d, var(--blue-d));
}
.badge.locked .medallion { background: var(--paper-3); color: var(--ink-3); box-shadow: inset 0 -5px 0 rgba(31,42,74,0.15); }
.badge.locked { opacity: 0.7; }
.badge .nm { font-family: var(--display); font-weight: 800; font-size: 14px; color: var(--ink); margin-bottom: 4px; line-height: 1.1; }
.badge .ls { font-family: var(--display); font-size: 11px; color: var(--ink-3); font-weight: 700; }
.badge.earned .ls { color: var(--green-d); }
.badge.champion .medallion { background: var(--yellow); color: var(--ink); box-shadow: inset 0 -5px 0 var(--yellow-d); }
.badge.champion .medallion::after {
  content: '★';
  position: absolute;
  top: -8px; right: -8px;
  width: 26px; height: 26px;
  background: var(--orange);
  border: 2px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-size: 14px;
  box-shadow: inset 0 -2px 0 var(--orange-d);
}

/* bands table */
.bands-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.bands-table thead th {
  font-family: var(--display); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3);
  text-align: left; padding: 8px 14px;
}
.bands-table tbody td {
  padding: 14px 14px;
  background: var(--paper-3);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.bands-table tbody td:first-child { border-left: 2px solid var(--line); border-radius: 12px 0 0 12px; }
.bands-table tbody td:last-child { border-right: 2px solid var(--line); border-radius: 0 12px 12px 0; }
.bands-table .band-rank { font-family: var(--display); font-weight: 800; color: var(--ink); }
.bands-table .band-xp { font-family: var(--display); font-weight: 800; color: var(--orange-d); }
.band-grade .pill {
  font-family: var(--display); font-weight: 800; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; border: 2px solid var(--line);
  background: white; display: inline-block;
}
.band-grade.distinction .pill { background: var(--yellow); box-shadow: inset 0 -2px 0 var(--yellow-d); }
.band-grade.merit .pill { background: var(--green); color: white; box-shadow: inset 0 -2px 0 var(--green-d); }
.band-grade.pass .pill { background: var(--blue); color: white; box-shadow: inset 0 -2px 0 var(--blue-d); }
.band-grade.developing .pill { background: var(--purple); color: white; box-shadow: inset 0 -2px 0 var(--purple-d); }
.bands-table .achieved { font-family: var(--display); font-weight: 800; color: var(--green-d); display: inline-flex; align-items: center; gap: 6px; }
.bands-table .pending { font-family: var(--display); font-weight: 700; color: var(--ink-3); }

/* footer */
.footer {
  margin-top: 60px;
  padding: 20px 24px;
  background: white;
  border: 3px solid var(--line);
  border-radius: 18px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  box-shadow: var(--shadow-sm);
}

/* utility */
.muted { color: var(--ink-3); }
