/* The Genius Project: pre-teen readability layer.
   Loaded AFTER style.css / hub.css / course.css on every pre-teen course page.
   Goal: a 6-year-old can read along. Rounded friendly fonts (Baloo 2 for
   headings, Nunito for body), bigger text, taller line-height, shorter
   line lengths, extra breathing room, and chunky touch-friendly controls
   that work well on tablets. */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@500;600;700;800;900&display=swap');

/* ---------- Base type ---------- */
body {
  font-family: 'Nunito', 'Comic Sans MS', 'Inter', Arial, sans-serif;
  font-size: 19px;
}
h1, h2, h3, h4, h5,
.lesson-title, .section-title, .ch-inner h1,
.wb-word, .callout-head, .mc-body h3, .hub-card h3 {
  font-family: 'Baloo 2', 'Nunito', Arial, sans-serif !important;
  letter-spacing: 0.01em;
}

/* ---------- Lesson pages ---------- */
.lesson-title { font-size: clamp(34px, 6vw, 46px); line-height: 1.15; }
.lesson-lede {
  font-size: 20px;
  line-height: 1.85;
  max-width: 58ch;
}
.lesson-meta span { font-size: 16px; }
.lesson-main p, .lesson-main li {
  font-size: 19.5px;
  line-height: 1.9;
  max-width: 58ch;
}
.lesson-main h2 { font-size: 30px; margin-top: 44px; margin-bottom: 14px; }
.lesson-main h3 { font-size: 24px; }
.lesson-main p { margin-bottom: 18px; }
.lesson-main ul, .lesson-main ol { margin-bottom: 18px; }
.lesson-main li { margin-bottom: 10px; }

/* Word boxes, callouts, hints: bigger and airier */
.word-box .wb-def, .callout p, .callout li { font-size: 18.5px; line-height: 1.85; }
.word-box .wb-word { font-size: 24px; }
.callout { padding: 22px 24px; border-radius: 18px; }
.howto li { font-size: 18.5px; line-height: 1.85; margin-bottom: 12px; }
.howto h5 { font-size: 18px; }
.flow-box .fb-label { font-size: 17px; }
.flow-box .fb-sub { font-size: 15.5px; line-height: 1.7; }
.flow-box p { font-size: 16.5px !important; line-height: 1.75 !important; }
.flow-box { padding: 20px 22px; }

/* Check-your-understanding + quiz: big friendly tap targets */
.cyu .cyu-q { font-size: 19.5px; line-height: 1.8; }
.cyu .cyu-opt {
  font-size: 18.5px;
  line-height: 1.6;
  padding: 16px 18px;
  min-height: 56px;
  border-radius: 16px;
}
.cyu .cyu-explain { font-size: 17.5px; line-height: 1.8; }
/* short "what to press" cue shown above the answer buttons in a check box */
.cyu-hint, .cyu-ask { font-size: 16px; font-weight: 700; color: var(--ink-mid); margin: 0 0 12px; line-height: 1.6; }
.quiz-q { font-size: 21px !important; line-height: 1.7 !important; }
.quiz-opts button, #quiz-opts button {
  font-size: 19px !important;
  line-height: 1.6 !important;
  padding: 16px 18px !important;
  min-height: 58px;
  border-radius: 16px !important;
}
.quiz-explain { font-size: 18px !important; line-height: 1.8 !important; }
.quiz-progress { font-size: 17px !important; }

/* Buttons and inputs: chunky, tablet-first (56px+ touch targets) */
.big-btn, .btn, .mark-done-btn, .lesson-gate-btn {
  font-size: 19px !important;
  padding: 16px 28px !important;
  min-height: 58px;
  border-radius: 18px !important;
}
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  font-size: 18px !important;
  padding: 14px 16px !important;
  min-height: 54px;
  border-radius: 14px !important;
}
input[type="range"] {
  height: 44px;
  cursor: pointer;
}
.lab-status { font-size: 17.5px; line-height: 1.75; }
.cert-note { font-size: 16.5px !important; line-height: 1.75 !important; }
.cert-input-label { font-size: 20px !important; }

/* Sidebar outline: bigger tap rows */
.course-outline a { font-size: 16.5px; padding-top: 10px; padding-bottom: 10px; }
.sidebar-toggle { font-size: 17px; min-height: 50px; }

