:root {
  --ink: #17202a;
  --muted: #5d6d7e;
  --bg: #fff7df;
  --gold: #ffc83d;
  --gold-dark: #d99000;
  --mint: #7ee6b8;
  --blue: #5aa7ff;
  --pink: #ff7ab6;
  --panel: rgba(255,255,255,.82);
  --shadow: 0 24px 60px rgba(74, 47, 0, .18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,200,61,.55), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(126,230,184,.55), transparent 28%),
    linear-gradient(135deg, #fff8dd, #ffe8ef 52%, #e5f3ff);
}
.app-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 48px; }
.panel { background: var(--panel); border: 3px solid rgba(255,255,255,.75); border-radius: 32px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 18px; position: sticky; top: 10px; z-index: 4; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Baloo 2"; font-size: 1.45rem; font-weight: 900; }
.brand-mark { position: relative; width: 54px; height: 40px; display: inline-block; flex: 0 0 auto; }
.brand-dino {
  position: absolute;
  left: 4px;
  bottom: 3px;
  width: 34px;
  height: 30px;
  border-radius: 48% 44% 42% 48%;
  background: linear-gradient(145deg, var(--mint), #20c58b);
  box-shadow: inset -6px -6px rgba(0,0,0,.08);
}
.brand-dino::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 5px;
  height: 7px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 13px 0 0 var(--ink);
}
.brand-dino::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 12px;
  border-left: 12px solid #20c58b;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.brand-coin {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #fff7c2;
  box-shadow: 0 5px 0 rgba(217,144,0,.35);
}
.account-area { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.account-status { background: #fff7d0; border-radius: 999px; color: #7a5200; font-size: .9rem; font-weight: 900; padding: 9px 12px; }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; padding: 42px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: var(--gold-dark); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; }
h1, h2, h3 { font-family: "Baloo 2", Inter, sans-serif; line-height: .96; margin: 0; }
h1 { font-size: clamp(2.8rem, 8vw, 6rem); max-width: 780px; }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); }
.subtitle, .scenario, .feedback, .hub p, .modal-copy, .map-note { color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
button { border: 0; cursor: pointer; font-weight: 900; border-radius: 999px; padding: 15px 22px; font-size: 1rem; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
button:hover { transform: translateY(-2px); }
button:disabled { cursor: not-allowed; opacity: .65; transform: none; }
.button-link, .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: 900;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.button-link { padding: 15px 22px; font-size: 1rem; }
.nav-link { padding: 10px 14px; font-size: .9rem; }
.button-link:hover, .nav-link:hover { transform: translateY(-2px); }
.small { padding: 10px 14px; font-size: .9rem; }
.primary { background: var(--ink); color: white; box-shadow: 0 12px 22px rgba(23,32,42,.22); }
.secondary { background: white; color: var(--ink); border: 2px solid rgba(23,32,42,.1); }
.mascot-card { min-height: 360px; border-radius: 28px; background: linear-gradient(160deg, #fff, #ffedb1); display: grid; place-items: center; text-align: center; padding: 28px; position: relative; overflow: hidden; }
.mascot-card p { max-width: 300px; color: #7a5200; font-weight: 900; line-height: 1.35; }
.video-card { min-height: 420px; padding: 0; background: #102029; border-color: rgba(255,255,255,.9); }
.hero-video {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
}
.video-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  background: rgba(255, 253, 244, .9);
  border: 3px solid rgba(255,255,255,.85);
  border-radius: 18px;
  padding: 12px;
  backdrop-filter: blur(10px);
}
.video-caption p { margin: 0; color: var(--ink); font-size: .95rem; }
.coin-rain { position: absolute; inset: 22px 24px auto auto; display: flex; gap: 8px; animation: bob 2.2s ease-in-out infinite; }
.coin-rain span { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); border: 3px solid #fff5b8; box-shadow: 0 5px 0 rgba(217,144,0,.35); }
.character-crew { position: relative; width: min(100%, 330px); height: 240px; margin-top: 10px; }
.muncher { width: 180px; height: 170px; border-radius: 45% 55% 48% 52%; background: linear-gradient(145deg, var(--mint), #1fc98a); position: relative; box-shadow: inset -16px -18px rgba(0,0,0,.09), 0 16px 0 #0d9d68; }
.muncher.dino { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); }
.dino-spikes { position: absolute; left: 38px; right: 34px; top: -16px; display: flex; justify-content: space-between; }
.dino-spikes span { width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 22px solid #22b579; }
.eye { position: absolute; top: 56px; width: 28px; height: 36px; background: var(--ink); border-radius: 999px; }
.eye.left { left: 48px; } .eye.right { right: 48px; }
.mouth { position: absolute; left: 50%; bottom: 42px; transform: translateX(-50%); width: 86px; height: 48px; background: var(--ink); color: var(--gold); border-radius: 8px 8px 42px 42px; display: grid; place-items: center; font-size: 1.7rem; }
.belly {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 56px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  color: #08744d;
  display: grid;
  place-items: center;
  font-family: "Baloo 2", Inter, sans-serif;
  font-size: .86rem;
  font-weight: 900;
}
.coin-pal {
  position: absolute;
  left: 0;
  bottom: 34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2a4, var(--gold) 60%);
  border: 6px solid #fff7c2;
  box-shadow: 0 14px 0 rgba(217,144,0,.35);
}
.jar-buddy {
  position: absolute;
  right: 0;
  bottom: 28px;
  width: 88px;
  height: 112px;
  border: 6px solid #b5e4ff;
  border-radius: 18px 18px 28px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(190,235,255,.9));
  box-shadow: 0 14px 0 rgba(90,167,255,.22);
}
.jar-lid { position: absolute; left: 14px; right: 14px; top: -18px; height: 18px; border-radius: 10px 10px 4px 4px; background: #5aa7ff; }
.coin-face, .jar-face { position: absolute; inset: 0; }
.coin-eye, .coin-smile, .jar-smile { position: absolute; display: block; }
.coin-eye { top: 34px; width: 10px; height: 14px; border-radius: 999px; background: var(--ink); }
.coin-eye.left { left: 28px; } .coin-eye.right { right: 28px; }
.coin-smile, .jar-smile { left: 50%; bottom: 24px; transform: translateX(-50%); width: 34px; height: 18px; border-bottom: 5px solid var(--ink); border-radius: 0 0 999px 999px; }
.jar-face .coin-eye { top: 42px; }
.jar-face .coin-eye.left { left: 22px; } .jar-face .coin-eye.right { right: 22px; }
.jar-smile { bottom: 32px; width: 30px; }
.play-setup, .age-paths, .mini-games { padding: 30px; margin-top: 22px; }
.role-grid, .age-grid, .mini-game-grid { display: grid; gap: 14px; margin-top: 20px; }
.role-grid { grid-template-columns: repeat(4, 1fr); }
.age-grid, .mini-game-grid { grid-template-columns: repeat(3, 1fr); }
.role-card, .age-card, .mini-game-card {
  background: white;
  border: 3px solid transparent;
  border-radius: 18px;
  padding: 18px;
  text-align: left;
  min-height: 176px;
  box-shadow: 0 12px 24px rgba(23,32,42,.08);
}
.role-card:hover, .age-card:hover, .mini-game-card:hover { border-color: var(--gold); }
.role-card.active, .age-card.active { border-color: var(--ink); background: #f7fbff; }
.role-card .card-icon, .age-card .card-icon, .mini-game-card .card-icon { display: block; font-size: 2rem; margin-bottom: 10px; }
.role-card strong, .age-card strong, .mini-game-card strong { display: block; font-family: "Baloo 2"; font-size: 1.35rem; line-height: 1; }
.role-card small, .age-card small, .mini-game-card small { display: block; color: var(--muted); line-height: 1.45; margin-top: 8px; }
.experience-hint {
  margin-top: 16px;
  color: var(--muted);
  background: #f7fbff;
  border-left: 8px solid var(--mint);
  border-radius: 18px;
  padding: 16px;
  font-weight: 800;
}
.age-topics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.age-topics span { background: #fff4c5; color: #7a5200; border-radius: 999px; padding: 6px 9px; font-size: .8rem; font-weight: 900; }
.mini-game-card { display: grid; gap: 12px; }
.mini-game-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.mini-game-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.mini-game-meta span { background: #edf7ff; color: #1d5b91; border-radius: 999px; padding: 6px 9px; font-size: .78rem; font-weight: 900; }
.mini-game-card button { width: 100%; padding: 11px 12px; }
.kids-arcade {
  margin-top: 22px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(240,255,248,.9));
}
.kids-copy p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; line-height: 1.5; margin: 12px 0 0; max-width: 650px; }
.kids-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.stats { margin: 22px 0; padding: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stats div { background: white; border-radius: 22px; padding: 18px; text-align: center; }
.stats span { display: block; font-family: "Baloo 2"; font-size: 2.4rem; font-weight: 800; }
.stats small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.game, .hub, .map { padding: 34px; margin-top: 22px; }
.game-header, .section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.badge { background: #fff0b8; color: #7a5200; border-radius: 999px; padding: 10px 14px; font-weight: 900; white-space: nowrap; }
.map { background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(232,248,255,.9)); overflow: hidden; }
.map-path { position: relative; display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 18px; margin: 28px 0; }
.map-path::before { content: ""; position: absolute; left: 8%; right: 8%; top: 52%; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #ffd966, #7ee6b8, #8cc8ff, #ffb3d1); opacity: .65; z-index: 0; }
.level-node { position: relative; z-index: 1; min-height: 170px; border: 4px solid white; border-radius: 28px; background: white; padding: 18px; text-align: left; box-shadow: 0 14px 30px rgba(23,32,42,.1); }
.level-node strong { display: block; font-family: "Baloo 2"; font-size: 1.45rem; line-height: 1; }
.level-node span { display: block; font-size: 2rem; margin-bottom: 10px; }
.level-node small { display: block; color: var(--muted); line-height: 1.35; margin: 8px 0 14px; }
.level-node.current { border-color: var(--gold); transform: translateY(-8px); }
.level-node.complete { background: #f0fff8; border-color: var(--mint); }
.level-node.locked { filter: grayscale(.45); opacity: .68; }
.level-node button { width: 100%; padding: 10px 12px; font-size: .9rem; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.choice { background: white; border: 3px solid transparent; border-radius: 24px; padding: 20px; text-align: left; min-height: 150px; }
.choice strong { display: block; font-family: "Baloo 2"; font-size: 1.45rem; }
.choice:hover { border-color: var(--gold); }
.feedback { background: #f7fbff; border-left: 8px solid var(--blue); border-radius: 18px; padding: 18px; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0; }
.hub-grid article { background: white; border-radius: 24px; padding: 22px; }
.quest-form { display: flex; gap: 12px; align-items: end; background: #fff8db; border-radius: 24px; padding: 18px; }
.quest-form label { flex: 1; font-weight: 900; }
input, select { width: 100%; margin-top: 8px; border: 2px solid #f0d98f; border-radius: 16px; padding: 14px; font-size: 1rem; background: white; }
.quest-list { display: grid; gap: 8px; padding-left: 20px; }
.modal { border: 0; border-radius: 30px; padding: 0; background: transparent; width: min(92vw, 560px); }
.modal::backdrop { background: rgba(23,32,42,.45); backdrop-filter: blur(4px); }
.modal-card { background: #fffdf4; border: 4px solid white; border-radius: 30px; box-shadow: var(--shadow); padding: 28px; position: relative; display: grid; gap: 14px; }
.modal-card.wide { width: min(92vw, 760px); }
.close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; padding: 0; background: #f4f6f8; color: var(--ink); font-size: 1.5rem; }
/* ===== Academy ===== */
.academy .section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.academy-controls {
  display: flex;
  gap: 8px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.lesson-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
}

.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: #f59e0b;
}

.lesson-card.completed {
  border-color: #10b981;
  background: #ecfdf5;
}

.lesson-card .lesson-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
}

.lesson-card h4 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #1f2937;
}

.lesson-card small {
  color: #6b7280;
  font-size: 13px;
}

.lesson-card .lesson-progress {
  margin-top: 12px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.lesson-card .lesson-progress > div {
  height: 100%;
  background: #f59e0b;
  border-radius: 3px;
  transition: width .3s;
}

.lesson-card.completed .lesson-progress > div {
  background: #10b981;
}

.lesson-badge-earned {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fbbf24;
  color: #78350f;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
}

/* Reader */
.lesson-reader {
  margin-top: 20px;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  border: 2px solid #e5e7eb;
}

.lesson-content {
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.7;
}

.lesson-content h3 {
  margin-top: 28px;
  font-size: 22px;
  color: #1f2937;
}

.lesson-content p {
  color: #374151;
  margin: 12px 0;
}

.lesson-content ul {
  padding-left: 20px;
  color: #374151;
}

.lesson-content li {
  margin: 8px 0;
}

/* Parent mode tweaks */
.academy.parent-mode .lesson-content {
  background: #f8fafc;
  padding: 24px;
  border-radius: 12px;
}

.academy.parent-mode .lesson-content h3 {
  color: #1e40af;
}

/* Quiz */
.quiz-box {
  max-width: 680px;
  margin: 28px auto 0;
  padding: 24px;
  background: #fef3c7;
  border-radius: 16px;
  border: 2px solid #f59e0b;
}

.quiz-box h3 {
  margin: 0 0 16px;
  color: #92400e;
}

.quiz-question {
  margin-bottom: 18px;
}

.quiz-question strong {
  display: block;
  margin-bottom: 8px;
  color: #1f2937;
}

.quiz-question label {
  display: block;
  padding: 8px 12px;
  margin: 6px 0;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: .15s;
}

.quiz-question label:hover {
  border-color: #f59e0b;
}

.quiz-question input {
  margin-right: 8px;
}

.quiz-result {
  margin-top: 14px;
  font-weight: 700;
  font-size: 16px;
}

.quiz-result.perfect {
  color: #047857;
}

.quiz-result.good {
  color: #b45309;
}
.hidden { display: none; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(4deg); } }
@media (max-width: 1000px) { .role-grid { grid-template-columns: repeat(2, 1fr); } .age-grid, .mini-game-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .map-path { grid-template-columns: 1fr; } .map-path::before { left: 50%; right: auto; top: 8%; bottom: 8%; width: 10px; height: auto; } }
@media (max-width: 800px) {
  .topbar, .hero, .choices, .hub-grid { grid-template-columns: 1fr; }
  .topbar { display: grid; }
  .account-area { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .game-header, .section-heading, .quest-form { flex-direction: column; }
  .kids-arcade { grid-template-columns: 1fr; }
  .kids-actions { justify-content: flex-start; }
  .video-caption { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .role-grid { grid-template-columns: 1fr; }
  .play-setup, .age-paths, .mini-games { padding: 22px; }
}
