/* ============================================================
   K's Element Lab — styles
   Night-lab chrome + warm cream reading panels.
   Dyslexia-aware: Lexend reading text, big targets, no glare.
   ============================================================ */

:root {
  --ink: #1c2030;
  --night: #14182a;
  --night-2: #1d2340;
  --night-3: #262e52;
  --cream: #faf3e3;
  --cream-2: #f3e8cf;
  --cream-3: #e9dbbd;
  --gold: #ffb84d;
  --gold-deep: #e89a1f;
  --teal: #2ec4b6;
  --teal-deep: #1d9e92;
  --coral: #ff7a6b;
  --grape: #9d8cff;
  --leaf: #7bc950;
  --leaf-deep: #57a832;
  --sky: #5ec8f2;

  --font-display: 'Baloo 2', 'Comic Sans MS', cursive;
  --font-read: 'Lexend', 'Comic Sans MS', Verdana, sans-serif;

  --read-scale: 1;
  --read-spacing: 0.035em;

  --radius: 22px;
  --shadow: 0 10px 30px rgba(5, 8, 20, 0.45);
}

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

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

body {
  font-family: var(--font-read);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(157, 140, 255, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(46, 196, 182, 0.13), transparent 55%),
    var(--night);
  color: var(--cream);
  min-height: 100vh;
  letter-spacing: var(--read-spacing);
}

/* floating "atoms" background */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(3px 3px at 12% 20%, rgba(255,184,77,.5), transparent),
    radial-gradient(2px 2px at 70% 12%, rgba(94,200,242,.55), transparent),
    radial-gradient(3px 3px at 88% 55%, rgba(255,122,107,.4), transparent),
    radial-gradient(2px 2px at 30% 78%, rgba(123,201,80,.45), transparent),
    radial-gradient(2px 2px at 55% 40%, rgba(157,140,255,.5), transparent),
    radial-gradient(3px 3px at 8% 60%, rgba(46,196,182,.4), transparent);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 18px 18px 90px; }

button { font-family: inherit; letter-spacing: inherit; cursor: pointer; border: none; }
button:focus-visible, a:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; border-radius: 12px; }

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: 0.001s !important;
  transition-duration: 0.001s !important;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px 18px;
  flex-wrap: wrap;
}
.topbar .brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.5rem; color: var(--gold);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand .flask { font-size: 1.6rem; filter: drop-shadow(0 0 8px rgba(255,184,77,.6)); }
.topbar .spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--night-2);
  border: 2px solid var(--night-3);
  padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; color: var(--cream);
}
.chip.element-chip { border-color: var(--gold); color: var(--gold); }
.chip.streak-chip  { border-color: var(--coral); color: var(--coral); }
.chip button { background: none; color: inherit; font-size: 1rem; }

.iconbtn {
  background: var(--night-2); border: 2px solid var(--night-3);
  color: var(--cream); border-radius: 14px;
  width: 46px; height: 46px; font-size: 1.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, border-color .15s ease;
}
.iconbtn:hover { transform: translateY(-2px); border-color: var(--teal); }

/* grown-ups dropdown (reports · parent · settings collapsed into one) */
.grownup-menu { position: relative; display: inline-block; }
.grownup-menu > summary { list-style: none; cursor: pointer; }
.grownup-menu > summary::-webkit-details-marker { display: none; }
.grownup-menu > summary::marker { content: ""; }
.grownup-menu[open] > summary { border-color: var(--teal); }
.grownup-menu .menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  background: var(--cream); border-radius: 16px; padding: 8px;
  box-shadow: 0 12px 34px rgba(0,0,0,.4); min-width: 210px;
  display: flex; flex-direction: column; gap: 2px;
}
.grownup-menu .menu-head {
  font-family: var(--font-read); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .5px; color: #8a8170;
  padding: 4px 12px 6px;
}
.grownup-menu .menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-read); font-weight: 600; font-size: 1rem; color: var(--ink);
  padding: 11px 12px; border-radius: 10px;
}
.grownup-menu .menu-item:hover { background: var(--cream-2); }

/* ---------- home ---------- */
.hero {
  background: linear-gradient(135deg, var(--night-2), var(--night-3));
  border: 2px solid var(--night-3);
  border-radius: var(--radius);
  padding: 26px;
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
  box-shadow: var(--shadow);
  animation: rise .5s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.element-tile {
  width: 118px; height: 118px; border-radius: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 14px 30px rgba(0,0,0,.4);
  position: relative;
}
.element-tile .num { position: absolute; top: 8px; left: 12px; font-size: .8rem; opacity: .85; font-weight: 700; }
.element-tile .sym { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.element-tile .nm  { font-size: .82rem; font-weight: 700; margin-top: 4px; }

.hero h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; margin-bottom: 4px; }
.hero .sub { color: var(--cream-3); opacity: .9; font-size: 1rem; margin-bottom: 14px; }

.xpbar { background: var(--night); border-radius: 999px; height: 22px; overflow: hidden; border: 2px solid var(--night-3); }
.xpbar > div {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  box-shadow: 0 0 14px rgba(255,184,77,.55);
  transition: width .8s cubic-bezier(.2,.9,.3,1.2);
  min-width: 8px;
}
.xplabel { font-size: .9rem; margin-top: 8px; color: var(--cream-3); font-weight: 600; }

.section-title {
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  margin: 28px 4px 14px; color: var(--cream);
  display: flex; align-items: center; gap: 10px;
}
.section-title .dash { flex: 1; height: 2px; background: var(--night-3); border-radius: 2px; }

/* mission cards */
.mission-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.mission-card {
  text-align: left;
  background: var(--night-2); border: 2px solid var(--night-3);
  border-radius: 18px; padding: 16px;
  color: var(--cream);
  display: flex; gap: 12px; align-items: center;
  transition: transform .15s ease, border-color .15s ease;
}
.mission-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.mission-card .mi { font-size: 1.8rem; }
.mission-card .mt { font-weight: 700; font-size: 1rem; }
.mission-card .ms { font-size: .82rem; color: var(--cream-3); opacity: .85; }
.mission-card .tag {
  font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--night-3); color: var(--gold); display: inline-block; margin-bottom: 3px;
}