/* ---------- 3D game shells ---------- */
.vox-hud .vh-item { font-size: 18px !important; padding: 10px 16px !important; }
.vox-msg { font-size: 18.5px !important; line-height: 1.75; padding: 16px 18px !important; }
.sentence-band { font-size: 22px !important; line-height: 1.6; }
.temp-chips span { font-size: 16px !important; padding: 8px 14px !important; }
.pick-row button {
  font-size: 21px !important;
  min-height: 64px !important;
  border-radius: 18px !important;
}
.guess-row .gr-val { font-size: 32px !important; min-width: 110px !important; }
.guess-row { padding: 18px 20px !important; }
.vox-controls .big-btn { flex: 1; min-width: 170px; }

/* ---------- Hub / course-home pages ---------- */
.ch-inner p { font-size: 18.5px; line-height: 1.8; max-width: 62ch; }
/* fix dark-on-dark bold text inside the hero band */
.course-hero .ch-stat b { color: #fff; }
.course-hero .ch-inner p strong, .course-hero .ch-inner p b { color: #ffd75e; }
.ch-badge { font-size: 15px; }
.ch-stat b { font-size: 26px; }
.ch-stat span { font-size: 12.5px; }
.section-title { line-height: 1.2; }
.outcomes-grid .outcome p { font-size: 17.5px; line-height: 1.75; }
.mc-body p { font-size: 17px; line-height: 1.75; }
.mc-body h3 { font-size: 22px; }
.mc-kicker { font-size: 13.5px; }
.mc-foot .mc-time, .mc-foot .mc-go { font-size: 15px; }
.hub-card p { font-size: 17px; line-height: 1.75; }
.hub-card li { font-size: 16.5px; line-height: 1.7; margin-bottom: 8px; }
.hub-week { font-size: 14px; }

/* ---------- Mobile / tablet ---------- */
@media (max-width: 820px) {
  body { font-size: 18px; }
  .lesson-main p, .lesson-main li { font-size: 18.5px; }
  .big-btn, .btn { width: auto; }
  .vox-controls { gap: 12px; }
  .pick-row { gap: 12px; }
}

/* ---------- Ordered week path (hub navigation) ---------- */
.week-path { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.wp-card {
  display: flex; gap: 18px; align-items: flex-start;
  background: #fff; border: 2px solid var(--line-strong); border-radius: 20px;
  padding: 22px; text-decoration: none; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.wp-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(13,27,75,.10); }
.wp-num {
  flex: none; width: 62px; height: 62px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff; background: #0d1b4b;
}
.wp-body { flex: 1; min-width: 0; }
.wp-kicker { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mid); margin-bottom: 4px; }
.wp-body h3 { margin: 0 0 6px; font-size: 21px; color: var(--ink); }
.wp-body > p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink-mid); }
.wp-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.wp-links span {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--line-strong); border-radius: 999px;
  padding: 9px 15px; font-size: 14.5px; font-weight: 700; color: var(--ink);
  background: var(--bg-2, #f6f7fb);
}
.wp-links .wp-open { background: #0d1b4b; border-color: #0d1b4b; color: #fff; }
@media (max-width: 640px) {
  .wp-card { flex-direction: column; gap: 12px; }
  .wp-num { width: 52px; height: 52px; font-size: 22px; }
}

/* ---------- Vox mini-games (js/vox-mini.js) ---------- */
.vox-mini { margin: 30px 0; }
.vm-shell {
  background: #0d1b4b;
  border: 3px solid #1e2f6e;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(13, 27, 75, .28);
  overflow: hidden;
}
.vm-head {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.vm-title {
  font-family: 'Baloo 2', 'Nunito', Arial, sans-serif;
  font-size: 24px; font-weight: 800; color: #fff;
  line-height: 1.25;
}
.vm-hud { display: flex; flex-wrap: wrap; gap: 8px; }
.vm-hud-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .12);
  border: 2px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 17px; font-weight: 700; color: #cfe0ff;
}
.vm-hud-item b { color: #ffd75e; font-size: 19px; }
.vm-shell canvas {
  display: block; width: 100%; height: auto;
  border-radius: 16px;
  background: #9fd9ff;
  touch-action: manipulation;
}
.vm-msg {
  min-height: 58px;
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .10);
  border: 2px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  padding: 12px 18px;
  margin: 12px 0;
  font-size: 19px; line-height: 1.7; font-weight: 700; color: #fff;
}
/* the global `strong, b { color: var(--ink) }` rule would paint bold words
   navy inside these dark game panels (a game question wrapped in <b> vanished
   on the dark message box). Keep all emphasis inside the panels light. */
