:root {
  color-scheme: light;
  --ink: #242446;
  --muted: #85869e;
  --purple: #6b55db;
  --purple-dark: #5340bd;
  --lavender: #eeeaff;
  --line: #eeedf5;
  --surface: #fff;
  --page: #f7f8fd;
  --green: #49b89a;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #a798ff; outline-offset: 3px; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; flex-direction: column;
  width: 238px; padding: 28px 18px 22px; background: #fff; border-right: 1px solid #eeedf4;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: #f0edff; font-size: 23px; }
.brand-name { font-family: "Fredoka", sans-serif; font-size: 21px; font-weight: 600; letter-spacing: -.6px; }
.brand-name span { color: var(--purple); }
.profile-card { display: flex; align-items: center; gap: 10px; margin: 34px 0 24px; padding: 13px 10px; border-radius: 14px; background: #faf9ff; }
.avatar { display: grid; flex: 0 0 39px; height: 39px; place-items: center; border-radius: 12px; background: #fff0dd; font-size: 22px; }
.profile-card div:nth-child(2) { min-width: 0; }
.profile-card strong, .profile-card span:not(.online-dot) { display: block; }
.profile-card strong { font-size: 12px; }
.profile-card div span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.online-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: #58c8a9; box-shadow: 0 0 0 3px #def7ee; }
.side-nav { display: grid; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 0 12px; border-radius: 11px; color: #77788f; font-size: 12px; font-weight: 600; transition: background .2s, color .2s; }
.nav-link span { display: grid; width: 20px; place-items: center; font-size: 17px; }
.nav-link:hover, .nav-link.active { color: var(--purple); background: #f0edff; }
.sidebar-bottom { margin-top: auto; }
.streak-card { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid #f3eadc; border-radius: 14px; background: #fffaf0; }
.streak-icon { font-size: 23px; }
.streak-card strong, .streak-card span { display: block; }
.streak-card strong { font-size: 11px; }
.streak-card span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.sidebar-note { padding: 19px 10px 0; color: #9c9bae; font-size: 11px; line-height: 1.7; }
.sidebar-note b { color: #72728c; }

.main-content { max-width: 1440px; margin-left: 238px; padding: 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 74px; border-bottom: 1px solid #ececf3; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #a0a0b0; font-size: 11px; }
.breadcrumb-current { color: #555570; font-weight: 700; }
.breadcrumb-dot { color: #cbc9d9; }
.topbar-right { display: flex; align-items: center; gap: 11px; }
.level-pill { padding: 8px 12px; border: 1px solid #ebe8fa; border-radius: 20px; background: #fff; color: #797894; font-size: 10px; }
.level-pill span { color: #f7b84a; }
.level-pill b { color: var(--purple); }
.sound-toggle { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #eeedf5; border-radius: 50%; background: #fff; cursor: pointer; font-size: 14px; }

.welcome-row { display: flex; align-items: center; justify-content: space-between; min-height: 225px; margin-top: 15px; padding: 22px 19px; border-radius: 20px; background: linear-gradient(115deg, #fff1bd 0%, #ffe1ec 44%, #e8e3ff 72%, #d8f6ec 100%); }
.eyebrow { margin: 0 0 10px; color: #9392a8; font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.eyebrow-star { color: #f4b84e; font-size: 13px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Fredoka", "Trebuchet MS", sans-serif; }
.welcome-copy h1 { margin: 0; font-size: clamp(29px, 3.25vw, 40px); letter-spacing: -.7px; line-height: 1.18; }
.welcome-copy h1 span, .section-heading h2 span { color: var(--purple); }
.welcome-text { margin: 12px 0 15px; color: #85859b; font-size: 12px; }
.text-link { color: var(--purple); font-size: 11px; font-weight: 800; }
.text-link span { margin-left: 5px; }
.hero-art { position: relative; display: grid; width: 300px; height: 183px; place-items: center; margin-right: 25px; }
.hero-orbit { position: absolute; width: 168px; height: 168px; border: 1px dashed #d5cdfb; border-radius: 50%; }
.hero-orbit:before, .hero-orbit:after { position: absolute; content: ""; border-radius: 50%; }
.hero-orbit:before { inset: 16px; background: #f0edff; }
.hero-orbit:after { inset: 28px; border: 1px solid #ded9fa; }
.hero-photo { position: relative; z-index: 1; width: 270px; max-width: 100%; height: auto; filter: drop-shadow(0 10px 6px #51416c25); }
.floating-book, .floating-planet { position: absolute; z-index: 2; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px #4e469018; font-size: 22px; }
.floating-book { top: 28px; left: 47px; transform: rotate(-12deg); }
.floating-planet { right: 34px; bottom: 23px; transform: rotate(12deg); }
.hero-caption { position: absolute; right: -3px; bottom: 12px; color: #8d87bc; font-family: "Fredoka", sans-serif; font-size: 12px; line-height: 1.25; transform: rotate(-5deg); }
.hero-spark { position: absolute; z-index: 2; color: #f1b753; }
.spark-one { top: 21px; right: 89px; font-size: 20px; }.spark-two { bottom: 30px; left: 39px; color: #a097ec; font-size: 19px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 91px; overflow: hidden; padding: 15px 17px; border: 1px solid #eeedf4; border-radius: 15px; background: #fff; }
.stat-icon { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border-radius: 13px; background: #fff7df; font-size: 20px; }
.stat-points .stat-icon { background: #e9f8f2; }.stat-badges .stat-icon { background: #f1edff; }
.stat-card div { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; }
.stat-label { grid-column: 1 / -1; color: #89899d; font-size: 10px; font-weight: 600; }
.stat-card strong { font-family: "Fredoka", sans-serif; font-size: 23px; line-height: 1.2; }
.stat-hint { color: #aaa9b9; font-size: 9px; }
.stat-decoration { position: absolute; top: 12px; right: 17px; color: #e7ddff; font-size: 18px; }
.stat-points .stat-decoration { color: #dcf4e9; }.stat-badges .stat-decoration { color: #e9e3ff; }

.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 15px; }
.section-heading .eyebrow, .bottom-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2, .bottom-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.category-controls { display: flex; align-items: center; gap: 10px; }
.category-status { color: #9695a9; font-size: 9px; }
.quick-quiz-button { min-height: 31px; padding: 0 11px; border: 0; border-radius: 8px; background: #eeeaff; color: var(--purple); font-size: 9px; font-weight: 800; cursor: pointer; }
.quick-quiz-button span { margin-left: 4px; }
.quick-quiz-button:disabled { background: #f0eff5; color: #aaa9b7; cursor: default; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.category-card { position: relative; display: flex; min-width: 0; min-height: 110px; flex-direction: column; align-items: flex-start; justify-content: space-between; overflow: hidden; padding: 12px 11px 11px; border: 1px solid transparent; border-radius: 13px; text-align: left; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.category-card:hover { z-index: 1; transform: translateY(-3px); box-shadow: 0 9px 20px #37305912; }
.category-card.selected { border-color: #8d7ce9; box-shadow: 0 0 0 2px #8d7ce926; }
.category-emoji { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: #ffffffa8; font-size: 20px; }
.category-name { max-width: 100%; color: #3e3d59; font-size: 10px; font-weight: 800; line-height: 1.25; }
.category-arrow { position: absolute; top: 12px; right: 10px; color: #8d8ba5; font-size: 12px; }
.cat-math { background: linear-gradient(135deg, #fff0b0, #ffd36e); }.cat-english { background: linear-gradient(135deg, #bff5e7, #8de5cc); }.cat-science { background: linear-gradient(135deg, #ded4ff, #b7a5ff); }.cat-geography { background: linear-gradient(135deg, #ccecff, #91d4ff); }.cat-history { background: linear-gradient(135deg, #ffd4bf, #ffae91); }.cat-general { background: linear-gradient(135deg, #ffe9a8, #ffd16b); }.cat-bible { background: linear-gradient(135deg, #f3d9ff, #d8b1fa); }.cat-picture { background: linear-gradient(135deg, #ffcce2, #ff9fc6); }
.cat-quantitative { background: linear-gradient(135deg, #c9f3ff, #7bd7f5); }.cat-verbal { background: linear-gradient(135deg, #ffd0e8, #ff9fc9); }.cat-puzzle { background: linear-gradient(135deg, #ddd0ff, #ab8cf3); }.cat-crosswords { background: linear-gradient(135deg, #d4f5c2, #a5e286); }.cat-aptitude { background: linear-gradient(135deg, #ffe0ad, #ffbc64); }.cat-shapes { background: linear-gradient(135deg, #c4e7ff, #8bbdff); }.cat-essay { background: linear-gradient(135deg, #fff0a8, #ffd45e); }.cat-comprehension { background: linear-gradient(135deg, #e2d5ff, #c0a4ff); }.cat-stories { background: linear-gradient(135deg, #ffd7c7, #ffab8b); }

.challenge-banner { position: relative; display: flex; align-items: center; min-height: 147px; gap: 19px; overflow: hidden; margin-top: 26px; padding: 18px 23px; border-radius: 17px; background: #6d58d8; color: #fff; }
.challenge-banner:after { position: absolute; top: -97px; right: 100px; width: 260px; height: 260px; border: 1px solid #ffffff1a; border-radius: 50%; content: ""; box-shadow: 0 0 0 35px #ffffff08, 0 0 0 70px #ffffff08; }
.daily-illustration { position: relative; display: grid; flex: 0 0 108px; height: 105px; place-items: center; border-radius: 14px; background: #ffffff1b; }
.daily-stars { position: absolute; right: 8px; bottom: 8px; color: #fbe08d; font-size: 11px; }
.daily-copy { z-index: 1; flex: 1; }
.daily-label { display: block; margin-bottom: 7px; color: #dfd9ff; font-size: 9px; font-weight: 800; letter-spacing: 1px; }.daily-label span { color: #ffd578; }
.daily-copy h2 { margin: 0 0 5px; font-size: 19px; }
.daily-copy p { max-width: 420px; margin: 0; color: #e4dfff; font-size: 10px; line-height: 1.5; }
.daily-action { z-index: 1; display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 9px; }
.daily-reward { color: #ffdf91; font-size: 10px; font-weight: 700; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 37px; padding: 0 15px; border: 0; border-radius: 9px; font-size: 10px; font-weight: 800; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-light { background: #fff; color: #5944c4; }.button-light:hover { background: #f2efff; }
.button-primary { background: var(--purple); color: #fff; }.button-primary:hover { background: var(--purple-dark); }

.modes-section { margin-top: 31px; }
.mode-prompt { margin: 0 0 3px; color: #9c9bad; font-size: 10px; }
.mode-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.mode-card { position: relative; display: flex; min-height: 130px; flex-direction: column; align-items: flex-start; padding: 13px 12px; border: 1px solid #eeedf4; border-radius: 13px; background: #fff; text-align: left; cursor: pointer; transition: transform .18s, box-shadow .18s; }
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px #37305912; }
.mode-icon { display: grid; width: 35px; height: 35px; margin-bottom: 9px; place-items: center; border-radius: 11px; background: #fff5dc; font-size: 18px; }
.mode-picture .mode-icon { background: #eaf5ff; }.mode-sound .mode-icon { background: #f3edff; }.mode-letters .mode-icon { background: #e8f7f1; }.mode-battle .mode-icon { background: #fff0eb; }
.mode-title { margin-bottom: 4px; font-family: "Fredoka", sans-serif; font-size: 13px; }
.mode-description { max-width: calc(100% - 8px); color: #9291a5; font-size: 9px; line-height: 1.4; }
.mode-arrow { position: absolute; top: 13px; right: 12px; color: #c4c1d5; font-size: 13px; }

.bottom-row { display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; margin-top: 30px; }
.trophy-card, .encouragement-card { position: relative; min-height: 171px; overflow: hidden; padding: 17px 19px; border: 1px solid #eeedf4; border-radius: 15px; background: #fff; }
.bottom-heading { display: flex; align-items: flex-start; justify-content: space-between; }.bottom-heading h2 { font-size: 19px; }
.trophy-sparkle { color: #edb950; font-size: 22px; }
.badge-list { display: flex; gap: 17px; min-height: 51px; align-items: center; margin: 10px 0 7px; }
.badge-item { display: flex; align-items: center; gap: 7px; color: #817f95; font-size: 9px; }
.badge-item span { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 50%; background: #fff5de; font-size: 18px; }
.badge-item.locked { opacity: .44; }.badge-item.locked span { background: #f1f0f5; filter: grayscale(1); }
.subtle-button { padding: 0; border: 0; background: transparent; color: var(--purple); font-size: 10px; font-weight: 800; cursor: pointer; }.subtle-button span { margin-left: 4px; }
.encouragement-card { display: flex; align-items: center; gap: 15px; background: #eff8f4; border-color: #e5f0e9; }
.encouragement-art { position: relative; display: grid; flex: 0 0 72px; height: 83px; place-items: center; border-radius: 14px; background: #ffffffab; font-size: 41px; }
.encouragement-art span { position: absolute; top: 7px; right: 9px; color: #f1bd52; font-size: 13px; }
.encouragement-card .eyebrow { margin-bottom: 6px; }
.encouragement-card h2 { margin: 0 0 6px; font-size: 17px; line-height: 1.2; }
.encouragement-card p:last-child { max-width: 235px; margin: 0; color: #878b9b; font-size: 9px; line-height: 1.45; }
.quote-mark { position: absolute; top: -10px; right: 14px; color: #d7eddf; font-family: Georgia, serif; font-size: 86px; }
.footer { display: flex; justify-content: space-between; padding: 24px 2px 20px; color: #a5a4b4; font-size: 9px; }.footer span span { color: #f08a9d; }

dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: #25213e99; backdrop-filter: blur(4px); }
.game-dialog { width: min(540px, calc(100% - 30px)); max-width: none; max-height: min(90vh, 760px); overflow: auto; border-radius: 21px; box-shadow: 0 24px 70px #201b4938; }
.game-shell { padding: 24px 31px 20px; }
.game-topline, .game-progress-row { display: flex; align-items: center; justify-content: space-between; }
.game-audio-controls { display: flex; align-items: center; gap: 7px; }
.game-sound-toggle, .game-music-toggle {
  display: grid; width: 32px; height: 32px; place-items: center;
  border: 1px solid #e6d8ff; border-radius: 50%; background: #f0e7ff;
  color: #5729bf; cursor: pointer; font-size: 15px; font-weight: 800;
}
.game-music-toggle { border-color: #ffd3e4; background: #ffe5ef; color: #bd2867; }
.game-category { color: var(--purple); font-size: 11px; font-weight: 800; }
.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #efedf4; border-radius: 50%; background: #fff; color: #88879b; font-size: 22px; cursor: pointer; }
.game-progress-row { margin: 14px 0 7px; color: #88879a; font-size: 10px; }
.game-timer { padding: 5px 9px; border-radius: 20px; background: #fff1e9; color: #dc7655; font-weight: 700; }.game-timer.urgent { background: #ffe3e0; color: #ce4a49; }
.progress-track { height: 6px; overflow: hidden; border-radius: 10px; background: #efedf7; }.progress-track span { display: block; width: 10%; height: 100%; border-radius: inherit; background: #8b78ed; transition: width .25s; }
.battle-score { display: flex; justify-content: center; gap: 22px; margin: 13px 0 -7px; color: #77758e; font-size: 11px; }.battle-score b { color: var(--purple); }
.question-area { padding: 22px 0 17px; text-align: center; }
.question-visual { display: grid; width: 104px; min-height: 96px; margin: 0 auto 10px; place-items: center; border: 3px solid #fff; border-radius: 24px; background: linear-gradient(145deg, #fff3ae, #ffc9e1 55%, #c8efff); box-shadow: 0 7px 18px #574a9622; font-size: 61px; line-height: 1.2; }
.question-kicker { margin: 0 0 6px; color: #a19fb2; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.question-area h2 { margin: 0; font-size: 25px; line-height: 1.25; }
.question-hint { margin: 8px 0 0; color: #8b899e; font-size: 11px; }
.sound-clue { margin-top: 12px; padding: 9px 13px; border: 1px solid #e8e4fb; border-radius: 20px; background: #f5f2ff; color: var(--purple); font-size: 10px; font-weight: 700; cursor: pointer; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-option { min-height: 49px; padding: 10px; border: 1px solid #ecebf2; border-radius: 11px; background: #fff; color: #47465e; font-size: 13px; font-weight: 700; cursor: pointer; transition: border .15s, background .15s, transform .15s; }
.answer-option:hover:not(:disabled) { transform: translateY(-2px); border-color: #b5aaf3; background: #faf9ff; }
.answer-option:disabled { cursor: default; }.answer-option.correct { border-color: #79cfad; background: #edfaf4; color: #368f70; }.answer-option.incorrect { border-color: #f0a29b; background: #fff1ef; color: #c65e5b; }
.game-feedback { min-height: 23px; padding-top: 9px; color: #3caa82; text-align: center; font-size: 11px; font-weight: 800; }.game-feedback.wrong { color: #d8796c; }
.next-button { display: flex; width: 100%; margin-top: 2px; }
.game-footnote { margin: 16px 0 0; color: #aaa9b7; text-align: center; font-size: 9px; }
.result-dialog { width: min(410px, calc(100% - 30px)); max-width: none; border-radius: 22px; box-shadow: 0 24px 70px #201b4938; }
.result-content { position: relative; padding: 31px 30px 27px; text-align: center; }.result-close, .certificate-close { position: absolute; top: 13px; right: 13px; }
.result-confetti { margin-bottom: 7px; font-size: 51px; }.result-content .eyebrow { margin-bottom: 7px; color: #9a92d3; }
.result-content h2 { margin: 0 0 7px; font-size: 28px; }.result-content > p:not(.eyebrow) { margin-bottom: 18px; color: #88879c; font-size: 11px; }
.result-rewards { display: flex; justify-content: center; gap: 10px; margin-bottom: 21px; }.result-rewards span { padding: 10px 13px; border-radius: 11px; background: #fff7e2; color: #81715a; font-size: 11px; }.result-rewards span + span { background: #eef9f4; }
.result-actions { display: grid; gap: 13px; justify-items: center; }.result-actions .button { width: 100%; min-height: 43px; }.result-actions .subtle-button { padding: 4px; }
.certificate-dialog { width: min(650px, calc(100% - 28px)); max-width: none; overflow: visible; border-radius: 8px; background: transparent; }
.certificate-paper { position: relative; margin: 13px; padding: 40px 30px 27px; border: 9px double #ddc66f; outline: 1px solid #fff; background: #fffdf5; text-align: center; box-shadow: 0 16px 45px #19163255; }
.certificate-seal { display: grid; width: 60px; height: 60px; margin: 0 auto 11px; place-items: center; border: 2px solid #e1ca72; border-radius: 50%; background: #fff6d7; font-size: 32px; }
.certificate-overline { margin: 0 0 9px; color: #a28a40; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.certificate-paper h2 { margin: 0 0 13px; color: #4a4380; font-size: 31px; line-height: 1.12; }.certificate-paper h2 span { color: #9272d9; }
.certificate-text { max-width: 390px; margin: 0 auto 18px; color: #77738b; font-size: 11px; line-height: 1.6; }
.certificate-name { display: inline-block; min-width: 235px; padding: 8px 10px; border-bottom: 1px solid #d2c68d; color: #4b4774; font-family: "Fredoka", sans-serif; font-size: 18px; }
.certificate-input-label { display: block; margin: 0 auto 6px; color: #80799d; font-size: 10px; font-weight: 700; }
.certificate-name-input { display: block; width: min(290px, 100%); min-height: 38px; margin: 0 auto 5px; padding: 8px 12px; border: 1px solid #d8d1ef; border-radius: 9px; background: #fff; color: #4b4774; font: inherit; font-size: 13px; text-align: center; }
.certificate-name-input:focus { border-color: #9272d9; outline: 3px solid #9272d933; }
.certificate-privacy-note { margin: 0 0 9px; color: #9c97ab; font-size: 9px; }
.certificate-bottom { display: flex; justify-content: space-between; margin-top: 20px; color: #9a8b55; font-size: 9px; }
.certificate-download-options { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 16px 0 10px; color: #514572; font-size: 11px; font-weight: 700; }
.certificate-download-options select { min-height: 34px; padding: 5px 25px 5px 10px; border: 1px solid #d8d1ef; border-radius: 8px; background: #fff; color: #4b4774; font: inherit; }
.certificate-download { min-height: 42px; }
.certificate-download-status { min-height: 14px; margin: 8px 0 0; color: #07805f; font-size: 10px; }

@media (min-width: 1440px) { .main-content { margin-right: auto; } }
@media (max-width: 1100px) {
  .main-content { padding: 0 30px; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-card { min-height: 94px; }
  .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mode-card { min-height: 120px; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; height: 61px; flex-direction: row; align-items: center; padding: 0 18px; border-right: 0; border-bottom: 1px solid #eeedf4; }
  .brand { padding: 0; }.brand-mark { width: 34px; height: 34px; }.brand-name { font-size: 19px; }
  .profile-card, .sidebar-bottom { display: none; }
  .side-nav { display: flex; gap: 3px; margin-left: auto; }.nav-link { min-height: 36px; gap: 0; padding: 0 9px; font-size: 0; }.nav-link span { font-size: 17px; }
  .main-content { margin: 0; padding: 0 22px; }.topbar { height: 56px; }.breadcrumb { font-size: 10px; }
  .welcome-row { min-height: 185px; }.welcome-copy h1 { font-size: 30px; }.welcome-text { max-width: 350px; line-height: 1.5; }
  .hero-art { width: 210px; height: 155px; margin-right: 2px; transform: scale(.85); transform-origin: center right; }.hero-caption { display: none; }
  .stat-card { gap: 8px; min-height: 78px; padding: 11px 10px; }.stat-icon { flex-basis: 34px; height: 34px; font-size: 17px; }.stat-hint { display: none; }.stat-card strong { font-size: 20px; }
  .section-block { margin-top: 28px; }.category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }.category-card { min-height: 93px; }
  .challenge-banner { min-height: 130px; gap: 13px; padding: 14px; }.daily-illustration { flex-basis: 77px; height: 85px; }.daily-copy h2 { font-size: 16px; }.daily-copy p { font-size: 9px; }.daily-action { gap: 7px; }.daily-action .button { padding: 0 10px; font-size: 9px; }
  .bottom-row { grid-template-columns: 1fr; }.mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .main-content { padding: 0 15px; }.topbar { height: 52px; }.level-pill { padding: 7px 9px; }.sound-toggle { width: 31px; height: 31px; }
  .welcome-row { position: relative; min-height: 178px; padding: 18px 10px; }.welcome-copy { z-index: 1; max-width: 77%; }.welcome-copy h1 { font-size: 28px; }.welcome-text { max-width: 250px; margin-top: 8px; font-size: 10px; }.welcome-copy .eyebrow { font-size: 8px; }
  .hero-art { position: absolute; top: 14px; right: -12px; width: 155px; transform: scale(.62); }.hero-photo { width: 160px; max-width: none; }.floating-book { left: 14px; }.floating-planet { right: 5px; }
  .stats-row { gap: 7px; }.stat-card { min-height: 74px; flex-direction: column; align-items: flex-start; gap: 4px; padding: 9px; }.stat-icon { position: absolute; top: 8px; right: 7px; width: 25px; height: 25px; font-size: 13px; }.stat-card div { display: block; }.stat-label { display: block; max-width: 54px; font-size: 9px; }.stat-card strong { font-size: 20px; }
  .section-heading { align-items: flex-start; }.section-heading h2 { font-size: 20px; }.category-controls { flex-direction: column; align-items: flex-end; gap: 5px; }.category-status { max-width: 130px; text-align: right; line-height: 1.3; }.mode-prompt { display: none; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.category-card { min-height: 77px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px; }.category-emoji { flex: 0 0 34px; }.category-name { font-size: 10px; }.category-arrow { top: 10px; right: 9px; font-size: 10px; }
  .challenge-banner { align-items: flex-start; gap: 10px; padding: 13px 11px; }.daily-illustration { flex-basis: 56px; height: 66px; }.daily-stars { display: none; }.daily-copy { padding-top: 2px; }.daily-label { font-size: 7px; }.daily-copy h2 { font-size: 14px; line-height: 1.2; }.daily-copy p { font-size: 8px; }.daily-action { align-items: flex-start; margin-top: 76px; margin-left: -66px; }.daily-reward { font-size: 8px; }.daily-action .button { min-height: 31px; font-size: 8px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.mode-card { min-height: 116px; }.mode-title { font-size: 12px; }.mode-description { font-size: 8px; }
  .bottom-row { margin-top: 23px; }.trophy-card, .encouragement-card { padding: 15px; }.badge-list { gap: 10px; }.badge-item { gap: 4px; font-size: 8px; }.badge-item span { width: 28px; height: 28px; font-size: 15px; }.encouragement-card { gap: 10px; }.encouragement-art { flex-basis: 60px; height: 75px; font-size: 34px; }.footer { flex-direction: column; gap: 7px; padding-bottom: 18px; }
  .game-shell { padding: 19px 17px 16px; }.question-area { padding: 18px 0 14px; }.question-area h2 { font-size: 22px; }.answer-option { min-height: 45px; font-size: 11px; }.answer-grid { gap: 8px; }.certificate-paper { margin: 5px; padding: 36px 13px 20px; }.certificate-paper h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }

:root {
  --ink: #2b2057;
  --muted: #685f89;
  --purple: #6b35db;
  --purple-dark: #4c22b5;
  --lavender: #eee5ff;
  --line: #e8defa;
  --page: #fff8eb;
  --green: #0c9d75;
}
body {
  background:
    radial-gradient(ellipse at 87% 14%, #ffd4e7 0, transparent 25rem),
    radial-gradient(ellipse at 8% 48%, #c9f5ee 0, transparent 28rem),
    #fff8eb;
}
.sidebar { background: #fffdf8; border-color: #f0dfc8; }
.profile-card { background: #fff1d2; }
.nav-link:hover, .nav-link.active { background: #e9ddff; color: #5826c4; }
.sound-toggle, .music-toggle {
  display: grid; width: 36px; height: 36px; place-items: center;
  border: 2px solid #e6d8ff; border-radius: 12px; background: #f0e7ff;
  color: #5729bf; cursor: pointer; font-size: 17px; font-weight: 800;
  box-shadow: 0 3px 0 #d9c8ff;
}
.music-toggle { border-color: #ffd3e4; background: #ffe5ef; color: #bd2867; box-shadow: 0 3px 0 #ffc1d9; }
.sound-toggle[aria-pressed="false"], .music-toggle[aria-pressed="false"] { background: #fff; }
.welcome-row {
  background: linear-gradient(112deg, #4d24b6 0%, #7430c6 34%, #c33391 69%, #ed4f68 100%);
  box-shadow: 0 12px 28px #da50922d;
}
.welcome-copy .eyebrow, .welcome-copy h1, .welcome-text, .text-link { color: #fff; }
.welcome-copy h1 span { color: #ffe76b; }
.welcome-text { opacity: .96; }
.text-link { display: inline-flex; gap: 7px; align-items: center; padding: 8px 12px; border: 2px solid #ffffff78; border-radius: 22px; background: #ffffff24; }
.hero-orbit { border-color: #ffffffa6; }
.hero-orbit:before { background: #ffffff30; }
.hero-orbit:after { border-color: #ffffff80; }
.hero-photo { filter: drop-shadow(0 10px 8px #40265b35); }
.hero-photo { height: 178px; border: 5px solid #fff; border-radius: 25px; object-fit: cover; box-shadow: 0 8px 22px #44235d55; }
.stats-row { gap: 15px; }
.stat-card { border: 2px solid #fff; box-shadow: 0 8px 18px #45327212; }
.stat-stars { background: linear-gradient(135deg, #fff2aa, #ffe16b); }
.stat-points { background: linear-gradient(135deg, #bff3dd, #7cddbb); }
.stat-badges { background: linear-gradient(135deg, #e0d2ff, #bfa7ff); }
.stat-label, .stat-hint { color: #514572; }
.stat-icon, .stat-points .stat-icon, .stat-badges .stat-icon { background: #ffffff8a; }
.category-card { min-height: 120px; border: 2px solid #fff; box-shadow: 0 5px 0 #42326b1c; }
.category-card:hover { box-shadow: 0 10px 0 #42326b1c, 0 12px 20px #37305920; }
.category-card.selected { border-color: #432189; box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #6033cc; }
.category-name { color: #2b2057; font-size: 11px; }
.cat-science .category-name { color: #fff; }
.category-emoji { background: #ffffffc7; }
.cat-math { background: linear-gradient(135deg, #ffe65a, #ffae21); }
.cat-english { background: linear-gradient(135deg, #70efd0, #2bc4a0); }
.cat-science { background: linear-gradient(135deg, #7b58e2, #4c2aa8); }
.cat-geography { background: linear-gradient(135deg, #8ee8ff, #38bce9); }
.cat-history { background: linear-gradient(135deg, #ffb18a, #ff765e); }
.cat-general { background: linear-gradient(135deg, #ffd36d, #ff9a37); }
.cat-bible { background: linear-gradient(135deg, #c2caff, #8093f5); }
.cat-picture { background: linear-gradient(135deg, #ffc4df, #f27cab); }
.category-controls .quick-quiz-button { min-height: 38px; padding: 0 15px; border-radius: 20px; background: #6b35db; color: #fff; box-shadow: 0 4px 0 #4c22b5; }
.quick-quiz-button:disabled { background: #e7e1ef; box-shadow: none; color: #817891; }
.challenge-banner { background: linear-gradient(105deg, #fe6b58, #ed398e 53%, #7139d3); box-shadow: 0 10px 22px #d9487a30; }
.daily-illustration { overflow: hidden; border: 3px solid #ffffffa8; background: #fff; }
.daily-photo, .encouragement-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.daily-stars { z-index: 1; padding: 4px 6px; border-radius: 10px; background: #41246b9c; color: #fff3a6; }
.mode-card { border: 2px solid #fff; box-shadow: 0 5px 0 #47336e1c; }
.mode-card:nth-child(1) { background: #fff0af; }
.mode-card:nth-child(2) { background: #ffd8e9; }
.mode-card:nth-child(3) { background: #d8d0ff; }
.mode-card:nth-child(4) { background: #c9f5e3; }
.mode-card:nth-child(5) { background: #c8ecff; }
.mode-card:hover { box-shadow: 0 8px 0 #47336e1c, 0 12px 20px #37305918; }
.mode-title { color: #35245f; }
.trophy-card { border: 2px solid #f8df82; background: linear-gradient(135deg, #fff9d9, #ffefb0); }
.encouragement-card { border: 2px solid #a9e8d2; background: linear-gradient(135deg, #bff4df, #d6f7ee); }
.encouragement-art { overflow: hidden; border: 3px solid #fff; background: #fff; }
.encouragement-art span { z-index: 1; padding: 2px; border-radius: 50%; background: #fff; }
.footer { color: #695987; }
.footer a { color: #592dc5; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.question-visual.photo-mode {
  width: min(320px, 100%); height: 220px; min-height: 0; overflow: hidden;
  padding: 0; border: 5px solid #fff; border-radius: 24px;
  background: linear-gradient(135deg, #fff8e7, #f2edff); box-shadow: 0 9px 22px #59409232;
}
.question-photo { display: block; width: 100%; height: 100%; padding: 5px; background: linear-gradient(135deg, #fff8e7, #f2edff); object-fit: contain; }
.question-visual svg { display: block; width: 100%; max-width: 180px; height: auto; }
.picture-illustration { display: grid; width: 100%; height: 100%; place-items: center; background: linear-gradient(135deg, #fff5cb, #f5dcff); font-size: 112px; animation: picture-bob 2.4s ease-in-out infinite; }
.picture-choice { display: flex; min-height: 128px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 7px; }
.picture-choice img { display: block; width: 100%; height: 90px; object-fit: contain; }
.picture-choice-illustration { display: grid; width: 100%; height: 90px; place-items: center; border-radius: 9px; background: linear-gradient(135deg, #fff5cb, #f5dcff); font-size: 52px; animation: picture-bob 2.4s ease-in-out infinite; }
.picture-choice .picture-choice-illustration { font-size: 52px; }
.reading-passage { max-height: 180px; overflow: auto; margin: 0 auto 13px; padding: 12px 14px; border: 2px solid #fff; border-radius: 14px; background: linear-gradient(135deg, #fff3bd, #ffe1ef); color: #59436d; font-size: 12px; line-height: 1.55; text-align: left; }
.written-response { display: grid; gap: 9px; margin-top: 12px; }
.written-response[hidden], #answer-grid[hidden] { display: none !important; }
.written-response label { color: #514572; font-size: 11px; font-weight: 800; }
.written-response textarea, .written-response input { width: 100%; padding: 11px; border: 2px solid #e3dcf5; border-radius: 11px; background: #fff; color: #31264f; font: inherit; font-size: 13px; }
.written-response textarea { min-height: 110px; resize: vertical; }
.crossword-letters { margin: 0; padding: 10px; border-radius: 10px; background: #fff3bf; color: #4a3b65; font-family: "Fredoka", sans-serif; font-size: 21px; font-weight: 700; letter-spacing: .22em; text-align: center; }
.response-privacy { margin: 0; color: #8c8799; font-size: 10px; }
.essay-feedback { display: grid; gap: 10px; margin-top: 5px; padding: 13px; border: 2px solid #c9efdc; border-radius: 14px; background: linear-gradient(145deg, #f1fff7, #fffdf2); text-align: left; }
.essay-feedback[hidden] { display: none; }
.essay-feedback h3 { margin: 0; color: #287252; font-family: "Fredoka", sans-serif; font-size: 17px; }
.essay-feedback > ul, .essay-suggestions ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.essay-feedback > ul > li { padding: 8px 10px; border-radius: 9px; background: #fff; color: #5b5570; font-size: 11px; line-height: 1.5; }
.essay-feedback > ul > li strong { display: block; margin-bottom: 2px; color: #514572; font-size: 11px; }
.essay-suggestions { display: grid; gap: 6px; padding-top: 9px; border-top: 1px solid #d5efdf; color: #287252; font-size: 11px; }
.essay-suggestions ul { padding-left: 17px; list-style: disc; color: #5b5570; line-height: 1.45; }
.essay-feedback-note { margin: 0; color: #898398; font-size: 9px; line-height: 1.45; }
.written-response textarea[readonly] { border-color: #c9efdc; background: #fbfffc; }
.written-response button:disabled { opacity: .7; cursor: default; }
.picture-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: #b5aaf3; background: #faf9ff; }
@keyframes picture-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.game-feedback { color: #07805f; }
.game-feedback.wrong { color: #c33f64; }
.answer-option { border: 2px solid #e7ddf6; }
.answer-option:hover:not(:disabled) { border-color: #7d54dc; background: #f6f0ff; }
.answer-option.correct { border-color: #34b987; background: #d9f9e9; color: #08724f; }
.answer-option.incorrect { border-color: #ff8293; background: #ffe0e4; color: #ac294b; }
.button-primary { background: linear-gradient(100deg, #7139de, #a23fe1); box-shadow: 0 4px 0 #4d24b0; }
.button-primary:hover { background: linear-gradient(100deg, #5f2dcb, #8a2ecb); }
.button-light { box-shadow: 0 4px 0 #ded3ff; }
.certificate-paper { border-color: #f4c844; background: linear-gradient(135deg, #fffbe4, #fff); }
.sound-toggle:focus-visible, .music-toggle:focus-visible { outline-color: #ff5b93; }
@media (max-width: 520px) {
  .sound-toggle, .music-toggle { width: 32px; height: 32px; }
  .topbar-right { gap: 6px; }
  .hero-photo { width: 160px; max-width: none; height: auto; aspect-ratio: 1.5; }
  .stats-row { gap: 7px; }
  .category-card { min-height: 79px; }
  .question-visual.photo-mode { height: min(54vw, 220px); }
}
.photo-credits-page { max-width: 1050px; margin: 0 auto; padding: 45px 28px 70px; }
.photo-credits-page > .text-link { margin-bottom: 30px; color: var(--purple); }
.photo-credits-page h1 { margin: 0 0 10px; color: #5228bd; font-size: clamp(32px, 5vw, 48px); }
.photo-credits-page h2 { margin: 30px 0 12px; color: #d93d83; font-size: 23px; }
.credits-intro { max-width: 760px; color: #685f89; line-height: 1.6; }
.credits-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.credits-list li { padding: 14px; border: 2px solid #fff; border-radius: 13px; background: #ffffffd9; box-shadow: 0 4px 0 #49336d12; color: #514572; font-size: 12px; line-height: 1.55; }
.credits-list a { color: #592dc5; font-weight: 700; text-decoration: underline; text-decoration-color: #b59cfa; text-underline-offset: 2px; }
@media (max-width: 640px) {
  .photo-credits-page { padding: 28px 15px 48px; }
  .credits-list { grid-template-columns: 1fr; }
}

@media print {
  body { min-width: 0; background: #fff; }
  .app-shell, .game-dialog, .result-dialog { display: none !important; }
  body > .certificate-dialog[open] { position: static; display: block !important; width: 100%; max-width: none; margin: 0; overflow: visible; background: #fff; }
  .certificate-paper { min-height: 90vh; margin: 0; padding: 48px 30px; box-shadow: none; }
  .certificate-close, .certificate-input-label, .certificate-name-input, .certificate-privacy-note, .certificate-download-options, .certificate-download, .certificate-download-status { display: none !important; }
}