@font-face {
  font-family: "Island Kai";
  src: url("../assets/island-kai.woff") format("woff");
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #173d37;
  --deep: #0d524b;
  --muted: #49655a;
  --sand: #f7f0e0;
  --paper: #fffbef;
  --ivory: #fffdf5;
  --line: #e8deca;
  --gold: #f9c857;
  --amber: #9c520b;
  --coral: #f0775b;
  --pool: #2b9f99;
  --question-font: "Island Kai", "Kaiti SC", STKaiti, KaiTi, serif;
  --ui-font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --shadow: 0 9px 26px #3055481c;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--sand);
  background-image: radial-gradient(#a1714215 .7px, transparent .85px);
  background-size: 7px 7px;
  color: var(--ink);
  font-family: var(--ui-font);
}
button, select { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { cursor: default; }
.touch { min-width: 60px; min-height: 60px; touch-action: manipulation; }
.touch:focus-visible { outline: 3px solid #ffbf46; outline-offset: 3px; }
:where(h1, h2, h3, h4, p, dl, dd) { margin: 0; }
[hidden] { display: none !important; }
.icon { width: 1em; height: 1em; display: inline-grid; place-items: center; vertical-align: -.08em; line-height: 1; flex: none; }
.icon-balloon {
  position: relative;
  width: .74em; height: .91em;
  background: currentColor;
  border-radius: 52% 51% 49% 49%;
  transform: rotate(10deg);
  box-shadow: inset .15em .10em .15em #ffffff87;
}
.icon-balloon::after {
  content: ''; position: absolute; top: .86em; left: .31em;
  width: .1em; height: .24em; background: currentColor;
}
.icon-fish {
  position: relative;
  background: currentColor;
  width: .89em; height: .57em; border-radius: 65% 55% 54% 65%;
  box-shadow: inset 0 .09em .13em #fff8;
}
.icon-fish::before {
  content: ''; position: absolute; left: -.18em; top: .05em;
  width: .38em; height: .47em; background: currentColor;
  clip-path: polygon(0 0, 100% 45%, 0 100%);
}
.icon-fish::after {
  content: ''; position: absolute; right: .19em; top: .17em;
  height: .09em; width: .09em; border-radius: 50%; background: #143d38;
}
.icon-boss {
  position: relative;
  width: .92em; height: .73em;
  border-radius: 53% 51% 41% 43%;
  background: currentColor;
  transform: rotate(-8deg);
}
.icon-boss::before, .icon-boss::after {
  content: ''; position: absolute; width: .12em; height: .20em;
  border-radius: 60%; top: .23em; background: #fff;
}
.icon-boss::before { left: .23em; }
.icon-boss::after { right: .23em; }

.primary, .secondary, .speak, .top-icon, .top-parent {
  border: 1px solid transparent;
  padding: 0 18px;
  background: var(--ivory);
  border-radius: 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 760;
  white-space: normal;
}
.primary {
  color: #163e36;
  background: #ffd269;
  border-color: #e8ac40;
  box-shadow: 0 4px 0 #d59a37;
}
.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #d59a37; }
.primary:disabled { opacity: .52; box-shadow: none; }
.secondary { border-color: #dccfb6; box-shadow: 0 2px 0 #d8cbb555; }
.secondary[aria-pressed="true"], select:focus { background: #e3f0e3; border-color: #478276; color: var(--deep); }
.speak { padding: 0; color: var(--deep); font-size: 27px; border-color: #e5dfcd; }
.speak:active { background: #e5efe3; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  max-width: 1680px;
  min-height: 95px;
  margin: auto;
  padding: max(12px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) 12px max(26px, env(safe-area-inset-left));
}
.branding { display: flex; gap: 13px; align-items: center; margin-right: auto; }
.brand-icon { height: 59px; width: 59px; border-radius: 17px; border: 2px solid #fdf4d7; box-shadow: 0 3px 0 #d6cdb9, 0 4px 13px #2958492b; }
.branding h1 { font-size: clamp(25px, 2.9vw, 38px); font-family: var(--question-font); line-height: 1.05; letter-spacing: 0; font-weight: 800; }
.branding p { margin-top: 5px; color: var(--muted); font-size: 14px; font-weight: 690; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.stat { color: #314c3c; display: flex; align-items: center; gap: 7px; background: #fff8e7; border: 1px solid #e9ddc5; border-radius: 19px; padding: 9px 12px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.stat .icon { font-size: 22px; }
.stat.coin .icon { width: 25px; height: 25px; border-radius: 50%; color: #995212; font-size: 15px; background: #ffd066; box-shadow: inset 0 0 0 2px #ffdf88, 0 2px 0 #cb8426; }
.stat.time .icon { color: #487e70; }
.top-icon { padding: 0; color: #26675c; font-size: 29px; border-color: var(--line); }
.top-icon[aria-pressed="true"] { color: #695f56; }
.top-parent { color: var(--deep); border-color: var(--line); font-size: 15px; padding: 0 13px; }
.top-parent .icon { font-size: 22px; }
.offline-status { color: #4f665b; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.offline-status i { width: 8px; height: 8px; background: #d3a24d; display: block; border-radius: 50%; }
.offline-status[data-ready="true"] i { background: #168174; box-shadow: 0 0 0 3px #16817416; }
.main { max-width: 1680px; margin: auto; padding: 0 max(26px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left)); }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 30.5%);
  gap: 17px;
}
.atlas {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 28px;
  background: #3b9f9e; min-height: clamp(552px, calc(100svh - 129px), 825px);
  border: 1px solid #268b806a; box-shadow: var(--shadow);
}
.atlas-picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; user-select: none; pointer-events: none; }
.atlas::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg,#064d532a,transparent 27%,transparent 72%,#00495152); z-index: 1; pointer-events: none; }
.atlas-nav {
  position: absolute; top: 19px; left: 19px; z-index: 3;
  display: flex; width: max-content; align-items: center; gap: 6px;
  padding: 6px; background: #fef6e3; border: 1px solid #fff2cd; box-shadow: 0 4px 14px #08565b47; border-radius: 22px;
}
.subject-tab {
  display: inline-flex; gap: 9px; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 16px; padding: 0 16px; min-width: 100px;
  color: #25534a; font-size: 18px; font-weight: 850;
}
.subject-tab[aria-pressed="true"] { background: #16695e; color: #fff8e4; box-shadow: inset 0 -3px 0 #064b44; }
.subject-tab .icon { font: 800 18px/1 var(--question-font); border-radius: 7px; width: 26px; height: 27px; background: #d7ebe1; color: #21685b; }
.subject-tab[aria-pressed="true"] .icon { background: #aee0b9; color: #155a4d; }
.map-pages { position: absolute; right: 19px; bottom: 19px; z-index: 3; display: flex; gap: 7px; }
.atlas-pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.island-pin {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  display: flex; align-items: center; gap: 9px; justify-content: flex-start;
  min-width: 132px; padding: 6px 11px 6px 8px; border: 2px solid #fff8dd;
  border-radius: 18px; background: #fffcf0; box-shadow: 0 4px 0 #275b4b83, 0 6px 21px #0b5c5444;
  text-align: left; line-height: 1.16;
}
.pin-0 { left: 20%; top: 68.5%; }
.pin-1 { left: 50%; top: 40.5%; }
.pin-2 { left: 80%; top: 68.5%; }
.island-pin.current { background: #ffdf89; border-color: #fff1bc; box-shadow: 0 4px 0 #9c691d, 0 0 0 4px #fff5c265, 0 8px 25px #134e518c; }
.island-pin.dim { background: #e8ebde; color: #3c645e; }
.pin-dot {
  display: grid; place-items: center; border-radius: 50%;
  width: 38px; height: 38px; color: #fffce9; background: #2b8170; border: 2px solid #59ad8d;
  font: 800 24px/1 var(--question-font);
}
.current .pin-dot { background: #d87b25; border-color: #f09945; }
.pin-label { display: grid; gap: 4px; }
.pin-label b { white-space: nowrap; font-size: 16px; }
.pin-label span { color: #52603f; font-size: 13px; font-weight: 700; }
.atlas-note {
  position: absolute; z-index: 2; left: 20px; bottom: 20px; color: #fffae3; background: #0c554bdf;
  min-height: 38px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #c7f1d35c; border-radius: 13px; font-size: 14px; font-weight: 690;
}
.offline-status .update-button { font-size: 13px; padding: 0 8px; }
.island-sheet {
  background: var(--paper); border: 1px solid #e9dcc0; border-radius: 28px;
  padding: clamp(15px, 2vw, 28px); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-self: stretch; justify-content: flex-start; gap: 17px;
}
.sheet-heading { padding: 4px 1px 7px; }
.sheet-kicker { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 14px; font-weight: 760; color: #46746a; }
.sheet-stars { display: flex; align-items: center; gap: 5px; color: #7f500f; background: #ffefc2; padding: 4px 8px; border-radius: 10px; white-space: nowrap; }
.sheet-stars .icon { color: #b36e12; }
.sheet-heading h2 { font: 800 clamp(26px, 2.62vw, 37px)/1.2 var(--question-font); margin-top: 10px; }
.sheet-detail { font-size: 14px; color: var(--muted); margin-top: 7px; }
.stage-list { display: grid; gap: 10px; }
.stage-row {
  width: 100%; min-height: 69px; display: flex; align-items: center; gap: 11px; text-align: left;
  background: #fffdfa; padding: 9px 11px; border: 1px solid #e7decb; border-radius: 16px;
  box-shadow: 0 2px 0 #e5d7b655;
}
.stage-row:disabled { background: #faf6e9; color: #536456; }
.stage-row:active:not(:disabled) { background: #e7f5e7; }
.stage-icon {
  height: 45px; width: 45px; display: grid; place-items: center; border-radius: 12px;
  font-size: 29px; flex: none; color: #db573a; background: #ffe5d6;
}
.stage-fishing { color: #176f68; background: #d7efe9; }
.stage-row:nth-child(3) .stage-icon { color: #9f6412; background: #ffedbb; }
.stage-boss { color: #80519d; background: #ebdef5; }
.stage-text { display: grid; gap: 4px; min-width: 0; margin-right: auto; }
.stage-text b { font-size: 17px; line-height: 1.12; }
.stage-text small { font-size: 12px; color: #567065; }
.stage-status { color: #756441; font-size: 18px; font-weight: 800; flex: none; }
.stage-status .icon-arrow { color: #267c67; font-size: 26px; }
.stage-row:disabled .stage-status { color: #9b9c8e; }
.stage-development {
  flex: none; padding: 4px 8px; border-radius: 8px; background: #f8ecd4;
  color: #74511f; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.sail { width: 100%; font-size: 17px; margin-top: auto; }
.sail .icon { font-size: 24px; }
.stage-lock-note { color: #6d5a31; text-align: center; padding: 12px; background: #f8edce; border-radius: 13px; margin-top: auto; }
.empty-map { justify-content: center; }

.parent-layout { max-width: 1290px; margin: 0 auto; }
.parent-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 6px 0 16px; }
.parent-head h2 { font-size: 30px; }
.parent-grid { display: grid; gap: 18px; grid-template-columns: minmax(220px, 29%) minmax(0,1fr); align-items: start; }
.parent-sidebar { display: grid; gap: 18px; }
.paper { padding: clamp(13px, 2vw, 25px); border: 1px solid var(--line); background: var(--paper); border-radius: 23px; box-shadow: var(--shadow); }
.paper h3 { font-size: 22px; margin-bottom: 14px; }
.paper p { font-size: 15px; color: var(--muted); }
.profile-options { display: grid; gap: 7px; margin-bottom: 11px; }
.profile-options button { justify-content: flex-start; }
.profile-dot { background: #eadcf5; width: 32px; height: 32px; display: grid; place-items: center; color: #85569e; border-radius: 12px; }
.profile-1 { color: #ab6a22; background: #ffefc6; }
.profile-2 { color: #1f7a61; background: #d8efdc; }
.profile-3 { color: #285e90; background: #d9ebfb; }
.minute-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin: 12px 0; }
.minute-options button { padding: 0 8px; }
.timer-settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.quick-buttons, .quick-learn { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.quick-learn > * { flex: 1 1 200px; }
.until-field { font-size: 14px; display: grid; gap: 7px; }
.until-field select { width: 100%; border-radius: 15px; padding: 0 12px; border: 1px solid #ddcfb5; background: #fffdf5; }
.settings-note { min-height: 25px; }
.subject-range { margin-top: 16px; }
.subject-range h4 { margin-bottom: 8px; font-weight: 820; color: #1b665b; }
.range-unit { margin-bottom: 8px; padding: 5px; background: #faf4e5; border-radius: 17px; }
.range-toggle { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: #fcfaf0; border: 1px solid #e4dac1; border-radius: 13px; padding: 6px 11px; }
.range-toggle[aria-pressed="true"] { background: #eaf3e6; border-color: #adceba; }
.range-toggle:disabled { opacity: .65; }
.checkmark { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #b3baad; border-radius: 7px; background: #fffdf4; flex: none; }
[aria-pressed="true"] > .checkmark { border-color: #267b67; background: #267b67; color: white; }
.lesson-grid { display: grid; gap: 6px; padding: 6px 4px 1px 15px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.parent-save { position: sticky; bottom: 0; z-index: 3; background: #fff8e9ef; border: 1px solid var(--line); box-shadow: 0 -5px 23px #5b754b1c; padding: 8px 14px; border-radius: 18px; margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.play-layout { max-width: 1420px; min-height: max(530px, calc(100svh - 121px)); margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.game-toolbar {
  display: grid; grid-template-columns: minmax(105px, auto) 1fr minmax(120px, auto);
  align-items: center; gap: 13px; margin-bottom: 10px;
}
.game-track { display: flex; gap: 14px; align-items: center; justify-content: center; }
.game-label { display: grid; gap: 4px; line-height: 1.1; }
.game-label b { font-size: 20px; }
.game-label span { font-size: 12px; color: var(--muted); }
.round-dots { display: flex; gap: 5px; }
.round-dots span { display: block; width: 13px; height: 13px; border-radius: 50%; background: #dfd3ba; }
.round-dots .done { background: #318773; }
.round-dots .here { background: #f6b937; box-shadow: 0 0 0 2px #e7a83958; }
.round-count { font-size: 14px; font-weight: 750; white-space: nowrap; }
.combo { justify-self: end; font-size: 15px; font-weight: 800; white-space: nowrap; background: #ffebc0; border-radius: 16px; padding: 11px 12px; color: #754a14; }
.combo .icon { color: #bc7712; font-size: 20px; }
.question-paper {
  position: relative; z-index: 1; overflow: hidden; min-height: 85px; padding: 13px 17px;
  border-radius: 20px; border: 1px solid #e2d6bc; background: #fffdf2; box-shadow: 0 4px 0 #dfd1b75d;
}
.question-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.question-title h2 { font: 750 clamp(42.667px, 4.15vw, 55px)/1.18 var(--question-font); overflow-wrap: anywhere; }
.math-visual { margin-top: 9px; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.math-visual > .shape, .math-dot {
  display: block; flex: 0 0 48px; width: 48px; height: 48px; background: currentColor;
}
.math-visual > [data-shape="0"], .math-dot { border-radius: 50%; }
.math-visual > [data-shape="1"] { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.color-red { color: #dc4a46; }
.color-gold { color: #ba8012; }
.color-blue { color: #2471ad; }
.dot-group {
  display: flex; flex-wrap: wrap; gap: 4px; max-width: 166px; color: #137669;
  background: #e8f6e8; border: 1px solid #bddfd1; border-radius: 14px; padding: 3px 6px;
}
.question-context { margin: 0 0 8px; font-size: clamp(16px, 1.9vw, 24px); line-height: 1.45; }
.boss-order { font-size: clamp(20px, 2.5vw, 28px); line-height: 1.4; }
.game-scene { margin-top: 11px; border-radius: 26px; min-height: 330px; position: relative; isolation: isolate; overflow: hidden; }
.scene-boss {
  border: 1px solid #bab8db; background:
    radial-gradient(ellipse at 88% 21%, #f4e9e7 0 14%, transparent 42%),
    linear-gradient(110deg, #eeedf8 14%, #e2dff3 48%, #cfc3ed 100%);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(165px, 24%);
}
.play-stage { min-width: 0; }
.boss-controls { padding: 13px 16px; display: grid; align-content: center; gap: 8px; }
.captain-zone { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 19px 14px; min-width: 0; }
.boss-health { height: 19px; display: block; width: 100%; max-width: 235px; background: #735897; border: 3px solid #fff2f4; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 0 #583b7863; }
.boss-health-fill { height: 100%; border-radius: 10px; background: #ed826d; transition: width .43s ease; }
.captain-name { color: #583f70; font-size: 14px; font-weight: 800; margin-top: 7px; }
.captain { width: 100%; max-width: 275px; max-height: 265px; margin: 6px auto 0; object-fit: contain; animation: captain-float 2.7s ease-in-out infinite alternate; filter: drop-shadow(0 11px 0 #634f8633); }
@keyframes captain-float { to { transform: translateY(-9px); } }
.boss-choices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.boss-option { display: flex; align-items: center; gap: 7px; }
.answer-touch, .sequence-chip, .token {
  flex: 1 1 auto; border-radius: 16px; border: 1px solid #cab9e7; background: #fffaf2; box-shadow: 0 3px 0 #b29fce;
  font: 740 42.667px/1.09 var(--question-font); padding: 5px 10px; overflow-wrap: anywhere;
}
.game-hint { font-size: 15px; color: #5b5172; font-weight: 720; }
.game-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 3px; }
.token-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.token-block { display: flex; flex: 1 1 42%; gap: 5px; }
.token { min-height: 60px; touch-action: none; }
.token:disabled { opacity: .32; }
.sequence-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px; min-height: 62px; border: 1px dashed #8d80b0; background: #fffaf85d; border-radius: 14px; }
.sequence-empty { display: grid; place-items: center; border: 1px dotted #a899c0; border-radius: 10px; min-width: 42px; height: 42px; font-weight: 780; color: #75658b; }
.sequence-chip { color: #215c49; background: #e9f5dd; border-color: #c8d9b5; box-shadow: none; font-size: 37px; }
.sort-tray, .sort-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.sort-token { touch-action: none; border-radius: 13px; border: 1px solid #e5d7bf; background: #fffdf4; font-size: 35px; padding: 0 7px; }
.sort-token.placed { opacity: .52; }
.sort-token[aria-pressed="true"] { outline: 3px solid #604784; opacity: 1; }
.sort-board { display: flex; gap: 7px; flex-wrap: wrap; }
.sort-bin, .fish-basket {
  flex: 1 1 86px; display: grid; align-content: center; gap: 3px; text-align: center; padding: 4px;
  border: 1px solid #b79ed6; background: #f9f1ff; border-radius: 13px 13px 20px 20px; box-shadow: 0 3px 0 #beb1d0;
}
.sort-subgroup { flex: 1 1 106px; min-width: 0; display: grid; gap: 4px; padding: 5px; background: #e0d8ed; border-radius: 13px; text-align: center; font-size: 14px; }
.sort-subbins { display: flex; gap: 4px; flex-wrap: wrap; }
.sort-subbins .sort-bin { flex: 1 1 65px; }
.sort-bin b { font-size: 15px; }
.bin-preview { min-height: .9em; font-size: 19px; line-height: 1; }
.fish-reservoir { display: flex; align-items: center; gap: 12px; }
.fish-source { display: flex; align-items: center; gap: 10px; touch-action: none; padding: 0 13px; border: 1px solid #7abaa7; background: #d5f4e7; border-radius: 18px; box-shadow: 0 3px 0 #91caba; font-weight: 750; }
.fish-source .icon { font-size: 29px; color: #168476; }
.fish-source[aria-pressed="true"] { outline: 3px solid #246b60; }
.fish-source:disabled { opacity: .4; }
.fish-stock { font-size: 18px; font-weight: 760; }
.fish-baskets { display: flex; flex-wrap: wrap; gap: 7px; }
.fish-basket { font-size: 14px; min-height: 70px; }
.fish-basket b { font-size: 21px; color: #176453; }
.fish-basket.has-fish { background: #e0f4dc; border-color: #a5caa2; }
.drag-ghost { pointer-events: none; position: fixed; z-index: 20; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 15px; color: #fffbea; background: #17675be8; min-width: 58px; min-height: 58px; padding: 5px 10px; font: 740 29px/1 var(--question-font); box-shadow: 0 8px 18px #2a514358; }

.keypad { max-width: 610px; display: grid; gap: 8px; }
.digit-header { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.digit-value { min-height: 60px; padding: 0 13px; display: flex; align-items: center; gap: 8px; justify-content: center; color: #2d4d4a; background: #fffdf2; border: 1px solid #d2cbd9; border-radius: 15px; }
.digit-display { font: 800 43px/1 var(--question-font); }
.digit-grid { display: grid; grid-template-columns: repeat(5, minmax(60px, 1fr)); gap: 7px; }
.digit {
  border-radius: 14px; border: 1px solid #cfc3dc; box-shadow: 0 3px 0 #bdb3d0;
  background: #fdf9f7; padding: 3px; font: 800 38px/1 var(--question-font);
}
.digit:active { background: #e4eee2; transform: translateY(2px); }

.dialog {
  color: var(--ink); padding: 0; width: min(610px, calc(100% - 30px)); max-height: calc(100% - 26px);
  overflow: auto; border: 1px solid #eadcc2; border-radius: 25px; background: var(--paper); box-shadow: 0 13px 65px #182f3069;
}
.dialog::backdrop { background: #184b49a5; backdrop-filter: blur(3px); }
.dialog-inner { padding: 24px; display: grid; gap: 13px; }
.dialog h2 { font: 800 40px/1.14 var(--question-font); }
.dialog p { color: #374f45; font-size: 18px; line-height: 1.4; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 11px; }
.dialog .primary { justify-self: end; }
.gate .dialog-inner { padding: 20px; gap: 9px; }
.dialog .gate-sum { font: 800 43px/1.2 var(--question-font); }
.cancel-gate { justify-self: start; }
.feedback-copy { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.feedback-copy p { font-size: 22px; }
.feedback-source { color: var(--muted); font-size: 13px; }
.dialog p.solution { padding: 12px; background: #fff1c3; border-radius: 15px; font: 730 28px/1.24 var(--question-font); color: #6b4b15; }

.hit-badge {
  position: absolute; z-index: 5; top: 13%; left: 50%; transform: translateX(-50%);
  background: #ffe17b; border: 2px solid #fff4d7; border-radius: 16px; padding: 9px 21px;
  box-shadow: 0 5px 0 #bb812ec9; color: #74440b; font: 800 31px/1 var(--question-font); pointer-events: none;
}
.win-hit { animation: shake .24s ease-in-out; }
@keyframes shake { 25% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.spark-shower { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.spark-shower i {
  position: absolute; top: 40%; left: 49%; font-style: normal; line-height: 1; color: #ffd55e; font-size: var(--size);
  text-shadow: 1px 2px #986418;
  animation: burst .7s var(--delay) forwards;
}
.spark-shower i:nth-child(3n) { color: #f68c6f; }
.spark-shower i:nth-child(4n) { color: #fdf4bd; }
@keyframes burst { from { opacity: 1; transform: translate(0,0) scale(.9); } to { opacity: 0; transform: translate(var(--x), var(--y)) rotate(68deg) scale(.45); } }
.boss-shot {
  position: absolute; left: 25%; top: 67%; z-index: 3; pointer-events: none; color: #f8bc44;
  -webkit-text-stroke: 2px #fff9e4; font-size: 63px; line-height: 1;
  animation: launch-star .63s ease-in forwards;
}
@keyframes launch-star { to { left: 86%; top: 34%; opacity: .1; transform: rotate(160deg) scale(.53); } }

.summary-wrap {
  border: 1px solid #8abdae; min-height: max(480px, calc(100svh - 124px)); border-radius: 26px;
  display: grid; place-items: center; padding: 20px; background: linear-gradient(#12514e2a,#124c52a6), url("../assets/islands.jpg") center/cover;
}
.summary-sheet {
  width: min(610px,100%); text-align: center; padding: 25px; border: 1px solid #f0dbaa; background: #fffae9; border-radius: 25px; box-shadow: 0 12px 33px #0f4d4c7a;
}
.summary-stars { display: flex; justify-content: center; gap: 7px; margin-bottom: 6px; font-size: 59px; line-height: 1; color: #d8cead; }
.summary-stars .on { color: #efaf31; text-shadow: 0 4px 0 #c07b22; }
.summary-sheet h2 { font: 800 51px/1.12 var(--question-font); margin-bottom: 9px; }
.summary-sheet p { color: var(--muted); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 13px 0; margin: 14px 0; border-block: 1px solid #eddcbc; }
.result-stats dt { color: var(--muted); font-size: 15px; }
.result-stats dd { font-weight: 850; color: #25574d; font-size: 26px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.startup { display: grid; justify-items: center; align-content: center; gap: 15px; min-height: 90svh; text-align: center; padding: 24px; }
.startup h1 { font: 800 40px/1 var(--question-font); }
.startup img { border-radius: 20px; }
.storage-alert { text-align: center; padding: 5px 15px 15px; color: #795522; font-size: 13px; }

@media (min-width: 1150px) {
  .island-sheet { gap: 21px; }
  .stage-list { gap: 13px; }
  .stage-row { min-height: 75px; }
}
@media (max-width: 980px) {
  .offline-status { display: none; }
  .main, .masthead { padding-left: 16px; padding-right: 16px; }
  .map-layout { grid-template-columns: minmax(0,1fr) 279px; gap: 12px; }
  .island-sheet { padding: 14px; }
  .scene-boss { grid-template-columns: minmax(0,1fr) 155px; }
}
@media (max-width: 760px) {
  .masthead { flex-wrap: wrap; min-height: 72px; gap: 9px; }
  .brand-icon { width: 43px; height: 43px; border-radius: 13px; }
  .branding { gap: 8px; }
  .branding h1 { font-size: 24px; }
  .branding p { display: none; }
  .head-actions { gap: 5px; }
  .stat { padding: 6px 8px; font-size: 12px; }
  .top-parent { padding: 0 8px; }
  .top-parent span:not(.icon) { position: absolute; clip-path: inset(50%); }
  .map-layout, .parent-grid { grid-template-columns: 1fr; }
  .atlas { min-height: clamp(355px, 57svh, 510px); }
  .atlas-nav { top: 12px; left: 12px; }
  .atlas-note { bottom: 12px; left: 12px; }
  .island-pin { min-width: 100px; padding: 5px 7px; }
  .pin-dot { width: 28px; height: 28px; font-size: 19px; }
  .pin-label b { font-size: 14px; }
  .pin-label span { font-size: 11px; }
  .pin-0 { left: 18%; }.pin-2 { left: 82%; }
  .stage-list { grid-template-columns: 1fr 1fr; }
  .parent-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .game-toolbar { grid-template-columns: auto 1fr auto; gap: 5px; }
  .game-toolbar button { padding: 0 8px; }
  .game-track { gap: 5px; }
  .game-label span, .round-dots { display: none; }
  .combo { font-size: 12px; padding: 8px; }
  .question-title h2 { font-size: 34px; }
  .answer-touch { font-size: 33px; }
  .scene-boss { grid-template-columns: minmax(0,1fr); }
  .captain-zone { display: none; }
  .keypad { max-width: none; }
}
@media (max-width: 440px) {
  .stat.time { display: none; }
  .masthead, .main { padding-left: 10px; padding-right: 10px; }
  .brand-icon { display: none; }
  .stage-list { grid-template-columns: 1fr; }
  .digit-grid { gap: 4px; }
  .dialog-inner { padding: 12px; }
  .secondary, .primary { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.level-navigation { display: flex; gap: 6px; justify-content: flex-end; }
.level-navigation .touch { padding-inline: clamp(6px, 1vw, 14px); white-space: nowrap; }
.password-form { display: grid; gap: 10px; }
.parent-password {
  width: 100%; min-height: 56px; padding: 7px 12px; border: 1px solid #b8af98;
  border-radius: 12px; background: #fffdf5; color: #183d37; font: inherit; font-size: 24px; letter-spacing: .38em;
}
.gate-status:empty { display: none; }
@media (max-width: 720px) {
  .game-track .combo { display: none; }
  .level-navigation { gap: 4px; }
  .level-navigation .touch { padding-inline: 6px; font-size: 12px; min-width: 0; }
}

.daily-launch {
  background: #e4f3e8; border: 1px solid #bedacc; border-radius: 19px; padding: 11px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 9px;
}
.daily-launch h2 { margin: 0 0 3px; font: 800 clamp(19px, 2vw, 25px)/1.1 var(--question-font); }
.daily-launch p { margin: 0; font-size: .82rem; color: var(--muted); }
.daily-launch .primary { flex-shrink: 0; padding-inline: 12px; }
.daily-finish .summary-sheet { padding-block: 35px; }
.daily-finish .result-stats { margin-bottom: 24px; }
.game-label .daily-phase { color: #246854; }
.mini-lesson { max-width: min(740px, calc(100% - 24px)); }
.mini-lesson .dialog-inner { display: grid; gap: 15px; }
.mini-lesson-copy { font-size: clamp(19px, 2.4vw, 25px); line-height: 1.55; margin: 0; }
.mini-lesson-copy .speak { margin-left: 10px; vertical-align: middle; }
.mini-characters, .mini-baskets { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.mini-characters > span, .mini-basket { border: 1px solid #a8d3c7; border-radius: 12px; background: #e2f4ee; padding: 10px; }
.mini-characters > span { display: grid; text-align: center; }
.mini-characters strong { font: 800 clamp(28px, 4vw, 47px)/1.5 var(--question-font); }
.mini-characters small { color: #546858; }
.mini-basket { display: flex; gap: 5px; }
.mini-basket i {
  width: clamp(11px, 1.7vw, 23px); aspect-ratio: 1; border-radius: 60%; background: #18867a;
  animation: lesson-dot .25s ease-out both; animation-delay: calc(var(--appear) * .10s);
}
@keyframes lesson-dot { from { transform: translateY(-11px) scale(.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mini-basket i { animation: none; } }
@media (min-width: 761px) and (max-height: 830px) {
  .island-sheet { gap: 12px; }
  .stage-list { gap: 7px; }
  .stage-row { min-height: 60px; padding-block: 7px; }
  .stage-icon { height: 39px; width: 39px; }
  .island-sheet .sail { min-height: 52px; }
}

.voice-status { color: #a03128; font-size: 14px; margin: 8px 0; }