.vm-msg b, .vm-msg strong { color: #fff; }
.vm-msg em { color: #ffd75e; font-style: normal; }
.vm-controls {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
}
.vm-btn {
  flex: 1 1 auto;
  min-width: 150px; max-width: 320px;
  min-height: 62px;
  font-family: 'Baloo 2', 'Nunito', Arial, sans-serif;
  font-size: 20px !important; font-weight: 800;
  border: 3px solid #ffc400 !important;
  border-radius: 20px !important;
  background: #ffc400; color: #0d1b4b;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, filter .1s ease;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25);
}
.vm-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.vm-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.vm-btn:disabled { opacity: .45; cursor: default; transform: none; }
.vm-btn.vm-on {
  background: #22c55e; border-color: #22c55e !important; color: #fff;
  animation: vm-glow 1.2s ease-in-out infinite;
}
@keyframes vm-glow {
  0%, 100% { box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 0 0 0 rgba(34, 197, 94, .55); }
  50% { box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 0 0 12px rgba(34, 197, 94, 0); }
}
@media (max-width: 640px) {
  .vm-shell { padding: 12px; border-radius: 20px; }
  .vm-title { font-size: 20px; }
  .vm-msg { font-size: 17px; }
  .vm-btn { min-width: 130px; font-size: 18px !important; min-height: 58px; }
}

/* ---------- Vox arcade: memory, simon, board race (js/vox-arcade.js) ---------- */
.vox-arcade { margin: 30px 0; }
.vox-arcade .vm-shell { }
.va-stage { margin-bottom: 12px; }
.va-stage canvas { display: block; width: 100%; height: auto; border-radius: 16px; background: #141a4d; touch-action: manipulation; }
/* button flash used by Simon playback */
.vm-btn.va-flash { filter: brightness(1.5) saturate(1.4); transform: translateY(-3px) scale(1.03); box-shadow: 0 0 0 6px rgba(255,255,255,.35), 0 6px 0 rgba(0,0,0,.25); }

/* memory match grid: chunky voxel-style cards */
.va-grid { display: grid; gap: 12px; padding: 6px; }
.va-card {
  aspect-ratio: 3 / 4; border: none; background: none; padding: 0; cursor: pointer;
  perspective: 700px; min-height: 74px;
}
.va-card-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transition: transform .4s cubic-bezier(.2,.8,.3,1); transform-style: preserve-3d;
}
.va-card.va-flipped .va-card-inner, .va-card.va-matched .va-card-inner { transform: rotateY(180deg); }
.va-card-back, .va-card-face {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-size: clamp(26px, 7vw, 40px);
}
.va-card-back {
  background: linear-gradient(135deg, #2f7cff, #1e40af);
  border: 3px solid #6ea8ff; color: #cfe0ff;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.22);
}
.va-card-face {
  background: linear-gradient(135deg, #fff, #eef3ff);
  border: 3px solid #ffc400; transform: rotateY(180deg); color: #0d1b4b;
  box-shadow: inset 0 -6px 0 rgba(13,27,75,.12);
}
.va-card-face em { font-size: 12px; font-style: normal; font-weight: 800; }
.va-card.va-matched .va-card-face { border-color: #22c55e; background: linear-gradient(135deg, #eafff2, #d6ffe6); animation: kid-pop .4s both; }
.va-card:focus-visible { outline: 3px solid #ffc400; outline-offset: 3px; }

/* board race */
.va-board {
  position: relative; display: grid; gap: 8px; padding: 10px;
  background: #101f57; border-radius: 16px;
}
.va-tile {
  position: relative; aspect-ratio: 1 / 1; min-height: 46px;
  border-radius: 10px; background: #1b2a63; border: 2px solid #2a3c7e;
  display: flex; align-items: center; justify-content: center;
}
.va-tnum { font-size: 13px; font-weight: 800; color: #8ea6e6; }
.va-tag { position: absolute; bottom: 2px; right: 4px; font-size: 15px; font-weight: 900; }
.va-tag.va-up { color: #22c55e; }
.va-tag.va-down { color: #ff6a55; }
.va-tag.va-flag { font-size: 20px; right: 3px; bottom: 0; }
.va-token {
  position: absolute; width: 36px; height: 36px; font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: left .22s ease, top .22s ease; z-index: 3;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.4));
}
@media (max-width: 640px) {
  .va-tile { min-height: 38px; }
  .va-tnum { font-size: 11px; }
  .va-token { width: 28px; height: 28px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .va-card-inner, .va-token { transition: none !important; }
  .vm-btn.va-flash { transition: none; }
}

/* ---------- Kid-friendly lesson animations ---------- */
/* Sprinkle these classes on emoji spans and callouts to bring lessons alive.
   Every animation stops for readers who prefer reduced motion. */
.anim-bounce { display: inline-block; animation: kid-bounce 1.6s ease-in-out infinite; }
.anim-wiggle { display: inline-block; animation: kid-wiggle 1.8s ease-in-out infinite; }
.anim-float { display: inline-block; animation: kid-float 3s ease-in-out infinite; }
.anim-pulse { display: inline-block; animation: kid-pulse 1.5s ease-in-out infinite; }
.anim-spin-slow { display: inline-block; animation: kid-spin 6s linear infinite; }
.anim-pop { display: inline-block; animation: kid-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes kid-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes kid-wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}
@keyframes kid-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
@keyframes kid-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
@keyframes kid-spin { to { transform: rotate(360deg); } }
@keyframes kid-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* Big animated emoji rows for openers ("look and say" pre-reading strips) */
.emoji-strip {
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center; align-items: center;
  font-size: 52px; line-height: 1;
  margin: 22px 0; padding: 18px;
  background: var(--bg-2, #f6f7fb);
  border: 2px dashed var(--line-strong);
  border-radius: 20px;
}
.emoji-strip span { display: inline-block; }
.emoji-strip span:nth-child(odd) { animation: kid-bounce 1.6s ease-in-out infinite; }
.emoji-strip span:nth-child(even) { animation: kid-float 3s ease-in-out infinite; }
/* Reveal sections as the child scrolls to them (js/parent-guide.js adds .in-view) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .anim-bounce, .anim-wiggle, .anim-float, .anim-pulse, .anim-spin-slow, .anim-pop,
  .emoji-strip span, .vm-btn.vm-on { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Parent Guide button + panel (js/parent-guide.js) ---------- */
.pg-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 320;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 14px 22px;
  background: #0d1b4b; color: #fff;
  border: 3px solid #ffc400; border-radius: 999px;
  font-family: 'Baloo 2', 'Nunito', Arial, sans-serif;
  font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 12px 30px rgba(13, 27, 75, .35);
  transition: transform .12s ease;
}
.pg-fab:hover { transform: translateY(-2px); }
.pg-overlay {
  position: fixed; inset: 0; z-index: 330;
  background: rgba(13, 27, 75, .55);
  display: none;
}
.pg-overlay.pg-open { display: block; }
.pg-panel {
  position: fixed; z-index: 340;
  right: 0; top: 0; bottom: 0;
  width: min(480px, 100vw);
  background: #fff;
  box-shadow: -18px 0 50px rgba(13, 27, 75, .25);
  transform: translateX(105%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.pg-panel.pg-open { transform: translateX(0); }
.pg-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px;
  background: #0d1b4b; color: #fff;
}
.pg-panel-head h3 {
  margin: 0; font-family: 'Baloo 2', 'Nunito', Arial, sans-serif;
  font-size: 22px; color: #fff;
}
.pg-close {
  flex: none; width: 48px; height: 48px;
  border-radius: 14px; border: 2px solid rgba(255, 255, 255, .4);
  background: transparent; color: #fff;
  font-size: 22px; font-weight: 800; cursor: pointer;
}
.pg-body { padding: 20px 22px 30px; overflow-y: auto; }
.pg-body h4 {
  font-family: 'Baloo 2', 'Nunito', Arial, sans-serif;
  font-size: 18px; margin: 20px 0 8px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.pg-body h4:first-child { margin-top: 0; }
.pg-body p, .pg-body li { font-size: 16.5px; line-height: 1.75; color: var(--ink-mid); }
.pg-body ul { padding-left: 20px; margin: 0 0 12px; }
.pg-body li { margin-bottom: 8px; }
.pg-tip {
  background: #fff7df; border: 2px solid #ffd75e; border-radius: 14px;
  padding: 12px 16px; margin-bottom: 14px;
  font-size: 16px; line-height: 1.7; color: #4a3b00;
}
@media (max-width: 640px) {
  .pg-fab { right: 12px; bottom: 12px; font-size: 16px; min-height: 54px; padding: 12px 18px; }
}

/* ---------- Week page quick links + previous/next ---------- */
.wk-quicklinks { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0 0 14px; }
.wk-quicklinks a {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--line-strong); border-radius: 16px;
  background: #fff; color: var(--ink); text-decoration: none;
  padding: 14px 20px; font-size: 16px; font-weight: 700; min-height: 54px;
  transition: transform .12s ease, border-color .12s ease;
}
.wk-quicklinks a:hover { transform: translateY(-2px); border-color: #0d1b4b; }
.week-nav { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 26px; }
.week-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 11px 18px; font-size: 15px; font-weight: 700;
  background: var(--bg-2, #f6f7fb); border: 2px solid var(--line-strong);
  color: var(--ink); text-decoration: none; min-height: 48px;
}
.week-nav a:hover { border-color: #0d1b4b; }
