:root {
  --ink: #18332c;
  --muted: #5d6f69;
  --line: #dce6e1;
  --paper: #f6faf8;
  --white: #ffffff;
  --green: #176b4d;
  --green-soft: #dff2e8;
  --blue: #1f70a8;
  --blue-soft: #e2f1fa;
  --orange: #c96d17;
  --orange-soft: #fff0dc;
  --coral: #c94f47;
  --saffron: #f0a225;
  --shadow: 0 12px 30px rgba(20, 54, 43, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #ffbd4a; outline-offset: 3px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

.entry-screen { position: relative; min-height: 100vh; display: grid; align-items: center; padding: 32px max(24px, calc((100vw - 1180px) / 2)); overflow: hidden; }
.entry-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.entry-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 34, 28, 0.87) 0%, rgba(7, 34, 28, 0.58) 48%, rgba(7, 34, 28, 0.08) 100%); }
.entry-panel { position: relative; width: min(440px, 100%); padding: 30px; color: var(--white); background: rgba(13, 45, 37, 0.88); border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 8px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.entry-brand, .brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--saffron); color: #26302d; font-weight: 900; }
.entry-brand { margin-bottom: 34px; font-weight: 750; }
.eyebrow { margin: 0 0 8px; color: var(--orange); font-size: 0.76rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.entry-panel .eyebrow, .chapter-hero .eyebrow { color: #ffd079; }
.entry-panel h1 { margin: 0; max-width: 360px; font-size: 3.1rem; line-height: 1.02; letter-spacing: 0; }
.entry-copy { margin: 16px 0 24px; color: rgba(255, 255, 255, 0.82); line-height: 1.55; }
.motto-line { margin: 12px 0 0; color: #ffd079; font-weight: 850; }
.student-form { display: grid; gap: 9px; }
.student-form label { margin-top: 5px; font-size: 0.84rem; font-weight: 800; }
.student-form input[type="text"], .student-form select { width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: var(--white); border: 1px solid transparent; border-radius: 6px; }
.student-form input[aria-invalid="true"] { border-color: #ff9a92; box-shadow: 0 0 0 2px rgba(255, 154, 146, 0.2); }
.form-message { min-height: 20px; margin: 2px 0 0; color: #ffc2bc; font-size: 0.84rem; }
.privacy-note { margin: 18px 0 0; color: rgba(255, 255, 255, 0.68); font-size: 0.76rem; line-height: 1.45; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 18px; border: 1px solid transparent; border-radius: 6px; font-weight: 850; text-decoration: none; transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: var(--white); box-shadow: 0 6px 16px rgba(23, 107, 77, 0.2); }
.button-primary:hover { background: #11593f; }
.button-light { background: var(--white); color: var(--green); }
.button-wide { width: 100%; }
.button[disabled] { cursor: wait; opacity: 0.7; transform: none; }
.button-google { gap: 10px; color: #25302c; background: var(--white); border-color: rgba(255, 255, 255, 0.6); }
.button-google:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.button-google[aria-disabled="true"] { pointer-events: none; opacity: 0.65; }
.google-g { display: grid; width: 24px; height: 24px; place-items: center; color: #3367d6; border: 1px solid #d8dce5; border-radius: 50%; font-weight: 900; }
.form-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; color: rgba(255, 255, 255, 0.58); font-size: 0.72rem; text-transform: uppercase; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; flex: 1; background: rgba(255, 255, 255, 0.2); }
.guide-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 2px; padding: 0; border: 0; }
.guide-choice legend { margin-bottom: 8px; font-size: 0.84rem; font-weight: 800; }
.guide-choice label { position: relative; margin: 0; cursor: pointer; }
.guide-choice input { position: absolute; opacity: 0; }
.guide-choice span { display: grid; min-height: 42px; place-items: center; padding: 6px; color: var(--ink); background: var(--white); border: 2px solid transparent; border-radius: 6px; font-size: 0.8rem; }
.guide-choice input:checked + span { color: var(--green); border-color: var(--saffron); box-shadow: 0 0 0 1px var(--saffron); }
.guide-choice input:focus-visible + span { outline: 3px solid #ffbd4a; outline-offset: 2px; }

.profile-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: #eef6f2; }
.profile-panel { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(340px, 1fr); width: min(940px, 100%); overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.profile-characters { align-self: end; width: 100%; max-height: 650px; object-fit: contain; object-position: center bottom; padding: 30px 20px 0; background: var(--green-soft); }
.profile-panel > div { padding: 38px; }
.profile-panel h1 { margin: 0; font-size: 3rem; line-height: 1.04; letter-spacing: 0; }
.profile-copy { margin: 14px 0 22px; color: var(--muted); line-height: 1.55; }
.profile-form label, .profile-form legend { color: var(--ink); }
.profile-form input[type="text"], .profile-form select { border-color: var(--line); }
.profile-form .guide-choice span { background: var(--paper); border-color: var(--line); }
.dark-message { color: var(--coral); }

.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--paper); color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app { min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 72px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand-copy, .student-copy { display: grid; }
.brand-copy strong, .student-copy strong { line-height: 1.1; }
.brand-copy small, .student-copy small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.student-menu { display: flex; align-items: center; gap: 10px; }
.student-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 900; }
.student-copy { min-width: 120px; }
.student-copy strong { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; }
.icon-button:hover { color: var(--ink); background: var(--paper); }
.icon-button svg, .search-field svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.section-tabs { position: sticky; z-index: 15; top: 72px; display: flex; min-height: 52px; justify-content: center; gap: 4px; padding: 7px 24px; background: var(--white); border-bottom: 1px solid var(--line); }
.section-tab { min-width: 94px; padding: 8px 14px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font-weight: 800; }
.section-tab:hover { color: var(--ink); }
.section-tab.is-active { color: var(--green); border-bottom-color: var(--green); }

.main-content { min-height: calc(100vh - 124px); }
.view { display: none; }
.view.is-active { display: block; animation: reveal 240ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.chapter-hero { position: relative; height: min(48vh, 430px); min-height: 330px; overflow: hidden; background: #1b4b3a; }
.chapter-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.chapter-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 40, 33, 0.87), rgba(10, 40, 33, 0.42) 56%, rgba(10, 40, 33, 0.04)); }
.chapter-hero-overlay { position: absolute; z-index: 1; inset: 0; display: grid; align-content: center; justify-items: start; width: min(1180px, calc(100% - 48px)); margin: auto; color: var(--white); }
.chapter-hero-overlay h1 { margin: 0; font-size: 5.2rem; line-height: 0.98; letter-spacing: 0; }
.chapter-hero-overlay p:not(.eyebrow) { max-width: 590px; margin: 18px 0 22px; color: rgba(255, 255, 255, 0.88); font-size: 1.05rem; line-height: 1.55; }

.progress-band, .subject-band, .view-header, .learn-toolbar, .filter-row, .result-count, .place-grid, .region-gallery, .activity-intro, .quiz-panel, .game-panel, .result-panel { width: min(1180px, calc(100% - 48px)); margin-right: auto; margin-left: auto; }
.progress-band { padding: 34px 0 40px; }
.subject-band { padding: 38px 0 54px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 2rem; letter-spacing: 0; }
.compact-heading { margin-bottom: 14px; }
.progress-total { color: var(--muted); font-weight: 800; }
.progress-track { width: 100%; height: 10px; overflow: hidden; background: #dfe8e4; border-radius: 5px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width 450ms ease; }
.progress-track.slim { height: 6px; margin: 10px 0 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.metric { display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; column-gap: 14px; min-width: 0; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.metric-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-weight: 900; }
.metric-green .metric-icon { background: var(--green-soft); color: var(--green); }
.metric-blue .metric-icon { background: var(--blue-soft); color: var(--blue); }
.metric-orange .metric-icon { background: var(--orange-soft); color: var(--orange); }
.metric strong { overflow: hidden; text-overflow: ellipsis; font-size: 1.18rem; }
.metric > span:last-child { color: var(--muted); font-size: 0.82rem; }

.subject-row { display: grid; grid-template-columns: minmax(230px, 0.8fr) minmax(0, 2fr); gap: 34px; align-items: stretch; }
.subject-title-block { display: flex; align-items: center; gap: 16px; }
.subject-badge { display: grid; place-items: center; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 8px; background: var(--green); color: var(--white); font-size: 1.2rem; font-weight: 900; }
.subject-title-block h3 { margin: 0 0 5px; font-size: 1.25rem; }
.subject-title-block p { margin: 0; color: var(--muted); line-height: 1.4; }
.mode-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-button { display: grid; align-content: center; gap: 5px; min-height: 112px; padding: 18px; text-align: left; background: var(--white); border: 1px solid var(--line); border-top-width: 4px; border-radius: 8px; }
.mode-button:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mode-button strong { font-size: 1rem; }
.mode-button span { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.mode-learn { border-top-color: var(--green); }
.mode-practice { border-top-color: var(--blue); }
.mode-play { border-top-color: var(--orange); }

.view-header { display: grid; grid-template-columns: 1fr minmax(280px, 480px); gap: 42px; align-items: end; padding: 42px 0 26px; }
.view-header h1 { margin: 0; font-size: 3.45rem; line-height: 1.02; letter-spacing: 0; }
.view-header > p { margin: 0; color: var(--muted); line-height: 1.65; }
.region-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 28px; }
.region-gallery figure { position: relative; min-width: 0; aspect-ratio: 4 / 3; margin: 0; overflow: hidden; border-radius: 8px; background: #d8e5df; }
.region-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.region-gallery figure:hover img { transform: scale(1.025); }
.region-gallery figcaption { position: absolute; right: 0; bottom: 0; left: 0; padding: 24px 12px 10px; color: var(--white); background: linear-gradient(transparent, rgba(7, 31, 25, 0.82)); font-weight: 850; }

.learn-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.segmented { display: inline-grid; grid-auto-flow: column; padding: 3px; background: #e6eeea; border-radius: 7px; }
.segment { min-height: 40px; padding: 7px 14px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font-weight: 800; }
.segment.is-active { color: var(--green); background: var(--white); box-shadow: 0 1px 5px rgba(20, 54, 43, 0.12); }
.search-field { display: flex; width: min(360px, 100%); height: 44px; align-items: center; gap: 9px; padding: 0 12px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.search-field input { min-width: 0; flex: 1; color: var(--ink); background: transparent; border: 0; outline: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 14px; }
.filter-button { min-height: 36px; padding: 6px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 18px; font-size: 0.8rem; font-weight: 800; }
.filter-button.is-active { color: var(--white); background: var(--green); border-color: var(--green); }
.result-count { margin-top: 18px; margin-bottom: 10px; color: var(--muted); font-size: 0.82rem; }
.place-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 58px; }
.place-card { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 130px; overflow: hidden; padding: 0; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.place-card:hover { border-color: #a8beb4; box-shadow: 0 9px 24px rgba(20, 54, 43, 0.1); transform: translateY(-1px); }
.place-card img { width: 112px; height: 100%; object-fit: cover; }
.place-card-body { display: grid; align-content: center; min-width: 0; padding: 15px; }
.place-card small { margin-bottom: 5px; color: var(--muted); font-weight: 700; }
.place-card strong { overflow-wrap: anywhere; font-size: 1rem; line-height: 1.22; }
.place-card span { margin-top: 7px; color: var(--green); font-size: 0.84rem; font-weight: 850; }
.place-card.is-learned::after { content: "Seen"; position: absolute; top: 7px; left: 7px; padding: 4px 7px; color: var(--green); background: rgba(255, 255, 255, 0.93); border-radius: 4px; font-size: 0.66rem; font-weight: 900; }
.empty-state { grid-column: 1 / -1; padding: 42px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed #b7c9c0; border-radius: 8px; }

.activity-intro { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 30px; align-items: center; min-height: 260px; margin-top: 10px; margin-bottom: 60px; padding: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.activity-visual { display: grid; place-items: center; width: 170px; aspect-ratio: 1; border-radius: 50%; }
.activity-visual span { display: grid; place-items: center; width: 102px; height: 102px; color: var(--white); border: 10px solid rgba(255, 255, 255, 0.45); border-radius: 50%; font-size: 2.6rem; font-weight: 950; }
.practice-visual { background: var(--blue); }
.game-visual { background: var(--orange); }
.activity-intro h2 { margin: 0 0 10px; font-size: 1.8rem; }
.activity-intro p { max-width: 650px; margin: 0 0 20px; color: var(--muted); line-height: 1.65; }
.quiz-panel, .game-panel { padding-bottom: 60px; }
.activity-status { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); }
.activity-status strong { color: var(--ink); }
.question-card { max-width: 800px; margin: 0 auto; padding: 30px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.question-label { margin: 0 0 10px; color: var(--blue); font-size: 0.78rem; font-weight: 850; text-transform: uppercase; }
.question-card h2 { min-height: 68px; margin: 0 0 22px; font-size: 2.1rem; line-height: 1.25; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-button { min-height: 58px; padding: 12px 15px; color: var(--ink); text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font-weight: 750; }
.answer-button:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.answer-button.is-correct { color: #0e583d; background: var(--green-soft); border-color: #54a57f; }
.answer-button.is-wrong { color: #8e302a; background: #fde8e6; border-color: #db827b; }
.answer-feedback { margin: 18px 0 14px; padding: 12px 14px; background: var(--paper); border-left: 4px solid var(--green); line-height: 1.5; }

.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 1000px; }
.memory-card { position: relative; min-width: 0; aspect-ratio: 1.5 / 1; padding: 0; color: var(--white); background: var(--green); border: 0; border-radius: 8px; transform-style: preserve-3d; transition: transform 320ms ease; }
.memory-card.is-flipped, .memory-card.is-matched { transform: rotateY(180deg); }
.memory-face { position: absolute; inset: 0; display: grid; place-content: center; padding: 12px; border-radius: 8px; backface-visibility: hidden; }
.memory-front { background: var(--green); font-size: 1.55rem; font-weight: 950; }
.memory-back { color: var(--ink); background: var(--white); border: 2px solid var(--green); transform: rotateY(180deg); }
.memory-back small { margin-bottom: 5px; color: var(--muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; }
.memory-back strong { overflow-wrap: anywhere; font-size: 1rem; line-height: 1.25; }
.memory-card.is-matched .memory-back { background: var(--green-soft); }
.result-panel { margin-top: 12px; margin-bottom: 60px; padding: 34px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.result-score { display: block; margin: 4px 0 10px; color: var(--green); font-size: 5rem; line-height: 1; font-weight: 950; }
.result-panel h2 { margin: 0 0 8px; }
.result-panel p { margin: 0 auto 20px; max-width: 540px; color: var(--muted); line-height: 1.55; }

.place-dialog { width: min(680px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; background: var(--white); border: 0; border-radius: 8px; box-shadow: 0 28px 70px rgba(8, 31, 24, 0.3); }
.place-dialog::backdrop { background: rgba(8, 31, 24, 0.64); backdrop-filter: blur(3px); }
.place-dialog > img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.dialog-close { position: absolute; z-index: 2; top: 10px; right: 10px; color: var(--ink); background: rgba(255, 255, 255, 0.94); }
.dialog-body { padding: 25px 28px 30px; }
.dialog-body h2 { margin: 0; font-size: 2.7rem; }
.dialog-body dl { margin: 24px 0 0; }
.dialog-body dl > div { display: grid; grid-template-columns: 100px 1fr; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.dialog-body dt { color: var(--muted); font-size: 0.78rem; font-weight: 850; text-transform: uppercase; }
.dialog-body dd { margin: 0; line-height: 1.55; }
.learned-note { margin: 18px 0 0; color: var(--green); font-size: 0.82rem; font-weight: 850; }

.mascot-dock { position: fixed; z-index: 30; right: 20px; bottom: 62px; display: grid; justify-items: end; pointer-events: none; }
.mascot-dock img { width: 118px; max-height: 160px; object-fit: contain; object-position: right bottom; filter: drop-shadow(0 10px 10px rgba(13, 45, 37, 0.2)); animation: mascot-float 3.2s ease-in-out infinite; }
.mascot-dock[data-age-group="younger"] img { animation-duration: 2.55s; }
.mascot-dock[data-age-group="older"] img { animation-duration: 3.6s; }
.mascot-bubble { position: relative; max-width: 230px; margin: 0 78px -12px 0; padding: 10px 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: 0.8rem; font-weight: 750; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease; }
.mascot-bubble.is-visible { opacity: 1; transform: none; }
.mascot-bubble::after { content: ""; position: absolute; right: 18px; bottom: -7px; width: 12px; height: 12px; background: var(--white); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
@keyframes mascot-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.reaction-layer { position: fixed; z-index: 45; inset: 0; overflow: hidden; pointer-events: none; }
.reaction-emoji { position: absolute; font-size: 2rem; animation: reaction-pop 1100ms ease-out forwards; }
@keyframes reaction-pop { 0% { opacity: 0; transform: translateY(12px) scale(0.5) rotate(-8deg); } 20% { opacity: 1; transform: translateY(0) scale(1.18) rotate(4deg); } 100% { opacity: 0; transform: translateY(-90px) scale(0.9) rotate(10deg); } }

.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: min(390px, calc(100% - 40px)); padding: 12px 15px; color: var(--white); background: #18332c; border-radius: 6px; box-shadow: var(--shadow); font-size: 0.86rem; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(24px, calc((100vw - 1180px) / 2)); color: var(--muted); background: #eaf1ed; border-top: 1px solid var(--line); font-size: 0.76rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--green); font-weight: 750; }

@media (max-width: 900px) {
  .entry-panel h1 { font-size: 2.35rem; }
  .profile-panel h1 { font-size: 2.4rem; }
  .chapter-hero-overlay h1 { font-size: 4.1rem; }
  .view-header h1 { font-size: 2.8rem; }
  .subject-row, .view-header { grid-template-columns: 1fr; gap: 20px; }
  .region-gallery { grid-template-columns: 1fr 1fr; }
  .place-grid { grid-template-columns: 1fr 1fr; }
  .memory-board { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
  .app { padding-right: 126px; }
  .mascot-dock { right: 5px; }
  .mascot-dock img { width: 104px; max-height: 144px; }
  .mascot-bubble { width: 108px; max-width: 108px; margin-right: 0; text-align: center; font-size: 0.68rem; }
}

@media (max-width: 640px) {
  .entry-screen { grid-template-columns: minmax(0, 1fr); align-items: end; padding: 18px; }
  .entry-shade { background: linear-gradient(0deg, rgba(7, 34, 28, 0.96), rgba(7, 34, 28, 0.42) 78%, rgba(7, 34, 28, 0.18)); }
  .entry-panel { width: 100%; max-width: 440px; min-width: 0; padding: 22px; }
  .entry-panel h1 { font-size: 2rem; }
  .entry-brand { margin-bottom: 22px; }
  .profile-screen { padding: 14px; }
  .profile-panel { grid-template-columns: 1fr; }
  .profile-characters { display: none; }
  .profile-panel > div { padding: 24px; }
  .profile-panel h1 { font-size: 2rem; }
  .topbar { height: 64px; padding: 0 14px; }
  .brand-copy small, .student-copy, .student-avatar { display: none; }
  .section-tabs { top: 64px; justify-content: stretch; padding: 5px 8px; }
  .section-tab { min-width: 0; flex: 1; padding: 8px 4px; font-size: 0.82rem; }
  .chapter-hero { height: 410px; }
  .chapter-hero-overlay { width: calc(100% - 36px); align-content: end; padding-bottom: 28px; }
  .chapter-hero-overlay h1 { max-width: 310px; font-size: 3.2rem; }
  .chapter-hero-overlay p:not(.eyebrow) { margin: 13px 0 18px; font-size: 0.93rem; }
  .progress-band, .subject-band, .view-header, .learn-toolbar, .filter-row, .result-count, .place-grid, .region-gallery, .activity-intro, .quiz-panel, .game-panel, .result-panel { width: calc(100% - 28px); }
  .metric-grid, .mode-actions { grid-template-columns: 1fr; }
  .metric { min-height: 82px; }
  .subject-title-block { align-items: flex-start; }
  .mode-button { min-height: 82px; }
  .view-header { padding-top: 30px; }
  .view-header h1 { font-size: 2.3rem; }
  .section-heading h2 { font-size: 1.45rem; }
  .region-gallery { grid-template-columns: 1fr 1fr; }
  .region-gallery figure { aspect-ratio: 1 / 1; }
  .learn-toolbar { align-items: stretch; flex-direction: column; }
  .segmented { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  .search-field { width: 100%; }
  .place-grid { grid-template-columns: 1fr; }
  .place-card { grid-template-columns: 104px minmax(0, 1fr); }
  .place-card img { width: 104px; }
  .activity-intro { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .activity-visual { width: 145px; }
  .answer-grid { grid-template-columns: 1fr; }
  .question-card { padding: 20px; }
  .question-card h2 { font-size: 1.4rem; }
  .memory-board { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .memory-card { aspect-ratio: 1 / 1.15; }
  .memory-back strong { font-size: 0.76rem; }
  .result-score { font-size: 2.8rem; }
  .activity-status { flex-wrap: wrap; }
  .dialog-body dl > div { grid-template-columns: 1fr; gap: 5px; }
  .dialog-body h2 { font-size: 1.8rem; }
  .site-footer { flex-direction: column; }
  .mascot-dock { right: 4px; bottom: 8px; }
  .mascot-dock img { width: 64px; max-height: 92px; }
  .mascot-bubble { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
