:root { color-scheme: light only;
  --sea: #6CCDF0; --sea-edge: #4FB3DA; --sea-light: #8ED9F4;
  --kaki: #FF6A3D; --btn: #EF5A36; --btn-edge: #B83E1E;
  --lemon: #FFD43B; --lemon-edge: #E3B21C;
  --ink: #262B6B; --ink-soft: #4A4F8A;
  --ok: #6BCB4F; --ok-edge: #4E9E37; --ok-bg: #E6F5DD;
  --sand: #FFF1CF; --sand-edge: #E6CE98;
  --game-bg: #E4F6FD; --game-edge: #BFE3F1;
  --parent-bg: #F2F9FC; --parent-edge: #D9ECF4;
  --white: #FFFFFF;
  --zh: 'Huninn', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --en: 'Andika', 'Huninn', 'Noto Sans TC', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body { font-family: var(--zh); color: var(--ink); background: var(--sea); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 4px solid var(--lemon); outline-offset: 3px; }
img { -webkit-user-drag: none; user-select: none; }
.en { font-family: var(--en); }
.hidden { display: none !important; }

/* 立體按鈕 */
.btn svg { width: 1em; height: 1em; flex-shrink: 0; }
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; border-radius: 22px; background: var(--btn); color: #fff; font-weight: 900; font-size: 22px; box-shadow: 0 6px 0 var(--btn-edge); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn.big { min-height: 76px; font-size: 28px; border-radius: 28px; padding: 0 40px; box-shadow: 0 8px 0 var(--btn-edge); }
.btn.white { background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--sea-edge); }
.btn.white:active { box-shadow: 0 1px 0 var(--sea-edge); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 2px solid var(--game-edge); font-size: 17px; min-height: 48px; padding: 0 18px; }
.btn.lemon { background: var(--lemon); color: var(--ink); box-shadow: 0 6px 0 var(--lemon-edge); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 56px; height: 56px; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 var(--sea-edge); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .08s; }
.icon-btn:active { transform: translateY(4px); }
.icon-btn svg { width: 26px; height: 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 18px 6px 6px; box-shadow: 0 5px 0 var(--sea-edge); font-weight: 900; font-size: 20px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--lemon); overflow: hidden; display: flex; justify-content: center; flex-shrink: 0; }
.avatar img { width: 82px; height: 82px; flex-shrink: 0; margin-top: 2px; }

