@font-face {
  font-family: Andika;
  src: url('./assets/fonts/Andika-Regular.ttf') format('truetype');
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper:#f8f4e9; --ink:#192a3e; --navy:#111f36; --muted:#536273;
  --line:#dfd9ca; --milk:#fffdf7; --mint:#dcefe4; --peach:#f8e4d5;
  --blue:#e1ebf7; --lilac:#eee4f0; --accent:#78ddb4; --warm:#ffce83;
  font-family:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
  -webkit-tap-highlight-color:transparent;
}
* { box-sizing:border-box }
html { min-height:100%; overscroll-behavior:none }
body { margin:0; min-height:100vh; color:var(--ink); background:var(--paper); overscroll-behavior:none }
button,input,select { color:inherit; font:inherit }
button {
  border:0; cursor:pointer; touch-action:manipulation; user-select:none; -webkit-user-select:none;
  -webkit-touch-callout:none;
}
button:disabled { cursor:default }
button:focus-visible,input:focus-visible,select:focus-visible {
  outline:3px solid #1c79aa; outline-offset:4px;
}
img { max-width:100%; display:block }
h1,h2,p { margin:0 }
svg { flex:none; vertical-align:middle }
.pinyin { font-family:Andika,sans-serif; font-weight:600; line-height:1.15 }
.visually-hidden {
  position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0);
  white-space:nowrap; border:0;
}
.frame { width:min(1180px,calc(100% - 64px)); margin-inline:auto }
.parent-trigger.holding::after {
  content:""; position:absolute; inset:8px; border-radius:17px; border:3px solid #38a47d;
  animation:hold 3s linear both; pointer-events:none;
}
@keyframes hold {
  from { clip-path:inset(0 100% 0 0) } to { clip-path:inset(0 0 0 0) }
}
.result-card::before { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none }
.mission-tag { display:inline-flex; gap:9px; align-items:center; letter-spacing:.17em; color:#b6ddcb; font-weight:720; font-size:14px }
.mission-tag span { width:9px; height:9px; border-radius:50%; background:#84deba; box-shadow:0 0 0 4px #74d7ad26 }
.button {
  display:inline-flex; align-items:center; justify-content:center; gap:9px; padding:10px 22px; line-height:1.25;
  min-height:64px; min-width:64px; border-radius:16px; font-weight:800; white-space:nowrap; transition:transform .15s,box-shadow .15s,background .15s;
}
.button:not(:disabled):active,.quiz-choice:not(:disabled):active {
  transform:translateY(2px);
}
.primary { background:var(--accent); color:#122f32; box-shadow:0 4px 0 #418f77 }
.primary:hover { background:#8ce9c3 }
.primary:active { box-shadow:0 2px 0 #418f77 }
.primary.unavailable { background:#d0e4d8; box-shadow:0 3px 0 #a6bfaf; color:#405b50 }
.secondary { background:#f2eee4; border:1px solid #d9d4c4 }
.secondary:hover { background:#e9e6d9 }
.danger { background:#f7e4de; color:#882d21; border:1px solid #e8c0b6 }
.back-link {
  display:inline-flex; min-height:64px; align-items:center; gap:8px; border:0; color:#304c5a; padding-inline:9px;
  background:none; font-weight:760;
}
.back-link:hover { color:#188367 }
.mint { --tint:var(--mint); --line-tint:#bdd8c7; --deep:#4d806c }
.peach { --tint:var(--peach); --line-tint:#eacdbb; --deep:#a56a50 }
.blue { --tint:var(--blue); --line-tint:#c6d8e9; --deep:#5374a0 }
.lilac { --tint:var(--lilac); --line-tint:#decce5; --deep:#886794 }
.meter-fill i { display:block; height:100%; border-radius:inherit; background:var(--deep) }
.inner { padding-block:12px 36px }
.back-link { padding-left:0 }
.page-heading h1 { margin:5px 0 9px; font-size:clamp(29px,5vw,48px); font-weight:890; letter-spacing:.025em }
.star-trio { color:#9d9180; display:inline-flex; align-items:center; gap:2px; white-space:nowrap }
.star-trio .lit { color:#9d6222 }
.star-trio .lit svg { fill:#f8c975 }
.game { user-select:none; -webkit-user-select:none; -webkit-touch-callout:none }
.game-top { display:flex; align-items:center; gap:18px }
.game-top>strong { max-width:33%; font-size:18px }
.task-meter { margin-left:auto; display:flex; align-items:center; gap:5px; font-variant-numeric:tabular-nums }
.task-meter i { width:13px; height:8px; border-radius:7px; background:#e5dece }
.task-meter .done { background:#5da88b }.task-meter .now { background:#ecab56 }
.task-meter strong { margin-left:7px; white-space:nowrap }
.orientation-note { display:none; font-size:12px; color:var(--muted) }
.play-panel {
  min-height:490px; display:flex; flex-direction:column; justify-content:space-between; align-items:stretch;
  padding:21px 24px; border-radius:25px; border:1px solid var(--line-tint);
  background:radial-gradient(ellipse at 50% -10%,var(--tint),transparent 72%),var(--milk);
  box-shadow:0 4px 0 var(--line-tint); text-align:center;
}
.instruction {
  align-self:center; display:flex; align-items:center; gap:8px; color:#34515a;
  background:#fffdf8c9; border:1px solid var(--line-tint); border-radius:999px; padding:8px 15px; font-weight:820;
}
.stimulus {
  display:flex; align-items:center; justify-content:center; gap:19px;
  min-height:116px; margin-block:5px;
}
.stimulus-text { font-size:clamp(31px,8vw,72px); overflow-wrap:anywhere }
.stimulus.with-picture .stimulus-text { font-size:clamp(27px,6vw,53px) }
.word-emoji { font-family:"Apple Color Emoji","Segoe UI Emoji",sans-serif; font-size:clamp(52px,9vw,104px); line-height:1.18 }
.hear {
  position:relative; flex:none; border-radius:50%; min-width:76px; min-height:76px;
  background:var(--navy); color:#e9fbeb; display:grid; place-content:center;
  border:4px solid #fff9ec; box-shadow:0 0 0 1px #abc9bc,0 4px 0 #abbeb3;
}
.hear.playing::after {
  content:""; position:absolute; inset:-8px; border:2px solid #4fa48a; border-radius:50%;
  animation:pulse 1s ease-out infinite;
}
@keyframes pulse { to { transform:scale(1.18); opacity:0 } }
.quiz-options,.demo-options,.slots,.pieces { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:14px }
.quiz-options,.demo-options { padding:10px 0 }
.quiz-choice {
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px;
  min-width:106px; min-height:95px; border:2px solid var(--line-tint);
  border-radius:22px; padding:13px 23px; background:#fffdf8; color:var(--ink); box-shadow:0 4px 0 var(--line-tint);
  font-size:clamp(30px,6vw,54px);
}
.quiz-choice:not(:disabled):hover { border-color:var(--deep) }
.quiz-choice.yes,.quiz-choice.speaking { background:#d3efe0; border-color:#61ad8c; box-shadow:0 4px 0 #83bda4 }
.quiz-choice.no { background:#f9ded7; border-color:#d99583; box-shadow:0 4px 0 #e6b1a3 }
.quiz-choice.hint { border-style:dashed; border-color:#77a58a }
.quiz-choice small { font-weight:700; line-height:1.15; color:#536273; font-size:15px; max-width:100%; white-space:nowrap }
.quiz-choice { position:relative }
.arrival {
  position:absolute; top:2px; right:1px; padding:7px; border-radius:50%;
  background:var(--navy); color:#8be7bc; animation:arrival .56s ease-out both;
}
@keyframes arrival { from{transform:translate(-70px,35px) scale(.4);opacity:0} }
.orbits .quiz-choice,.demo-options .quiz-choice { border-radius:50%; min-width:min(153px,39vw); min-height:min(136px,36vw) }
.orbits .quiz-choice:first-child,.demo-options .quiz-choice:first-child { background-image:linear-gradient(140deg,#fed8bf89,#ffffff10) }
.orbits .quiz-choice:nth-child(2),.demo-options .quiz-choice:nth-child(2) { background-image:linear-gradient(140deg,#fce5a180,#ffffff10) }
.spaceships .quiz-choice { background:#eee2f4; border-radius:28px 28px 13px 13px; border-color:#c7b1d3 }
.build-area { display:grid; gap:16px; padding-block:2px 12px }
.slots,.pieces { gap:10px }
.slot-group { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:7px }
.slot-group+.slot-group { border-left:2px dashed #c6bcb2; padding-left:14px; margin-left:4px }
.slot,.piece {
  min-width:70px; min-height:66px; padding:8px 12px; border-radius:15px; font-size:clamp(26px,5.3vw,46px);
  display:grid; place-items:center; color:var(--tile-ink,#2e4452);
  background:var(--tile,#ebf1eb); border:2px solid var(--tile-line,#bad1c1);
}
.slot { background:color-mix(in srgb,var(--tile,#ebf1eb) 48%,#fffdf7); border-style:dashed }
.slot.filled { background:var(--tile,#ebf1eb); border-style:solid }
.slot.empty span,.slot-empty { opacity:.52 }
.piece { touch-action:none; box-shadow:0 3px 0 var(--tile-line,#bad1c1) }
.piece.selected,.slot.drop-target { outline:3px solid #226c66; outline-offset:3px }
.piece.used { opacity:.24; color:transparent; box-shadow:none }
.initial { --tile:#dbeafc; --tile-line:#a8c6e3; --tile-ink:#244c76; border-radius:24px 24px 10px 10px }
.medial { --tile:#ffe6a6; --tile-line:#e4bd65; --tile-ink:#654e21; border-radius:13px }
.final { --tile:#f7d6cd; --tile-line:#d99d8b; --tile-ink:#71382b; border-radius:11px 11px 22px 22px }
.whole { --tile:#eaddf1; --tile-line:#cbb5db; --tile-ink:#583669; border-radius:23px 23px 11px 11px }
.fuel { --tile:#d5ecdb; --tile-line:#a8cdb5; --tile-ink:#235740; border-radius:15px }
.tone { --tile:#fae6b8; --tile-line:#e4bd65; --tile-ink:#684b1b }
.letter { --tile:#dcecf1; --tile-line:#b0d0dd; --tile-ink:#254e64 }
.fused .slot-group { animation:join .42s ease-out both }
.solved:has(.slot-group .initial) .slot-group { animation:launch .46s ease-out }
@keyframes join { from{gap:22px} to{gap:2px} }
@keyframes launch { 30%{transform:translateY(-14px) rotate(-3deg)} 65%{transform:translateY(2px)} }
.drag-ghost { position:fixed; z-index:20; transform:translate(-50%,-50%) rotate(-6deg); pointer-events:none; opacity:.92 }
.game-footer { min-height:69px; display:flex; align-items:center; justify-content:center; gap:17px; flex-wrap:wrap }
.mouth-demo { display:flex; align-items:center; justify-content:center; gap:6px; color:#75897e; min-height:36px; opacity:.64 }
.mouth-demo.shown { opacity:1 }
.mouth-demo.shown .mouth-shape { animation:mouth .48s ease-out both }
.mouth-demo.shown .mouth-shape:last-child { animation-delay:.28s }
@keyframes mouth { 45%{transform:scale(1.21)} }
.station-build { display:flex; align-items:center; justify-content:center; gap:4px; padding:0 0 5px }
.station-core { padding:4px 7px; border-radius:9px; color:#6e5478; background:#e8d9ed }
.station-build i { width:clamp(10px,3vw,22px); height:13px; border:1px dashed #ae97bb; border-radius:3px; background:#f0e9f2 }
.station-build .done,.station-build .new { border-style:solid; background:#c4aad5 }
.station-build .new { animation:arrival .43s ease-out both }
.feedback,.touch-hint { display:inline-flex; gap:8px; align-items:center; font-weight:760 }
.feedback.good { color:#236949; font-size:25px }
.feedback.again { color:#8a4c31 }
.touch-hint { color:#586973; font-size:14px }
.result { padding-block:35px }
.result-card {
  position:relative; isolation:isolate; background:#14233a; color:#fff7e8; border-radius:25px;
  min-height:385px; display:flex; align-items:center; overflow:hidden; padding:40px clamp(25px,7vw,90px);
}
.result-card h1 { font-size:clamp(36px,6.5vw,70px); margin:11px 0 }
.result-card p:not(.mission-tag) { margin-top:15px; color:#d2dfdf; font-weight:750 }
.result-card .star-trio { gap:8px }
.result-card .star-trio svg { width:35px; height:35px }
.result-buttons,.settings-actions { display:flex; gap:10px; flex-wrap:wrap }
.result-buttons { margin-top:23px }
.result-buttons .secondary { color:var(--ink) }
.daily-badge,.badge-line { display:inline-flex; align-items:center; gap:8px; font-weight:780; color:#85551e }
.daily-badge { color:#f5cb80 }
.page-heading { margin-bottom:21px }
.page-heading p { color:var(--muted) }
.gear-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px }
.gear-card {
  display:grid; justify-items:center; gap:10px; padding:20px 9px;
  border-radius:18px; border:1px solid var(--line); background:var(--milk); color:var(--ink);
}
.gear-card[aria-pressed=true] { border-color:#86b49b; background:#eaf3e8 }
.gear-card:disabled { color:var(--muted); opacity:.77 }
.gear-icon {
  display:grid; place-content:center; min-width:72px; height:72px; border-radius:24px; font-size:30px;
  background:var(--paint,#f2e8e3); color:#20374c;
}
.parent-heading,.studio-summary,.studio-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap }
.tabs { display:flex; gap:5px; flex-wrap:wrap }
.tabs button {
  border:1px solid var(--line); background:var(--milk); border-radius:13px; min-height:64px;
  min-width:64px; padding:8px 13px; font-weight:750;
}
.tabs button[aria-pressed=true] { background:#dcefe4; border-color:#a6cdb9; color:#254e44 }
.report { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px }
.panel,.sound-row {
  border:1px solid var(--line); border-radius:18px; background:var(--milk); padding:19px;
}
.panel h2 { margin-bottom:14px; font-size:21px }
.panel p { color:var(--muted) }
.report-line { display:grid; grid-template-columns:112px 1fr 58px; align-items:center; gap:8px; margin:14px 0; font-size:14px }
.report-line strong { text-align:right }
.meter-fill { height:10px; border-radius:10px; background:var(--tint); overflow:hidden }
.badge-line { margin-top:8px; font-size:14px }
.report-weak li { margin:12px 0 }
.report-weak li span { display:block; margin-top:5px; color:var(--muted); font-size:14px }
.week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px }
.week-day { display:grid; text-align:center; justify-items:center; gap:5px; font-size:12px; color:var(--muted) }
.week-day strong { color:var(--ink) }
.bar-track {
  display:flex; align-items:flex-end; height:77px; width:min(33px,75%); border-radius:7px;
  overflow:hidden; background:#efece1;
}
.bar-track i { width:100%; background:#68aa94; border-radius:7px 7px 0 0 }
.setting-row {
  display:flex; align-items:center; justify-content:space-between; gap:9px;
  min-height:64px; border-bottom:1px solid #eee7d9;
}
.setting-row select,.filter input { min-height:48px; border-radius:12px; border:1px solid var(--line); background:#faf7ef; padding:7px 12px }
.setting-row input,.check-line input { accent-color:#3b9178; width:22px; height:22px }
.report-settings .settings-actions { margin-top:13px }
.settings-actions .button { padding-inline:13px }
.studio { display:grid; gap:13px }
.studio-summary h2 { margin-bottom:4px }
.studio-controls { margin-top:15px; justify-content:flex-start }
.filter { flex:1; min-width:150px }
.filter input { width:100% }
.check-line { display:flex; align-items:center; gap:5px; min-height:64px; font-size:14px }
.notice { padding:10px 12px; margin-top:12px; background:#fff1d7; border-radius:9px }
.sound-list { display:grid; gap:9px }
.sound-row { display:grid; grid-template-columns:minmax(100px,1fr) 70px minmax(0,3.5fr); align-items:center; gap:10px; padding:8px 12px 8px 18px }
.sound-row small { display:block; margin-top:4px; color:var(--muted) }
.sound-row strong { font-size:20px }
.sound-row.recording { border-color:#dc8c79; background:#fff2ed }
.sound-buttons { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:6px }
.little,.record-active { min-height:54px; padding:8px 11px; border:1px solid var(--line); background:#f5f1e7; font-size:14px; border-radius:11px }
.little svg,.record-active svg { width:18px; height:18px }
.record-active { background:#ac4436; color:#fff9f3; border-color:transparent }
.sound-status { border-radius:999px; background:#f0ece2; text-align:center; font-size:12px; padding:6px 3px; font-weight:750 }
.sound-status.local,.sound-status.shared { color:#266953; background:#e2f2e6 }
.sound-status.missing { color:#8d4d2a; background:#faebdb }
.flag { min-height:54px; min-width:50px; border-radius:10px; background:transparent; color:#766e5e }
.flag[aria-pressed=true] { color:#875a16; background:#fbefd4 }
.flag[aria-pressed=true] svg { fill:#e9b459 }
#studio-list>.button { margin-top:12px }
.modal-back {
  z-index:10; position:fixed; inset:0; display:grid; place-items:center; padding:20px;
  background:#0d192aaa;
}
.modal-panel {
  width:min(100%,472px); border-radius:20px; padding:23px; border:1px solid var(--line); background:var(--milk);
  box-shadow:0 10px 35px #12192149;
}
.modal-panel h2 { font-size:25px }
.modal-panel p { color:var(--muted); margin:10px 0 17px; line-height:1.6 }
.modal-panel>div { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px }
.rest-panel { text-align:center }
.rest-panel>div { justify-content:center; margin-top:17px }
.sleep { display:block; font-size:53px; margin-bottom:8px }
.toast {
  position:fixed; z-index:30; bottom:max(24px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%);
  border-radius:12px; padding:12px 15px; width:max-content; max-width:calc(100% - 25px); background:#14263b; color:#fff8ed;
  box-shadow:0 4px 14px #12233c44; font-size:15px;
}
@media(max-width:960px) {
  .frame { width:calc(100% - 42px) }
}
@media(max-width:650px) {
  .frame { width:calc(100% - 28px) }
  .mission-tag { font-size:11px; letter-spacing:.12em }
  .game-top { gap:8px; flex-wrap:wrap }
  .game-top>strong { font-size:15px; max-width:unset; flex:1 }
  .task-meter i { width:6px }
  .task-meter { gap:3px; font-size:12px }
  .play-panel { padding:16px 9px 14px; min-height:439px; border-radius:18px }
  .instruction { font-size:14px }
  .stimulus { min-height:89px; gap:8px }
  .hear { min-width:64px; min-height:64px }
  .quiz-options,.demo-options { gap:8px }
  .quiz-choice { min-height:73px; min-width:73px; padding:8px 12px }
  .slot,.piece { min-width:64px; min-height:64px; padding-inline:8px }
  .slot-group+.slot-group { margin:0; padding-left:6px }
  .slots,.pieces,.slot-group { gap:6px }
  .game-footer { gap:9px }
  .touch-hint { font-size:12px }
  .result-card { min-height:340px }
  .report { grid-template-columns:1fr }
  .sound-row { grid-template-columns:1fr 57px; padding:9px }
  .sound-buttons { grid-column:1/-1; justify-content:flex-start }
}
@media(orientation:portrait) {
  .orientation-note { display:inline }
}
@media(orientation:portrait) and (max-width:650px) {
  .orientation-note { display:none }
}
@media(max-height:650px) and (orientation:landscape) {
  .inner { padding-top:3px }
  .play-panel { min-height:335px; padding-block:10px }
  .stimulus { min-height:76px }
  .game-footer { min-height:64px }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:0.01ms!important; transition-duration:0.01ms!important }
}

