:root {
  --ink: #2b2d42;
  --soft: #5b5f73;
  --bg: #fff8ec;
  --line: #ead9bb;
  --pri: #ff7a59;
  --pri-d: #d9532f;
  --yellow: #ffd23f;
  --ok: #22c55e;
  --bad: #ef4444;
  --c: var(--pri);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { overscroll-behavior: none; }   /* iPhone / iPad App：長頁可以向下捲，但捲到頂或底不會彈 */
body {
  font-family: "PingFang HK", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Heiti TC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 140px 60px at 12% 8%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 110px 46px at 20% 5%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 160px 64px at 88% 14%, #fff 60%, transparent 62%),
    radial-gradient(circle at 10% 98%, #ffd9e2 0 170px, transparent 171px),
    linear-gradient(180deg, #cdeefe 0%, #e8f6ff 28%, var(--bg) 62%);
  background-attachment: fixed;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  /* 不要在 body 設 overscroll-behavior：body 是捲動框（overflow），設了會令長頁捲不到（捲動傳不到視窗）；放在 html */
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
h1 { font-size: clamp(20px, 5vw, 28px); margin: 0; text-align: center; line-height: 1.3; }
h2 { font-size: 19px; margin: 18px 0 8px; }
small { display: block; font-size: 13px; color: var(--soft); font-weight: 600; }
textarea { font: inherit; }
.emo, .big, .tile-e, .things, .group, .cell, .scene-pic, .t-e, .gg-card, .mbtn span {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.owl { display: block; overflow: visible; }

/* ── 版面 ── */
.screen {
  max-width: 980px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 12px;
}
.screen.center { align-items: center; justify-content: center; text-align: center; gap: 16px; }
.bar { display: flex; align-items: center; gap: 8px; width: 100%; }
.bar h1 { flex: 1; min-width: 0; }
.icon {
  width: 46px; height: 46px; flex: none; border-radius: 50%; border: 3px solid var(--line); border-bottom-width: 5px;
  background: #fff; font-size: 22px; line-height: 1; display: grid; place-items: center; font-weight: 900;
}
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border-radius: 999px;
  background: #fff; border: 3px solid var(--line); font-weight: 800; font-size: 16px; white-space: nowrap;
}
.pill.link { border-bottom-width: 5px; }
.gems { gap: 6px; color: #1565a8; }
.gems .gem { width: 22px; height: 22px; }
.gems.bump { animation: bump .3s; }
.btn {
  border: 0; border-radius: 999px; padding: 13px 26px; font-size: 19px; font-weight: 900; color: #fff;
  background: var(--pri); box-shadow: 0 6px 0 var(--pri-d); transition: transform .08s, box-shadow .08s;
}
.btn.big { font-size: 24px; padding: 16px 40px; }
.btn.alt { background: #3b82f6; box-shadow: 0 6px 0 #1d4ed8; }
.btn.red { background: #ef4444; box-shadow: 0 5px 0 #b91c1c; }
.btn:disabled { background: #c9bfae; box-shadow: 0 6px 0 #a89d89; }
.btn:active:not(:disabled), .mbtn:active, .tile:active, .school:active, .iv:active, .opt:active, .clap:active, .ptool:active, .prow:active { transform: translateY(4px); }
.bubble {
  position: relative; background: #fff; border: 3px solid var(--line); border-radius: 22px;
  padding: 10px 16px; font-size: clamp(17px, 4.4vw, 22px); font-weight: 800; line-height: 1.45;
}
.bubble.wide { max-width: 560px; font-size: 17px; font-weight: 700; }
.lead { font-size: 18px; font-weight: 700; margin: 0; }
.sub { margin: -4px 0 4px; text-align: center; color: var(--soft); font-weight: 700; font-size: 15px; }
.hint-line { color: var(--soft); font-size: 13px; font-weight: 600; text-align: center; margin: 6px 0; line-height: 1.6; }
.big { font-size: clamp(64px, 18vw, 108px); line-height: 1.1; }
.stars { display: inline-flex; gap: 2px; }
.stars i { font-style: normal; color: #e2d6bf; font-size: 18px; }
.stars i.on { color: #f5b301; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.top-right { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 16px; }
.card { background: #fffdf8; border: 3px solid var(--line); border-radius: 24px; padding: 16px; }
.card h2:first-child { margin-top: 0; }
.mid-owl { width: min(48vw, 210px); }

/* ── 主頁 ── */
.home { justify-content: center; }
.home-top { display: flex; justify-content: space-between; align-items: center; }
.home-main { flex: 1; display: grid; gap: 18px; align-content: center; }
.home-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.logo-top { display: flex; justify-content: center; gap: 2px; font-size: clamp(42px, 13vw, 84px); font-weight: 900; letter-spacing: -1px; line-height: 1; }
.logo-top span {
  display: inline-block; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink); animation: bob 2.4s ease-in-out calc(var(--i) * .12s) infinite;
}
.logo-top span:nth-child(5n+1) { color: #ff7a59; }
.logo-top span:nth-child(5n+2) { color: #ffd23f; }
.logo-top span:nth-child(5n+3) { color: #4ade80; }
.logo-top span:nth-child(5n+4) { color: #60a5fa; }
.logo-top span:nth-child(5n+5) { color: #c084fc; }
.logo-sub { display: inline-block; margin-top: 10px; padding: 5px 22px; border-radius: 999px; background: var(--ink); color: #fff; font-size: clamp(17px, 4.6vw, 24px); font-weight: 900; letter-spacing: .2em; text-indent: .2em; }
.hero { display: flex; align-items: center; gap: 4px; }
.hero-owl { width: clamp(120px, 32vw, 180px); animation: bob 2.6s ease-in-out infinite; }
.menu { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 440px; margin: 0 auto; }
.mrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 14px; border: 0; border-radius: 999px;
  font-size: 19px; font-weight: 900; letter-spacing: .06em; color: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .22);
}
.mbtn span { font-size: 1.1em; letter-spacing: 0; }
.mbtn.big { font-size: 26px; padding: 16px; }
.mbtn.red { background: linear-gradient(#ff6b5b, #ef4444); }
.mbtn.purple { background: linear-gradient(#a78bfa, #7c3aed); }
.mbtn.orange { background: linear-gradient(#fdba4d, #f08c00); }
.mbtn.teal { background: linear-gradient(#2dd4bf, #0d9488); }
.mbtn.plain { background: #fff; color: #4338ca; border: 3px solid #c7d2fe; box-shadow: 0 5px 0 #a5b4fc; }

/* ── 學校地圖 ── */
.zone { display: flex; align-items: baseline; gap: 10px; color: var(--ink); border-bottom: 4px solid var(--c); padding-bottom: 4px; }
.zone small { font-size: 13px; color: var(--c); letter-spacing: 2px; }
.path { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.school {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; min-width: 0;
  background: #fff; border: 3px solid var(--c); border-bottom-width: 7px; border-radius: 22px;
}
.school.locked { border-color: var(--line); background: #f6efe1; opacity: .7; }
.school-n { width: 50px; height: 50px; flex: none; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.locked .school-n { background: #e2d6bf; }
.school-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.school-b b { font-size: 17px; line-height: 1.3; }
.meter { height: 9px; border-radius: 99px; background: #f1e7d3; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.offer { flex: none; font-size: 12px; font-weight: 900; text-align: center; color: var(--bad); line-height: 1.3; transform: rotate(8deg); }

/* ── 學校 ── */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 4px 10px; min-width: 0;
  background: #fff; border: 3px solid var(--c); border-bottom-width: 7px; border-radius: 22px; text-align: center;
}
.dim-ic {
  width: 56px; height: 56px; border-radius: 18px; background: var(--c); color: #fff; display: grid; place-items: center;
  font-size: 24px; font-weight: 900; font-family: "Arial Rounded MT Bold", "PingFang HK", "Microsoft JhengHei", sans-serif;
}
.dim-ic.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; flex: none; }
.tile b { font-size: clamp(16px, 4vw, 20px); }
.tile small { font-size: clamp(11px, 3vw, 13px); min-height: 2.6em; line-height: 1.3; }
.iv {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-align: left; margin-top: 4px;
  background: var(--c); color: #fff; border: 0; border-radius: 26px; box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 70%, #000);
}
.iv b { font-size: 22px; }
.iv small { color: #fff; font-size: 14px; }
.iv-e { font-size: 40px; }
.iv.locked { background: #e9dfcc; color: var(--soft); box-shadow: 0 7px 0 #d6c9ae; }
.iv.locked small { color: var(--soft); }

/* ── 遊戲 ── */
.game { gap: 8px; }
.prog { flex: 1; height: 14px; border-radius: 99px; background: #fff; border: 3px solid var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--c); transition: width .4s; }
.streak { font-weight: 900; color: #ea580c; min-width: 0; }
.prompt { display: flex; align-items: center; gap: 6px; }
.ava { width: 70px; flex: none; }
.ava.jump { animation: jump .45s; }
.prompt .bubble { flex: 1; border-color: var(--c); }
.play { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.stim { flex: 1; min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.opts { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 10px; width: 100%; max-width: calc(var(--cols, 3) * 150px); margin: 0 auto; }
.opts.words, .opts.rows { max-width: 580px; }
.opts.one { display: flex; justify-content: center; max-width: none; }
.opts.hide { visibility: hidden; }
.opt {
  position: relative; container-type: inline-size; aspect-ratio: 1; min-width: 0; padding: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 3px solid var(--line); border-bottom-width: 7px; border-radius: 20px;
}
.opt .emo { font-size: 40px; font-size: 54cqw; line-height: 1.1; }
.opt .num { font-size: 34px; font-size: 44cqw; font-weight: 900; }
.opt .letter, .letter { font-weight: 900; font-family: "Arial Rounded MT Bold", "Comic Sans MS", "Segoe UI", sans-serif; }
.opt .letter { font-size: 40px; font-size: 52cqw; }
.opt .group { font-size: 18px; font-size: 22cqw; line-height: 1.2; word-break: break-all; padding: 0 4cqw; }
.opt .shape { height: auto; }
.opt .bead { width: 70cqw; height: 70cqw; font-size: 38cqw; }
.opts.words .opt, .opts.rows .opt { aspect-ratio: auto; min-height: 62px; padding: 10px 8px; }
.word { font-size: clamp(18px, 5vw, 26px); font-weight: 900; }
.opts.cards .opt { aspect-ratio: auto; flex-direction: column; gap: 4px; padding: 12px 6px; }
.opts.cards .emo { font-size: 44px; font-size: min(38cqw, 72px); }
.cap { font-size: clamp(14px, 3.8vw, 19px); font-weight: 800; line-height: 1.25; }
.opts.rows .opt { justify-content: flex-start; gap: 12px; padding: 12px 14px; }
.lbl { font-size: 22px; font-weight: 900; width: 1.2em; flex: none; }
.pencil { position: relative; height: 22px; border-radius: 6px 0 0 6px; background: var(--c); border: 3px solid var(--ink); border-right: 0; margin-right: 22px; }
.pencil::after { content: ""; position: absolute; left: 100%; top: -3px; border: 11px solid transparent; border-left: 20px solid var(--ink); }
.opt.right { border-color: var(--ok); background: #dcfce7; }
.opt.wrong { border-color: var(--bad); background: #fee2e2; animation: shake .4s; }
.opt.hint { border-color: #f59e0b; animation: pulse .9s infinite; }
.opt.reveal { border-color: var(--ok); border-style: dashed; }
.badge { position: absolute; top: 5px; left: 5px; padding: 2px 9px; border-radius: 99px; background: var(--ok); color: #fff; font-size: 13px; font-weight: 900; }
.badge:empty { display: none; }
.fb { position: fixed; inset: 0; display: grid; place-items: center; font-size: 140px; pointer-events: none; opacity: 0; z-index: 20; }
.fb.show { animation: flash 1s ease-out; }

/* 泡泡、氣球、翻牌 */
.opts.bubbles { gap: 18px; }
.opts.bubbles .opt {
  border-radius: 50%; border: 3px solid #fff; color: #0b4f7c;
  background: radial-gradient(circle at 32% 28%, #fff 0 12%, #d9f1ff 30%, #8fd3fb 75%, #5bb8ef);
  box-shadow: 0 6px 16px rgba(30, 110, 170, .25); animation: floaty 3s ease-in-out var(--d) infinite;
}
.opts.balloon { gap: 16px 18px; padding-bottom: 18px; }
.opts.balloon .opt {
  border: 0; border-radius: 50% 50% 46% 46%; color: #fff; overflow: visible;
  box-shadow: inset -8px -10px 0 rgba(0, 0, 0, .12); animation: floaty 3.4s ease-in-out var(--d) infinite;
}
.opts.balloon .opt::after { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 16px; background: #9a8f7a; }
.opts.balloon .opt:nth-child(5n+1) { background: #ef4444; }
.opts.balloon .opt:nth-child(5n+2) { background: #3b82f6; }
.opts.balloon .opt:nth-child(5n+3) { background: #16a34a; }
.opts.balloon .opt:nth-child(5n+4) { background: #a855f7; }
.opts.balloon .opt:nth-child(5n+5) { background: #ea580c; }
.opts.balloon .opt.wrong, .opts.bubbles .opt.wrong { background: #fee2e2; color: var(--bad); }
.opt.popped { animation: popout .35s forwards !important; pointer-events: none; }
.slots { display: flex; gap: 8px; }
.slot { width: 52px; height: 60px; border-bottom: 5px solid var(--ink); display: grid; place-items: end center; font-size: 42px; font-weight: 900; font-family: "Arial Rounded MT Bold", "Comic Sans MS", sans-serif; }
.slot.on { color: #1d4ed8; animation: pop .3s; }
.opts.pairs { max-width: calc(var(--cols) * 130px); }
.opt.flip { background: linear-gradient(135deg, #ff7a59, #ffb020); border-color: #e8603f; }
.opt.flip .front { display: none; }
.opt.flip .back { font-size: 40px; font-size: 50cqw; font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.opt.flip.up, .opt.flip.right { background: #fff; border-color: var(--line); animation: flipin .25s; }
.opt.flip.right { background: #dcfce7; border-color: var(--ok); }
.opt.flip.up .back, .opt.flip.right .back { display: none; }
.opt.flip.up .front, .opt.flip.right .front { display: flex; align-items: center; justify-content: center; }
.opt.flip .word { font-size: 20px; font-size: 24cqw; }

/* 題目圖像 */
.wordbig { font-size: clamp(52px, 15vw, 92px); font-weight: 900; letter-spacing: .05em; }
.sentence { font-size: clamp(19px, 5vw, 27px); font-weight: 800; line-height: 1.5; max-width: 640px; }
.sentence u { text-decoration-thickness: 3px; text-underline-offset: 6px; }
.sentence.en { font-family: "Arial Rounded MT Bold", "Segoe UI", sans-serif; }
.note { font-size: 14px; font-weight: 700; color: var(--soft); }
.frame { background: #fff; border: 3px dashed var(--c); border-radius: 16px; padding: 8px 16px; font-size: clamp(17px, 4.6vw, 22px); font-weight: 800; }
.seq { display: flex; align-items: flex-end; gap: 5px; }
.loco { font-size: clamp(34px, 10vw, 60px); line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.car { width: clamp(44px, 12vw, 80px); aspect-ratio: 1; display: grid; place-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 12px; font-size: clamp(18px, 5vw, 32px); font-weight: 900; }
.car.q, .num.q { background: var(--yellow); border: 3px dashed var(--ink); border-radius: 12px; }
.num.q { padding: 0 14px; }
.things { font-size: clamp(30px, 9vw, 52px); line-height: 1.25; max-width: 6.5em; word-break: break-all; }
.things .gone { opacity: .25; text-decoration: line-through; text-decoration-color: var(--bad); }
.eq { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(26px, 7.5vw, 44px); }
.eq .group { max-width: 3.6em; word-break: break-all; line-height: 1.2; }
.eqn { font-size: clamp(28px, 8vw, 44px); font-weight: 900; }
.eqn.xl { font-size: clamp(44px, 13vw, 76px); }
.pat { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; font-size: clamp(24px, 7vw, 46px); }
.pat .q { background: var(--yellow); border: 3px dashed var(--ink); border-radius: 12px; padding: 2px; }
.mrow { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(30px, 8.5vw, 48px); font-weight: 900; }
.arrow { color: var(--c); font-size: .7em; font-weight: 900; }
.mirror { width: 1.5em; height: 1.9em; display: grid; place-items: center; border-radius: 50%; border: 5px solid #f5b301; background: linear-gradient(135deg, #e0f2fe, #c7d2fe); font-size: .8em; }
.balance { display: flex; align-items: flex-end; gap: 10px; }
.pan { display: flex; gap: 6px; align-items: center; justify-content: center; min-width: 110px; padding: 8px 10px; border-bottom: 6px solid var(--ink); border-radius: 0 0 22px 22px; font-size: clamp(38px, 10.5vw, 56px); }
.blk { display: grid; place-items: center; width: 1.3em; height: 1.3em; background: #bae6fd; border: 3px solid var(--ink); border-radius: 10px; font-weight: 900; font-size: .8em; }
.pivot { font-size: 40px; text-align: center; }
.shirts { display: flex; gap: 12px; }
.shirts div { display: flex; flex-direction: column; align-items: center; font-weight: 800; }
.shirt { width: clamp(70px, 20vw, 100px); }
.clues { margin: 0; padding: 10px 14px 10px 30px; text-align: left; background: #fff; border: 3px solid var(--line); border-radius: 16px; font-size: clamp(16px, 4.3vw, 20px); font-weight: 700; line-height: 1.6; }
.shelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; background: #fff; border: 3px solid var(--line); border-radius: 16px; }
.item .emo { font-size: clamp(34px, 9vw, 48px); line-height: 1.1; }
.price { padding: 1px 12px; border-radius: 99px; background: var(--yellow); font-weight: 900; font-size: 18px; }
.wallet { padding: 6px 18px; border-radius: 99px; background: #dcfce7; border: 3px solid var(--ok); font-weight: 900; font-size: 20px; }
.scene-label { font-size: 14px; font-weight: 800; color: var(--soft); }
.scene { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; padding: 8px; background: #e0f2fe; border: 3px dashed #7dd3fc; border-radius: 18px; }
.cell { width: clamp(42px, 12vw, 64px); aspect-ratio: 1; display: grid; place-items: center; background: #fff; border-radius: 12px; font-size: clamp(24px, 7.5vw, 40px); }
.memrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: clamp(30px, 8.5vw, 62px); }
.preview { display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 16px 18px; background: #fff; border: 3px solid var(--c); border-radius: 22px; }
.timer { width: 100%; min-width: 200px; height: 10px; border-radius: 99px; background: #f1e7d3; overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--c); animation: drain linear forwards; }
.bead { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--c); color: #fff; font-weight: 900; font-size: .75em; border: 3px solid var(--ink); }
.tale { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 16px; max-width: 600px; text-align: left; background: #fff; border: 3px solid var(--line); border-radius: 18px; font-size: clamp(16px, 4.3vw, 19px); font-weight: 600; line-height: 1.7; }
.tale.en { font-size: clamp(18px, 4.8vw, 22px); }
.tale .emo { font-size: 44px; line-height: 1; }
.tale em { font-style: normal; font-weight: 900; color: #c2410c; }
.panels { display: flex; gap: 8px; }
.panels div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; background: #fff; border: 3px solid var(--line); border-radius: 16px; font-weight: 900; color: #c2410c; }
.panels .emo { font-size: clamp(40px, 12vw, 64px); }

/* 反應遊戲 */
.gg { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gg-card { width: min(52vw, 220px); aspect-ratio: 1; display: grid; place-items: center; background: #fff; border: 4px solid var(--line); border-radius: 30px; }
.gg-card.pop { animation: pop .25s ease-out; border-color: var(--c); }
.gg-card .emo { font-size: min(28vw, 116px); }
.gg-card .num { font-size: min(26vw, 106px); font-weight: 900; }
.ready { font-size: 26px; font-weight: 900; color: var(--soft); }
.light { width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--c); border: 6px solid var(--ink); box-shadow: inset 0 -14px 0 rgba(0, 0, 0, .15); }
.gg-mark { height: 44px; font-size: 34px; }
.clap { width: min(44vw, 170px); aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--yellow); box-shadow: 0 9px 0 #d4a60f; font-size: min(20vw, 80px); }
.clap:active { box-shadow: 0 3px 0 #d4a60f; transform: translateY(6px); }
.clap:disabled { opacity: .45; }

/* ── 結果、錄取通知書 ── */
.result-stars .stars i { font-size: 60px; animation: pop .5s backwards; }
.result-stars .stars i:nth-child(2) { animation-delay: .2s; }
.result-stars .stars i:nth-child(3) { animation-delay: .4s; }
.offer-letter { position: relative; width: min(100%, 380px); padding: 18px 22px 34px; background: #fffdf6; border: 5px double #e8603f; border-radius: 18px; box-shadow: 0 10px 0 rgba(0, 0, 0, .08); }
.letter-owl { width: 120px; margin: 0 auto; }
.offer-letter h2 { margin: 4px 0 10px; font-size: 30px; letter-spacing: .2em; color: #c2410c; }
.offer-letter p { margin: 4px 0; font-size: 18px; font-weight: 700; }
.offer-letter .letter-name { font-size: 24px; font-weight: 900; line-height: 1.35; }
.stamp { position: absolute; right: 16px; bottom: 14px; padding: 4px 14px; border: 4px solid var(--bad); border-radius: 10px; color: var(--bad); font-size: 22px; font-weight: 900; transform: rotate(-14deg); opacity: .85; }
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.confetti i { position: absolute; top: -40px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear infinite; }
.gate { display: flex; gap: 14px; }
.fly-gem { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; z-index: 95; filter: drop-shadow(0 3px 4px rgba(21, 101, 168, .35)); }
.fly-gem .gem { width: 100%; height: 100%; }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border: 3px solid #f5b301; border-radius: 20px; box-shadow: 0 10px 24px rgba(0, 0, 0, .15); font-weight: 700; animation: drop .4s; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translate(-50%, -20px); }
.toast-e { font-size: 36px; }

/* ── 六維評估、成績表 ── */
.dim-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; background: #fff; border: 2px solid var(--line); border-radius: 99px; font-weight: 800; font-size: 15px; }
.chip b { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 99px; background: var(--c); color: #fff; font-size: 13px; }
.report { display: grid; gap: 12px; }
.radar-card { display: flex; justify-content: center; }
.radar { width: 100%; max-width: 340px; height: auto; }
.radar .rl { font-size: 15px; font-weight: 800; fill: var(--ink); }
.radar .rv { font-size: 14px; font-weight: 700; fill: var(--soft); }
.sbars { display: flex; flex-direction: column; gap: 12px; }
.sbar { display: grid; grid-template-columns: 7.5em 1fr 2.6em 3.6em; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.sb-track { height: 14px; border-radius: 99px; background: #f1e7d3; overflow: hidden; }
.sb-track i { display: block; height: 100%; border-radius: 99px; }
.sb-val { text-align: right; font-weight: 900; }
.sb-band { font-size: 13px; color: var(--soft); }
.advice { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; }
.advice p { margin: 4px 0 0; line-height: 1.6; font-weight: 500; }
details summary { cursor: pointer; font-weight: 800; color: #1d4ed8; margin-top: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 26px; }
.stat span { font-size: 13px; font-weight: 700; color: var(--soft); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-weight: 700; }
.hist { display: flex; flex-direction: column; gap: 6px; }
.hrow { display: flex; justify-content: space-between; padding: 10px 14px; background: #fff; border: 2px solid var(--line); border-radius: 14px; font-weight: 700; }
.hrow.on { border-color: #e8603f; }

/* ── 商店、獎盃 ── */
.shop { display: grid; gap: 12px; }
.shop-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.shop-owl { width: min(56vw, 230px); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: #fff; border: 3px solid var(--line); border-radius: 18px; }
.swatch.picked { border-color: #e8603f; box-shadow: 0 0 0 3px #ffd7c9; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ink); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; text-align: center; background: #f3ece0; border: 3px solid var(--line); border-radius: 20px; opacity: .7; }
.trophy.got { background: #fff; border-color: #f5b301; opacity: 1; }
.t-e { font-size: 44px; }

/* ── 設定 ── */
.set { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 2px solid #f3ead9; font-weight: 800; }
.set:last-child { border-bottom: 0; }
.set div { display: flex; gap: 4px; flex: none; }
.seg { padding: 7px 14px; border-radius: 99px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 15px; }
.seg.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg.danger { border-color: var(--bad); color: var(--bad); }

/* ── 家長工具 ── */
.ptools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ptool { display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; background: #fffdf8; border: 3px solid var(--line); border-bottom-width: 6px; border-radius: 22px; }
.ptool b { font-size: 20px; }
.pt-ic { width: 60px; height: 60px; flex: none; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 900; }
.tabs { display: flex; gap: 8px; }
.tabs.scroll { overflow-x: auto; padding-bottom: 4px; }
.tab { flex: none; padding: 9px 16px; border-radius: 99px; border: 3px solid var(--line); background: #fff; font-weight: 800; }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; text-align: left; background: #fffdf8; border: 2px solid var(--line); border-radius: 18px; }
.prow b { font-size: 17px; }
.row-meta { font-size: 13px; font-weight: 700; color: var(--soft); }
.rate-t.r1 { color: #b91c1c; } .rate-t.r2 { color: #b45309; } .rate-t.r3 { color: #15803d; } .rate-t.r4 { color: #1d4ed8; }
.qcard { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.tag { padding: 3px 12px; border-radius: 99px; background: #fff1c7; border: 2px solid #f5d27a; color: #92400e; font-weight: 800; font-size: 14px; }
.qbig { margin: 0; font-size: clamp(22px, 5.5vw, 32px); line-height: 1.4; }
.passage { margin: 0; font-size: clamp(20px, 5vw, 28px); line-height: 1.9; font-weight: 600; letter-spacing: .04em; }
.passage.en { letter-spacing: 0; font-family: "Arial Rounded MT Bold", "Segoe UI", sans-serif; line-height: 1.7; }
.tip { width: 100%; padding: 10px 14px; border-radius: 16px; background: #eef6ff; border: 2px solid #c7ddfb; }
.tip p, .tip ul { margin: 6px 0 0; line-height: 1.6; font-weight: 500; }
.tip ul { padding-left: 20px; }
.frame-tip { background: #fff7ed; border-color: #fed7aa; }
.recbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.recbar audio { height: 40px; max-width: 100%; }
.rec-dot { color: var(--bad); font-weight: 900; animation: blink 1s infinite; }
.pctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; justify-content: space-between; }
.pbar { display: inline-flex; align-items: center; gap: 12px; padding: 5px; border-radius: 99px; background: #fff1c7; border: 2px solid #f5d27a; font-weight: 800; }
.pbar button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #f5d27a; background: #fff; font-size: 20px; font-weight: 900; color: #b45309; }
.pbar b { color: #b45309; font-size: 20px; }
.rate { padding: 8px 16px; border-radius: 99px; border: 2px solid var(--line); background: #fff; font-weight: 800; }
.rate.r1 { color: #b91c1c; border-color: #fca5a5; } .rate.r2 { color: #b45309; border-color: #fcd34d; }
.rate.r3 { color: #15803d; border-color: #86efac; } .rate.r4 { color: #1d4ed8; border-color: #93c5fd; }
.note-l { width: 100%; display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.note-l textarea { width: 100%; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff; resize: vertical; font-weight: 500; user-select: text; -webkit-user-select: text; }
.scene-pic { align-self: center; display: flex; flex-direction: column; gap: 6px; padding: 16px 22px; border-radius: 22px; background: linear-gradient(#d6f0ff, #f1fbe9); border: 3px solid #bfe3f7; }
.scene-pic div { display: flex; justify-content: center; gap: 10px; }
.scene-pic span { font-size: clamp(34px, 9vw, 54px); }
.story-tool { max-width: 640px; }

/* ── 遊戲樂園 ── */
.mbtn.green { background: linear-gradient(#4ade80, #16a34a); }
.arcade { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.arc-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px; text-align: center; background: #fff; border: 4px solid var(--c); border-bottom-width: 9px; border-radius: 28px; }
.arc-card b { font-size: 26px; }
.arc-e { font-size: 64px; line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lvl { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; background: #fff; border: 3px solid var(--c); border-bottom-width: 7px; border-radius: 22px; }
.lvl.locked { border-color: var(--line); background: #f6efe1; opacity: .7; }
.lvl-n { width: 48px; height: 48px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.lvl.locked .lvl-n { background: #e2d6bf; }
.opts.none { display: none; }

/* 找不同 */
.spot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.spot-pic { position: relative; container-type: inline-size; width: min(100%, 520px); aspect-ratio: 4 / 3; border: 4px solid var(--ink); border-radius: 18px; overflow: hidden; touch-action: manipulation; cursor: pointer; }
.spot-pic + .spot-pic { margin-top: 2px; }
.th-park { background: linear-gradient(#bfe8ff 0 40%, #a5e37f 40%); }
.th-beach { background: linear-gradient(#bfe8ff 0 26%, #5bc0eb 26% 42%, #f6e3a1 42%); }
.th-farm { background: linear-gradient(#cdeefe 0 40%, #cfe8a2 40%); }
.th-room { background: linear-gradient(#ffe9d6 0 42%, #d9b38c 42%); }
.th-space { background: radial-gradient(circle at 70% 30%, #4338ca, #1e1b4b 70%); }
.si { position: absolute; transform: translate(-50%, -50%); line-height: 1; pointer-events: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ring { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 5px solid #ef4444; border-radius: 50%; pointer-events: none; animation: pop .3s; }
.ring.hint { border-color: #f59e0b; border-style: dashed; animation: pulse .9s infinite; }
.x-mark { position: absolute; transform: translate(-50%, -50%); color: #ef4444; font-size: 34px; font-weight: 900; pointer-events: none; text-shadow: 0 0 4px #fff; }
.spot-count { padding: 4px 14px; border-radius: 99px; background: #fff; border: 3px solid var(--c); font-weight: 900; }

/* 迷宮 */
.maze { position: relative; display: grid; grid-template-columns: repeat(var(--w), 1fr); width: min(92vw, 460px, 62vh); aspect-ratio: 1; background: #fffdf5; border: 5px solid var(--ink); border-radius: 10px; touch-action: none; }
.mc { position: relative; display: grid; place-items: center; border: 0 solid var(--ink); }
.mc.wn { border-top-width: 3px; } .mc.ws { border-bottom-width: 3px; } .mc.ww { border-left-width: 3px; } .mc.we { border-right-width: 3px; }
.mc.trail { background: #ffe8b0; }
.goal { font-size: calc(min(92vw, 460px, 62vh) / var(--w) * .62); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.mw { position: relative; z-index: 1; padding: 1px 4px; border-radius: 6px; background: #fff; border: 2px solid #c7d2fe; font-size: clamp(12px, calc(min(92vw, 460px, 62vh) / var(--w) * .3), 20px); font-weight: 900; line-height: 1.2; }
.mc.got .mw { border-color: var(--ok); background: #dcfce7; }
.mc.bad .mw { border-color: var(--bad); background: #fee2e2; animation: shake .4s; }
.token { position: absolute; left: 0; top: 0; width: calc(100% / var(--w)); height: calc(100% / var(--w)); padding: 4%; z-index: 2; transition: transform .14s ease-out; pointer-events: none; }
.token .owl { width: 100%; height: 100%; }
.token.bump { animation: shake .3s; }
.pad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 50px); gap: 6px; justify-content: center; }
.pad-b { border: 0; border-radius: 14px; background: var(--c); color: #fff; font-size: 22px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.pad-up { grid-column: 2; } .pad-left { grid-column: 1; grid-row: 2; } .pad-down { grid-column: 2; grid-row: 2; } .pad-right { grid-column: 3; grid-row: 2; }

/* 閱讀理解 */
.passage-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 640px; padding: 14px 18px; background: #fff; border: 3px solid var(--line); border-radius: 18px; text-align: left; }
.passage-card p { margin: 0; font-size: clamp(18px, 4.8vw, 23px); line-height: 1.85; font-weight: 600; letter-spacing: .03em; }
.passage-card.en p { letter-spacing: 0; font-family: "Arial Rounded MT Bold", "Segoe UI", sans-serif; line-height: 1.6; }
.read-s { font-size: clamp(26px, 7vw, 40px); }

/* ── 圖示、圖片 ── */
.ic { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.ic.gold { color: #f5b301; }
.icon .ic { width: 24px; height: 24px; }
.mbtn .ic { width: 1.15em; height: 1.15em; }
.emo.pic { display: inline-block; line-height: 0; }
.pic img { width: 1.25em; height: 1.25em; object-fit: contain; display: inline-block; vertical-align: middle; -webkit-user-drag: none; }
.pic .fb-e { display: none; line-height: 1.1; }
.pic.noimg img { display: none; }
.pic.noimg .fb-e { display: inline; }
.scn { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #f6efe1; }
.scn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scn .fb-e { display: none; position: absolute; inset: 0; place-items: center; font-size: clamp(30px, 12vw, 64px); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.scn.noimg img { display: none; }
.scn.noimg .fb-e { display: grid; }
.opts.cards .scn .fb-e { font-size: 34px; font-size: min(30cqw, 60px); }
.scene-box { width: min(78vw, 380px); }
.tale .scn { max-width: 300px; margin: 0 auto; }
.panels div { width: min(28vw, 150px); }
.panels .scn .fb-e { font-size: clamp(28px, 9vw, 48px); }
.scene-pic { width: min(100%, 560px); align-self: center; padding: 0; background: none; border: 0; }
.scene-rows { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: clamp(30px, 8vw, 48px); }
.spot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-pic.noimg .spot-bg { display: none; }
.wbg { position: absolute; inset: 0; display: block; }
.wbg img { width: 100%; height: 100%; object-fit: cover; }
.wbg.noimg img { display: none; }
.fb-ic { display: grid; place-items: center; width: 160px; height: 160px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }
.fb-ic .ic { width: 100%; height: 100%; }
.fb-ic.star { color: #f5b301; }
.fb-ic.heart { color: #f472b6; }
.think-ic { font-size: 84px; color: #f5b301; }
.big-ic { font-size: 72px; color: var(--soft); }
.ic-big { font-size: 38cqw; line-height: 1; display: grid; }
.ic-big.gold { color: #f5b301; } .ic-big.blue { color: #2563eb; } .ic-big.red { color: #ef4444; } .ic-big.green { color: #16a34a; }
.streak { display: inline-flex; align-items: center; gap: 2px; }
.streak .ic { color: #ea580c; }
.lvchip { padding: 3px 10px; border-radius: 99px; background: var(--c); color: #fff; font-size: 13px; font-weight: 900; white-space: nowrap; }
.lvchip:empty { display: none; }
.gg-mark .ok { color: var(--ok); } .gg-mark .no { color: var(--bad); } .gg-mark .slow { font-size: 20px; font-weight: 900; color: #b45309; }
.gg-mark .ic { width: 40px; height: 40px; }
.clap { color: #92400e; }
.clap .ic { width: 55%; height: 55%; }
.x-mark { width: 36px; height: 36px; display: grid; }
.x-mark .ic { width: 100%; height: 100%; }
.slots.wordslots { flex-wrap: wrap; justify-content: center; max-width: 620px; }
.wordslots .slot { width: auto; min-width: 64px; height: 52px; padding: 0 8px; font-size: clamp(19px, 5vw, 27px); font-family: inherit; }
.note .ic { color: var(--soft); }
.arc-e .ic { width: 64px; height: 64px; color: var(--c); }
.lvl-n .ic { width: 22px; height: 22px; }
.t-e .ic, .t-e .gem { width: 46px; height: 46px; }
.trophy.got .t-e { color: #f5b301; }
.trophy .t-e { color: #b8ab92; }
.toast .ic { width: 36px; height: 36px; }
.stat span .ic { color: #f5b301; }
.chip b .ic { width: 16px; height: 16px; }
.dim-ic .ic { width: 58%; height: 58%; }
.lead .gem, .pill .gem, small .gem, .btn .gem { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.result-stars + h1 + .lead.up, .lead.up { color: #7c3aed; }

/* ── 主頁新增 ── */
.grow { flex: 1; }
.home-top { gap: 8px; }
.lvbadge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: #fff; border: 3px solid var(--line); border-radius: 99px; font-weight: 900; font-size: 15px; white-space: nowrap; }
.lvbar { width: 52px; height: 8px; background: #f1e7d3; border-radius: 99px; overflow: hidden; }
.lvbar i { display: block; height: 100%; background: #a855f7; border-radius: 99px; }
.gacha-fab { position: fixed; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border: 0; border-radius: 20px; background: linear-gradient(#f472b6, #db2777); color: #fff; font-weight: 900; font-size: 13px; box-shadow: 0 6px 0 #9d174d; animation: pulse 1.4s infinite; }
.gacha-fab .ic { width: 34px; height: 34px; }

/* ── 程度選擇 ── */
.onboard { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 560px; margin: 0 auto; }
.pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px 10px 10px; text-align: left; background: #fff; border: 3px solid var(--c, var(--line)); border-bottom-width: 6px; border-radius: 20px; }
.pick .wbg { position: relative; width: 70px; height: 70px; border-radius: 14px; overflow: hidden; flex: none; }
.pick b { display: block; font-size: 18px; }
.pick > .ic:last-child { margin-left: auto; color: var(--soft); }
.pick.alt { border-color: #c7d2fe; }
.pick-ic { width: 70px; height: 70px; padding: 18px; border-radius: 14px; background: #eef2ff; color: #4338ca; }

/* ── 選擇世界 ── */
.worlds { display: grid; grid-auto-flow: column; grid-auto-columns: min(80vw, 300px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 16px; }
.wcard { position: relative; scroll-snap-align: center; min-height: 440px; border-radius: 26px; overflow: hidden; border: 4px solid var(--c); box-shadow: 0 8px 0 rgba(0, 0, 0, .12); }
.wdeco { position: absolute; top: 24px; left: 0; right: 0; display: flex; justify-content: space-around; font-size: 58px; }
.winfo { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 14px; background: rgba(255, 255, 255, .94); border-radius: 18px; display: flex; flex-direction: column; gap: 6px; }
.wnum { font-size: 13px; font-weight: 900; color: var(--c); }
.winfo b { font-size: 24px; }
.wprog { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 14px; }
.wprog .ic { color: #f5b301; }
.wcard.locked .wbg, .wcard.locked .wdeco { filter: grayscale(.75); opacity: .8; }
.wlock { font-weight: 800; color: var(--soft); font-size: 14px; }
.winfo .btn { font-size: 17px; padding: 10px 18px; }

/* ── 闖關地圖 ── */
.wmap-screen { max-width: 640px; gap: 8px; }
.wmap { position: relative; width: 100%; border-radius: 26px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.wmap-img { position: absolute; inset: 0; }
.wmap-img { background-size: 100% auto; background-repeat: repeat-y; }
.wpath { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.wpath path { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 22; vector-effect: non-scaling-stroke; }
.mdeco { position: absolute; transform: translate(-50%, -50%); font-size: 42px; z-index: 1; pointer-events: none; }
.node { position: absolute; transform: translate(-50%, -50%); width: 62px; height: 62px; padding: 0; border-radius: 50%; border: 4px solid #fff; background: var(--c, #94a3b8); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0, 0, 0, .22); z-index: 2; }
.node:active { transform: translate(-50%, -46%); }
.node .nn { font-size: 22px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.node .ic { width: 28px; height: 28px; }
.node.locked { background: #cbd5e1; color: #64748b; }
.node.cur { animation: nodePulse 1.2s infinite; }
.nstars { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 1px; white-space: nowrap; line-height: 1; }
.nstars .stars i { font-size: 15px; text-shadow: 0 1px 0 #fff, 0 -1px 0 #fff; }
.ndim { position: absolute; top: calc(100% + 17px); left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 12px; font-weight: 900; white-space: nowrap; }
.node.boss { width: 84px; height: 84px; border-radius: 24px; background: linear-gradient(#f87171, #b91c1c); }
.node.boss .ic { width: 44px; height: 44px; }
.node.boss.locked { background: #cbd5e1; }
.banner { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px; padding: 4px 10px; background: #fff; color: var(--ink); border-radius: 12px; font-size: 13px; font-weight: 900; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.banner small { font-size: 11px; }
.node.chest { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(#fcd34d, #d97706); }
.node.chest:not(.locked):not(.done) { animation: wiggle 1s infinite; }
.node.chest.done { background: #fde68a; color: #92400e; }
.avatar { position: absolute; width: 72px; transform: translateX(-50%); z-index: 3; transition: left .9s ease-in-out, top .9s ease-in-out; pointer-events: none; animation: bob 2s ease-in-out infinite; }
.avatar .owl { width: 100%; }

/* ── 彈出視窗 ── */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(30, 27, 45, .45); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.modal { width: min(100%, 420px); max-height: 90vh; overflow: auto; background: #fffdf8; border-radius: 26px; padding: 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); animation: pop .3s; }
.modal h2 { margin: 0; font-size: 24px; line-height: 1.35; }
.modal p { margin: 0; line-height: 1.6; }
.modal-owl { width: 120px; }
.dim-ic.big { width: 76px; height: 76px; border-radius: 22px; font-size: 30px; }
.best { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.chest-open { width: 110px; height: 110px; color: #d97706; animation: pop .4s; }
.chest-open .ic { width: 100%; height: 100%; }
.prize { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 20px; }
.prize-gem .gem { width: 84px; height: 84px; }
.sw.big { width: 84px; height: 84px; }

/* ── 每日扭蛋 ── */
.gacha { position: relative; width: 220px; height: 300px; }
.g-dome { position: absolute; top: 0; left: 10px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 10%, #dbeafe 40%, #93c5fd); border: 6px solid #fff; overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.capsule { position: absolute; width: 50px; height: 50px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .12); }
.capsule.c0 { background: linear-gradient(#ff7a59 50%, #fff 50%); } .capsule.c1 { background: linear-gradient(#4ade80 50%, #fff 50%); }
.capsule.c2 { background: linear-gradient(#a78bfa 50%, #fff 50%); } .capsule.c3 { background: linear-gradient(#ffd23f 50%, #fff 50%); }
.capsule:nth-child(1) { left: 20px; top: 110px; } .capsule:nth-child(2) { left: 66px; top: 128px; } .capsule:nth-child(3) { left: 112px; top: 114px; }
.capsule:nth-child(4) { left: 44px; top: 70px; } .capsule:nth-child(5) { left: 92px; top: 74px; } .capsule:nth-child(6) { left: 128px; top: 62px; } .capsule:nth-child(7) { left: 64px; top: 30px; }
.g-body { position: absolute; bottom: 0; left: 20px; width: 180px; height: 120px; background: linear-gradient(#ef4444, #b91c1c); border-radius: 20px 20px 26px 26px; border: 5px solid #fff; }
.g-knob { position: absolute; left: 50%; top: 20px; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%; background: #ffd23f; border: 5px solid #fff; }
.g-knob::after { content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 8px; margin-left: -4px; border-radius: 4px; background: #d97706; }
.g-slot { position: absolute; right: 14px; bottom: 14px; width: 44px; height: 28px; border-radius: 10px; background: #7f1d1d; }
.gacha.spin .g-knob { animation: spin 1s ease-in-out; }
.gacha.spin .g-dome { animation: shake .35s 3; }

.card.recommend { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--c); }
.recommend .wbg { position: relative; width: 80px; height: 80px; border-radius: 16px; overflow: hidden; flex: none; }
.recommend b { display: block; font-size: 18px; margin-top: 4px; }
.recommend > div { flex: 1; min-width: 160px; }

@keyframes nodePulse { 50% { box-shadow: 0 6px 0 rgba(0, 0, 0, .22), 0 0 0 10px rgba(255, 255, 255, .55); } }
@keyframes wiggle { 25% { transform: translate(-50%, -50%) rotate(-8deg); } 75% { transform: translate(-50%, -50%) rotate(8deg); } }
@keyframes spin { to { transform: rotate(720deg); } }
@keyframes fadein { from { opacity: 0; } }

/* ── 橫向（平板、手機打橫）── */
@media (min-aspect-ratio: 5/4) and (min-width: 700px) {
  .home-main { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .play { flex-direction: row; align-items: center; }
  .play .stim { flex: 1 1 50%; }
  .play .opts { flex: 1 1 50%; }
  .report { grid-template-columns: 1fr 1.2fr; align-items: center; }
  .shop { grid-template-columns: 1fr 1.4fr; }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .spot { flex-wrap: nowrap; }
  .spot-pic { width: min(calc(50% - 6px), calc((100vh - 200px) * 4 / 3)); }
  .spot-pic + .spot-pic { margin-top: 0; }
}
@media (min-aspect-ratio: 5/4) and (max-width: 699px) {
  .spot { flex-wrap: nowrap; }
  .spot-pic { width: min(calc(50% - 6px), calc((100vh - 170px) * 4 / 3)); }
}
@media (max-height: 520px) and (min-aspect-ratio: 5/4) {
  .hero-owl { width: 96px; }
  .hero .bubble { font-size: 15px; padding: 8px 12px; }
  .logo-top { font-size: 40px; }
  .logo-sub { margin-top: 6px; font-size: 15px; }
  .home-hero { gap: 4px; }
  .menu { gap: 8px; }
  .mbtn, .mbtn.big { padding: 9px; font-size: 18px; }
  .big { font-size: 64px; }
  .ava { width: 52px; }
  .opts { max-width: calc(var(--cols, 3) * 110px); }
}
@media (max-width: 420px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sbar { grid-template-columns: 6.5em 1fr 2.4em; }
  .sb-band { display: none; }
}

@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes jump { 40% { transform: translateY(-10px) scale(1.06); } }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(245, 158, 11, .3); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } }
@keyframes popout { 40% { transform: scale(1.25); opacity: 1; } to { transform: scale(1.6); opacity: 0; visibility: hidden; } }
@keyframes floaty { 50% { transform: translateY(-7px); } }
@keyframes flipin { from { transform: rotateY(90deg); } }
@keyframes flash { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; transform: scale(1.1); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes drain { from { width: 100%; } to { width: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { *, .fly-gem { animation: none !important; } }