/* lab grid */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.lab-card {
  text-align: left;
  border-radius: var(--radius); padding: 22px 18px;
  border: 2px solid transparent;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative; overflow: hidden;
}
.lab-card:hover { transform: translateY(-4px) rotate(-0.5deg); }
.lab-card .li { font-size: 2.3rem; }
.lab-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin: 8px 0 2px; }
.lab-card p { font-size: .88rem; opacity: .85; font-weight: 500; }
.lab-card .lab-progress { margin-top: 12px; background: rgba(0,0,0,.14); height: 12px; border-radius: 99px; overflow: hidden; }
.lab-card .lab-progress > div { height: 100%; background: rgba(255,255,255,.85); border-radius: 99px; }
.lab-reading { background: linear-gradient(140deg, #ffd58a, var(--gold)); }
.lab-numbers { background: linear-gradient(140deg, #8ef0e4, var(--teal)); }
.lab-science { background: linear-gradient(140deg, #c3b8ff, var(--grape)); }
.lab-world   { background: linear-gradient(140deg, #a7e98a, var(--leaf)); }
.lab-computer { background: linear-gradient(140deg, #8fe0f7, #6d7bf0); }

/* badge shelf */
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--night-2); border: 2px solid var(--gold);
  color: var(--gold); border-radius: 999px; padding: 8px 14px;
  font-weight: 700; font-size: .9rem;
  animation: pop .4s ease both;
}
.badge-pill.locked { border-color: var(--night-3); color: #5d6483; filter: grayscale(1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- lab page ---------- */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.back-btn {
  background: var(--night-2); border: 2px solid var(--night-3); color: var(--cream);
  border-radius: 14px; padding: 10px 16px; font-weight: 700; font-size: 1rem;
}
.page-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; }

.activity-list { display: grid; gap: 14px; }
.activity-card {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--cream); color: var(--ink);
  border-radius: 18px; padding: 18px;
  border: 3px solid transparent;
  box-shadow: 0 6px 18px rgba(5,8,20,.35);
  transition: transform .15s ease, border-color .15s ease;
}
.activity-card:hover { transform: translateX(6px); border-color: var(--gold); }
.activity-card .ai { font-size: 2rem; width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; background: var(--cream-2); flex-shrink: 0; }
.activity-card .at { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.activity-card .ad { font-size: .88rem; opacity: .75; margin-top: 2px; }
.activity-card .meta { margin-left: auto; text-align: right; flex-shrink: 0; }
.mastery-ring { font-weight: 800; font-size: .92rem; color: var(--teal-deep); }
.mastery-bar { width: 90px; height: 10px; background: var(--cream-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.mastery-bar > div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--leaf)); border-radius: 99px; }

.preview-note {
  background: var(--night-2); border: 2px dashed var(--night-3); border-radius: 16px;
  padding: 14px 18px; color: var(--cream-3); font-size: .95rem; margin-bottom: 18px;
  display: flex; gap: 10px; align-items: center;
}

/* ---------- activity player ---------- */
.player {
  background: var(--cream); color: var(--ink);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 34px);
  box-shadow: var(--shadow);
  animation: rise .4s ease both;
}
.player .player-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.player .player-top h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; flex: 1; }
.dots { display: flex; gap: 7px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--cream-3); transition: background .3s, transform .3s; }
.dots span.done { background: var(--leaf); transform: scale(1.1); }
.dots span.now { background: var(--gold); transform: scale(1.25); box-shadow: 0 0 8px rgba(255,184,77,.7); }

.prompt {
  font-size: calc(1.45rem * var(--read-scale));
  font-weight: 600; line-height: 1.7;
  margin-bottom: 6px;
}
.prompt .big-word {
  font-size: calc(2.4rem * var(--read-scale));
  font-weight: 700; letter-spacing: .06em;
  display: inline-block; padding: 4px 18px;
  background: var(--cream-2); border-radius: 14px; border-bottom: 5px solid var(--gold);
}
.passage {
  background: var(--cream-2); border-radius: 16px; padding: 20px 22px;
  font-size: calc(1.3rem * var(--read-scale));
  line-height: 2.05; font-weight: 500;
  margin: 14px 0 18px;
}

.say-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--sky); color: var(--ink);
  border-radius: 999px; padding: 10px 20px;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 0 #3aa6d4;
  margin: 6px 0 16px;
  transition: transform .1s ease;
}
.say-btn:active { transform: translateY(3px); box-shadow: none; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.choices.two-col { grid-template-columns: repeat(2, minmax(120px, 240px)); justify-content: center; }
.choice-btn {
  background: #fff; border: 3px solid var(--cream-3); color: var(--ink);
  border-radius: 18px; padding: 18px 14px;
  font-family: var(--font-read);
  font-size: calc(1.35rem * var(--read-scale));
  font-weight: 600; min-height: 64px;
  transition: transform .12s ease, border-color .12s, background .12s;
}
.choice-btn:hover { transform: translateY(-3px); border-color: var(--gold); }
.choice-btn.correct { background: #e7f6dd; border-color: var(--leaf); animation: pop .35s ease; }
.choice-btn.faded { opacity: .45; }
.choice-btn.huge { font-size: calc(2.6rem * var(--read-scale)); font-weight: 700; }

/* letter tiles */
.tile-slots, .tile-bank { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.tile {
  width: 64px; height: 64px; border-radius: 14px;
  font-family: var(--font-read); font-size: 1.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.tile-bank .tile { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-deep); }
.tile-bank .tile:hover { transform: translateY(-4px); }
.tile-bank .tile:disabled { opacity: 0.25; box-shadow: none; transform: none; cursor: default; }
.tile-slots .slot { background: var(--cream-2); border: 3px dashed var(--cream-3); color: var(--ink); }
.tile-slots .slot.filled { background: var(--teal); color: #fff; border-style: solid; border-color: var(--teal-deep); }

/* order strip */
.order-strip { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 14px 0; min-height: 60px; }
.order-strip .picked {
  background: var(--teal); color: #fff; border-radius: 14px; padding: 12px 16px;
  font-weight: 700; font-size: 1.05rem;
}
.order-bank { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.order-bank .obtn {
  background: #fff; border: 3px solid var(--cream-3); border-radius: 14px;
  padding: 12px 16px; font-weight: 600; font-size: 1.05rem; color: var(--ink);
}
.order-bank .obtn:disabled { opacity: .3; }

.check-row { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.big-btn {
  font-family: var(--font-display);
  background: var(--leaf); color: #fff;
  font-weight: 800; font-size: 1.2rem;
  border-radius: 18px; padding: 14px 36px;
  box-shadow: 0 5px 0 var(--leaf-deep);
  transition: transform .1s ease;
}
.big-btn:active { transform: translateY(4px); box-shadow: none; }
.big-btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 5px 0 var(--gold-deep); }
.big-btn.ghost { background: var(--cream-2); color: var(--ink); box-shadow: 0 5px 0 var(--cream-3); }

/* feedback */
.feedback {
  margin-top: 18px; border-radius: 16px; padding: 16px 20px;
  font-size: calc(1.15rem * var(--read-scale)); font-weight: 600;
  display: flex; align-items: center; gap: 12px;
  animation: pop .3s ease both;
}
.feedback.yes { background: #e7f6dd; color: #2c5e12; border: 2px solid var(--leaf); }
.feedback.try { background: #fff3d6; color: #7a5200; border: 2px solid var(--gold); }
.feedback.reveal { background: #e8f1ff; color: #1d3f6e; border: 2px solid var(--sky); }
.feedback .fi { font-size: 1.7rem; }

/* end screen */
.endcard { text-align: center; padding: 30px 10px; }
.endcard .stars { font-size: 3.4rem; letter-spacing: .12em; margin: 12px 0; }
.endcard h3 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; }
.endcard .gain { font-size: 1.15rem; color: var(--teal-deep); font-weight: 700; margin: 10px 0 22px; }
.endcard .next-info { color: #6b6147; font-size: 0.98rem; margin-bottom: 18px; }

/* movement break */
.energizer {
  background: linear-gradient(140deg, #ff9d8a, var(--coral));
  color: var(--ink);
  border-radius: var(--radius); padding: 30px; text-align: center;
  box-shadow: var(--shadow);
  animation: rise .4s ease both;
}
.energizer h3 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; margin-bottom: 6px; }
.energizer .moves { display: grid; gap: 12px; margin: 22px auto; max-width: 420px; }
.energizer .move {
  background: rgba(255,255,255,.85); border-radius: 16px; padding: 14px 18px;
  font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; gap: 12px;
}
.energizer .move .me { font-size: 1.6rem; }

/* element road */
.element-road { display: flex; gap: 10px; flex-wrap: wrap; }
.road-el {
  width: 72px; height: 72px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  position: relative; border: 2px solid transparent;
}
.road-el .rs { font-size: 1.3rem; line-height: 1; }
.road-el .rn { font-size: .58rem; font-weight: 700; margin-top: 2px; }
.road-el.future { background: var(--night-2) !important; color: #565d7d; border-color: var(--night-3); }
.road-el.now { box-shadow: 0 0 0 4px var(--gold), 0 0 22px rgba(255,184,77,.6); }

/* parent view */
.parent-panel { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.parent-panel h3 { font-family: var(--font-display); font-weight: 800; margin: 18px 0 10px; font-size: 1.2rem; }
.skill-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.skill-table th, .skill-table td { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--cream-2); }
.skill-table th { font-weight: 700; color: #6b6147; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.skill-table .mbar { width: 130px; height: 10px; background: var(--cream-2); border-radius: 99px; overflow: hidden; }
.skill-table .mbar > div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--leaf)); }
.danger-btn { background: #f6dddd; color: #8c2b2b; border-radius: 12px; padding: 10px 18px; font-weight: 700; margin-top: 14px; }
.note-box { background: var(--cream-2); border-radius: 14px; padding: 14px 18px; font-size: .92rem; line-height: 1.6; margin-top: 10px; }
.parent-sub { font-size: .85rem; color: #6b6147; line-height: 1.5; margin: 2px 0 12px; }
.sitting { border: 2px solid var(--cream-2); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.sitting-head { font-family: var(--font-display); font-weight: 800; font-size: .98rem; margin-bottom: 6px; }
.sitting-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; padding: 5px 0; border-top: 1px solid var(--cream-2); }
.sitting-row:first-of-type { border-top: 0; }
.sitting-row em { color: #8c2b2b; font-style: normal; font-weight: 600; }

/* settings */
.settings-panel { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 2px solid var(--cream-2); flex-wrap: wrap; }
.setting-row .sl { font-weight: 700; font-size: 1.05rem; }
.setting-row .sd { font-size: .85rem; opacity: .7; margin-top: 2px; }
.seg { display: flex; gap: 6px; background: var(--cream-2); border-radius: 12px; padding: 5px; }
.seg button { background: transparent; border-radius: 9px; padding: 8px 16px; font-weight: 700; color: var(--ink); font-size: .95rem; }
.seg button.on { background: var(--teal); color: #fff; }

/* confetti */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetto {
  position: absolute; top: -20px;
  width: 12px; height: 12px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .9; }
}

/* periodic table explorer */
.ptable-wrap { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.ptable-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.pt-el {
  border-radius: 12px; padding: 8px 4px; text-align: center;
  font-family: var(--font-display); border: 2px solid transparent;
  color: var(--ink);
  transition: transform .12s ease;
}
.pt-el:hover { transform: scale(1.07); border-color: var(--ink); }
.pt-el .ps { font-size: 1.25rem; font-weight: 800; }
.pt-el .pn { font-size: .58rem; font-weight: 700; }
.el-detail {
  margin-top: 18px; background: var(--cream-2); border-radius: 16px; padding: 18px 20px;
  font-size: calc(1.1rem * var(--read-scale)); line-height: 1.8;
}
.el-detail h4 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 6px; }

/* ---------- tap-to-read (ear mode) ---------- */
.iconbtn.ear.on { border-color: var(--gold); background: var(--gold); color: var(--ink); box-shadow: 0 0 14px rgba(255,184,77,.7); }
.readmode-banner {
  background: linear-gradient(90deg, var(--gold), #ffd58a);
  color: var(--ink);
  border-radius: 14px; padding: 12px 18px;
  font-weight: 700; font-size: 1rem;
  margin-bottom: 16px;
  animation: pop .3s ease both;
}
.read-mode #app * { cursor: help; }
.reading-flash {
  outline: 4px solid var(--gold) !important;
  outline-offset: 2px;
  border-radius: 8px;
  transition: outline-color .3s;
}

/* ---------- mic + typed answers ---------- */
.mic-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grape); color: #fff;
  border-radius: 999px; padding: 11px 20px;
  font-weight: 700; font-size: 1rem;
  font-family: var(--font-read);
  box-shadow: 0 4px 0 #7a68d6;
  transition: transform .1s ease;
}
.mic-btn:active { transform: translateY(3px); box-shadow: none; }
.mic-btn:disabled { opacity: .9; }
.mic-btn.listening { background: var(--coral); box-shadow: 0 4px 0 #d65647; animation: pulse 1s ease infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mic-row { margin-top: 14px; }

.alt-answer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 18px; padding-top: 14px;
  border-top: 2px dashed var(--cream-3);
}
.alt-label { font-size: .92rem; opacity: .7; font-weight: 600; width: 100%; text-align: center; }
.typed-input {
  font-family: var(--font-read); font-size: 1.3rem; font-weight: 600;
  letter-spacing: .06em; color: var(--ink);
  background: #fff; border: 3px solid var(--cream-3); border-radius: 14px;
  padding: 10px 16px; width: min(280px, 60vw);
}
.typed-input:focus { outline: none; border-color: var(--teal); }
.big-btn.small { font-size: 1rem; padding: 11px 20px; }

/* ---------- settings: ElevenLabs section ---------- */
.settings-section {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  margin: 26px 0 8px; padding-bottom: 6px;
  border-bottom: 3px solid var(--cream-2);
}
.settings-section:first-child { margin-top: 0; }
.field-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.text-input {
  font-family: var(--font-read); font-size: 1rem; color: var(--ink);
  background: #fff; border: 3px solid var(--cream-3); border-radius: 12px;
  padding: 10px 14px; flex: 1; min-width: 220px;
}
.text-input:focus { outline: none; border-color: var(--teal); }
.voice-select {
  font-family: var(--font-read); font-size: 1rem; font-weight: 600; color: var(--ink);
  background: #fff; border: 3px solid var(--cream-3); border-radius: 12px;
  padding: 10px 14px; max-width: 260px;
}
.field-status { font-size: .92rem; font-weight: 600; margin: 8px 2px 4px; min-height: 1.2em; }
.status-ok { color: var(--leaf-deep); }
.status-off { color: #a05b2c; }

/* ---------- reading strip (ear-mode karaoke) ---------- */
#reading-strip {
  /* centered with auto margins — the pop animation's transform would override translateX centering */
  position: fixed; left: 0; right: 0; bottom: 20px; margin-inline: auto;
  z-index: 90;
  width: min(760px, 94vw);
  max-height: 32vh; overflow-y: auto;
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 18px 48px 18px 22px;
  box-shadow: 0 16px 44px rgba(5,8,20,.55);
  animation: pop .25s ease both;
}
#reading-strip .rs-words {
  font-family: var(--font-read);
  font-size: calc(1.5rem * var(--read-scale));
  font-weight: 600; line-height: 2.1; letter-spacing: .05em;
}
.rs-w { border-radius: 8px; padding: 2px 5px; transition: background .12s ease; }
.rs-w.now {
  background: var(--gold); color: var(--ink);
  box-shadow: 0 0 0 2px var(--gold-deep);
}
.rs-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--cream-2); color: var(--ink);
  font-size: 1rem; font-weight: 700;
}

/* ---------- question visuals (Gemini Nano Banana) ---------- */
.visual-box {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  width: min(380px, 100%);
  min-height: 120px; max-height: 280px;
  background: var(--cream-2);
  border: 3px solid var(--cream-3);
  border-radius: 18px;
  overflow: hidden;
  animation: pop .3s ease both;
}
.visual-box img {
  width: 100%; height: auto; max-height: 280px;
  object-fit: cover; display: block;
}
.visual-spin {
  font-size: 2rem;
  animation: paint 1.2s ease-in-out infinite;
}
@keyframes paint {
  0%, 100% { transform: rotate(-12deg) scale(1); opacity: .55; }
  50% { transform: rotate(12deg) scale(1.18); opacity: 1; }
}

/* ---------- problem toast ---------- */
.toast {
  position: fixed; left: 0; right: 0; bottom: 24px; margin-inline: auto;
  z-index: 100;
  width: fit-content;
  max-width: min(560px, 90vw);
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--coral);
  border-radius: 16px; padding: 14px 20px;
  font-weight: 600; font-size: .98rem; line-height: 1.5;
  box-shadow: 0 14px 40px rgba(5,8,20,.5);
  animation: pop .3s ease both;
}

@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .element-tile { margin: 0 auto; }
  .choices.two-col { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Three.js games (harness chrome + Atom Builder tray)
   ============================================================ */
.game-player { display: flex; flex-direction: column; }

/* one instruction at a time — large, calm, Lexend */
.game-banner {
  font-family: var(--font-read);
  font-size: calc(1.35rem * var(--read-scale));
  font-weight: 600; line-height: 1.6;
  background: var(--cream-2); color: var(--ink);
  border-radius: 16px; border-bottom: 5px solid var(--gold);
  padding: 14px 20px; margin: 4px 0 14px;
}

/* the WebGL canvas lives here — fixed, comfortable aspect, never scrolls under the tray */
.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 56vh;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #1d2340 0%, #14182a 70%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
}
.game-stage .game-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }

.game-loading, .game-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--cream);
  font-family: var(--font-display); font-size: 1.4rem; text-align: center; padding: 20px;
}
.game-loading { font-size: 2.4rem; }
.game-loading span { font-size: 1.1rem; font-family: var(--font-read); opacity: .85; }
.game-fallback { font-size: 2.6rem; }
.game-fallback span { font-size: 1.1rem; font-family: var(--font-read); max-width: 320px; }

/* control tray — big tap targets, no dexterity demand */
.game-tray { margin-top: 16px; }
.atom-tray {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "tile counters" "tile buttons";
  gap: 10px 18px; align-items: center;
}
.atom-target { grid-area: tile; width: 92px; height: 92px; border-radius: 18px; }
.atom-target .sym { font-size: 2rem; }
.atom-counters { grid-area: counters; display: flex; gap: 14px; flex-wrap: wrap; }
.atom-count {
  font-family: var(--font-read); font-weight: 600; font-size: 1.05rem;
  background: var(--cream-2); color: var(--ink);
  border-radius: 999px; padding: 7px 16px;
  border-left: 6px solid var(--cream-3);
}
.atom-count.proton { border-left-color: var(--coral); }
.atom-count.electron { border-left-color: var(--teal); }
.atom-count b { font-size: 1.2rem; }
.atom-count.ok { background: #e7f6dd; border-left-color: var(--leaf); }

.atom-buttons { grid-area: buttons; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.atom-btn {
  min-height: 56px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  color: var(--ink); border-radius: 16px; padding: 12px 20px;
  transition: transform .1s ease;
}
.atom-btn:active { transform: translateY(4px); box-shadow: none !important; }
.atom-btn.proton { background: var(--coral); box-shadow: 0 5px 0 #d65546; }
.atom-btn.neutron { background: var(--cream-3); box-shadow: 0 5px 0 #cdbd97; }
.atom-btn.electron { background: var(--teal); color: #08312c; box-shadow: 0 5px 0 var(--teal-deep); }

@media (max-width: 620px) {
  .atom-tray { grid-template-columns: 1fr; grid-template-areas: "tile" "counters" "buttons"; justify-items: center; }
  .game-stage { aspect-ratio: 4 / 3; }
}

/* Friction Lab — surface-choice tiles (big tap targets, predict-then-slide) */
.friction-tray { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.friction-tiles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.friction-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 120px; min-height: 96px; padding: 12px 18px;
  background: var(--cream-2); color: var(--ink);
  border-radius: 18px; box-shadow: 0 5px 0 var(--cream-3);
  font-family: var(--font-display); transition: transform .1s ease;
}
.friction-tile:active { transform: translateY(4px); box-shadow: none; }
.friction-tile[disabled] { opacity: .5; box-shadow: none; transform: translateY(4px); }
.friction-tile .ft-emoji { font-size: 2.1rem; line-height: 1.1; }
.friction-tile .ft-label { font-weight: 800; font-size: 1.15rem; }
.friction-tile .ft-hint { font-family: var(--font-read); font-weight: 600; font-size: .85rem; color: var(--ink-soft, #5a5a5a); }

/* ============================================================
   Computer Lab — DOM games (Binary Builder, Program the Robot)
   These draw straight into .game-stage (the dark "screen"), so
   styles assume a dark background and light text.
   ============================================================ */

/* ---- Binary Builder ---- */
.binary-board {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(12px, 3.5vh, 26px); padding: 16px; color: var(--cream);
}
.bb-goal { font-family: var(--font-display); font-size: clamp(1.2rem, 4vw, 1.7rem); }
.bb-goal b { color: var(--gold); font-size: 1.3em; }
.bb-lights { display: flex; gap: clamp(8px, 2.5vw, 16px); flex-wrap: wrap; justify-content: center; }
.bb-light {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--night-3); border: 3px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 12px 10px 8px; min-width: 62px;
  transition: transform .12s ease, border-color .12s, background .12s;
}
.bb-light:hover { transform: translateY(-3px); }
.bb-light .bb-bulb {
  width: 34px; height: 34px; border-radius: 50%;
  background: #2a3157; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
  transition: background .15s, box-shadow .15s;
}
.bb-light .bb-val { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--cream); }
.bb-light .bb-bit { font-family: var(--font-read); font-weight: 700; font-size: .95rem; opacity: .6; }
.bb-light.on { background: #3a2f12; border-color: var(--gold); }
.bb-light.on .bb-bulb { background: var(--gold); box-shadow: 0 0 16px 3px rgba(255,184,77,.7); }
.bb-light.on .bb-bit { opacity: 1; color: var(--gold); }
.bb-total { font-family: var(--font-read); font-weight: 600; font-size: 1.15rem; }
.bb-total b { font-family: var(--font-display); font-size: 1.5rem; color: var(--sky); }
.bb-total.ok b { color: var(--leaf); }
.bb-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }

/* Place Value Builder (Number Lab) — base-10 twin of the binary board */
.pv-board {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 3vh, 22px); padding: 16px; color: var(--cream);
}
.pv-goal { font-family: var(--font-display); font-size: clamp(1.2rem, 4vw, 1.7rem); }
.pv-goal b { color: var(--gold); font-size: 1.3em; }
.pv-cols { display: flex; gap: clamp(6px, 2vw, 14px); flex-wrap: wrap; justify-content: center; }
.pv-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--night-3); border: 3px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 8px 8px 6px; min-width: 64px;
}
.pv-name { font-family: var(--font-read); font-weight: 700; font-size: .72rem; opacity: .7; text-transform: uppercase; letter-spacing: .3px; }
.pv-step {
  background: #2a3157; border: none; color: var(--cream); font-size: 1.1rem;
  border-radius: 10px; width: 42px; height: 34px; cursor: pointer;
  transition: background .12s, transform .1s;
}
.pv-step:hover { background: var(--gold); color: var(--night-3); }
.pv-step:active { transform: scale(.92); }
.pv-digit { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--gold); min-width: 1.2em; text-align: center; }
.pv-place { font-family: var(--font-read); font-size: .72rem; opacity: .55; }
.pv-total { font-family: var(--font-read); font-weight: 600; font-size: 1.15rem; }
.pv-total b { font-family: var(--font-display); font-size: 1.5rem; color: var(--sky); }
.pv-total.ok b { color: var(--leaf); }
.pv-expand { font-family: var(--font-read); font-size: 1rem; opacity: .8; }
.pv-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }

/* Compass Quest (World Explorer) — 3×3 direction grid on the dark stage */
.compass-board { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; color: var(--cream); }
.compass-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: clamp(6px, 1.6vw, 12px); width: min(86%, 380px); aspect-ratio: 1 / 1;
}
.cq-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 16px; background: var(--night-3); border: 3px solid rgba(255,255,255,.12);
  color: var(--cream); font-family: var(--font-display); position: relative;
  transition: transform .12s ease, border-color .12s, background .12s;
}
.cq-dir { cursor: pointer; }
.cq-dir:hover { transform: translateY(-2px); border-color: var(--gold); }
.cq-dir:active { transform: scale(.95); }
.cq-arrow { font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1; color: var(--sky); }
.cq-label { font-weight: 800; font-size: clamp(.85rem, 2.6vw, 1.1rem); letter-spacing: .5px; }
.cq-landmark { position: absolute; top: 4px; right: 6px; font-size: clamp(1.1rem, 3.4vw, 1.5rem); }
.cq-center { background: transparent; border-style: dashed; border-color: rgba(255,255,255,.18); }
.cq-center .cq-you { font-size: clamp(1.4rem, 5vw, 2rem); }
.cq-center .cq-here { font-family: var(--font-read); font-weight: 700; font-size: .7rem; opacity: .6; }
.cq-cell.cq-correct { background: #1f3a2a; border-color: var(--leaf); box-shadow: 0 0 16px 2px rgba(125,200,120,.45); }
.cq-cell.cq-correct .cq-arrow { color: var(--leaf); }
.cq-cell.cq-miss { border-color: var(--coral); animation: cq-shake .3s; }
@keyframes cq-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.cq-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }

/* Bead Multiplication (Number Lab) — controls under the 3D mat */
.bead-tray { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.bead-count { font-family: var(--font-read); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.bead-count b { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
.bead-buttons, .bead-choices { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.bead-btn {
  min-height: 52px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--ink); border-radius: 14px; padding: 10px 18px; transition: transform .1s ease;
}
.bead-btn.add { background: var(--gold); box-shadow: 0 5px 0 #d9a43c; }
.bead-btn:active { transform: translateY(4px); box-shadow: none !important; }
.bead-btn[disabled] { opacity: .45; box-shadow: none; }
.bead-choice {
  min-width: 76px; min-height: 64px; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem;
  color: var(--ink); background: var(--cream-2); border-radius: 16px; box-shadow: 0 5px 0 var(--cream-3);
  transition: transform .1s ease;
}
.bead-choice:active { transform: translateY(4px); box-shadow: none; }

/* "This week at school" focus cards — a distinct accent on the standard mission card */
.mission-card.focus { border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(255,184,77,.12); }
.mission-card.focus .tag { color: var(--gold); font-weight: 800; }

/* Star Word — type a word, hear it */
.starword { background: var(--night-3); border: 2px solid rgba(255,255,255,.10); border-radius: 14px; padding: 12px 14px; margin: 6px 0 14px; }
.sw-label { font-family: var(--font-display); font-weight: 700; color: var(--cream); }
.sw-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.sw-input { flex: 1 1 180px; min-width: 140px; font-size: 1.1rem; padding: 8px 12px; border-radius: 10px; border: 2px solid rgba(255,255,255,.15); background: var(--night-2, #1a2036); color: var(--cream); }
.sw-input:focus { outline: none; border-color: var(--gold); }
.sw-msg { display: inline-block; margin-top: 8px; font-family: var(--font-read); color: var(--gold); min-height: 1.2em; }

/* Easter eggs (Phase 2) */
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.element-tile.wiggle { animation: wiggle .6s ease; }
.element-tile { position: relative; }   /* anchor googly eyes */
.element-tile.pranked .num, .element-tile.pranked .sym { opacity: .35; }
.googly { position: absolute; width: 22px; height: 22px; background: #fff; border: 2px solid #1c2030; border-radius: 50%; box-shadow: inset 0 0 0 1px #ddd; }
.googly::after { content: ""; position: absolute; width: 9px; height: 9px; background: #1c2030; border-radius: 50%; top: 7px; left: 6px; animation: googly-roll 1.6s ease-in-out infinite; }
.googly.g1 { top: 30%; left: 30%; }
.googly.g2 { top: 30%; right: 30%; }
@keyframes googly-roll { 0%,100% { transform: translate(0,0); } 25% { transform: translate(3px,2px); } 50% { transform: translate(-2px,3px); } 75% { transform: translate(2px,-2px); } }

/* Progress reports (parent-facing) */
.report-nudge { display: block; width: 100%; margin: 0 0 14px; padding: 12px 16px; border: 2px solid var(--gold); background: rgba(255,184,77,.12); color: var(--cream); border-radius: 12px; font-family: var(--font-display); font-weight: 700; cursor: pointer; }
.report-nudge:hover { background: rgba(255,184,77,.2); }
.rep-note { color: var(--cream-3); font-size: .95rem; margin: 4px 0 14px; }
.rep-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rep-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--night-3); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 14px; }
.rep-label { font-family: var(--font-read); color: var(--cream); }
.rep-actions { display: flex; gap: 8px; }
.rep-empty { color: var(--cream-3); opacity: .7; font-style: italic; }
.rep-aud { margin-bottom: 22px; }
.aud-title { font-family: var(--font-display); color: var(--gold); font-size: 1.15rem; margin: 8px 0 2px; }
.rep-aud.kid { border-top: 2px dashed rgba(255,184,77,.3); padding-top: 14px; }
.rep-aud.kid .aud-title { color: var(--teal); }

/* ---- Grown-up Check-in (adult-administered probes) ---- */
.gate { max-width: 460px; margin: 24px auto; text-align: center; color: var(--cream); }
.gate-q { font-size: 1.3rem; margin: 18px 0 14px; }
.gate-opts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.big-btn.leaf { background: var(--leaf); color: #14271a; }
.big-btn.wrong { animation: wiggle .3s; opacity: .5; }
.checkin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.checkin-card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--night-3); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px 16px; cursor: pointer; color: var(--cream); font-family: var(--font-read); }
.checkin-card:hover { border-color: var(--gold); }
.checkin-card .ci-ic { font-size: 1.6rem; }
.checkin-card .ci-t { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.checkin-card .ci-d { font-size: .85rem; color: var(--cream-3); }
.checkin-card .ci-last { font-size: .78rem; color: var(--teal); margin-top: 2px; }
.probe-dots { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.probe-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--night-3); border: 1px solid rgba(255,255,255,.15); }
.probe-dots span.done { background: var(--leaf); } .probe-dots span.now { background: var(--gold); transform: scale(1.3); }
.nonword-stage { display: flex; align-items: center; justify-content: center; min-height: 38vh; }
.nonword { font-family: var(--font-read); font-weight: 700; font-size: clamp(3rem, 14vw, 6rem); letter-spacing: .08em; background: var(--cream); color: var(--ink); padding: 18px 40px; border-radius: 20px; }
.probe-instruct { text-align: center; color: var(--cream-3); margin: 10px 0; }
.probe-score { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.probe-summary { text-align: center; color: var(--cream); margin-top: 18px; }
.probe-summary .ps-big { font-family: var(--font-display); font-weight: 800; font-size: 3rem; color: var(--gold); }
.probe-summary .ps-u { font-size: 1.2rem; } .probe-summary .ps-sub { color: var(--cream-3); margin-bottom: 8px; }
.adult-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--night-3); border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.adult-strip .fl-state { flex: 1; min-width: 140px; color: var(--cream-3); font-size: .9rem; }
.fluency-passage { font-family: var(--font-read); font-size: 1.5rem; line-height: 2.1; letter-spacing: var(--read-spacing); color: var(--cream); background: var(--night-2); border-radius: 14px; padding: 18px 20px; }
.fluency-passage .rwl-w { cursor: pointer; padding: 0 2px; border-radius: 4px; }
.fluency-passage .rwl-w.err { background: var(--coral); color: #2a0f0c; text-decoration: line-through; }
.sounds-script { font-family: var(--font-read); font-weight: 700; font-size: clamp(2rem, 10vw, 4rem); color: var(--cream); letter-spacing: .04em; }
.tap-pad { display: flex; gap: 16px; justify-content: center; padding: 16px; margin: 4px auto 8px; cursor: pointer; }
.tap-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--gold); background: transparent; transition: background .1s; }
.tap-dot.on { background: var(--gold); }
.adult-key { text-align: center; color: var(--teal); font-size: .95rem; margin-bottom: 10px; }
.belief-q { background: var(--night-3); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.belief-q h3 { margin: 0 0 10px; font-family: var(--font-display); color: var(--cream); font-size: 1.05rem; }
.belief-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.belief-opt { background: var(--night-2); border: 2px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 16px; color: var(--cream); font-family: var(--font-read); font-size: 1rem; cursor: pointer; }
.belief-opt:hover { border-color: var(--gold); }
.belief-opt.sel { border-color: var(--leaf); background: rgba(123,201,80,.18); }
.belief-opts.feels .belief-opt { font-size: 1.8rem; padding: 8px 16px; }

/* ---- Program the Robot ---- */
.robot-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px; }
.robot-board { --rc-size: clamp(38px, 9vw, 60px); display: grid; gap: 6px; }
.rc {
  position: relative; width: var(--rc-size); height: var(--rc-size);
  border-radius: 10px; background: var(--night-3);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.05);
}
.rc.wall { background: #4a2230; box-shadow: inset 0 0 0 2px rgba(255,120,120,.25); }
.rc.goal::after {
  content: "⭐"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--rc-size) * 0.6);
}
.rc .robot {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--rc-size) * 0.66);
  transition: transform .18s ease;
}
.rc .robot.bump { animation: rc-bump .3s ease; }
@keyframes rc-bump { 0%,100% { transform: translate(0,0); } 50% { transform: translate(0,-4px) rotate(-6deg); } }

.robot-controls { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.robot-strip {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  min-height: 52px; width: 100%; padding: 10px 12px;
  background: var(--cream-2); border-radius: 14px; align-items: center;
}
.robot-strip .cmd {
  display: inline-flex; align-items: center; gap: 2px;
  background: #fff; border-radius: 10px; padding: 6px 10px;
  font-size: 1.4rem; box-shadow: 0 2px 0 var(--cream-3);
}
.robot-strip .cmd b { font-family: var(--font-display); font-size: 1rem; color: var(--teal-deep); }
.robot-strip .cmd.empty { background: none; box-shadow: none; font-size: 1rem; font-family: var(--font-read); color: var(--ink); opacity: .55; }
.robot-pad { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.robot-pad-row { display: flex; gap: 8px; }
.rbtn {
  width: 60px; height: 60px; font-size: 1.8rem; border-radius: 16px;
  background: var(--sky); color: var(--ink); box-shadow: 0 5px 0 #36a9d6;
  transition: transform .1s ease;
}
.rbtn:active { transform: translateY(4px); box-shadow: none; }
.robot-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }

/* ============================================================
   Research upgrades — reading-while-listening + movement prime
   ============================================================ */

/* RWL: highlight each word of a story passage as it is read aloud */
.passage .rwl-w { border-radius: 6px; padding: 0 2px; transition: background .12s ease, color .12s ease; }
.passage .rwl-w.rwl-now { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px rgba(255,184,77,.35); }

/* Home prompt to warm up the body first (shown until primed for the day) */
.prime-hint {
  display: block; width: 100%; cursor: pointer;
  background: linear-gradient(140deg, #bdeecf, #8ee0c0);
  color: var(--ink); border-radius: var(--radius);
  padding: 13px 18px; margin: 2px 0 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 5px 0 #66c39a; text-align: center;
  transition: transform .1s ease;
}
.prime-hint:active { transform: translateY(4px); box-shadow: none; }

/* Phoneme–grapheme mapping: sound boxes hold multi-letter graphemes (sh, ai, igh) */
.map-label { font-weight: 700; font-size: 1.05rem; margin: 8px 0 2px; color: var(--ink); }
.tile.gtile,
.tile-slots.sound-boxes .slot.sbox { width: auto; min-width: 64px; padding: 0 16px; font-size: 1.7rem; }
.tile-slots.sound-boxes .slot.sbox { box-shadow: inset 0 0 0 2px rgba(20,24,42,.06); }

/* Repeated reading: self-rating chips (metacognition, not a grade) */
.rate-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-weight: 600; }
.rate-chip {
  background: var(--cream-2); color: var(--ink); border-radius: 999px;
  padding: 10px 18px; font-weight: 700; font-size: 1rem; box-shadow: 0 4px 0 var(--cream-3);
  transition: transform .1s ease;
}
.rate-chip:active { transform: translateY(4px); box-shadow: none; }

/* "Look how far you've come" growth view + home entry button */
.growth-btn {
  display: block; width: 100%; cursor: pointer;
  background: linear-gradient(140deg, #ffd58a, var(--gold));
  color: var(--ink); border-radius: var(--radius);
  padding: 14px 18px; margin: 4px 0 18px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 5px 0 var(--gold-deep); text-align: center;
  transition: transform .1s ease;
}
.growth-btn:active { transform: translateY(4px); box-shadow: none; }
.growth { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: clamp(18px,4vw,30px); box-shadow: var(--shadow); animation: rise .4s ease both; }
.growth-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.growth-hero h3 { font-family: var(--font-display); font-size: 1.3rem; }
.growth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.growth-stat { background: var(--cream-2); border-radius: 16px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.growth-stat .gs-i { font-size: 1.8rem; }
.growth-stat .gs-n { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--gold-deep); }
.growth-stat .gs-l { font-size: .95rem; font-weight: 600; line-height: 1.3; }
.growth-note { background: #e7f6dd; border-radius: 16px; padding: 16px 20px; margin: 18px 0; font-size: 1.1rem; line-height: 1.6; }

/* Worked example shown once before a new skill (faded scaffolding) */
.we-card { background: var(--cream-2); border-radius: 18px; padding: 20px 22px; border-left: 6px solid var(--gold); }
.we-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; margin-bottom: 12px; }
.we-word { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; letter-spacing: .06em; text-align: center; color: var(--gold-deep); margin: 6px 0 14px; }
.we-steps { margin: 0 0 12px 1.2em; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.we-steps li { font-size: calc(1.15rem * var(--read-scale)); line-height: 1.6; }

/* "Learn it first" concept lesson — themed sky (teaching) vs gold (worked example) */
.lesson-card { border-left-color: var(--sky); }
.lesson-visual { width: min(340px, 100%); max-height: 220px; margin: 4px auto 16px; }
.lesson-lines { list-style: disc; margin: 0 0 12px 1.2em; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.lesson-lines li { font-size: calc(1.15rem * var(--read-scale)); line-height: 1.6; }

/* 💡 Learn chip beside an activity card in the lab list */
.activity-row { display: flex; gap: 10px; align-items: stretch; }
.activity-row .activity-card { flex: 1; }
.learn-chip {
  flex-shrink: 0; width: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--cream-2); color: var(--ink);
  border-radius: 18px; border: 3px solid transparent;
  box-shadow: 0 6px 18px rgba(5,8,20,.35);
  font-size: 1.5rem; transition: transform .15s ease, border-color .15s ease;
}
.learn-chip span { font-family: var(--font-display); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.learn-chip:hover { transform: translateY(-2px); border-color: var(--sky); }

/* Smooth Reading story picker (autonomy / choice within structure) */
.story-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 8px; }
.story-card {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  background: var(--cream-2); color: var(--ink); border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 4px 0 var(--cream-3); cursor: pointer; transition: transform .1s ease;
}
.story-card:active { transform: translateY(4px); box-shadow: none; }
.story-card .sc-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.story-card .sc-pat { font-size: .85rem; background: var(--cream-3); border-radius: 99px; padding: 2px 10px; font-weight: 700; }
.story-card .sc-meta { font-size: .85rem; font-weight: 700; opacity: .7; }
.story-card.surprise { background: linear-gradient(140deg, #c3b8ff, var(--grape)); box-shadow: 0 4px 0 #7a6ad0; justify-content: center; align-items: center; }
