
/* Layout: one friendly column, like pages in a lab notebook, with a microscope "eyepiece" hero and two hands-on stations (explore the cell, watch it split). Colors borrow from real microscope stains: pink eosin and purple hematoxylin. */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #000000;
  --muted: #2B2B2B;
  --line: #DDDDDD;
  --hema: #5A3DB0;
  --eosin: #D23E7E;
  --on-accent: #FFFFFF;
  --mito: #E9821E;
  --gel: #F3EEFA;
  --gel-edge: #B99BE6;
  --nuc: #7C5BD6;
  --nuc-dark: #4B2F9E;
  --ok: #1F8A5B;
  --ok-bg: #E2F4EB;
  --bad: #C23B3B;
  --bad-bg: #FBE6E6;
  --slide: #FDF0F5;
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2.2rem, 6vw, 3.6rem);
  --radius: 18px;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 32px 64px;
  display: grid;
  gap: 72px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); font-weight: 700; }
h2 { font-size: var(--step-2); font-weight: 600; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; max-width: 62ch; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--eosin);
}
section { display: grid; gap: 20px; }
.stack { display: grid; gap: 12px; }
strong { color: var(--ink); }

button {
  font: 600 1rem var(--font-display);
  border: 2px solid var(--hema);
  background: var(--surface);
  color: var(--hema);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
button:hover { transform: translateY(-2px); }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--eosin); outline-offset: 3px; }
button.primary { background: var(--hema); color: var(--on-accent); }
button:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
}
.hero p.lead { font-size: var(--step-1); color: var(--muted); }
.eyepiece { position: relative; max-width: 100%; }
.eyepiece svg { width: 100%; height: auto; display: block; }
.eyepiece figcaption { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* ---------- What is a cell ---------- */
.bricks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.brick {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.15rem;
}
.brick svg { width: 100%; max-width: 140px; height: 70px; }
.brick:hover { border-color: var(--hema); }
.brick[aria-pressed="true"] { border-color: var(--eosin); background: var(--slide); color: var(--eosin); }
.cell-pick-q { font: 600 var(--step-1) var(--font-display); }
.cell-pick-q a { color: var(--hema); }
.cell-info {
  background: var(--surface);
  border: 2px solid var(--eosin);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 10px;
}
.cell-info.empty { border-style: dashed; border-color: var(--line); color: var(--muted); text-align: center; }
.cell-info dl { margin: 0; display: grid; gap: 10px; }
.cell-info dt { font: 600 1rem var(--font-display); color: var(--eosin); text-transform: uppercase; letter-spacing: 0.06em; }
.cell-info dd { margin: 0; max-width: 62ch; }

/* ---------- Explorer ---------- */
.station {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: center;
}
.station > * { min-width: 0; }
.diagram svg { width: 100%; height: auto; display: block; }
.part { cursor: pointer; transition: filter .2s ease; }
.part:hover, .part.active { filter: drop-shadow(0 0 6px var(--eosin)); }
.cyto { fill: var(--gel); }
.membrane { fill: none; stroke: var(--gel-edge); stroke-width: 14; pointer-events: stroke; }
.membrane-inner { fill: none; stroke: var(--hema); stroke-width: 2.5; stroke-dasharray: 2 6; stroke-linecap: round; pointer-events: none; }
.nucleus-body { fill: var(--nuc); }
.nucleolus { fill: var(--nuc-dark); }
.mito-body { fill: var(--mito); }
.mito-fold { fill: none; stroke: var(--surface); stroke-width: 2.5; stroke-linecap: round; }
.dna { fill: none; stroke: var(--surface); stroke-width: 2; opacity: .7; }
.speck { fill: var(--gel-edge); }

.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker button[aria-pressed="true"] { background: var(--hema); color: var(--on-accent); }
.info { display: grid; gap: 12px; }
.info .nick {
  display: inline-block;
  justify-self: start;
  background: var(--slide);
  color: var(--eosin);
  font: 600 0.95rem var(--font-display);
  padding: 4px 12px;
  border-radius: 999px;
}
.info .job { color: var(--muted); }
.info .try { font-style: italic; color: var(--muted); border-left: 3px solid var(--eosin); padding-left: 12px; }

/* ---------- Division ---------- */
.split-stage { grid-template-columns: 1fr; }
.split-svg { width: 100%; height: auto; max-height: 280px; display: block; }
.daughter, .daughter .nuc {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 1s cubic-bezier(.5,0,.3,1);
}
.daughter circle.mem { fill: var(--gel); stroke: var(--gel-edge); stroke-width: 6; }
.daughter .nuc circle { fill: var(--nuc); }
[data-step="1"] .daughter { transform: scale(1.22); }
[data-step="2"] .daughter { transform: scale(1.22); }
[data-step="2"] .a .nuc { transform: translateX(-26px); }
[data-step="2"] .b .nuc { transform: translateX(26px); }
[data-step="3"] .a { transform: translateX(-42px) scale(1.12); }
[data-step="3"] .b { transform: translateX(42px) scale(1.12); }
[data-step="3"] .a .nuc { transform: translateX(-14px); }
[data-step="3"] .b .nuc { transform: translateX(14px); }
[data-step="4"] .a { transform: translateX(-90px); }
[data-step="4"] .b { transform: translateX(90px); }
.split-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li {
  border-radius: 12px;
  padding: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
  border: 2px solid transparent;
  transition: border-color .3s, color .3s;
}
.steps li b { display: block; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.steps li.on { border-color: var(--eosin); color: var(--ink); }
.count { margin-left: auto; font-family: var(--font-display); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.count b { color: var(--eosin); font-size: 1.5rem; }
.doubling {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted);
}
.doubling span { background: var(--slide); color: var(--eosin); padding: 2px 10px; border-radius: 999px; font-weight: 600; }

/* ---------- Facts ---------- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--slide);
  display: grid;
  gap: 8px;
  align-content: start;
}
.fact .big { font: 700 2.4rem/1 var(--font-display); color: var(--eosin); font-variant-numeric: tabular-nums; }
.fact .unit { font: 600 1rem var(--font-display); color: var(--hema); }

/* ---------- Quiz ---------- */
.quiz { display: grid; gap: 16px; }
.q {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 12px;
}
.q .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q button.right { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.q button.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.q .fb { font-weight: 700; min-height: 1.6em; }
.q .fb.good { color: var(--ok); }
.q .fb.oops { color: var(--bad); }
.score {
  border-radius: var(--radius);
  padding: 20px;
  background: var(--hema);
  color: var(--on-accent);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.score p { font: 600 var(--step-1) var(--font-display); max-width: none; }
.score button { border-color: var(--on-accent); background: transparent; color: var(--on-accent); }

footer { color: var(--muted); font-size: 0.9rem; text-align: center; }

/* ---------- Motion ---------- */
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes drift { 0%,100% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(3px,-4px) rotate(4deg); } }
.breathe { transform-box: fill-box; transform-origin: center; animation: breathe 5s ease-in-out infinite; }
.drift { transform-box: fill-box; transform-origin: center; animation: drift 6s ease-in-out infinite; }
.drift.d2 { animation-delay: -2s; } .drift.d3 { animation-delay: -4s; }
@media (prefers-reduced-motion: reduce) {
  .breathe, .drift { animation: none; }
  .daughter, .daughter .nuc, button { transition: none; }
}

/* ---------- Narrow ---------- */
@media (max-width: 760px) {
  .hero, .station { grid-template-columns: 1fr; }
  .eyepiece { max-width: 340px; margin: 0 auto; }
  .bricks, .facts { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .station { padding: 18px; border-radius: 22px; }
  .wrap { gap: 56px; }
}
body { margin: 0; } img { max-width: 100%; } [hidden] { display: none !important; }

/* ---------- Links to cell pages ---------- */
a.brick { text-decoration: none; font-family: var(--font-display); font-weight: 600; transition: transform .15s ease, border-color .15s ease; }
a.brick:hover { transform: translateY(-3px); }
a.brick:focus-visible { outline: 3px solid var(--eosin); outline-offset: 3px; }
.brick .go { font-size: 0.95rem; color: var(--eosin); }

/* ---------- Lesson pages ---------- */
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.topbar a { font: 600 1rem var(--font-display); color: var(--hema); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.cell-hero { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: center; }
.cell-hero > * { min-width: 0; }
.cell-hero svg { width: 100%; height: auto; display: block; }
.cell-hero .lead { font-size: var(--step-1); color: var(--muted); }
.progress { display: flex; flex-wrap: wrap; gap: 8px; }
.progress button[aria-current="step"] { background: var(--hema); color: var(--on-accent); }
.progress button.done::after { content: " ✓"; }
.lesson {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  display: grid;
  gap: 16px;
  scroll-margin-top: 16px;
}
.lesson > * { min-width: 0; }
.lesson .eyebrow { margin-bottom: -8px; }
.callout { border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; }
.callout p { max-width: none; }
.callout.try { background: var(--slide); }
.callout.wow { background: var(--gel); }
.callout .label { font: 600 0.85rem var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--eosin); }
.lesson ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; max-width: 62ch; }
.figure { overflow-x: auto; }
.figure svg { width: 100%; min-width: 420px; max-width: 620px; height: auto; display: block; }
.figure text { font-family: var(--font-display); font-weight: 600; font-size: 15px; fill: var(--ink); }
.figure text.small { font-size: 13px; fill: var(--muted); font-weight: 500; }
.lesson-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) {
  .cell-hero { grid-template-columns: 1fr; }
  .cell-hero svg { max-width: 260px; margin: 0 auto; }
  .lesson { padding: 20px; border-radius: 22px; }
  .more { grid-template-columns: 1fr; }
}

/* ---------- Videos ---------- */
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.video { display: grid; gap: 8px; align-content: start; min-width: 0; }
.video .frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 16px; overflow: hidden; background: #000; border: 2px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video h3 { font-size: 1.1rem; }
.video p { color: var(--muted); font-size: 0.95rem; }
.video a { color: var(--hema); font: 600 0.95rem var(--font-display); }
@media (max-width: 760px) { .videos { grid-template-columns: 1fr; } }

/* ---------- 3D viewer ---------- */
.v3d { display: grid; gap: 12px; }
.v3d-stage {
  position: relative;
  height: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #F5F1FA;
}
.v3d-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d-labels { position: absolute; inset: 0; pointer-events: none; }
.v3d-label { position: absolute; left: 0; top: 0; will-change: transform; }
.v3d-label .dot {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #FFFFFF; border: 3px solid var(--eosin);
  transform: translate(-50%, -50%);
}
.v3d-label .txt {
  position: absolute; transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap; background: #FFFFFF; color: #000000;
  border: 2px solid #000000; border-radius: 999px; padding: 2px 10px;
  font: 600 0.9rem var(--font-display);
}
.v3d.nolabels .v3d-labels { display: none; }
.v3d-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v3d-controls button[aria-pressed="true"] { background: var(--hema); color: var(--on-accent); }
.v3d-sep { width: 2px; height: 28px; background: var(--line); margin: 0 4px; }
.v3d-caption { font-weight: 700; min-height: 3.2em; }
.v3d-fallback {
  position: absolute; inset: 0; margin: 0; max-width: none;
  display: grid; place-items: center; padding: 16px; text-align: center; background: #F5F1FA;
}
@media (max-width: 760px) {
  .v3d-stage { height: 330px; }
  .v3d-sep { display: none; }
}

/* phone: tell kids they can swipe wide pictures */
.figure::after { content: none; }
@media (max-width: 600px) {
  .figure::after {
    content: "Swipe to see the whole picture →";
    display: block; margin-top: 6px;
    font: 600 0.85rem var(--font-display); color: var(--eosin);
    position: sticky; left: 0;
  }
}

/* ---------- Cell groups (animal / plant / human) ---------- */
.kind {
  display: inline-block; justify-self: start;
  font: 600 0.8rem var(--font-display); text-transform: uppercase; letter-spacing: 0.07em;
  padding: 3px 10px; border-radius: 999px; color: #FFFFFF; vertical-align: middle;
}
.kind-animal { background: #6A4FC4; }
.kind-plant { background: #2E7D32; }
.kind-human { background: #C2185B; }
.cell-hero .kind { font-size: 0.9rem; }
.brick .kind { font-size: 0.72rem; }
.groups-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cell-group { display: grid; gap: 12px; align-content: start; padding: 20px; border-radius: 24px; border: 2px solid; }
.cell-group h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cell-group p { max-width: 62ch; }
.group-animal { background: #F4F0FB; border-color: #B9A6E8; }
.group-plant { background: #EEF8EA; border-color: #8CC98A; }
.group-human { background: #FDF0F5; border-color: #EBA3C2; }
.cell-group .brick { background: #FFFFFF; }
.bricks.one { grid-template-columns: 1fr; }
.bricks.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .bricks.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .groups-top { grid-template-columns: 1fr; } }

/* ---------- Click-to-play video ---------- */
.video .play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: #000; cursor: pointer; }
.video .play:hover { transform: none; }
.video .play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .2s; }
.video .play:hover img { opacity: 1; }
.video .play-icon {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; transform: translate(-50%, -50%);
  background: #E62117; border-radius: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .15s;
}
.video .play-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
  border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent #FFFFFF;
}
.video .play:hover .play-icon { transform: translate(-50%, -50%) scale(1.08); }
.video .play:focus-visible { outline: 4px solid var(--eosin); outline-offset: -4px; }

/* ======================================================
   Round 6: top links, badges, read aloud, words, games, compare
   ====================================================== */
.kind-onecell { background: #2F7A6B; }
.group-onecell { background: #EAF6F3; border-color: #8CC5B8; }
.groups-top { grid-template-columns: repeat(3, 1fr); }
.bricks.six { grid-template-columns: repeat(3, 1fr); }
.more { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .groups-top { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .bricks.six { grid-template-columns: repeat(2, 1fr); }
  .more { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) { .bricks.six, .more { grid-template-columns: 1fr; } }

/* Top bar links */
.toplinks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.toplinks a { font: 600 1rem var(--font-display); color: var(--hema); text-decoration: none; }
.toplinks a:hover { text-decoration: underline; }
.brand { font: 700 1.3rem var(--font-display); color: var(--ink); }

/* Badge marks + toast */
.got { font: 600 0.85rem var(--font-display); color: #8A6400; background: #FFF4CC; border-radius: 999px; padding: 2px 10px; }
.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(520px, calc(100% - 32px));
  background: #24163A; color: #FFFFFF; border-radius: 16px; padding: 14px 18px;
  font: 600 1rem var(--font-display); box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast a { color: #FFD23F; }

/* Read aloud */
.read-aloud { justify-self: start; }
.read-aloud[aria-pressed="true"] { background: var(--hema); color: var(--on-accent); }

/* Tappable words */
.term {
  font: inherit; font-weight: inherit; color: inherit; background: none; border: 0; border-radius: 0;
  padding: 0; cursor: help; text-decoration: underline dotted var(--eosin) 2px; text-underline-offset: 3px;
}
.term:hover { transform: none; color: var(--eosin); }
.term-pop {
  position: absolute; z-index: 40; background: #FFFFFF; color: #000000;
  border: 2px solid #000000; border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.18); display: grid; gap: 6px;
}
.term-pop strong { font: 600 1.1rem var(--font-display); }
.term-pop p { margin: 0; }
.term-pop a { color: var(--hema); font: 600 0.9rem var(--font-display); }

/* Words page */
.lead a { color: var(--hema); }
.word-list { display: grid; gap: 4px; }
.word-letter { font-size: var(--step-2); color: var(--eosin); margin-top: 18px; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.word-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.word-row:target { background: var(--slide); border-radius: 10px; padding-left: 10px; }
.word-row h3 { font-size: 1.15rem; }
@media (max-width: 600px) { .word-row { grid-template-columns: 1fr; gap: 2px; } }

/* Fun cards (home) */
.fun { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fun-card {
  display: grid; justify-items: center; gap: 6px; text-align: center; text-decoration: none; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface);
  transition: transform .15s ease, border-color .15s ease;
}
.fun-card:hover { transform: translateY(-3px); border-color: var(--hema); }
.fun-card b { font: 600 1.2rem var(--font-display); }
.fun-card span { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) { .fun { grid-template-columns: repeat(2, 1fr); } }

/* Games */
.game { background: var(--surface); border: 2px solid var(--line); border-radius: 28px; padding: 24px; scroll-margin-top: 16px; }
.game-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.game-bar button[aria-pressed="true"] { background: var(--hema); color: var(--on-accent); }
.build-board { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.build-board > * { min-width: 0; }
.build-pic svg { width: 100%; height: auto; display: block; }
.build-svg .bp { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); transition: opacity .5s ease, transform .5s cubic-bezier(.3,1.6,.5,1); }
.build-svg .bp.shown { opacity: 1; transform: scale(1); }
.build-side { display: grid; gap: 10px; }
.build-label { font: 600 0.85rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--eosin); margin: 0; }
.build-tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; }
.part-chip { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; background: var(--slide); border-color: var(--eosin); color: #000; }
.part-chip.selected { background: var(--eosin); color: #FFFFFF; }
.part-chip.lifted { opacity: .35; }
.part-chip.ghost { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.build-slots { display: grid; gap: 8px; }
.slot {
  display: grid; gap: 4px; text-align: left; font: 400 1rem var(--font-body); color: #000;
  background: #FFFFFF; border: 2px dashed #A9A0BA; border-radius: 14px; padding: 10px 14px;
}
.slot:hover { transform: none; border-color: var(--hema); }
.slot .answer { font: 600 0.95rem var(--font-display); color: var(--muted); }
.slot.over { border-color: var(--hema); background: var(--gel); }
.slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.slot.filled .answer { color: var(--ok); }
.slot.shake { animation: shake .4s; border-color: var(--bad); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.build-msg { font-weight: 700; min-height: 1.6em; margin-top: 12px; }
.build-msg.good { color: var(--ok); }
.build-msg.oops { color: var(--bad); }
.who-card { display: grid; gap: 14px; }
.who-count { color: var(--muted); font: 600 0.95rem var(--font-display); font-variant-numeric: tabular-nums; }
.who-clue { font: 600 var(--step-2) var(--font-display); line-height: 1.25; max-width: 30ch; }
.who-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.who-opt { display: grid; justify-items: center; gap: 6px; border-radius: 16px; padding: 12px 8px; background: #FFFFFF; color: #000; }
.who-opt img { width: 70px; height: 35px; }
.who-opt.right { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.who-opt.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
#who-next { justify-self: start; }
@media (max-width: 760px) {
  .build-board { grid-template-columns: 1fr; }
  .who-opts { grid-template-columns: repeat(2, 1fr); }
  .game { padding: 18px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) { .build-svg .bp { transition: none; } .slot.shake { animation: none; } }

/* Compare */
.takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.takeaway { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; align-content: start; }
@media (max-width: 760px) { .takeaways { grid-template-columns: 1fr; } }
.swipe-note { display: none; font: 600 0.9rem var(--font-display); color: var(--eosin); }
@media (max-width: 760px) { .swipe-note { display: block; } }
.table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 18px; }
table.compare { border-collapse: collapse; width: 100%; min-width: 680px; }
.compare th, .compare td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--bg); font: 600 1rem var(--font-display); }
.compare thead th img { display: block; margin-bottom: 4px; }
.compare tbody th { font: 600 1rem var(--font-display); width: 22%; }
.compare tbody tr:nth-child(even) { background: #FAF8FD; }
.compare small { display: block; color: var(--muted); font-size: 0.85rem; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--bad); font-weight: 700; }

/* Badges page */
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.badge-card {
  display: grid; justify-items: center; text-align: center; gap: 6px; align-content: start;
  border: 2px dashed #C9C2D6; border-radius: var(--radius); padding: 18px; background: #F7F6F9;
}
.badge-card .medal { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: #E9E6EE; }
.badge-card:not(.earned) .medal img { filter: grayscale(1); opacity: .45; }
.badge-card.earned { border-style: solid; border-color: #E0B100; background: #FFFBEA; }
.badge-card.earned .medal { background: #FFE38A; box-shadow: 0 0 0 6px #FFF1B8; }
.badge-card h3 { font-size: 1.1rem; }
.badge-how { font-size: 0.92rem; margin: 0; }
.badge-how a { color: var(--hema); }
.badge-state { font: 600 0.95rem var(--font-display); color: var(--muted); }
.badge-card.earned .badge-state { color: #8A6400; }
.badge-note { display: grid; gap: 12px; color: var(--muted); }
.reset-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#reset-confirm { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink); font-weight: 700; }
button.danger { border-color: var(--bad); color: var(--bad); }
@media (max-width: 900px) { .badge-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .badge-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Round 7: more animal & plant cells ---------- */
.cell-groups { display: grid; gap: 20px; }
.bricks.four { grid-template-columns: repeat(4, 1fr); }
.bricks.one { grid-template-columns: minmax(0, 280px); }
@media (max-width: 860px) { .bricks.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .bricks.four { grid-template-columns: 1fr; } .bricks.one { grid-template-columns: 1fr; } }
.cell-hero .hero-icon { width: 100%; max-width: 300px; height: auto; justify-self: center; }
.all-cells { margin-top: 4px; }
.all-cells a { font: 600 1rem var(--font-display); color: var(--hema); }
.lesson a { color: var(--hema); }

/* ---------- Egg timeline panel ---------- */
.v3d-panel { display: grid; gap: 14px; border: 2px solid var(--line); border-radius: 20px; padding: 18px; background: #FFFDF5; }
.tl-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tl-head h3 { font-size: var(--step-1); }
.tl-slider { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.tl-slider label { font: 700 1.2rem var(--font-display); min-width: 4.5em; font-variant-numeric: tabular-nums; }
.tl-slider input[type="range"] { width: 100%; accent-color: var(--hema); height: 28px; }
.tl-stops { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-stop { padding: 6px 10px; font-size: 0.9rem; border-width: 2px; }
.tl-stop span { font-variant-numeric: tabular-nums; }
.tl-stop[aria-current="step"] { background: var(--hema); color: var(--on-accent); }
.tl-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; background: #FFFFFF; border: 2px solid #F2C94C; border-radius: 16px; padding: 14px 16px; min-height: 96px; }
.tl-emoji { font-size: 2.4rem; line-height: 1; }
.tl-title { font: 600 1.15rem var(--font-display); display: block; margin-bottom: 4px; }
.tl-text { margin: 0; }
@media (max-width: 600px) { .tl-slider { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Human Body Cell Atlas ---------- */
.atlas-tools { display: grid; gap: 10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 12px; border-bottom: 2px solid var(--line); }
#atlas-search { font: 400 1.1rem var(--font-body); padding: 12px 16px; border: 2px solid var(--hema); border-radius: 999px; width: 100%; max-width: 520px; background: #FFFFFF; color: #000; }
#atlas-search:focus-visible { outline: 3px solid var(--eosin); outline-offset: 2px; }
.atlas-count { color: var(--muted); font: 600 0.95rem var(--font-display); margin: 0; font-variant-numeric: tabular-nums; }
.atlas-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-chip { font: 600 0.9rem var(--font-display); color: var(--sys); border: 2px solid var(--sys); border-radius: 999px; padding: 4px 12px; text-decoration: none; background: #FFFFFF; }
.atlas-chip:hover { background: var(--sys); color: #FFFFFF; }
.atlas-sys { display: grid; gap: 14px; scroll-margin-top: 150px; }
.atlas-sys > h2 { color: var(--sys); border-bottom: 3px solid var(--sys); padding-bottom: 6px; }
.atlas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.atlas-card { display: grid; gap: 10px; align-content: start; border: 2px solid var(--line); border-top: 6px solid var(--sys); border-radius: 18px; padding: 16px; background: #FFFFFF; scroll-margin-top: 150px; }
.atlas-card:target { box-shadow: 0 0 0 4px var(--sys); }
.atlas-pic { height: 80px; display: grid; place-items: center; background: #FAF8FD; border-radius: 12px; }
.atlas-pic svg { width: 140px; height: 70px; }
.atlas-card h3 { font-size: 1.25rem; }
.atlas-card dl { margin: 0; display: grid; gap: 6px; }
.atlas-card dt { font: 600 0.78rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--sys); }
.atlas-card dd { margin: 0; }
.atlas-wow { margin: 0; background: #FFF8E1; border-radius: 10px; padding: 8px 10px; font-size: 0.97rem; }
.atlas-wow b { font-family: var(--font-display); color: #8A6400; }
.atlas-video .frame { border-radius: 12px; }
.atlas-vtitle { font-size: 0.88rem; margin: 6px 0 0; color: #000; }
.atlas-vtitle .by { color: var(--muted); }
.older { display: inline-block; font: 600 0.72rem var(--font-display); background: #EDE7F7; color: var(--hema); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.atlas-novideo { color: var(--muted); font-size: 0.9rem; font-style: italic; margin: 0; }
.atlas-more { font: 600 0.95rem var(--font-display); color: var(--hema); }
.atlas-empty { font: 600 1.1rem var(--font-display); color: var(--muted); }
.atlas-callout { display: grid; gap: 4px; text-decoration: none; color: var(--ink); background: #FFFFFF; border: 2px dashed #C2185B; border-radius: 16px; padding: 14px 18px; }
.atlas-callout b { font: 600 1.1rem var(--font-display); color: #C2185B; }
.atlas-callout span { color: var(--muted); }
.atlas-callout:hover { border-style: solid; }
@media (max-width: 900px) { .atlas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .atlas-grid { grid-template-columns: 1fr; } .atlas-tools { position: static; } }
.atlas-intro { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 700px) { .atlas-intro { grid-template-columns: 1fr; } }

/* ---------- Round 8: every cell on the home page ---------- */
.bricks.many { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.bricks.many .brick { padding: 14px 10px; font-size: 1.02rem; gap: 6px; text-align: center; }
.bricks.many .brick svg { max-width: 120px; height: 60px; }
.bricks.many .brick .go { font-size: 0.85rem; }
.cell-group h3 .count { font: 600 0.85rem var(--font-display); color: var(--muted); background: #FFFFFF; border-radius: 999px; padding: 2px 10px; margin-left: 6px; vertical-align: middle; }
.sys-title { font: 600 1.05rem var(--font-display); color: #C2185B; margin: 10px 0 0; }
@media (max-width: 420px) { .bricks.many { grid-template-columns: repeat(2, 1fr); } .bricks.many .brick svg { max-width: 100px; } }

/* ---------- Realistic microscope view (home) ---------- */
.lens { position: relative; width: 100%; max-width: 440px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; border: 14px solid #111111; box-shadow: 0 0 0 4px #3A3A3A, 0 10px 30px rgba(0,0,0,.25); background: #F3D7E4; }
.lens canvas { width: 100%; height: 100%; display: block; }
.scalebar { position: absolute; right: 18%; bottom: 20%; display: grid; justify-items: center; gap: 2px; }
.scalebar span { font: 700 0.85rem var(--font-display); color: #111111; background: rgba(255,255,255,.75); border-radius: 6px; padding: 0 5px; }
.scalebar::after { content: ""; display: block; width: 42px; height: 5px; border-radius: 3px; background: #111111; }
.scalebar { width: 9.7%; }
.scalebar span { white-space: nowrap; }
.scalebar::after { width: 100%; }

/* ---------- Tap sign on the home microscope ---------- */
.lens-link { display: grid; justify-items: center; gap: 12px; text-decoration: none; position: relative; }
.lens-link:hover .lens { transform: scale(1.02); }
.lens { transition: transform .2s ease; }
.lens-link:focus-visible { outline: 3px solid var(--eosin); outline-offset: 6px; border-radius: 24px; }
.tap-sign {
  font: 700 1.15rem var(--font-display); color: #FFFFFF; background: var(--eosin);
  padding: 8px 18px; border-radius: 999px; box-shadow: 0 6px 16px rgba(210,62,126,.35);
  animation: tapbounce 1.6s ease-in-out infinite;
}
@keyframes tapbounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Microscope page ---------- */
.scope-wrap { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
.scope-side { display: grid; gap: 16px; }
.scope-group { display: grid; gap: 8px; }
.scope-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scope-btns button[aria-pressed="true"] { background: var(--hema); color: var(--on-accent); }
#zoom-in, #zoom-out { width: 46px; height: 46px; padding: 0; font-size: 1.5rem; line-height: 1; }
.mag { font: 600 1.05rem var(--font-display); min-width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; }
.scope-info { background: #FFF8E1; border-radius: 14px; padding: 12px 14px; margin: 0; min-height: 5.5em; }
.scope-view { display: grid; gap: 8px; justify-items: center; }
.scope {
  position: relative; width: 100%; max-width: 620px; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden;
  border: 16px solid #111111; box-shadow: 0 0 0 5px #3A3A3A, 0 12px 34px rgba(0,0,0,.3); background: #F3E6EC;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.scope:active { cursor: grabbing; }
.scope:focus-visible { outline: 4px solid var(--eosin); outline-offset: 4px; }
.scope canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.scope-vignette { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(0,0,0,0) 55%, rgba(20,5,15,.55) 100%); }
.scope-labels { position: absolute; inset: 0; pointer-events: none; }
.scope-scale { position: absolute; right: 16%; bottom: 16%; display: grid; justify-items: center; gap: 2px; pointer-events: none; }
.scope-scale span { font: 700 0.85rem var(--font-display); color: #111; background: rgba(255,255,255,.8); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.scope-scale i { display: block; height: 5px; border-radius: 3px; background: #111; width: 60px; }
.scope-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; max-width: none; font: 600 1.1rem var(--font-display); background: rgba(255,255,255,.85); }
.scope-tip { color: var(--muted); font-size: 0.9rem; text-align: center; }
@media (max-width: 820px) { .scope-wrap { grid-template-columns: 1fr; } .scope-view { order: -1; } .scope { border-width: 10px; } }
@media (prefers-reduced-motion: reduce) { .tap-sign { animation: none; } .lens { transition: none; } }

/* ---------- Grainy cell texture on all cell pictures ---------- */
.brick svg, .cell-hero svg, .atlas-pic svg, .fun-card img, .badge-card.earned .medal img,
.who-opt img, .compare thead img, .build-svg, .figure svg { filter: url(#cell-texture); }

/* fixes: borders must not make these wider than the screen */
.lens, .scope { box-sizing: border-box; }
/* long badge and card names must wrap on phones */
.badge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.badge-card, .brick, .atlas-card, .fun-card { min-width: 0; overflow-wrap: anywhere; }
.badge-card .medal { width: min(110px, 100%); height: auto; aspect-ratio: 1 / 1; }
.sys-title.plant-sys { color: #2E7D32; }
.sys-title.animal-sys { color: #5A3DB0; }

/* ---------- Finished lessons turn green ---------- */
.progress button.done { background: #E3F5EA; border-color: #1F8A5B; color: #13623F; }
.progress button.done[aria-current="step"] { background: #1F8A5B; border-color: #1F8A5B; color: #FFFFFF; }

/* ---------- Real eyepiece look (Microscope page) ---------- */
.scope { border: 0; border-radius: 28px; background: #040404; box-shadow: 0 12px 34px rgba(0,0,0,.35); }
.scope-field { position: absolute; inset: 0; overflow: hidden;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0 44%, rgba(0,0,0,.55) 46.5%, transparent 49%);
          mask-image: radial-gradient(circle at 50% 50%, #000 0 44%, rgba(0,0,0,.55) 46.5%, transparent 49%); }
.slide-wrap { position: absolute; inset: 0; }
.scope-field::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 41%, rgba(70,120,255,.16) 44.5%, rgba(255,160,60,.14) 47%, transparent 48.5%); }
.scope-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle, #000 0 45%, transparent 48%); mask-image: radial-gradient(circle, #000 0 45%, transparent 48%); }
.scope-eye { --ex: 50%; --ey: 50%; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--ex) var(--ey), transparent 0 40%, rgba(0,0,0,.15) 44%, rgba(0,0,0,.7) 48.5%, #040404 53%); }
.scope-labels { z-index: 2; }
.scope-scale { z-index: 2; right: 22%; bottom: 22%; }
.scope-loading { z-index: 3; background: rgba(4,4,4,.85); color: #FFFFFF; border-radius: 28px; }
.knob { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: 10px; }
.knob label { font: 600 1rem var(--font-display); }
.knob input[type="range"] { width: 100%; accent-color: var(--hema); height: 28px; }
.focus-hint { margin: 0; font: 600 0.95rem var(--font-display); color: #B23A6A; }
.focus-hint.sharp { color: var(--ok); }

/* ---------- Real eyepiece look (home page picture) ---------- */
.lens { border: 0; box-shadow: 0 10px 30px rgba(0,0,0,.3); background: #040404; }
.lens canvas { -webkit-mask-image: radial-gradient(circle, #000 0 62%, rgba(0,0,0,.5) 67%, transparent 71%); mask-image: radial-gradient(circle, #000 0 62%, rgba(0,0,0,.5) 67%, transparent 71%); }
.lens::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 50%;
  background:
    radial-gradient(circle at 38% 42%, rgba(40,30,30,.22) 0 1.2%, transparent 2.4%),
    radial-gradient(circle at 63% 58%, rgba(40,30,30,.16) 0 1.6%, transparent 3%),
    radial-gradient(circle at 55% 30%, rgba(40,30,30,.14) 0 .8%, transparent 1.8%),
    radial-gradient(circle, transparent 58%, rgba(70,120,255,.14) 63%, rgba(255,160,60,.12) 66%, transparent 70%); }
.lens .scalebar { right: 24%; bottom: 26%; }

/* ---------- Build-a-Body (end of home page) ---------- */
.build-body { display: grid; gap: 14px; background: #FBF7FF; border: 2px solid var(--line); border-radius: 28px; padding: 24px; }
.bb-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-modes button { font-size: 1.05rem; }
.bb-modes button[aria-pressed="true"] { background: var(--hema); color: var(--on-accent); }
.bb-progress { display: grid; gap: 6px; }
.bb-bar { height: 16px; background: #ECE6F3; border-radius: 999px; overflow: hidden; }
.bb-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7E57C2, #E91E63, #FB8C00); border-radius: 999px; transition: width .4s ease; }
.bb-count { margin: 0; font: 600 1rem var(--font-display); font-variant-numeric: tabular-nums; }
.bb-msg { margin: 0; min-height: 1.5em; font: 600 1.05rem var(--font-display); color: var(--eosin); }
.bb-board { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.bb-board > * { min-width: 0; }
.bb-figure { background: #FFFFFF; border: 2px solid var(--line); border-radius: 22px; padding: 12px; position: sticky; top: 12px; }
.bb-figure > svg { width: 100%; height: auto; display: block; max-height: 70vh; }
.bb-figure .rg { transition: color .4s ease, opacity .4s ease; }
.bb-figure .rg.full { animation: bbglow 2.4s ease-in-out infinite; }
.bb-figure .rg.full .heart { transform-box: fill-box; transform-origin: center; animation: bbbeat 1s ease-in-out infinite; }
@keyframes bbglow { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 4px currentColor); } }
@keyframes bbbeat { 0%,100% { transform: scale(1); } 20% { transform: scale(1.18); } 40% { transform: scale(1); } }
.bb-zoo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bb-creature { display: grid; justify-items: center; gap: 2px; padding: 8px; border-radius: 16px; background: #FAF8FD; border: 2px solid var(--line); color: #000; }
.bb-creature svg { width: 100%; max-width: 120px; height: auto; }
.bb-creature span { font: 600 0.95rem var(--font-display); }
.bb-creature small { color: var(--muted); font-variant-numeric: tabular-nums; }
.bb-side { display: grid; gap: 10px; }
#bb-search { font: 400 1rem var(--font-body); padding: 10px 14px; border: 2px solid var(--hema); border-radius: 999px; width: 100%; background: #FFFFFF; color: #000; }
.bb-tray { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.bb-sys { background: #FFFFFF; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.bb-sys summary { cursor: pointer; font: 600 1rem var(--font-display); display: flex; align-items: center; gap: 8px; }
.bb-sys summary b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.bb-sys .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.bb-row { margin: 8px 0; }
.bb-addall { font-size: 0.9rem; padding: 6px 12px; }
.bb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; font: 600 0.88rem var(--font-display); border-width: 2px; background: #FFFFFF; color: #000; }
.bb-chip img { width: 44px; height: 22px; }
.bb-chip.added { background: #E3F5EA; border-color: #1F8A5B; color: #13623F; }
.bb-chip.added::after { content: "✓"; }
.bb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-empty { color: var(--muted); }
.build-body.bb-complete { border-color: #E0B100; background: #FFFBEA; }
@media (max-width: 760px) { .bb-board { grid-template-columns: 1fr; } .bb-figure { position: static; max-width: 340px; justify-self: center; width: 100%; } }
@media (prefers-reduced-motion: reduce) { .bb-figure .rg.full, .bb-figure .rg.full .heart { animation: none; } .bb-bar i, .bb-figure .rg { transition: none; } }

/* ---------- Round: finishing touches ---------- */
.find-cell { display: grid; gap: 6px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; background: var(--bg); padding-block: 10px; }
#find-cell { font: 400 1.1rem var(--font-body); padding: 12px 16px; border: 2px solid var(--hema); border-radius: 999px; width: 100%; max-width: 520px; background: #FFFFFF; color: #000; }
#find-cell:focus-visible { outline: 3px solid var(--eosin); outline-offset: 2px; }
.find-count { margin: 0; min-height: 1.4em; font: 600 0.95rem var(--font-display); color: var(--muted); }
.az { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); padding-block: 8px; z-index: 3; }
.az a { min-width: 2.2em; text-align: center; padding: 4px 0; border: 2px solid var(--hema); border-radius: 10px; font: 600 1rem var(--font-display); color: var(--hema); text-decoration: none; background: #FFFFFF; }
.az a:hover, .az a:focus-visible { background: var(--hema); color: #FFFFFF; }
.word-letter { scroll-margin-top: 70px; }
.badge-group-title { grid-column: 1 / -1; margin-top: 12px; font-size: var(--step-1); display: flex; align-items: center; gap: 10px; }
.badge-group-count { font: 600 0.9rem var(--font-display); color: var(--muted); background: #FFFFFF; border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
footer a { color: var(--hema); }
.about { display: grid; gap: 10px; max-width: 70ch; }
.about ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.about a { color: var(--hema); }
.nf { text-align: left; }
.nf-home { font: 600 1.1rem var(--font-display); color: var(--hema); }

/* ---------- Finished lessons: green box + note; finished cells green on the home page ---------- */
.lesson.lesson-done { border-color: #1F8A5B; background: #F3FBF6; }
.done-note { margin: 0; justify-self: start; font: 600 0.95rem var(--font-display); color: #13623F; background: #E3F5EA; border: 2px solid #1F8A5B; border-radius: 999px; padding: 4px 12px; }
.brick.complete { border-color: #1F8A5B; background: #E3F5EA; }
.done-tag { font: 600 0.8rem var(--font-display); color: #FFFFFF; background: #1F8A5B; border-radius: 999px; padding: 2px 10px; }

/* ---------- Read-aloud voice picker (was missing) ---------- */
.voice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; margin-top: 12px; }
.voice-bar label { font: 600 0.95rem var(--font-display); }
.voice-bar select { font: 400 1rem var(--font-body); padding: 6px 10px; border: 2px solid var(--hema); border-radius: 10px; background: #FFFFFF; color: #000; max-width: 100%; }
.voice-bar #voice-pick { min-width: 0; flex: 1 1 200px; }
.voice-bar button { padding: 6px 14px; }

/* Home page button to the Meet the maker page */
.maker-btn { display: inline-block; padding: 14px 24px; border-radius: 999px; background: var(--hema); color: #fff;
  font: 700 1.15rem/1.25 var(--font-display); text-decoration: none; box-shadow: 0 4px 0 rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease; }
.maker-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.maker-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.maker-btn:focus-visible { outline: 3px solid var(--hema); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .maker-btn { transition: none; } }
