@font-face {
  font-family: "Signika";
  src: url("../fonts/signika-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Signika";
  src: url("../fonts/signika-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Signika";
  src: url("../fonts/signika-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Signika";
  src: url("../fonts/signika-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--color-page);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--color-ink);
  background: var(--color-page);
  font-family: var(--font-body);
  font-size: var(--text-child-min);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  touch-action: manipulation;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[lang="zh"] {
  font-family: var(--font-zh);
}

#app {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  place-items: center;
}

.screen { width: min(100%, 1180px); min-height: min(820px, calc(100dvh - 48px)); position: relative; }
.icon-button { display: inline-grid; width: 60px; height: 60px; padding: 0; border: 0; border-radius: var(--radius-round); box-shadow: inset 0 0 0 2px var(--color-grey-light); background: var(--color-card); color: var(--color-muted); cursor: pointer; place-items: center; }
.icon-button:hover, .icon-button:focus-visible { box-shadow: inset 0 0 0 3px var(--color-muted); }
.primary-button { min-height: 76px; padding: 16px 36px; border: 0; border-radius: var(--radius-answer); box-shadow: 0 9px 0 var(--color-orange-deep); background: var(--color-orange); color: white; cursor: pointer; font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.primary-button:active { transform: translateY(3px); box-shadow: 0 6px 0 var(--color-orange-deep); }
.primary-button:disabled { opacity: 0.45; cursor: default; }
.landing-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.landing-gear { position: absolute; top: 16px; right: 16px; }
.landing-fox { width: min(300px, 36dvh); height: min(300px, 36dvh); object-fit: contain; mix-blend-mode: multiply; }
.wordmark { margin: 0; color: var(--color-blue-deep); font-family: var(--font-display); font-size: clamp(54px, 8vw, 88px); font-weight: 800; line-height: 1; }
.landing-screen .primary-button { margin-top: 32px; }
.parent-link { min-height: 44px; margin-top: 38px; padding: 8px 18px; border: 0; background: transparent; color: var(--color-muted); cursor: pointer; font-size: var(--text-child-min); font-weight: 700; }
.screen-header { display: flex; align-items: center; min-height: 64px; }
.profiles-content, .setup-content { display: flex; min-height: calc(min(820px, 100dvh - 48px) - 64px); flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.screen-title { margin: 0; font-family: var(--font-display); font-size: clamp(38px, 5vw, 52px); line-height: 1.1; }
.screen-subtitle { margin: 8px 0 36px; color: var(--color-muted); font-size: var(--text-body-large); font-weight: 700; }
.profile-grid { display: flex; width: 100%; flex-wrap: wrap; gap: 28px; justify-content: center; }
.profile-card { display: flex; width: 190px; min-height: 244px; padding: 8px; border: 0; background: transparent; cursor: pointer; flex-direction: column; align-items: center; gap: 16px; font-family: var(--font-display); font-size: var(--text-section); font-weight: 700; }
.profile-card:hover, .profile-card:focus-visible { transform: translateY(-4px); }
.profile-photo { display: grid; width: 176px; height: 176px; overflow: hidden; padding: 10px; border-radius: var(--radius-round); background: var(--profile-light); color: var(--profile-deep); font-size: 72px; place-items: center; }
.profile-photo img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.profile-new .profile-photo { border: 4px dashed var(--color-grey); background: var(--color-grey-light); color: var(--color-grey-deep); }
.setup-form { display: grid; width: min(100%, 820px); gap: 24px; text-align: left; }
.setup-field { display: grid; gap: 10px; font-size: var(--text-body-large); font-weight: 800; }
.text-input, .language-select, .photo-input-label { min-height: 64px; padding: 14px 18px; border: 2px solid var(--color-grey-light); border-radius: var(--radius-tile); background: white; }
.photo-input-label { display: flex; cursor: pointer; align-items: center; }
.photo-input-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.track-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.track-card { min-height: 140px; padding: 18px; border: 3px solid var(--color-grey-light); border-radius: var(--radius-card); background: white; color: var(--color-ink); cursor: pointer; text-align: left; }
.track-card[aria-pressed="true"] { border-color: var(--color-orange); background: var(--color-orange-light); }
.track-card strong, .track-card span { display: block; }
.track-card span { margin-top: 8px; color: var(--color-muted); font-size: var(--text-child-min); }
.field-help { display: block; margin-top: 8px; color: var(--color-muted); font-size: var(--text-child-min); font-weight: 600; }
.setup-actions { display: flex; justify-content: center; }
.route-placeholder { font-family: var(--font-display); font-size: var(--text-display); font-weight: 700; }
.startup-message { display: grid; width: min(100%, 760px); padding: clamp(32px, 8vw, 72px); border-radius: var(--radius-panel); background: var(--color-orange-light); color: var(--color-orange-deep); gap: 18px; text-align: center; }
.startup-message h1 { margin: 0; font-family: var(--font-display); font-size: clamp(38px, 6vw, 64px); line-height: 1.1; }
.startup-message p { margin: 0; font-size: var(--text-child-min); font-weight: 700; }
.startup-message code, .startup-message a { display: block; overflow-wrap: anywhere; color: inherit; font-family: ui-monospace, monospace; font-size: var(--text-child-min); font-weight: 700; }

.session-screen { display: flex; flex-direction: column; }
.exercise-topbar { display: flex; min-height: 64px; margin-bottom: 24px; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-left { display: flex; flex-shrink: 0; align-items: center; gap: 16px; }
.module-pill { display: inline-flex; min-height: 54px; padding: 8px 18px 8px 10px; border-radius: var(--radius-round); background: var(--color-purple-light); color: var(--color-purple-deep); align-items: center; gap: 10px; font-size: var(--text-child-min); font-weight: 800; }
.module-pill > span { display: grid; width: 34px; height: 34px; border-radius: 11px; background: white; color: var(--color-purple); place-items: center; }
.progress-wrap { display: flex; align-items: center; gap: 18px; }
.progress-pills { display: flex; align-items: center; gap: 8px; }
.exercise-topbar .progress-wrap { min-width: 0; flex: 1; }
.exercise-topbar .progress-pills { min-width: 0; flex: 1; gap: 5px; }
.exercise-topbar .progress-count { flex-shrink: 0; }
.progress-pill { display: block; width: 26px; height: 14px; border-radius: var(--radius-round); background: var(--color-grey-light); }
.progress-pill.is-current { width: 42px; background: var(--color-grey); }
.progress-pill.is-correct { background: var(--color-green); }
.progress-pill.is-wrong { background: var(--color-purple); }
.progress-count { color: var(--color-muted); font-family: var(--font-display); font-size: var(--text-body-large); font-weight: 700; white-space: nowrap; }
.exercise-layout { display: grid; min-height: 0; padding-bottom: calc(var(--target-control) + 16px); flex: 1; grid-template-columns: 0.85fr 1fr; gap: 48px; align-items: center; }
.prompt-column { min-width: 0; }
.exercise-kicker { margin: 0 0 10px; color: var(--color-purple-deep); font-family: var(--font-display); font-size: var(--text-child-min); font-weight: 700; }
.exercise-prompt { margin: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-size: clamp(var(--text-prompt-min), 6vw, var(--text-prompt-max)); line-height: 1.05; }
.speaker-button { position: absolute; z-index: 20; bottom: 0; display: grid; width: var(--target-control); height: var(--target-control); padding: 0; border: 0; border-radius: var(--radius-round); box-shadow: 0 7px 0 var(--color-purple-deep); background: var(--color-purple); color: white; cursor: pointer; place-items: center; }
.speaker-button { left: 0; }
.speaker-button svg { width: 52%; height: 52%; }
.speaker-button:active { transform: translateY(3px); box-shadow: 0 4px 0 var(--color-purple-deep); }
.speaker-button:focus-visible { outline: 4px solid var(--color-blue); outline-offset: 4px; }
.answer-column { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 20px; }
.answer-grid { display: grid; width: min(100%, 560px); gap: 22px; }
.answer-grid.choices-2 { grid-template-columns: repeat(2, minmax(var(--target-exercise), 1fr)); }
.answer-grid.choices-3 { grid-template-columns: repeat(3, minmax(var(--target-exercise), 1fr)); }
.answer-grid.choices-4 { grid-template-columns: repeat(2, minmax(var(--target-exercise), 1fr)); }
.answer-option { display: grid; min-width: var(--target-exercise); align-content: start; gap: 12px; text-align: center; }
.answer-card { position: relative; display: flex; width: 100%; min-width: var(--target-exercise); min-height: var(--target-exercise); aspect-ratio: 1; padding: 16px; overflow: hidden; border: 0; border-radius: var(--radius-answer); box-shadow: inset 0 0 0 2px var(--color-grey-light), var(--shadow-pickup); background: white; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.answer-card:active { transform: scale(0.965); box-shadow: inset 0 0 0 4px var(--color-muted), var(--shadow-pickup); }
.answer-card.is-correct { box-shadow: inset 0 0 0 4px var(--color-green), var(--shadow-pickup); animation: correct-bounce 300ms ease-out; }
.answer-card.is-correct::after, .answer-card.is-incorrect::after { position: absolute; top: 10px; right: 10px; display: grid; width: 38px; height: 38px; border-radius: var(--radius-round); color: white; font-size: 24px; font-weight: 800; place-items: center; }
.answer-card.is-correct::after { content: "✓"; background: var(--color-green); }
.answer-card.is-incorrect { box-shadow: inset 0 0 0 4px var(--color-red), var(--shadow-pickup); }
.answer-card.is-incorrect::after { content: "×"; background: var(--color-red); }
.answer-card.is-incorrect .answer-art { opacity: 0.55; }
.answer-art { display: grid; min-height: 0; flex: 1; align-self: stretch; place-items: center; }
.answer-caption { max-width: 100%; overflow-wrap: anywhere; font-size: var(--text-child-min); font-weight: 800; line-height: 1.15; text-transform: capitalize; }
.demo-swatch { display: block; width: min(120px, 70%); aspect-ratio: 1; border-radius: var(--radius-round); box-shadow: inset 0 0 0 2px rgb(26 27 31 / 18%); }
.flag-image { width: 82%; max-height: 56%; border-radius: 6px; object-fit: contain; }
.prompt-hanzi { display: block; font-family: var(--font-zh); font-size: clamp(72px, 9vw, 96pt); line-height: 1.05; }
.prompt-pinyin { display: block; margin-top: 12px; color: var(--color-muted); font-family: var(--font-body); font-size: var(--text-body-large); font-weight: 700; letter-spacing: 0.04em; }
.exercise-prompt.has-picture { display: grid; width: min(300px, 100%); aspect-ratio: 1; margin-inline: auto; place-items: center; }
.chinese-picture { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.picture-placeholder { font-size: min(120pt, 13vw); line-height: 1; }
.choice-hanzi { display: block; max-width: 100%; font-family: var(--font-zh); font-size: clamp(56px, 7vw, 80pt); line-height: 1; direction: ltr; overflow-wrap: normal; text-align: left; text-orientation: mixed; white-space: nowrap; word-break: keep-all; writing-mode: horizontal-tb; }
.choice-hanzi[data-hanzi-length="2"] { font-size: clamp(44px, 4.5vw, 60px); }
.choice-hanzi[data-hanzi-length="3"] { font-size: clamp(36px, 3.5vw, 42px); }
.choice-hanzi[data-hanzi-length="4"], .choice-hanzi[data-hanzi-length="5"], .choice-hanzi[data-hanzi-length="6"] { font-size: clamp(27px, 3vw, 38px); }
.choice-hanzi[data-kind="sentence"] { font-size: var(--text-child-min); line-height: 1.25; overflow-wrap: anywhere; text-align: center; white-space: normal; word-break: normal; }
.prompt-hanzi[data-kind="sentence"] { font-size: clamp(32px, 4vw, 56px); line-height: 1.2; }
.choice-meaning, .german-word { display: block; font-size: clamp(28px, 3.8vw, 46px); line-height: 1.12; }
.german-word { font-weight: 800; }
.maths-number { display: block; font-family: var(--font-display); font-size: clamp(64px, 8vw, 104px); line-height: 1; }
.quantity-group { display: grid; max-width: 100%; grid-template-columns: repeat(var(--quantity-columns, 4), minmax(0, 1fr)); place-items: center; gap: 6px; color: var(--color-purple-deep); font-size: clamp(40px, 4.7vw, 56px); line-height: 1; }
.exercise-prompt .quantity-group { font-size: clamp(56px, 6vw, 76px); gap: 10px; }
.answer-grid.choices-3 .quantity-group { font-size: 30px; gap: 4px; }
.answer-grid.choices-4 .quantity-group { font-size: clamp(30px, 3vw, 40px); gap: 4px; }
.quantity-group i { font-style: normal; }
.answer-caption { display: grid; gap: 2px; }
.answer-caption[hidden] { display: none; }
.answer-caption .caption-hanzi { color: var(--color-ink); font-family: var(--font-zh); font-size: var(--text-child-min); }
.answer-caption .caption-pinyin { color: var(--color-muted); font-family: var(--font-body); font-size: var(--text-child-min); font-weight: 700; text-transform: none; }
.number-dots { display: grid; width: min(150px, 88%); grid-template-columns: repeat(3, 1fr); gap: 8px; place-items: center; }
.number-dots i { display: block; width: 28px; height: 28px; border-radius: var(--radius-round); background: var(--color-red); }
.colour-disc { display: block; width: min(130px, 76%); aspect-ratio: 1; border-radius: var(--radius-round); box-shadow: inset 0 0 0 2px var(--color-grey); }
.secondary-button { min-height: 64px; padding: 14px 28px; border: 3px solid var(--color-grey); border-radius: var(--radius-answer); background: white; color: var(--color-grey-deep); cursor: pointer; font-family: var(--font-display); font-size: var(--text-body-large); font-weight: 700; }
.stop-dialog { width: min(90vw, 620px); padding: 36px; border: 0; border-radius: var(--radius-panel); text-align: center; }
.stop-dialog::backdrop { background: rgb(26 27 31 / 55%); }
.stop-dialog h2 { margin: 0 0 28px; font-family: var(--font-display); font-size: var(--text-section); }
.dialog-actions, .summary-actions { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.summary-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 42px; text-align: center; }
.summary-screen .progress-wrap { flex-direction: column; }
.map-screen { display: flex; flex-direction: column; overflow: hidden; }
.map-topbar { display: flex; min-height: 64px; margin-bottom: 10px; align-items: center; justify-content: space-between; }
.map-tools { display: flex; gap: 12px; }
.map-canvas { position: relative; width: 100%; max-height: calc(100dvh - 146px); margin: auto; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--radius-panel); background-size: 100% 100%; background-repeat: no-repeat; }
.map-region { position: absolute; z-index: auto; padding: 0; border: 0; background: transparent; }
.map-region img { width: 100%; height: 100%; object-fit: contain; }
.map-region.is-active { cursor: pointer; }
.map-region.is-active:hover, .map-region.is-active:focus-visible { transform: scale(1.06); }
.map-region.is-soon { opacity: 0.38; filter: grayscale(0.6); pointer-events: none; }
.region-label { position: absolute; left: 50%; bottom: -2px; z-index: 4; padding: 5px 10px; border-radius: var(--radius-round); background: white; color: var(--color-grey-deep); font-size: var(--text-child-min); font-weight: 800; opacity: 0; transform: translateX(-50%); white-space: nowrap; }
.map-region.is-active:hover .region-label, .map-region.is-active:focus-visible .region-label, .map-region.is-active:active .region-label { opacity: 1; }
.map-fox { position: absolute; z-index: 10; height: auto; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; pointer-events: none; }
.map-friend { position: absolute; z-index: 5; color: var(--color-yellow-deep); font-size: 32px; }
.friend-reveal { padding: 18px 26px; border-radius: var(--radius-card); background: var(--color-yellow-light); color: var(--color-yellow-deep); font-size: var(--text-section); font-weight: 800; }
.parent-screen { padding-bottom: 36px; }
.parent-gate { display: flex; min-height: min(720px, calc(100dvh - 48px)); flex-direction: column; align-items: center; justify-content: center; gap: 30px; text-align: center; }
.parent-pin-form { display: grid; width: min(420px, 90%); gap: 18px; }
.parent-pin-form label { display: grid; gap: 10px; font-size: var(--text-child-min); font-weight: 700; text-align: left; }
.parent-pin-form input { text-align: center; letter-spacing: 0.35em; }
.pin-error { margin: 0; color: var(--color-red-deep); font-size: var(--text-child-min); font-weight: 700; }
.parent-header { display: flex; margin-bottom: 24px; align-items: center; justify-content: space-between; }
.parent-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.parent-profile-card, .parent-settings { display: grid; padding: 22px; border-radius: var(--radius-card); background: var(--color-grey-light); gap: 14px; }
.parent-profile-card input, .parent-profile-card select, .parent-settings input, .parent-settings select { min-height: 48px; padding: 8px 12px; border: 2px solid white; border-radius: 12px; background: white; font-size: 18px; }
.parent-field { display: grid; gap: 6px; font-size: 18px; font-weight: 700; }
.parent-photo-input { display: grid; gap: 8px; font-size: 18px; font-weight: 700; }
.mastery-overview p { margin: 5px 0; font-size: 18px; }
.danger-button { min-height: 54px; padding: 12px 20px; border: 2px solid var(--color-red); border-radius: var(--radius-tile); background: white; color: var(--color-red-deep); font-size: 18px; font-weight: 800; }
.parent-settings { margin-top: 20px; }
.parent-settings label { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 18px; font-size: 18px; font-weight: 700; }
.voice-setting-row { display: grid; min-height: 48px; grid-template-columns: minmax(130px, 1fr) minmax(220px, 1fr); align-items: center; gap: 18px; font-size: 18px; font-weight: 700; }
.voice-setting-controls { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 10px; }
.data-sources { padding: 14px 0; border-top: 2px solid rgb(255 255 255 / 55%); font-size: 17px; }
.data-sources summary { cursor: pointer; font-weight: 800; }
.data-sources p { margin: 10px 0 0; line-height: 1.45; }
.data-sources a { display: inline-block; margin: 8px 18px 0 0; color: var(--color-purple-deep); font-weight: 700; }
.toggle-row input { width: 28px; height: 28px; }
.transfer-actions { display: flex; margin-top: 20px; flex-wrap: wrap; gap: 16px; }
.import-label { position: relative; display: inline-flex; align-items: center; }
.import-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-label[data-error]::after { margin-left: 10px; color: var(--color-red-deep); content: attr(data-error); font-size: 16px; }

@keyframes correct-bounce {
  50% { transform: translateY(-8px); }
}

.route-hello {
  width: min(100%, 760px);
  padding: clamp(32px, 8vw, 80px);
  border-radius: var(--radius-panel);
  background: var(--color-orange-light);
  color: var(--color-orange-deep);
  text-align: center;
}

.route-hello h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(var(--text-section), 7vw, var(--text-display));
  line-height: 1;
}

.route-hello p {
  margin: 20px 0 0;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@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;
  }
}

@media (max-width: 760px), (max-height: 720px) {
  #app { padding: 18px; }
  .screen { min-height: calc(100dvh - 36px); }
  .landing-fox { width: 180px; height: 180px; }
  .profile-photo { width: 132px; height: 132px; }
  .profile-card { width: 150px; min-height: 190px; }
  .track-grid { grid-template-columns: 1fr; }
  .voice-setting-row { grid-template-columns: 1fr; gap: 6px; }
  .exercise-topbar { align-items: flex-start; }
  .progress-pills { display: none; }
  .exercise-layout { grid-template-columns: 0.72fr 1fr; gap: 20px; }
  .answer-grid { gap: 12px; }
  .answer-grid.choices-3 { grid-template-columns: repeat(2, minmax(var(--target-exercise), 1fr)); }
  .answer-card { padding: 10px; }
}

@media (max-height: 820px) {
  .answer-grid.choices-4 { width: min(100%, 420px); gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .answer-card.is-correct { animation: none; }
  .map-fox { transition: none; }
}

@media (max-width: 1100px) {
  .answer-grid.choices-3 { grid-template-columns: repeat(2, minmax(var(--target-exercise), 1fr)); }
  .answer-grid.choices-3 .quantity-group { font-size: clamp(40px, 4.7vw, 56px); gap: 6px; }
  .answer-grid.choices-3 .answer-option:last-child { grid-column: 1 / -1; width: calc((100% - 22px) / 2); justify-self: center; }
}

/* Keep Early German picture captions and the speaker inside a landscape iPad. */
.exercise-layout:has(.german-early-prompt) .answer-grid { width: min(100%, 560px, calc(100dvh - 408px)); }

/* Test feedback marks only the selected card, without motion or answer reveal. */
.test-screen .answer-card.test-correct { box-shadow: inset 0 0 0 4px var(--color-green), var(--shadow-pickup); }
.test-screen .answer-card.test-incorrect { box-shadow: inset 0 0 0 4px var(--color-grey), var(--shadow-pickup); }
.test-screen .answer-card:disabled { opacity: 1; cursor: default; }
.test-screen .answer-card:disabled:active { transform: none; }

/* The area uses the entire viewport and contains one uncropped 4:3 stage. */
body[data-route="area"] #app { padding: 0; background: #282536; }
.area-screen { display: grid; width: 100%; height: 100dvh; place-items: center; overflow: hidden; }
.area-stage { position: relative; width: min(100vw, calc(100dvh * 4 / 3)); aspect-ratio: 4 / 3; overflow: hidden; isolation: isolate; background: var(--area-hue) center / 100% 100% no-repeat; }
.area-name-board { position: absolute; z-index: 3; width: 22%; transform: translate(-50%, -50%); pointer-events: none; }
.area-board-art, .area-panel-art { display: block; width: 100%; height: auto; }
.area-board-title { position: absolute; inset: 22% 12% 24%; display: grid; place-items: center; color: #3a2312; font-family: var(--font-display); font-size: var(--text-child-min); font-weight: 800; line-height: 1.02; text-align: center; text-shadow: 0 1px 0 #fff8; }
.area-stage[data-area="sky-port"] .area-board-title { inset: 20% 12% 32%; }
.area-stage[data-area="acorn-hill"] .area-board-title { inset: 30% 16% 18%; }
.area-stage[data-area="echo-mountain"] .area-board-title { inset: 26% 16% 16%; }
.area-badge { position: absolute; z-index: 3; width: 18.5%; min-width: 64px; min-height: 64px; transform: translate(-50%, -50%); color: transparent; font-weight: 800; font-size: var(--text-child-min); line-height: 0; pointer-events: none; }
.area-panel-labels { position: absolute; inset: 34% 48% 22% 10%; display: flex; flex-direction: column; justify-content: center; gap: 2px; color: #3a2312; font-family: var(--font-display); font-size: 15px; font-weight: 800; line-height: 1.05; text-shadow: 0 1px 0 #fff8; }
.area-panel-labels::before { content: attr(data-stage); }
.area-panel-labels::after { content: attr(data-level); }
.area-panel-number { position: absolute; top: 52%; width: 16%; height: 38%; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); }
.area-panel-number.is-stage { left: 60%; }
.area-panel-number.is-level { left: 82%; }
.area-digit { height: 86%; width: auto; max-width: 52%; object-fit: contain; }
.area-stage[data-area="songbird-forest"] .area-panel-labels { inset: 20% 36% 14% 12%; justify-content: space-around; font-size: 16px; }
.area-stage[data-area="songbird-forest"] .area-panel-number { left: 77%; width: 18%; height: 26%; }
.area-stage[data-area="songbird-forest"] .area-panel-number.is-stage { top: 35%; }
.area-stage[data-area="songbird-forest"] .area-panel-number.is-level { top: 70%; }
.area-stage[data-area="acorn-hill"] .area-panel-labels { inset: 46% 48% 12% 10%; }
.area-stage[data-area="acorn-hill"] .area-panel-number { top: 65%; width: 15%; height: 36%; }
.area-stage[data-area="acorn-hill"] .area-panel-number.is-stage { left: 63%; }
.area-stage[data-area="acorn-hill"] .area-panel-number.is-level { left: 81%; }
.area-stage[data-area="echo-mountain"] .area-panel-labels { inset: 42% 48% 14% 10%; }
.area-stage[data-area="echo-mountain"] .area-panel-number { top: 62%; height: 38%; }
.area-back { position: absolute; z-index: 3; width: 64px; height: 64px; transform: translateX(-50%); font-size: 40px; }
.area-action { position: absolute; z-index: 3; display: grid; place-items: center; min-width: 64px; min-height: 64px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #2b2118; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: var(--text-child-min); font-weight: 800; letter-spacing: -0.02em; line-height: 1; text-shadow: 0 1px 0 #fffc; cursor: pointer; isolation: isolate; }
.area-action-art { position: absolute; z-index: -1; inset: -18%; width: 136%; height: 136%; max-width: none; object-fit: contain; pointer-events: none; }
.area-test:disabled { opacity: .42; cursor: default; }
.area-actions { display: contents; }
.area-friend { position: absolute; z-index: 2; display: block; aspect-ratio: 1; min-width: 64px; min-height: 64px; padding: 0; border: 0; background: transparent; transform: translate(-50%, -50%); overflow: hidden; }
.area-friend img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scaleX(var(--friend-flip)); }
.area-friend.is-seeking { cursor: pointer; }
.area-friend.is-seeking img { transform: translateY(60%) scaleX(var(--friend-flip)); animation: friend-peek 2.4s ease-in-out infinite; }
.area-friend.is-revealing img { animation: friend-reveal 450ms ease-out both; }
.area-friend:disabled { opacity: 1; cursor: default; }
@keyframes friend-peek { 0%, 70%, 100% { transform: translateY(60%) rotate(0deg) scaleX(var(--friend-flip)); } 78% { transform: translateY(60%) rotate(-4deg) scaleX(var(--friend-flip)); } 88% { transform: translateY(60%) rotate(4deg) scaleX(var(--friend-flip)); } }
@keyframes friend-reveal { from { transform: translateY(60%) scaleX(var(--friend-flip)); } to { transform: translateY(0) scaleX(var(--friend-flip)); } }
@keyframes friend-fade { from { opacity: .2; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .area-friend.is-seeking img { animation: none; }
  .area-friend.is-revealing img { animation: friend-fade 450ms ease-out both; }
}

.area-fox { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.area-fox img { position: absolute; left: 0; top: 0; aspect-ratio: 1; object-fit: contain; transform: translate(-50%, -100%); }
.area-debug { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.area-debug svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.area-debug polyline { fill: none; stroke: #8434c2; stroke-width: .004; stroke-dasharray: .01; }
.area-debug-marker { position: absolute; z-index: 1; padding: 3px; border: 2px solid #8434c2; border-radius: 8px; background: #fff; color: #301048; font-size: 16px; transform: translate(-50%, -50%); white-space: nowrap; }
.map-region.is-active .region-label { opacity: 1; }
.region-stage { display: block; font-size: var(--text-child-min); font-weight: 700; }

.save-conflict p { font-size: var(--text-child-min); }

.parent-panel { grid-template-columns: minmax(0, 1fr); }
.parent-progress-scroll { overflow-x: auto; }
.parent-progress { width: 100%; border-collapse: collapse; font-size: 18px; text-align: left; }
.parent-progress caption { padding: 12px 0; font-weight: 700; text-align: left; }
.parent-progress th, .parent-progress td { padding: 12px 8px; border-bottom: 1px solid #c8c5bf; }
.parent-progress td { font-variant-numeric: tabular-nums; }
.parent-progress thead th { vertical-align: bottom; }
.parent-progress tbody th { min-width: 120px; }
.parent-storage, .parent-storage-size, .parent-backup, .parent-backup-reminder { margin: 4px 0; font-size: 18px; }