/* 首頁地圖 */
.home { flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--sea); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(16px, env(safe-area-inset-top)) 18px 8px; position: relative; z-index: 3; }
.topbar .right { display: flex; gap: 10px; align-items: center; }
.stars-pill img { width: 34px; height: 34px; }
.stars-pill span { font-family: var(--en); font-size: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 22px; letter-spacing: 2px; }
.brand-logo { width: 52px; height: 52px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.12)); }
.map { flex: 1; position: relative; min-height: 380px; }
.map svg.path { position: absolute; inset: 0; width: 100%; height: 100%; }
.home { background: radial-gradient(ellipse at 50% 40%, #8FDDF5 0%, #6CCDF0 55%, #4FB9E3 100%); }
.scenery { position: absolute; inset: -2% -1%; pointer-events: none; }
.scenery .land { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 6px 0 rgba(58,150,190,.35)); }
.scenery .deco { position: absolute; transform: translate(-50%, -50%); max-width: 90px; min-width: 30px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.12)); }
.scenery .deco-cloud { opacity: .95; animation: drift 14s ease-in-out infinite alternate; }
.scenery .deco-whale, .scenery .deco-ship, .scenery .deco-turtle { animation: bob 3.2s ease-in-out infinite alternate; }
.waves i { position: absolute; width: 46px; height: 12px; border: 3px solid rgba(255,255,255,.6); border-color: rgba(255,255,255,.6) transparent transparent transparent; border-radius: 50%; transform: translate(-50%, -50%); }
@keyframes drift { from { margin-left: -12px; } to { margin-left: 12px; } }
@keyframes bob { from { margin-top: -3px; } to { margin-top: 3px; } }
@media (prefers-reduced-motion: reduce) { .scenery .deco { animation: none !important; } }
.island { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 50% 50% 46% 54% / 60% 60% 40% 40%; border: 9px solid var(--sand); background-clip: padding-box; box-sizing: content-box; filter: drop-shadow(0 6px 0 var(--sand-edge)); transition: transform .12s; }
.island:active { transform: translate(-50%, -46%); }
.island .lv { font-family: var(--en); font-weight: 700; font-size: 18px; }
.island .nm { font-weight: 900; font-size: 16px; white-space: nowrap; }
.island .sub { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.island.current { border-width: 11px; filter: drop-shadow(0 7px 0 var(--sand-edge)) drop-shadow(0 0 8px #fff) drop-shadow(0 0 4px #fff); }
.island.soon { opacity: .7; }
.guide { position: absolute; transform: translate(-50%, -100%); pointer-events: none; display: flex; align-items: flex-start; }
.guide img { width: clamp(96px, 14vw, 150px); }
.bubble { background: #fff; border-radius: 22px 22px 22px 6px; padding: 10px 16px; box-shadow: 0 5px 0 var(--sea-edge); font-weight: 700; font-size: 16px; white-space: nowrap; margin-top: 6px; }
.bubble b { font-family: var(--en); font-size: 22px; display: block; }
.today { margin: 10px 16px max(16px, env(safe-area-inset-bottom)); background: #fff; border-radius: 30px; padding: 14px 14px 14px 20px; box-shadow: 0 7px 0 var(--sea-edge); display: flex; align-items: center; gap: 14px; position: relative; z-index: 3; }
.today .thumbs { display: flex; gap: 8px; }
.today .thumb { width: 64px; height: 64px; border-radius: 20px; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.today .thumb:nth-child(2) { background: var(--game-bg); }
.today .thumb:nth-child(3) { background: #FFE3D8; }
.today .thumb .pic { width: 48px; height: 48px; }
.today .txt { flex: 1; min-width: 0; }
.today .txt b { display: block; font-size: 24px; font-weight: 900; }
.today .txt span { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 640px) {
  .today .thumbs { display: none; }
  .brand span { display: none; }
  .island .nm { font-size: 14px; }
  .today .txt b { font-size: 19px; }
  .btn.big { min-height: 64px; font-size: 24px; padding: 0 26px; }
}

/* 彈出面板 */
.sheet-bg { position: fixed; inset: 0; background: rgba(38,43,107,.35); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .15s; }
.sheet { background: #fff; width: min(760px, 100%); max-height: 86dvh; overflow: auto; border-radius: 32px 32px 0 0; padding: 22px 20px max(24px, env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet.center { border-radius: 32px; margin: auto 16px; width: min(460px, calc(100% - 32px)); }
.sheet-bg.mid { align-items: center; }
.sheet h2 { margin: 0 0 4px; font-size: 24px; font-weight: 900; }
.sheet .hint { margin: 0 0 14px; font-size: 15px; color: var(--ink-soft); font-weight: 500; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.unit-card { position: relative; background: var(--game-bg); border-radius: 22px; padding: 12px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 5px 0 var(--game-edge); text-align: center; }
.unit-card .pic { width: 56px; height: 56px; }
.unit-card b { font-size: 16px; font-weight: 900; }
.unit-card .st { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.unit-card.locked { background: #F1F1F4; box-shadow: 0 5px 0 #DADAE3; }
.unit-card.locked .pic { opacity: .5; }
.unit-card .lock { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.unit-card .done-badge { position: absolute; top: 6px; right: 8px; font-size: 13px; font-weight: 900; color: var(--ok-edge); }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }

.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.stk { background: #F1F1F4; border-radius: 20px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; }
.stk .pic { width: 64%; height: 64%; filter: grayscale(1) brightness(1.4); opacity: .25; }
.stk.got { background: var(--sand); box-shadow: 0 4px 0 var(--sand-edge); }
.stk.got .pic { filter: none; opacity: 1; }
.stk .en { font-weight: 700; font-size: 14px; }
/* 圖片元件 */
.pic { display: flex; align-items: center; justify-content: center; }
.pic img { width: 100%; height: 100%; object-fit: contain; }
.pic .swatch { width: 82%; height: 82%; border-radius: 30%; box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), 0 0 0 4px #fff; }
.pic .num { font-family: var(--en); font-weight: 700; color: var(--kaki); line-height: 1; text-shadow: 0 4px 0 rgba(184,62,30,.25); }
.pic .word-card { font-family: var(--en); font-weight: 700; background: #fff; border-radius: 18px; padding: 4px 10px; box-shadow: 0 4px 0 var(--game-edge); color: var(--ink); line-height: 1.1; text-align: center; }

/* 遊戲畫面 */
.play { flex: 1; display: flex; flex-direction: column; background: var(--game-bg); min-height: 100dvh; }
.play-top { display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 6px; }
.play-top .icon-btn { box-shadow: 0 4px 0 var(--game-edge); width: 50px; height: 50px; }
.progress { flex: 1; height: 18px; border-radius: 999px; background: var(--game-edge); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--lemon); border-radius: 999px; transition: width .3s; }
.step-name { font-weight: 700; font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
.stage-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 12px max(14px, env(safe-area-inset-bottom)); }
.stage { position: relative; width: min(100%, calc((100dvh - 110px) * 4 / 3)); aspect-ratio: 4 / 3; display: flex; flex-direction: column; gap: 2.2%; container-type: inline-size; }
.prompt { display: flex; align-items: center; gap: 2%; }
.prompt .fox { width: 18cqw; flex-shrink: 0; margin: -2cqw -1cqw -1cqw -2cqw; }
.prompt .say { flex: 1; background: #fff; border-radius: 4cqw 4cqw 4cqw 1.2cqw; padding: 2cqw 3cqw; box-shadow: 0 .8cqw 0 var(--game-edge); display: flex; align-items: center; justify-content: space-between; gap: 2cqw; min-height: 13cqw; }
.prompt .say .en { font-size: clamp(20px, 5.4cqw, 44px); font-weight: 700; line-height: 1.15; }
.prompt .say .zh { font-size: clamp(13px, 2.6cqw, 20px); color: var(--ink-soft); font-weight: 500; display: block; }
.prompt .say .target { color: #D2401C; }
.listen-btn { width: 11cqw; height: 11cqw; max-width: 72px; max-height: 72px; min-width: 48px; min-height: 48px; border-radius: 50%; background: var(--btn); box-shadow: 0 .8cqw 0 var(--btn-edge); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.listen-btn svg { width: 55%; height: 55%; }
.listen-btn:active { transform: translateY(3px); }
.area { flex: 1; position: relative; min-height: 0; }
.grid-cards { display: grid; gap: 2.4cqw; height: 100%; }
.card { background: #fff; border-radius: 4cqw; box-shadow: 0 1cqw 0 var(--game-edge); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; transition: transform .1s, opacity .2s; position: relative; min-height: 0; }
.card:active { transform: translateY(.8cqw); }
.card .pic { width: 62%; height: 62%; }
.card .lbl { font-family: var(--en); font-weight: 700; font-size: clamp(16px, 3.6cqw, 30px); }
.card.right { box-shadow: 0 0 0 1.2cqw var(--ok), 0 1.6cqw 0 1.2cqw var(--ok-edge); }
.card.wrong { opacity: .5; animation: shake .35s; }
.card.dim { opacity: .35; }
@keyframes shake { 25% { transform: translateX(-8px) } 75% { transform: translateX(8px) } }
.toast { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); background: var(--ok-bg); border-radius: 999px; padding: 1.4cqw 3.4cqw; display: flex; align-items: center; gap: 1.6cqw; font-weight: 900; font-size: clamp(16px, 3cqw, 24px); box-shadow: 0 .8cqw 0 #C9E7BB; animation: up .2s; z-index: 5; white-space: nowrap; }
.toast img { width: 6cqw; min-width: 32px; }
.toast.soft { background: #fff; box-shadow: 0 .8cqw 0 var(--game-edge); }

@media (orientation: portrait) {
  .stage-wrap { align-items: stretch; }
  .stage { width: 100%; max-width: 640px; aspect-ratio: auto; margin: 0 auto; }
  .trace { flex-direction: column; }
  .trace canvas { height: auto; width: 82cqw; max-width: none; }
  .trace .side { flex-direction: row; width: auto; }
  .trace .side .pic { width: 14cqw; height: 14cqw; }
  .intro { flex-wrap: wrap; align-content: center; }
  .intro .big-card { width: 78cqw; max-height: none; height: 62%; order: -1; flex-basis: 100%; }
  .feed { flex-direction: column; }
  .feed .items { flex-direction: row; }
  .feed .fox-target { width: 46cqw; height: 46cqw; }
  .feed .item { width: 27cqw; height: 27cqw; }
  .build .pic { width: 52cqw; height: 52cqw; }
  .slot, .tile { width: 17cqw; height: 17cqw; }
  .tile.wide, .slot.wide { width: 23cqw; }
}
/* 看看聽聽 */
.intro { height: 100%; display: flex; align-items: center; justify-content: center; gap: 3cqw; }
.intro .big-card { width: 48cqw; height: 100%; max-height: 52cqw; background: #fff; border-radius: 5cqw; box-shadow: 0 1.2cqw 0 var(--game-edge); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; }
.intro .big-card .pic { width: 58%; height: 58%; }
.intro .big-card .w { font-family: var(--en); font-weight: 700; font-size: clamp(28px, 7cqw, 64px); line-height: 1; }
.intro .big-card .phon { font-family: var(--en); font-size: clamp(16px, 3.4cqw, 30px); color: var(--ink-soft); letter-spacing: 1px; }
.intro .big-card .phon span { color: var(--kaki); }
.intro .big-card .zh { font-size: clamp(14px, 2.8cqw, 22px); color: var(--ink-soft); font-weight: 700; }
.nav-btn { width: 13cqw; height: 13cqw; max-width: 84px; max-height: 84px; min-width: 56px; min-height: 56px; border-radius: 50%; background: #fff; box-shadow: 0 1cqw 0 var(--game-edge); display: flex; align-items: center; justify-content: center; }
.nav-btn.go { background: var(--btn); box-shadow: 0 1cqw 0 var(--btn-edge); }
.nav-btn svg { width: 45%; height: 45%; }
.dots { position: absolute; bottom: -1cqw; left: 0; right: 0; display: flex; justify-content: center; gap: 1cqw; }
.dots i { width: 1.6cqw; height: 1.6cqw; min-width: 8px; min-height: 8px; border-radius: 50%; background: var(--game-edge); }
.dots i.on { background: var(--kaki); }

/* 拼字積木 */
.build { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2cqw; }
.build .pic { width: 26cqw; height: 26cqw; }
.slots, .tiles { display: flex; gap: 1.8cqw; justify-content: center; flex-wrap: wrap; }
.slot { width: 12cqw; height: 12cqw; min-width: 48px; min-height: 48px; border-radius: 3cqw; border: .6cqw dashed var(--game-edge); background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; font-family: var(--en); font-weight: 700; font-size: clamp(22px, 6cqw, 52px); }
.slot.filled { border-style: solid; border-color: var(--lemon); background: #fff; }
.tile { width: 12cqw; height: 12cqw; min-width: 48px; min-height: 48px; border-radius: 3cqw; background: var(--lemon); box-shadow: 0 1cqw 0 var(--lemon-edge); font-family: var(--en); font-weight: 700; font-size: clamp(22px, 6cqw, 52px); }
.tile.used { visibility: hidden; }
.tile.wide, .slot.wide { width: 17cqw; }

.slot.word, .tile.word { width: auto; min-width: 14cqw; padding: 0 2.4cqw; font-size: clamp(18px, 4.4cqw, 38px); height: 11cqw; }
.slots.sent { min-height: 12cqw; }
@media (orientation: portrait) { .slot.word, .tile.word { height: 14cqw; font-size: clamp(18px, 5.4cqw, 30px); } }
/* 氣球 */
.sky { position: absolute; inset: 0; overflow: hidden; border-radius: 4cqw; background: linear-gradient(#CFEFFB, #E4F6FD); }
.balloon { position: absolute; bottom: -24cqw; width: 14cqw; height: 18cqw; min-width: 64px; min-height: 82px; border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%; display: flex; align-items: center; justify-content: center; font-family: var(--en); font-weight: 700; font-size: clamp(24px, 6.5cqw, 54px); color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18); animation: rise linear forwards; box-shadow: inset -1.2cqw -1.6cqw 0 rgba(0,0,0,.12); }
.balloon::after { content: ''; position: absolute; bottom: -5cqw; left: 50%; width: 2px; height: 5cqw; background: rgba(38,43,107,.35); }
.balloon.pop { animation: pop .25s forwards; }
@keyframes rise { to { transform: translateY(-140cqw); } }
@keyframes pop { to { transform: scale(1.6); opacity: 0; } }

/* 描寫 */
.trace { height: 100%; display: flex; align-items: center; justify-content: center; gap: 3cqw; }
.trace canvas { background: #fff; border-radius: 5cqw; box-shadow: 0 1.2cqw 0 var(--game-edge); touch-action: none; height: 100%; aspect-ratio: 1; max-width: 70cqw; }
.trace .side { display: flex; flex-direction: column; align-items: center; gap: 2cqw; width: 22cqw; }
.trace .side .pic { width: 18cqw; height: 18cqw; }

/* 餵狐狸 */
.feed { height: 100%; display: flex; align-items: center; justify-content: space-around; gap: 2cqw; }
.feed .fox-target { width: 34cqw; height: 34cqw; border-radius: 50%; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.feed .fox-target.hover { transform: scale(1.08); background: #fff; }
.feed .fox-target img { width: 88%; }
.feed .items { display: flex; flex-direction: column; gap: 2cqw; }
.feed .item { width: 17cqw; height: 17cqw; min-width: 64px; min-height: 64px; background: #fff; border-radius: 4cqw; box-shadow: 0 1cqw 0 var(--game-edge); display: flex; align-items: center; justify-content: center; touch-action: none; }
.feed .item .pic { width: 78%; height: 78%; pointer-events: none; }
.feed .item.dragging { position: fixed; z-index: 99; pointer-events: none; box-shadow: 0 2cqw 3cqw rgba(38,43,107,.25); }

/* 跟讀 */
.speak { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqw; }
.speak .pic { width: 26cqw; height: 26cqw; }
.speak .w { font-family: var(--en); font-weight: 700; font-size: clamp(30px, 8cqw, 70px); line-height: 1; }
.speak .row { display: flex; gap: 3cqw; align-items: center; }
.mic { width: 18cqw; height: 18cqw; max-width: 110px; max-height: 110px; min-width: 72px; min-height: 72px; border-radius: 50%; background: var(--btn); box-shadow: 0 1.2cqw 0 var(--btn-edge); display: flex; align-items: center; justify-content: center; }
.mic svg { width: 46%; height: 46%; }
.mic.on { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 1.2cqw 0 var(--btn-edge), 0 0 0 3cqw rgba(239,90,54,.25); } }
.star-row { display: flex; gap: 1.4cqw; height: 9cqw; }
.star-row img { height: 100%; }
.star-row img.off { filter: grayscale(1); opacity: .3; }

/* 獎勵 */
.reward { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; background: var(--sea); position: relative; overflow: hidden; min-height: 100dvh; }
.reward .fox { width: min(46vw, 260px); }
.reward h1 { margin: 0; font-size: clamp(28px, 6vw, 44px); font-weight: 900; }
.reward .earned { display: flex; gap: 10px; }
.reward .earned img { width: clamp(48px, 10vw, 76px); animation: popin .4s backwards; }
.reward .earned img:nth-child(2) { animation-delay: .15s; }
.reward .earned img:nth-child(3) { animation-delay: .3s; }
.reward .sticker { background: #fff; border-radius: 28px; padding: 14px 22px; box-shadow: 0 6px 0 var(--sea-edge); display: flex; align-items: center; gap: 14px; font-weight: 700; }
.reward .sticker .pic { width: 64px; height: 64px; }
.confetti { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110dvh) rotate(540deg); } }
@keyframes popin { from { transform: scale(0); } }

/* 歡迎、建立孩子 */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; background: var(--sea); min-height: 100dvh; }
.welcome .fox { width: min(50vw, 240px); }
.panel { background: #fff; border-radius: 32px; padding: 24px; box-shadow: 0 7px 0 var(--sea-edge); width: min(520px, 100%); display: flex; flex-direction: column; gap: 16px; }
.panel h1 { margin: 0; font-size: 26px; font-weight: 900; text-align: center; }
.panel label { font-weight: 900; font-size: 17px; }
.field { width: 100%; height: 56px; border-radius: 18px; border: 3px solid var(--game-edge); padding: 0 16px; font-family: inherit; font-size: 20px; color: var(--ink); background: #fff; }
.field:focus { border-color: var(--sea); outline: none; }
.ages { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.age { height: 52px; border-radius: 16px; background: var(--game-bg); font-family: var(--en); font-weight: 700; font-size: 22px; box-shadow: 0 4px 0 var(--game-edge); }
.age.on { background: var(--lemon); box-shadow: 0 4px 0 var(--lemon-edge); }
.avatars { display: flex; gap: 12px; justify-content: center; }
.av-choice { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: flex; justify-content: center; background: var(--game-bg); box-shadow: 0 4px 0 var(--game-edge); }
.av-choice img { width: 120px; height: 120px; flex-shrink: 0; }
.av-choice.on { box-shadow: 0 0 0 5px var(--lemon), 0 6px 0 5px var(--lemon-edge); }
@media (max-width: 480px) { .ages { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ages.groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.age.grp { height: auto; min-height: 64px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: var(--zh, inherit); font-size: 18px; }
.age.grp b { font-weight: 900; }
.age.grp .en, .panel label .en { font-family: var(--en); font-weight: 700; font-size: 13px; opacity: .7; }
.panel h1 small.en { display: block; font-family: var(--en); font-size: 16px; font-weight: 700; opacity: .7; margin-top: 2px; }
.form-hint { margin: -4px 0 0; font-size: 13px; line-height: 1.5; opacity: .75; }
.form-hint .en { font-family: var(--en); }
@media (max-width: 480px) { .ages.groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 家長鎖、家長頁 */
.gate-q { font-family: var(--en); font-size: 40px; font-weight: 700; text-align: center; margin: 6px 0; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key { height: 58px; border-radius: 16px; background: var(--parent-bg); box-shadow: 0 4px 0 var(--parent-edge); font-family: var(--en); font-size: 26px; font-weight: 700; }
.gate-ans { height: 56px; border-radius: 16px; background: var(--parent-bg); font-family: var(--en); font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; letter-spacing: 4px; }
.parent { flex: 1; background: var(--parent-bg); min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px 28px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.parent > * { width: min(720px, 100%); }
.p-head { display: flex; align-items: center; gap: 10px; }
.p-head h1 { flex: 1; margin: 0; font-size: 24px; font-weight: 900; }
.p-head .icon-btn { box-shadow: 0 3px 0 var(--parent-edge); width: 48px; height: 48px; }
.kids { display: flex; gap: 8px; flex-wrap: wrap; }
.kid-chip { height: 46px; padding: 0 16px 0 5px; border-radius: 999px; border: 2px solid #B9DCEA; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.kid-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.kid-chip .mini { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: flex; justify-content: center; background: var(--lemon); }
.kid-chip .mini img { width: 58px; height: 58px; flex-shrink: 0; }
.card-p { background: #fff; border-radius: 24px; padding: 16px; box-shadow: 0 4px 0 var(--parent-edge); display: flex; flex-direction: column; gap: 10px; }
.card-p h2 { margin: 0; font-size: 17px; font-weight: 900; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { border-radius: 16px; padding: 10px; display: flex; flex-direction: column; }
.stat b { font-family: var(--en); font-size: 28px; }
.stat span { font-size: 13px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wchip { background: var(--parent-bg); border-radius: 14px; padding: 6px 10px 6px 6px; display: flex; align-items: center; gap: 6px; font-family: var(--en); font-weight: 700; font-size: 17px; }
.wchip .pic { width: 30px; height: 30px; }
.row-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; font-weight: 700; }
.seg { display: flex; gap: 6px; }
.seg button { height: 40px; padding: 0 12px; border-radius: 12px; background: var(--parent-bg); font-weight: 700; }
.seg button.on { background: var(--ink); color: #fff; }
.tip { background: var(--sand); }
.muted { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.credit { font-size: 12px; color: var(--ink-soft); text-align: center; line-height: 1.6; }
.credit a { color: var(--ink-soft); }

/* 休息時間 */
.rest { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: #8E93C9; color: #fff; min-height: 100dvh; }
.rest img { width: min(50vw, 240px); }
.rest h1 { margin: 0; font-size: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 480px) {
  .topbar .icon-btn { width: 46px; height: 46px; border-radius: 15px; }
  .topbar .right { gap: 6px; }
  .stars-pill { padding: 4px 12px 4px 4px; }
  .stars-pill img { width: 28px; height: 28px; }
  .stars-pill span { font-size: 20px; }
  .kid-pill { font-size: 17px; padding-right: 12px; }
  .kid-pill .avatar { width: 40px; height: 40px; }
}

/* 頭像：角色是全身圖、動物是臉 */
.avatar img.face, .mini img.face, .av-choice img.face, .who-av img.face { width: 78%; height: 78%; margin: auto; object-fit: contain; }
.avatar, .mini, .av-choice, .who-av { align-items: flex-start; }
.avatars { flex-wrap: wrap; }
.av-choice { width: 64px; height: 64px; }
.av-choice img.body { width: 108px; height: 108px; }

/* 誰要玩 */
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.who-card { background: var(--game-bg); border-radius: 24px; padding: 14px 10px; box-shadow: 0 5px 0 var(--game-edge); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .08s; }
.who-card:active { transform: translateY(4px); }
.who-card b { font-size: 19px; font-weight: 900; }
.who-av { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: flex; justify-content: center; background: #fff; }
.who-av img.body { width: 142px; height: 142px; flex-shrink: 0; }
.who-card.add .who-av { align-items: center; color: var(--ink-soft); border: 3px dashed var(--game-edge); }

/* 中文意思 */
.zh-lbl { font-family: var(--zh); font-size: clamp(14px, 2.8cqw, 22px); font-weight: 700; color: var(--ink-soft); }
.zh-lbl.big { font-size: clamp(18px, 4cqw, 30px); text-align: center; }

/* 開場 */
.opening { height: 100%; display: grid; grid-template-columns: 1fr 1.3fr; grid-template-rows: 1fr auto auto; gap: 2cqw; align-items: center; justify-items: center; }
.op-fox { grid-row: 1 / 3; width: 34cqw; animation: bounce 1.6s ease-in-out infinite; }
.op-bubble { background: #fff; border-radius: 5cqw 5cqw 5cqw 1.5cqw; padding: 3cqw 4cqw; box-shadow: 0 1cqw 0 var(--game-edge); display: flex; flex-direction: column; gap: 1cqw; font-size: clamp(16px, 3.2cqw, 26px); font-weight: 700; line-height: 1.45; }
.op-bubble b { font-size: clamp(22px, 4.8cqw, 40px); color: var(--kaki); }
.op-items { display: flex; gap: 2cqw; }
.op-item { width: 11cqw; height: 11cqw; background: #fff; border-radius: 3cqw; box-shadow: 0 .8cqw 0 var(--game-edge); display: flex; align-items: center; justify-content: center; animation: popin .4s backwards; }
.op-item .pic { width: 80%; height: 80%; }
.opening .go { grid-column: 1 / -1; }
@keyframes bounce { 50% { transform: translateY(-3cqw) rotate(-3deg); } }
@media (orientation: portrait) {
  .opening { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; }
  .op-fox { grid-row: auto; width: 52cqw; }
  .op-item { width: 17cqw; height: 17cqw; }
}

/* 學發音 */
.learn { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqw; }
.sound-big { font-weight: 700; font-size: clamp(54px, 15cqw, 130px); line-height: 1; color: var(--kaki); text-shadow: 0 .8cqw 0 rgba(184,62,30,.2); }
.ex-row { display: flex; gap: 2.4cqw; width: 100%; justify-content: center; }
.card.ex { flex: 1; max-width: 28cqw; aspect-ratio: 1; }
.card.ex .lbl u, .card .lbl u { text-decoration: none; color: var(--kaki); border-bottom: .5cqw solid var(--kaki); }
.card.glow { box-shadow: 0 0 0 1.2cqw var(--lemon), 0 1.6cqw 0 1.2cqw var(--lemon-edge); transform: scale(1.04); }
.learn.how { flex-direction: row; gap: 3cqw; }
.mouth { width: 42cqw; background: #fff; border-radius: 5cqw; padding: 2cqw; box-shadow: 0 1cqw 0 var(--game-edge); }
.mouth svg, .mouth .mouth-img { width: 100%; display: block; }
.mouth .mouth-img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3cqw; }
.mouth.small { width: 30cqw; }
.tips { flex: 1; display: flex; flex-direction: column; gap: 1.6cqw; }
.tip-row { background: #fff; border-radius: 3cqw; padding: 1.6cqw 2.4cqw; display: flex; gap: 2cqw; align-items: baseline; font-size: clamp(15px, 2.8cqw, 22px); font-weight: 500; line-height: 1.4; transition: background .2s, transform .2s; }
.tip-row b { flex-shrink: 0; color: var(--kaki); font-weight: 900; font-family: var(--en); min-width: 4.6em; display: flex; flex-direction: column; line-height: 1.2; }
.tip-row b small { font-family: var(--zh, inherit); font-size: .65em; opacity: .7; font-weight: 700; }
.tip-row .tip-en { display: block; font-family: var(--en); font-weight: 700; }
.tip-row .tip-zh { display: block; font-size: .72em; opacity: .7; margin-top: 2px; }
.tip-row.on { background: var(--sand); transform: scale(1.02); }
.tip-btns { display: flex; gap: 1.6cqw; flex-wrap: wrap; }
.next-step { align-self: center; }
@media (orientation: portrait) { .learn.how { flex-direction: column; } .mouth { width: 60cqw; } .card.ex { max-width: 30cqw; } }

/* 打地鼠 */
.moles { height: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr 1fr; gap: 2cqw; background: #A8DB8B; border-radius: 4cqw; padding: 2cqw; }
.hole { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.hole .dirt { position: absolute; bottom: 0; left: 8%; right: 8%; height: 34%; border-radius: 50%; background: #6B4A2E; box-shadow: inset 0 1.2cqw 0 #4E341F; z-index: 1; }
.mole { position: absolute; bottom: 8%; width: 70%; aspect-ratio: 1; border-radius: 45% 45% 20% 20%; background: #fff; box-shadow: 0 1cqw 0 var(--game-edge); transform: translateY(120%); transition: transform .22s cubic-bezier(.3,1.6,.6,1); z-index: 0; display: flex; align-items: center; justify-content: center; }
.mole .pic { width: 74%; height: 74%; }
.mole.up { transform: translateY(0); }
.mole.bonk { transform: translateY(10%) scale(.9) rotate(8deg); background: var(--ok-bg); }
.mole-letter { font-size: clamp(30px, 8cqw, 70px); font-weight: 700; color: var(--ink); }

@media (orientation: portrait) { .moles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, 1fr); } .hole .dirt { height: 26%; } }
/* 釣魚 */
.sea { position: absolute; inset: 0; border-radius: 4cqw; overflow: hidden; background: linear-gradient(#8ED9F4, #4FB3DA); }
.sea .boat { position: absolute; top: 1cqw; left: 3cqw; width: 18cqw; height: 6cqw; background: #FF8A5C; border-radius: 0 0 6cqw 6cqw; box-shadow: inset 0 -1cqw 0 #C8401A; }
.sea .bucket { position: absolute; top: 1.4cqw; right: 3cqw; min-width: 10cqw; height: 7cqw; background: #fff; border-radius: 2cqw 2cqw 3cqw 3cqw; display: flex; align-items: center; justify-content: center; font-size: clamp(18px, 4cqw, 34px); font-weight: 700; box-shadow: 0 .8cqw 0 rgba(0,0,0,.12); }
.fish { position: absolute; display: flex; align-items: center; animation: swim-r linear forwards; }
.fish.ltr { left: -30cqw; }
.fish.rtl { right: -30cqw; flex-direction: row-reverse; animation-name: swim-l; }
.fish .body { width: 18cqw; height: 11cqw; min-width: 76px; min-height: 48px; background: var(--c); border-radius: 50% 40% 40% 50% / 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset -1cqw -1cqw 0 rgba(0,0,0,.1); }
.fish .body .pic { width: 64%; height: 80%; }
.fish .tail { width: 0; height: 0; border-top: 4cqw solid transparent; border-bottom: 4cqw solid transparent; border-right: 5cqw solid var(--c); }
.fish.rtl .tail { border-right: none; border-left: 5cqw solid var(--c); }
.fish-word { font-size: clamp(16px, 4cqw, 34px); font-weight: 700; color: var(--ink); }
.fish.caught { animation: caught .5s forwards !important; }
@keyframes swim-r { to { transform: translateX(160cqw); } }
@keyframes swim-l { to { transform: translateX(-160cqw); } }
@keyframes caught { to { top: 2%; opacity: 0; transform: scale(.4); } }

/* 家長提示 */
.tip-line { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; line-height: 1.55; }
.tip-line .pic { width: 40px; height: 40px; flex-shrink: 0; }
.listen-mini { width: 40px; height: 40px; border-radius: 50%; background: var(--btn); box-shadow: 0 3px 0 var(--btn-edge); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.listen-mini svg { width: 55%; height: 55%; }

/* 互動繪本 */
.book-view { position: relative; height: 100%; display: grid; grid-template-columns: 1fr 1.15fr; grid-template-rows: 1fr auto; gap: 2.4cqw; }
.book-pic { grid-row: 1 / 3; background: linear-gradient(#FFF7EC, #FFE9C7); border-radius: 5cqw; box-shadow: 0 1.2cqw 0 var(--sand-edge); position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.book-char { width: 62%; margin-bottom: 4%; }
.book-char.big { width: 80%; }
.book-obj { position: absolute; right: 6%; top: 8%; width: 34%; aspect-ratio: 1; background: #fff; border-radius: 30%; box-shadow: 0 1cqw 0 var(--sand-edge); display: flex; align-items: center; justify-content: center; }
.book-obj .pic { width: 78%; height: 78%; }
.book-title { position: absolute; top: 8%; left: 6%; right: 6%; text-align: center; font-weight: 700; font-size: clamp(22px, 5cqw, 44px); color: var(--kaki); }
.book-text { background: #fff; border-radius: 5cqw; padding: 3cqw; box-shadow: 0 1.2cqw 0 var(--game-edge); display: flex; flex-direction: column; justify-content: center; gap: 2cqw; }
.en-text { font-family: var(--en); font-weight: 700; font-size: clamp(20px, 4.2cqw, 38px); line-height: 1.5; }
.tok { font: inherit; color: inherit; padding: 0 .1em; border-radius: .3em; transition: background .12s, color .12s; }
.tok.lit { background: var(--lemon); color: var(--ink); }
.zh-text { font-size: clamp(14px, 2.8cqw, 22px); color: var(--ink-soft); font-weight: 700; line-height: 1.5; }
.book-nav { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; }
.word-pop { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 1.2cqw 3cqw; display: flex; gap: 2cqw; align-items: baseline; font-size: clamp(16px, 3.2cqw, 26px); z-index: 5; }
.quiz-opts { height: 100%; display: flex; flex-direction: column; gap: 2cqw; }
.qopt { flex: 1; padding: 0 3cqw; }
.qopt .lbl { font-size: clamp(18px, 3.8cqw, 32px); text-align: center; }
.slot.letter, .tile.letter { width: 10cqw; height: 11cqw; min-width: 40px; }
@media (orientation: portrait) {
  .book-view { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; }
  .book-pic { grid-row: auto; }
  .slot.letter, .tile.letter { width: 13cqw; height: 14cqw; }
}
/* 15 個頭像：平板一排 8 個，手機一排 5 個 */
.avatars { display: grid; grid-template-columns: repeat(8, 52px); gap: 10px; justify-content: center; }
.av-choice { width: 52px; height: 52px; }
.av-choice img.body { width: 88px; height: 88px; }
.av-choice img.face { width: 86%; height: 86%; margin: auto; }
@media (max-width: 520px) { .avatars { grid-template-columns: repeat(5, 52px); } }

/* L6 文法小教室、填空 */
.gram { height: 100%; display: flex; flex-direction: column; gap: 2.4cqw; }
.gram-rules { margin: 0; padding: 2.6cqw 3cqw 2.6cqw 6cqw; background: #fff; border-radius: 4cqw; box-shadow: 0 1cqw 0 var(--game-edge); font-weight: 700; font-size: clamp(14px, 2.6cqw, 22px); line-height: 1.6; color: var(--ink); }
.gram-rules li { padding: .2em .4em; border-radius: .5em; transition: background .15s; }
.gram-rules li.on { background: var(--lemon); }
.gram-ex { display: grid; gap: 1.6cqw; flex: 1; align-content: start; }
.ex-line { display: flex; flex-direction: column; align-items: flex-start; gap: .3em; padding: 1.8cqw 3cqw; text-align: left; }
.ex-line .en { font-family: var(--en); font-weight: 700; font-size: clamp(18px, 3.4cqw, 30px); }
.ex-line .zh { font-size: clamp(13px, 2.3cqw, 19px); color: var(--ink-soft); font-weight: 700; }
.hl { color: var(--kaki); background: #FFF1CF; padding: 0 .2em; border-radius: .3em; }
.fill { height: 100%; display: flex; flex-direction: column; gap: 2.4cqw; justify-content: center; }
.fill-sent { background: #fff; border-radius: 4cqw; padding: 3.4cqw; box-shadow: 0 1cqw 0 var(--game-edge); font-weight: 700; font-size: clamp(20px, 4.4cqw, 40px); text-align: center; line-height: 1.5; }
.blank { display: inline-block; min-width: 3.5em; border-bottom: .12em dashed var(--kaki); color: var(--ink-soft); margin: 0 .2em; }
.blank.filled { color: var(--kaki); border-bottom-style: solid; }
.fill-zh { text-align: center; font-weight: 700; color: var(--ink-soft); font-size: clamp(15px, 2.8cqw, 24px); }
.fill-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.fopt { padding: 3cqw 1cqw; }
.fopt .lbl { font-size: clamp(18px, 3.6cqw, 32px); }
@media (orientation: portrait) { .fill-opts { grid-template-columns: 1fr; } }

/* 小動畫 */
.anim-ov { position: fixed; inset: 0; z-index: 50; background: #1E2A5E; display: flex; align-items: center; justify-content: center; animation: fadeIn .25s; }
.anim-ov.out { opacity: 0; transition: opacity .25s; }
.anim-stage { position: relative; width: min(100vw, 177.8vh); aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size; background: linear-gradient(#8EDBF7, #6CCDF0 60%, #FFE9C7 60%); }
.anim-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.anim-fallback { position: absolute; inset: 0; }
.anim-sun { position: absolute; right: 8%; top: 9%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: var(--lemon); box-shadow: 0 0 0 2cqw #FFE58A; animation: sunPulse 3s ease-in-out infinite; }
.anim-island { position: absolute; left: 10%; right: 10%; bottom: -14%; height: 46%; border-radius: 50% 50% 0 0; background: #9BDB7E; box-shadow: inset 0 2cqw 0 #B6E89E; }
.anim-kaki { position: absolute; left: 50%; bottom: 10%; height: 62%; transform: translateX(-50%); animation: kakiBob 1.6s ease-in-out infinite; }
.anim-kaki.pop { animation: kakiPop .5s cubic-bezier(.3, 1.6, .5, 1), kakiBob 1.6s ease-in-out .5s infinite; }
.anim-sub { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); max-width: 88%; background: rgba(38, 43, 107, .82); color: #fff; border-radius: 3cqw; padding: 1.2cqw 3cqw; text-align: center; display: flex; flex-direction: column; gap: .2em; }
.anim-sub .en { font-family: var(--en); font-weight: 700; font-size: clamp(18px, 4cqw, 44px); }
.anim-sub .zh { font-size: clamp(13px, 2.2cqw, 22px); font-weight: 700; opacity: .9; }
.anim-skip { position: absolute; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.anim-skip svg { width: 22px; }
.tap-kaki { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; background: rgba(30, 42, 94, .25); }
.tap-kaki img { height: 55%; animation: tapPulse 1s ease-in-out infinite; }
.tap-kaki .en { background: var(--kaki); color: #fff; font-weight: 700; font-size: clamp(20px, 4cqw, 40px); padding: .3em 1em; border-radius: 999px; box-shadow: 0 .8cqw 0 #B83E1E; }
.tap-kaki.jump img { animation: kakiJump .8s ease-out; }
@keyframes kakiBob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3%); } }
@keyframes kakiPop { 0% { transform: translateX(-50%) scale(.6); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes tapPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes kakiJump { 0% { transform: translateY(0); } 40% { transform: translateY(-25%) rotate(-8deg); } 100% { transform: translateY(0); } }
@keyframes sunPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes fadeIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .anim-kaki, .anim-sun, .tap-kaki img { animation: none; } }

.anim-kaki { bottom: 30%; height: 52%; }
@media (orientation: portrait) {
  .anim-stage { width: 100vw; aspect-ratio: 3 / 4; }
  .anim-kaki { height: 44%; bottom: 32%; }
  .anim-island { left: -10%; right: -10%; height: 40%; }
  .anim-sun { width: 20%; }
}
.tap-kaki.over-video { justify-content: flex-end; padding-bottom: 6%; background: transparent; }
.tap-kaki.over-video .en { animation: tapPulse 1s ease-in-out infinite; }
.book-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-title.on-cover { background: rgba(255, 255, 255, .88); border-radius: 3cqw; padding: .2em .6em; left: 8%; right: 8%; z-index: 1; }
.anim-ov.night .anim-stage { background: linear-gradient(#3B3F86, #6A6FB8 60%, #C9B8D9 60%); }
.anim-ov.night .anim-sun { background: #FFF1B8; box-shadow: 0 0 0 2cqw rgba(255, 241, 184, .35); }
.anim-ov.night .anim-island { background: #7FB577; box-shadow: inset 0 2cqw 0 #94C68B; }

/* 記憶遊戲 */
.card.mem { cursor: default; }
.card.glow, .card.mem.glow { box-shadow: 0 0 0 1.2cqw var(--lemon), 0 1cqw 0 1.2cqw var(--lemon-edge); transform: scale(1.04); }
.card.covered { background: #6BCB4F; box-shadow: 0 1cqw 0 #3E9A2C; }
.card.covered > * { visibility: hidden; }
.card.empty { background: #F3F7FA; box-shadow: inset 0 0 0 .6cqw #CFE3EE; }
.card .lbl.q { font-size: clamp(30px, 8cqw, 70px); color: #9BB7C7; }
.mem-area { display: flex; flex-direction: column; gap: 3cqw; }
.mem-area .grid-cards { height: auto; min-height: 0; }
.mem-area .mem-grid { flex: 1.25; }
.mem-area .mem-opts { flex: 1; }
.mem-area .mem-grid:only-child { flex: 0 1 62%; margin-top: 2cqw; }
.card .ord-badge { position: absolute; top: 4%; left: 6%; min-width: 1.6em; height: 1.6em; border-radius: 1em; background: var(--persimmon, #FF6A3D); color: #fff; font-family: var(--en); font-weight: 700; font-size: clamp(16px, 3.4cqw, 28px); display: flex; align-items: center; justify-content: center; }
.card .ord-badge:empty { display: none; }
.card.wrong { animation: shake .4s; }
.cup-table { position: relative; width: 100%; height: 80%; margin: 2% auto 0; }
.cup-slot { position: absolute; top: 0; width: 33.33%; height: 100%; }
.cup-item { position: absolute; left: 14%; right: 14%; bottom: 4%; height: 40%; display: flex; align-items: center; justify-content: center; }
.cup-item .pic { width: 90%; height: 90%; }
.cup { position: absolute; left: 6%; right: 6%; height: 46%; bottom: 50%; border-radius: 18% 18% 8% 8% / 22% 22% 6% 6%; background: linear-gradient(180deg, #FF8A5C, #E5532A); box-shadow: inset 0 -1.2cqw 0 #C8401A, 0 1cqw 0 rgba(0,0,0,.12); transition: bottom .45s cubic-bezier(.3,1.4,.6,1); }
.cup::after { content: ''; position: absolute; left: 12%; right: 12%; top: 14%; height: 10%; border-radius: 99px; background: rgba(255,255,255,.35); }
.cup-table.down .cup { bottom: 1%; }
.cup-table.down .cup-slot.up .cup { bottom: 50%; }
.cup-slot.right .cup-item { filter: drop-shadow(0 0 1.4cqw var(--ok)); }

/* 文法小教室：平板橫放時例句排成三欄，整頁一定放得下 */
.gram { overflow-y: auto; overscroll-behavior: contain; }
.gram .next-step { flex-shrink: 0; min-height: 58px; font-size: 22px; margin-bottom: 1cqw; }
@media (orientation: landscape) {
  .gram-ex { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); flex: 0 0 auto; }
  .gram-ex .ex-line { justify-content: center; }
  .ex-line .en { font-size: clamp(16px, 2.8cqw, 26px); }
  .gram-rules { line-height: 1.45; font-size: clamp(14px, 2.3cqw, 20px); }
}

/* 中文字幕（英文念、中文字幕） */
.zh-cap { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 12px); max-width: min(90vw, 720px); padding: 8px 18px; border-radius: 14px; background: rgba(38, 43, 107, .86); color: #fff; font-size: clamp(16px, 2.4vw, 22px); font-weight: 700; line-height: 1.4; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.zh-cap.show { opacity: 1; transform: translate(-50%, 0); }

/* 帳號與完整版 */
.buy .plan { margin: 4px 0; padding-left: 1.2em; line-height: 1.7; text-align: left; }
.buy .plan li { margin: 2px 0; }
.buy .gbtn { min-height: 46px; display: flex; justify-content: center; margin: 6px 0; }
.buy .acct { margin: 0; }
.linkish { background: none; border: 0; color: var(--sea-deep, #1E88B8); text-decoration: underline; font: inherit; cursor: pointer; padding: 4px; }
.buy .devs { list-style: none; padding: 0; margin: 4px 0 0; }
.buy .dev { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #F3F8FB; margin: 6px 0; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 15px; }

/* 中文字幕預設隱藏：點課程右上角「中」顯示 */
.play .zh, .play .zh-lbl, .play .tip-zh, .play .fill-zh, .play .zh-text, .play .tip-row b small, .zh-cap { display: none !important; }
body.zh-on .play .zh, body.zh-on .play .zh-lbl, body.zh-on .play .tip-zh, body.zh-on .play .fill-zh, body.zh-on .play .tip-row b small { display: block !important; }
body.zh-on .play .zh-lbl { display: inline-block !important; }
body.zh-on .play .zh-text { display: block !important; }
body.zh-on .zh-cap { display: block !important; }
.zh-toggle { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--ink, #262B6B); font-family: var(--zh, inherit); font-weight: 900; font-size: 20px; box-shadow: 0 3px 0 rgba(38,43,107,.18); cursor: pointer; }
.zh-toggle.on { background: var(--lemon, #FFD43B); }

/* ===== 12/7 視覺整理：玩具感、貼紙卡片、標題字 Fredoka（孩子要讀的字仍用 Andika） ===== */
:root { --display: 'Fredoka', 'Huninn', 'Noto Sans TC', sans-serif; }
.btn, .icon-btn, .step-name, .panel h1, .sheet h2, .op-bubble b, .stars-pill span, .island .lv { font-family: var(--display); letter-spacing: .3px; }
.btn { font-weight: 700; }
/* 課程背景：淡淡的天空與雲 */
.play { background:
  radial-gradient(ellipse 38% 14% at 12% 92%, rgba(255,255,255,.75), transparent 70%),
  radial-gradient(ellipse 30% 10% at 88% 86%, rgba(255,255,255,.6), transparent 70%),
  radial-gradient(ellipse 26% 9% at 80% 12%, rgba(255,255,255,.55), transparent 70%),
  linear-gradient(180deg, #E8F8FF 0%, #D4F1FC 60%, #C3EAF9 100%); }
.play-top .icon-btn, .zh-toggle { box-shadow: 0 4px 0 #A9D9EC; }
.progress { height: 20px; background: #fff; box-shadow: inset 0 2px 0 rgba(38,43,107,.08), 0 3px 0 #A9D9EC; padding: 3px; }
.progress i { background: linear-gradient(180deg, #FFE36E 0%, #FFC21A 100%); box-shadow: inset 0 -3px 0 rgba(214,140,0,.25), inset 0 3px 0 rgba(255,255,255,.55); }
.step-name { background: #fff; color: var(--ink); padding: 6px 12px; border-radius: 999px; box-shadow: 0 3px 0 #A9D9EC; font-weight: 600; }
/* 對話泡泡：有尾巴指向 Kaki，指示語用 Fredoka */
.prompt .say { position: relative; border-radius: 4cqw; box-shadow: 0 .8cqw 0 #A9D9EC; }
.prompt .say::before { content: ''; position: absolute; left: -1.8cqw; top: 50%; width: 3.2cqw; height: 3.2cqw; background: #fff; transform: translateY(-50%) rotate(45deg); border-radius: .6cqw; }
.prompt .say > div { position: relative; }
.prompt .say .en { font-family: var(--display); font-weight: 600; letter-spacing: .2px; }
.prompt .say .target, .card .lbl, .card .w, .intro .big-card .w, .speak .w { font-family: var(--en); }
.prompt .say .target { background: linear-gradient(180deg, transparent 62%, #FFE36E 62%); color: #C8401A; padding: 0 .15em; border-radius: .2em; }
.listen-btn { box-shadow: 0 .6cqw 0 #C8401A; }
/* 卡片：白色貼紙＋圖片後面一圈淡色光 */
.card { background: linear-gradient(180deg, #FFFFFF 0%, #F5FBFE 100%); border: .5cqw solid #fff; box-shadow: 0 1cqw 0 #A9D9EC, 0 1.6cqw 2.4cqw rgba(38,43,107,.06); border-radius: 4.4cqw; }
.card .pic { background: radial-gradient(circle at 50% 55%, #FFF4D6 0%, #FFF4D6 45%, transparent 66%); border-radius: 50%; }
.card.right { box-shadow: 0 0 0 1cqw var(--ok), 0 1.6cqw 0 1cqw var(--ok-edge); }
/* 開場泡泡 */
.op-bubble .op-en { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(16px, 2.8cqw, 24px); color: var(--ink); margin-top: .4em; }
@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } }

/* 首頁快捷鍵：小遊戲、發音口型 */
.home .dock { position: absolute; left: max(14px, env(safe-area-inset-left)); top: 96px; display: flex; flex-direction: column; gap: 12px; z-index: 6; }
.dock-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 92px; height: 92px; border-radius: 28px; background: #fff; box-shadow: 0 6px 0 #A9D9EC, 0 10px 18px rgba(38,43,107,.12); font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); transition: transform .08s; }
.dock-btn img { width: 48px; height: 48px; object-fit: contain; }
.dock-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #A9D9EC; }
@media (max-width: 600px) { .home .dock { flex-direction: row; top: auto; left: auto; right: 12px; bottom: 132px; gap: 6px; } .dock-btn { width: 60px; height: 64px; border-radius: 22px; font-size: 12px; } .dock-btn img { width: 32px; height: 32px; } }
/* 小遊戲選單 */
.arcade h2 small, .sound-lib h2 small, .sound-lib h3 small { font-family: var(--display); opacity: .55; font-size: .7em; }
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.arc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 22px; background: #F3FAFE; box-shadow: 0 5px 0 #CDE7F3; }
.arc img { width: 64px; height: 64px; object-fit: contain; }
.arc b { font-size: 18px; }
.arc .en { font-family: var(--display); font-size: 13px; opacity: .6; }
/* 發音口型 */
.sound-lib h3 { margin: 14px 0 8px; font-size: 18px; }
.snd-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.snd-chip { min-width: 58px; height: 58px; padding: 0 14px; border-radius: 18px; background: #FFF4D6; box-shadow: 0 5px 0 #F2D58B; font-weight: 700; font-size: 26px; color: var(--ink); }
.sound-card .sc-head { display: flex; align-items: center; justify-content: space-between; }
.sound-card .sc-label { font-size: 56px; font-weight: 700; color: var(--kaki); line-height: 1; }
.sound-card .sc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: center; margin-top: 8px; }
.sound-card .mouth { width: auto; background: #FFF4EC; border-radius: 22px; padding: 8px; box-shadow: none; }
.sound-card { max-width: 720px; }
.sound-card .tips { gap: 4px; }
.sound-card .tip-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; background: #F3FAFE; border-radius: 14px; font-size: 17px; }
.sound-card .tip-row b { min-width: 4.4em; color: var(--kaki); font-family: var(--display); }
.sound-card .tip-en { display: block; font-family: var(--en); font-weight: 700; }
.sound-card .tip-zh { display: none; font-size: .8em; opacity: .7; }
.sound-card.show-zh .tip-zh { display: block; }
.sound-card .sc-ex { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.sc-word { display: flex; flex-direction: column; align-items: center; width: 96px; padding: 8px; border-radius: 18px; background: #F3FAFE; box-shadow: 0 4px 0 #CDE7F3; }
.sc-word .pic { width: 60px; height: 60px; }
.sc-word .en { font-weight: 700; font-size: 18px; }
@media (max-width: 600px) { .sound-card .sc-body { grid-template-columns: 1fr; } }
.dock-btn.done { background: #FFF4D6; box-shadow: 0 6px 0 #F2D58B, 0 10px 18px rgba(38,43,107,.12); }
.dock-btn.done::after { content: '✓'; position: absolute; top: 6px; right: 10px; color: #3C9A2E; font-weight: 900; }
.dock-btn { position: relative; }
.streak { margin: 0 0 12px; font-weight: 700; color: var(--kaki); }
@media (max-height: 760px) and (min-width: 601px) { .dock-btn { width: 80px; height: 80px; } .dock-btn img { width: 40px; height: 40px; } }
