/* 遊戲化外觀：立體按鈕和卡片、遊戲背景、楚橋鼓勵、動作玩法、魔王戰、新遊戲 */

/* ── 立體外觀 ── */
.btn, .mbtn, .iv { position: relative; overflow: hidden; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn::after, .mbtn::after, .iv::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 5px; height: 38%; border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); pointer-events: none;
}
.btn { background: linear-gradient(#ff9a73, var(--pri)); box-shadow: 0 6px 0 var(--pri-d), 0 10px 18px rgba(217, 83, 47, .3); }
.btn.alt { background: linear-gradient(#6aa5ff, #3b82f6); box-shadow: 0 6px 0 #1d4ed8, 0 10px 18px rgba(29, 78, 216, .28); }
.mbtn { box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 12px 20px rgba(0, 0, 0, .14); border: 3px solid rgba(255, 255, 255, .55); }
.btn:active:not(:disabled), .mbtn:active { box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.icon, .pill, .lvbadge { box-shadow: 0 4px 0 #e2cfa8, 0 6px 12px rgba(0, 0, 0, .08); border-color: #fff; }
.card, .arc-card, .lvl, .tile, .ptool, .trophy, .pick, .swatch, .stat {
  border-color: #fff; box-shadow: 0 6px 0 #ecdcbc, 0 12px 24px rgba(120, 90, 40, .12);
}
.arc-card, .lvl, .tile { border-color: var(--c); box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 65%, #000), 0 14px 24px rgba(0, 0, 0, .12); border-bottom-width: 4px; }
.lvl.locked { box-shadow: 0 6px 0 #d6c9ae; }
.arc-card { background: linear-gradient(#fff 55%, color-mix(in srgb, var(--c) 12%, #fff)); }
.arc-e { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 28px; background: color-mix(in srgb, var(--c) 16%, #fff); }
h1 { -webkit-text-stroke: 0; text-shadow: 0 3px 0 rgba(255, 255, 255, .9); }

/* ── 遊戲畫面：世界背景 ── */
.screen.game { position: relative; isolation: isolate; }
.screen.game::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(255, 252, 244, .55), rgba(255, 252, 244, .78)), var(--wbg, none) center / cover, var(--bg);
}
.game > .bar { padding: 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .82); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); backdrop-filter: blur(6px); }
.game .prog { height: 18px; border-color: #fff; background: #f1e7d3; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .1); }
.game .prog i { background: linear-gradient(#ffe08a, #f5b301); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.game .prompt .bubble { border: 0; box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 45%, #fff), 0 10px 20px rgba(0, 0, 0, .08); }
.ava { width: 84px; }
.game .opt {
  border: 0; border-radius: 24px; background: linear-gradient(#fff, #fff8ea);
  box-shadow: 0 7px 0 #e6d2ab, 0 12px 22px rgba(120, 90, 40, .16), inset 0 -4px 0 rgba(0, 0, 0, .03);
  transition: transform .1s, box-shadow .1s;
}
.game .opt:hover { transform: translateY(-2px); }
.game .opt:active { transform: translateY(5px); box-shadow: 0 2px 0 #e6d2ab; }
.game .opt.right { background: linear-gradient(#e9ffef, #c8f7d6); box-shadow: 0 7px 0 #22a559, 0 0 0 4px #4ade80; }
.game .opt.wrong { background: linear-gradient(#fff1f1, #ffd6d6); box-shadow: 0 7px 0 #e16464; }
.game .opt.hint { box-shadow: 0 7px 0 #e6d2ab, 0 0 0 4px #f59e0b; }
.game .opt.reveal { box-shadow: 0 7px 0 #22a559, 0 0 0 4px #86efac; }
.game.quake { animation: quake .45s; }

/* ── 楚橋鼓勵 ── */
.cheer { position: fixed; left: max(8px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 75; display: flex; align-items: flex-end; gap: 4px; pointer-events: none; animation: cheerIn .5s cubic-bezier(.3, 1.6, .5, 1); }
.cheer.out { animation: cheerOut .45s forwards; }
.cheer-owl { width: clamp(110px, 28vw, 160px); }
.cheer.good .cheer-owl { animation: hop .5s ease-in-out 2; }
.cheer.combo .cheer-owl { animation: spinHop .8s ease-in-out; }
.cheer-bubble {
  position: relative; margin-bottom: 70px; max-width: 58vw; padding: 12px 18px; border-radius: 22px; background: #fff;
  font-size: clamp(18px, 4.8vw, 24px); font-weight: 900; color: var(--ink); box-shadow: 0 6px 0 #f5b301, 0 12px 26px rgba(0, 0, 0, .18);
}
.cheer.try .cheer-bubble, .cheer.miss .cheer-bubble { box-shadow: 0 6px 0 #60a5fa, 0 12px 26px rgba(0, 0, 0, .18); }
.cheer-bubble::before { content: ""; position: absolute; left: -12px; bottom: 16px; border: 10px solid transparent; border-right: 14px solid #fff; }
.cheer.combo .cheer-bubble { background: linear-gradient(#fff7d1, #ffe58a); }
.spark { position: fixed; left: 0; top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px; color: #f5b301; z-index: 90; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.spark .ic { width: 100%; height: 100%; }
.spark.big { width: 54px; height: 54px; margin: -27px 0 0 -27px; }

/* ── 動作玩法共用 ── */
.opts.field { display: block; max-width: 640px; width: 100%; }
.game-tag { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto 8px; width: max-content; padding: 4px 16px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 900; box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 60%, #000); }
.game-tag b { padding: 0 8px; border-radius: 99px; background: rgba(255, 255, 255, .3); }
.spr { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.spr-fb { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8 0 15%, transparent 16%), #b08968; }
.spr-boss { background: radial-gradient(circle at 35% 30%, #fff8 0 15%, transparent 16%), #a855f7; }
.spr-fish { border-radius: 50% 40% 40% 50%; background: #fb923c; }
.spr-monster { background: #4ade80; }
.spr-basket { border-radius: 10px 10px 40% 40%; background: repeating-linear-gradient(45deg, #d6a25f 0 8px, #b9803f 8px 16px); }
.spr-gate { border-radius: 50% 50% 8px 8px; background: #fca5a5; }

/* 打地鼠 */
.mole-field { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; padding: 18px 14px 14px; border-radius: 28px; background: linear-gradient(#a7e07a, #6fbf4a); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .1), 0 8px 20px rgba(0, 0, 0, .12); }
.hole { position: relative; aspect-ratio: 1 / .95; overflow: hidden; border-radius: 0 0 50% 50% / 0 0 30% 30%; }
.hole::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 30%; border-radius: 50%; background: radial-gradient(#4a2c17 55%, #6b4423); z-index: 2; pointer-events: none; }
.mole { position: absolute; left: 6%; right: 6%; bottom: -70%; height: 100%; padding: 0; border: 0; background: none; transition: bottom .22s cubic-bezier(.3, 1.4, .6, 1); z-index: 1; touch-action: manipulation; }
.mole.up { bottom: 6%; }
.mole .m-body { position: absolute; left: 0; bottom: -6%; height: 84%; width: 100%; }
.m-sign { position: absolute; left: 50%; top: -4%; transform: translateX(-50%); z-index: 3; min-width: 64%; max-width: 110%; padding: 3px 8px; border-radius: 14px; background: #fff; border: 3px solid #8b5a2b; display: grid; place-items: center; font-size: clamp(18px, 6vw, 30px); font-weight: 900; line-height: 1.1; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.m-sign .emo { font-size: clamp(30px, 9vw, 46px); }
.m-sign .ic-big, .m-sign svg { width: 1.4em; height: 1.4em; }
.mole.hit .m-sign { background: #dcfce7; border-color: #16a34a; }
.mole.hit .m-body { animation: squash .3s; }
.mole.dizzy .m-sign { background: #fee2e2; border-color: #ef4444; }
.mole.dizzy { animation: shake .4s; }

/* 楚橋跑酷 */
.runner { position: relative; height: clamp(300px, 52vh, 440px); border-radius: 28px; overflow: hidden; background: linear-gradient(#bde8ff 0 34%, #8fd16a 34%); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); perspective: 500px; }
.r-road { position: absolute; left: 50%; bottom: -10%; width: 140%; height: 80%; transform: translateX(-50%) rotateX(58deg); transform-origin: bottom; background: repeating-linear-gradient(#f4dca6 0 40px, #ead09a 40px 80px); border-left: 10px solid #fff; border-right: 10px solid #fff; animation: road .5s linear infinite; }
.r-gates { position: absolute; left: 0; right: 0; top: 10%; height: 58%; transform-origin: 50% 0; animation: approach var(--t) ease-out forwards; }
.r-gate { position: absolute; left: var(--x); top: 0; width: min(30%, 170px); height: 100%; transform: translateX(-50%); padding: 0; border: 0; background: none; }
.r-gate .g-img { position: absolute; inset: 0; }
.g-sign { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); min-width: 62%; padding: 6px 8px; border-radius: 16px; background: #fff; border: 3px solid #f59e0b; display: grid; place-items: center; font-size: clamp(18px, 5.5vw, 28px); font-weight: 900; white-space: nowrap; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.g-sign .emo { font-size: clamp(30px, 9vw, 48px); }
.r-gate.open { animation: gateOpen .6s forwards; }
.r-gate.shut { filter: grayscale(1) brightness(.85); animation: shake .4s; }
.r-owl { position: absolute; left: var(--x); bottom: 4%; width: clamp(80px, 22vw, 120px); transform: translateX(-50%); transition: left .3s ease-out; z-index: 3; animation: runBob .3s ease-in-out infinite; }
.r-owl.dash { animation: dash .7s ease-in forwards; }
.r-owl.bump { animation: shake .4s; }

/* 釣魚 */
.pond { position: relative; height: clamp(300px, 50vh, 430px); border-radius: 28px; overflow: hidden; background: linear-gradient(#b9ecff 0 14%, #5cc6f2 14%, #2e8fd0); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.waves { position: absolute; left: 0; right: 0; top: 11%; height: 16px; background: radial-gradient(circle at 10px -2px, transparent 12px, #5cc6f2 13px) repeat-x; background-size: 20px 16px; animation: waves 2s linear infinite; }
.fishy { position: absolute; top: calc(var(--y) - 4%); left: 0; width: clamp(130px, 34vw, 180px); height: clamp(110px, 28vw, 150px); padding: 0; border: 0; background: none; animation: swim var(--dur) var(--delay) linear infinite; z-index: 1; }
.f-img { position: absolute; inset: 0; filter: hue-rotate(var(--hue)); animation: face var(--dur) var(--delay) steps(1) infinite; }
.f-sign { position: absolute; left: 46%; top: 54%; transform: translate(-50%, -50%); padding: 1px 6px; border-radius: 12px; background: rgba(255, 255, 255, .92); font-size: clamp(15px, 4.4vw, 22px); font-weight: 900; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.f-sign .emo { font-size: clamp(22px, 6vw, 32px); }
.fishy.caught { animation: caught .8s forwards; z-index: 3; }
.fishy.away { opacity: .35; pointer-events: none; }
.hook { position: absolute; top: 0; left: 50%; width: 3px; height: 0; background: #334155; z-index: 2; transition: height .3s ease-in, left .2s; pointer-events: none; }
.hook i { position: absolute; bottom: -14px; left: -7px; width: 14px; height: 16px; border: 3px solid #334155; border-top: 0; border-radius: 0 0 10px 10px; }
.hook:not(.down) { height: 0 !important; }

/* 接住佢 */
.catch { position: relative; height: clamp(320px, 54vh, 460px); border-radius: 28px; overflow: hidden; background: linear-gradient(#d8f1ff, #fff3d6); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); touch-action: none; cursor: grab; }
.drop { position: absolute; top: 0; z-index: 1; padding: 4px 10px; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); font-size: clamp(18px, 5vw, 26px); font-weight: 900; white-space: nowrap; pointer-events: none; }
.drop .emo { font-size: clamp(34px, 9vw, 50px); }
.drop.in { animation: popout .35s forwards; }
.drop.bad { background: #fee2e2; animation: shake .35s; }
.drop.miss { opacity: .3; transition: opacity .3s; }
.basket { position: absolute; bottom: 4px; width: clamp(110px, 28vw, 150px); height: clamp(90px, 22vw, 120px); transform: translateX(-50%); transition: left .08s linear; z-index: 2; pointer-events: none; }
.basket.bounce { animation: squash .3s; }

/* 餵怪獸 */
.feed { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.monster { position: relative; width: clamp(150px, 40vw, 210px); aspect-ratio: 1; }
.monster.chomp { animation: chomp .45s; }
.monster.no { animation: shake .45s; }
.m-say { position: absolute; right: -20%; top: 0; padding: 4px 10px; border-radius: 14px; background: #fff; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); white-space: nowrap; }
.m-say:empty { display: none; }
.food { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.food-i { min-width: 72px; height: 72px; padding: 4px 10px; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(#fff, #fff8ea); box-shadow: 0 6px 0 #e6d2ab, 0 10px 18px rgba(0, 0, 0, .1); font-size: clamp(18px, 5vw, 24px); font-weight: 900; touch-action: none; cursor: grab; transition: transform .25s; }
.food-i .emo { font-size: 44px; }
.food-i.drag { transition: none; z-index: 5; box-shadow: 0 14px 24px rgba(0, 0, 0, .2); }
.food-i.eaten { pointer-events: none; }

/* ── 魔王戰 ── */
.boss-hud { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 24px; background: linear-gradient(#3b1f5e, #5b2d8a); color: #fff; box-shadow: 0 5px 0 #24113b, 0 10px 20px rgba(0, 0, 0, .2); }
.hearts { display: flex; gap: 2px; }
.hearts i { width: 28px; height: 28px; color: #ff4d6d; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .3)); }
.hearts i .ic { width: 100%; height: 100%; }
.hearts i.off { color: #cbb4e6; animation: pop .4s; }
.b-hp { display: flex; flex-direction: column; gap: 4px; }
.b-hp b { font-size: 15px; text-align: right; }
.hpbar { display: flex; gap: 3px; padding: 3px; border-radius: 99px; background: rgba(0, 0, 0, .35); }
.hpbar i { flex: 1; height: 12px; border-radius: 99px; background: linear-gradient(#ff8a8a, #ef4444); transition: background .3s, opacity .3s; }
.hpbar i.off { background: rgba(255, 255, 255, .15); }
.b-ava { width: 74px; height: 74px; margin: -18px 0 -12px; }
.b-ava.hurt { animation: hurt .5s; }
.b-ava.attack { animation: attack .55s; }
.b-ava.beaten { filter: grayscale(.4); transform: rotate(-12deg); }
.boss-intro { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle, rgba(91, 45, 138, .85), rgba(20, 10, 40, .92)); animation: fadein .3s; }
.bi-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #fff; max-width: 420px; }
.bi-card h2 { margin: 0; font-size: clamp(28px, 8vw, 40px); text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.bi-card p { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.6; }
.bi-card b { color: #ffd23f; font-size: 1.3em; }
.bi-img { width: min(60vw, 260px); height: min(60vw, 260px); animation: bossIn .7s cubic-bezier(.3, 1.5, .5, 1); }
.boss-intro.win .bi-img { animation: spinHop 1s; }
.boss-intro.win { background: radial-gradient(circle, rgba(255, 196, 0, .85), rgba(232, 96, 63, .92)); }
.modal-boss { width: 130px; height: 130px; animation: bob 2s ease-in-out infinite; }

/* ── 新地圖 ── */
.wpath path { stroke-width: 10; stroke-dasharray: 2 20; }
.wpath path.road { stroke: rgba(120, 80, 40, .22); stroke-width: 34; stroke-dasharray: none; }
.node {
  width: 66px; height: 66px; border: 5px solid #fff;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .6) 0 18%, transparent 19%), linear-gradient(color-mix(in srgb, var(--c, #94a3b8) 75%, #fff), var(--c, #94a3b8));
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c, #94a3b8) 60%, #000), 0 12px 18px rgba(0, 0, 0, .25);
}
.node.locked { background: linear-gradient(#e2e8f0, #cbd5e1); box-shadow: 0 6px 0 #94a3b8, 0 10px 14px rgba(0, 0, 0, .18); }
.node.boss { width: 104px; height: 104px; border-radius: 50%; background: radial-gradient(circle, #fff7d6 0 55%, #ffd23f 56%); box-shadow: 0 8px 0 #b45309, 0 0 0 6px rgba(255, 210, 63, .45), 0 14px 22px rgba(0, 0, 0, .3); }
.node.boss .nboss { width: 92%; height: 92%; }
.node.boss.locked .nboss { filter: grayscale(1) opacity(.55); }
.node.boss.done { background: radial-gradient(circle, #dcfce7 0 55%, #4ade80 56%); box-shadow: 0 8px 0 #15803d, 0 14px 22px rgba(0, 0, 0, .3); }
.node.cur { animation: nodeBounce 1.1s ease-in-out infinite; }
.banner { border: 3px solid #ffd23f; }

/* ── 拼圖 ── */
.jig { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.jig-board { position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); width: min(100%, 520px); aspect-ratio: 3 / 2; padding: 6px; gap: 3px; border-radius: 18px; background: #fff; box-shadow: 0 6px 0 #e6d2ab, 0 12px 22px rgba(0, 0, 0, .12); }
.jig-ghost { position: absolute; inset: 6px; border-radius: 12px; background-size: cover; opacity: .18; pointer-events: none; }
.jig-slot { position: relative; z-index: 1; border: 2px dashed #e2cfa8; border-radius: 6px; }
.jig-slot .jig-p { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4px; box-shadow: none; }
.jig-board.done .jig-slot { border-color: transparent; }
.jig-board.done { animation: pop .5s; }
.jig-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.jig-p { width: calc(min(100vw - 48px, 520px) / var(--cols) * .72); aspect-ratio: calc(3 * var(--rows)) / calc(2 * var(--cols)); border-radius: 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); touch-action: none; cursor: grab; position: relative; z-index: 2; }
.jig-p.drag { z-index: 10; box-shadow: 0 14px 24px rgba(0, 0, 0, .3); }
.jig-p.sel { outline: 4px solid #f59e0b; }
.jig-p.shake { animation: shake .4s; }

/* ── 寫字 ── */
.trace { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tr-box { position: relative; width: min(300px, calc(100vw - 60px)); aspect-ratio: 1; border-radius: 20px; background: #fffdf6; box-shadow: 0 6px 0 #e6d2ab, 0 12px 22px rgba(0, 0, 0, .12); border: 4px solid #e8603f; touch-action: none; }
.tr-box svg:not(.tr-grid) { position: relative; z-index: 1; }
.tr-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.tr-grid path { stroke: #f3c9b9; stroke-width: .6; stroke-dasharray: 2 2; fill: none; }
.tr-off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 800; color: var(--soft); padding: 20px; }

/* ── 節奏拍拍 ── */
.rhythm { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rh-lane { position: relative; width: 100%; height: 110px; border-radius: 60px; background: linear-gradient(#efe4ff, #dcc8ff); box-shadow: inset 0 4px 8px rgba(0, 0, 0, .1); overflow: hidden; touch-action: manipulation; }
.rh-target { position: absolute; left: 18%; top: 50%; width: 92px; height: 92px; transform: translate(-50%, -50%); border-radius: 50%; border: 6px solid #8b5cf6; background: rgba(255, 255, 255, .6); animation: beatRing .6s ease-in-out infinite; }
.rh-note { position: absolute; top: 50%; left: 100%; transform: translate(-50%, -50%); font-size: 54px; line-height: 1; }
.rh-note.hitn { animation: popout .3s forwards; }
.rh-note.missn { opacity: .25 !important; }
.rh-judge { height: 40px; font-size: 32px; font-weight: 900; }
.rh-judge.pop { animation: pop .3s; }
.rh-judge.perfect { color: #f59e0b; } .rh-judge.good { color: #16a34a; } .rh-judge.miss { color: #94a3b8; }
.rh-score { font-weight: 900; color: var(--soft); }
.rh-drum { width: min(44vw, 170px); aspect-ratio: 1; border-radius: 50%; border: 0; display: grid; place-items: center; align-content: center; gap: 0; color: #fff; font-size: 24px; font-weight: 900; background: radial-gradient(circle at 35% 30%, #c4a5ff, #8b5cf6 60%); box-shadow: 0 9px 0 #5b21b6, 0 14px 24px rgba(91, 33, 182, .35); touch-action: manipulation; }
.rh-drum .ic { width: 56px; height: 56px; }
.rh-drum.hit { animation: squash .2s; }

/* ── 開小店 ── */
.shopg { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sh-tray { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; min-height: 86px; width: min(100%, 520px); padding: 10px; border-radius: 22px; background: #f6e6c6; box-shadow: inset 0 4px 8px rgba(0, 0, 0, .1); }
.sh-hint { color: #a08660; font-weight: 800; }
.sh-sum { font-size: 22px; font-weight: 900; }
.sh-sum b { font-size: 30px; color: #16a34a; }
.sh-coins { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.sh-c, .sh-in { padding: 0; border: 0; background: none; }
.coin { display: grid; place-items: center; align-content: center; width: 70px; height: 70px; border-radius: 50%; font-size: 26px; font-weight: 900; line-height: 1; color: #7c4a03; background: radial-gradient(circle at 35% 30%, #fff3b0, #f5c518 55%, #d99a00); box-shadow: inset 0 0 0 4px #e8b100, 0 5px 0 #a87400; }
.coin small { font-size: 12px; color: #7c4a03; }
.coin.c1 { width: 56px; height: 56px; font-size: 22px; filter: saturate(.6); }
.coin.c2 { width: 62px; height: 62px; background: radial-gradient(circle at 35% 30%, #fff, #cfd8e3 55%, #9aa8b8); box-shadow: inset 0 0 0 4px #aab6c4, 0 5px 0 #6b7a8c; color: #334155; }
.coin.c2 small { color: #334155; }
.coin.c10 { width: 80px; height: 80px; background: radial-gradient(circle at 35% 30%, #ffe2b8, #f08c3c 55%, #c2410c); box-shadow: inset 0 0 0 5px #ea7a2a, 0 5px 0 #9a3412; color: #fff; }
.coin.c10 small { color: #fff; }
.sh-c:active .coin { transform: translateY(4px); }
.sh-in .coin { width: 50px; height: 50px; font-size: 18px; animation: pop .25s; }

@keyframes cheerIn { from { transform: translateY(120%); } }
@keyframes cheerOut { to { transform: translateY(130%); opacity: 0; } }
@keyframes hop { 50% { transform: translateY(-22px) rotate(-6deg); } }
@keyframes spinHop { 40% { transform: translateY(-30px) rotate(180deg); } 80% { transform: translateY(0) rotate(360deg); } }
@keyframes squash { 40% { transform: scale(1.15, .85); } 70% { transform: scale(.95, 1.05); } }
@keyframes road { to { background-position: 0 80px; } }
@keyframes approach { from { transform: scale(.6) translateY(-6%); } }
@keyframes runBob { 50% { transform: translateX(-50%) translateY(-8px); } }
@keyframes dash { to { transform: translateX(-50%) translateY(-160px) scale(.4); opacity: 0; } }
@keyframes gateOpen { to { transform: translateX(-50%) scale(1.5); opacity: 0; } }
@keyframes waves { to { background-position: 20px 0; } }
@keyframes swim { 0% { left: -30%; } 50% { left: 100%; } 100% { left: -30%; } }
@keyframes face { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
@keyframes caught { to { top: -40%; transform: rotate(-30deg); } }
@keyframes chomp { 30% { transform: scale(1.15, .85); } 60% { transform: scale(.92, 1.1); } }
@keyframes hurt { 20% { transform: translateX(10px) rotate(8deg); filter: brightness(2); } 50% { transform: translateX(-8px); } }
@keyframes attack { 40% { transform: translateX(-40px) scale(1.25); } }
@keyframes quake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, 0); } }
@keyframes bossIn { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }
@keyframes nodeBounce { 50% { transform: translate(-50%, -58%); } }
@keyframes beatRing { 50% { transform: translate(-50%, -50%) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .r-road, .waves { animation: none !important; } }
.nlock { position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #64748b; color: #fff; border: 3px solid #fff; }
.nlock .ic { width: 18px; height: 18px; }

/* ── 跑酷關卡 ── */
.runner-screen { position: fixed; inset: 0; overflow: hidden; background: #bfe9a8; touch-action: none; }
.runner-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.r-hud { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 0; }
.r-flags { flex: 1; display: flex; justify-content: center; gap: 4px; }
.r-flags i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .85); color: #d6c9ae; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.r-flags i .ic { width: 20px; height: 20px; }
.r-flags i.on { color: #f5b301; background: #fff7d1; animation: pop .4s; }
.r-flags i.half { color: #93c5fd; background: #eff6ff; animation: pop .4s; }
.rq { position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 58px); z-index: 2; transform: translateX(-50%); width: min(92vw, 560px); padding: 10px 16px; border-radius: 24px; background: rgba(255, 255, 255, .95); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 50%, #fff), 0 12px 24px rgba(0, 0, 0, .18); text-align: center; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), opacity .3s; }
.rq.off { transform: translate(-50%, -30px) scale(.9); opacity: 0; pointer-events: none; }
.rq-text { font-size: clamp(18px, 5vw, 24px); font-weight: 900; line-height: 1.4; }
.rq-stim { zoom: .62; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }
.r-tip { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 2; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: rgba(43, 45, 66, .8); color: #fff; font-weight: 800; white-space: nowrap; transition: opacity .5s; }
.r-tip.off { opacity: 0; }
.rq-card { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(30, 27, 45, .35); }
.rq-card-in { width: min(100%, 560px); margin-top: 120px; padding: 16px; border-radius: 26px; background: rgba(255, 253, 248, .97); box-shadow: 0 16px 40px rgba(0, 0, 0, .25); animation: pop .3s; }
.rq-card .opt { border: 0; border-radius: 22px; background: linear-gradient(#fff, #fff8ea); box-shadow: 0 7px 0 #e6d2ab, 0 12px 22px rgba(120, 90, 40, .16); }
.rq-card .opt.right { box-shadow: 0 7px 0 #22a559, 0 0 0 4px #4ade80; }
.rq-card .opt.wrong { box-shadow: 0 7px 0 #e16464; background: #fff1f1; }
.runner-screen .pill.bump, .runner-screen .gems.bump { animation: bump .3s; }

/* ── 主頁：遊戲大廳 ── */
.lobby { position: relative; min-height: 100vh; min-height: 100dvh; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(#bfe8ff, #c9f0b0) center / cover; overflow: hidden; }
.lb-top { display: flex; align-items: center; gap: 8px; }
.lb-me { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 99px; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.lb-ava { width: 40px; height: 40px; border-radius: 50%; background: #fff3dc; display: grid; place-items: center; overflow: hidden; }
.lb-ava .owl { width: 46px; margin-top: 6px; }
.lb-lv { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.lb-days { display: inline-flex; align-items: center; gap: 2px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 0 rgba(0, 0, 0, .12); font-weight: 800; font-size: 14px; }
.lb-days .ic { color: #ea580c; }
.lb-days b { font-size: 18px; color: #ea580c; margin: 0 2px; }
.lobby .pill.gems, .lobby .icon { background: rgba(255, 255, 255, .92); border: 0; }
.lb-logo { text-align: center; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .12)); }
.lb-logo .logo-top { font-size: clamp(38px, 11vw, 64px); }
.lb-logo .logo-sub { margin-top: 4px; font-size: clamp(14px, 3.8vw, 19px); }
.lb-mid { flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; min-height: 260px; }
.lb-side { display: flex; flex-direction: column; gap: 10px; }
.lb-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; background: none; }
.lb-ic { position: relative; width: clamp(62px, 17vw, 78px); height: clamp(62px, 17vw, 78px); border-radius: 24px; display: grid; place-items: center; padding: 6px; background: rgba(255, 255, 255, .9); box-shadow: 0 5px 0 rgba(0, 0, 0, .14), 0 8px 16px rgba(0, 0, 0, .1); transition: transform .12s; }
.lb-ic > .ic { width: 60%; height: 60%; color: #64748b; }
.lb-btn:hover .lb-ic { transform: translateY(-3px) rotate(-3deg); }
.lb-btn:active .lb-ic { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .14); }
.lb-name { font-size: 13px; font-weight: 900; color: #fff; -webkit-text-stroke: 4px #2b2d42; paint-order: stroke fill; letter-spacing: .04em; }
.lb-dot { position: absolute; right: -3px; top: -3px; width: 18px; height: 18px; border-radius: 50%; background: #ef4444; border: 3px solid #fff; animation: pulse 1.2s infinite; }
.lb-hero { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.lb-say { position: relative; max-width: 220px; padding: 10px 14px; border-radius: 20px; background: #fff; font-weight: 900; font-size: clamp(15px, 4vw, 18px); text-align: center; line-height: 1.4; box-shadow: 0 5px 0 #f5b301, 0 10px 20px rgba(0, 0, 0, .12); animation: pop .5s .3s backwards; }
.lb-say::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -10px; border: 10px solid transparent; border-top-color: #fff; }
.lb-owl { width: min(46vw, 230px); margin-top: 8px; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .18)); cursor: pointer; }
.lb-mission { position: relative; padding: 10px 70px 10px 12px; border-radius: 22px; background: rgba(255, 255, 255, .94); box-shadow: 0 6px 0 rgba(0, 0, 0, .12), 0 12px 24px rgba(0, 0, 0, .1); display: flex; flex-direction: column; gap: 5px; }
.lb-mhead { display: flex; align-items: baseline; gap: 8px; }
.lb-mhead b { font-size: 17px; }
.lb-mrow { display: grid; grid-template-columns: 28px auto 1fr auto; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.lb-mic { width: 28px; height: 28px; }
.lb-mbar { height: 10px; border-radius: 99px; background: #f1e7d3; overflow: hidden; }
.lb-mbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffc233, #ff7a59); }
.lb-mrow.ok .lb-mbar i { background: #22c55e; }
.lb-mn { min-width: 34px; text-align: right; font-size: 13px; color: var(--soft); }
.lb-mrow.ok .lb-mn { color: #16a34a; }
.lb-mn .ic { width: 20px; height: 20px; }
.lb-chest { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 60px; height: 60px; padding: 0; border: 0; background: none; animation: wiggle2 1s ease-in-out infinite; }
.lb-chest.locked { animation: none; filter: grayscale(.7) opacity(.7); }
.lb-chest.done { display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: #16a34a; animation: none; }
.lb-chest.done .ic { width: 34px; height: 34px; }
.lb-go { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; border: 4px solid #fff; border-radius: 999px; font-size: clamp(24px, 7vw, 32px); font-weight: 900; color: #fff; letter-spacing: .08em; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); background: linear-gradient(#ffb347, #ff7a1a); box-shadow: 0 8px 0 #c2410c, 0 14px 26px rgba(194, 65, 12, .35); animation: goPulse 1.6s ease-in-out infinite; }
.lb-go::after { content: ""; position: absolute; left: 10%; right: 10%; top: 6px; height: 40%; border-radius: 99px; background: linear-gradient(rgba(255, 255, 255, .55), transparent); }
.lb-go:active { transform: translateY(5px); box-shadow: 0 3px 0 #c2410c; }
.lb-goimg { width: 52px; height: 52px; }
@keyframes wiggle2 { 25% { transform: translateY(-50%) rotate(-8deg); } 75% { transform: translateY(-50%) rotate(8deg); } }
@keyframes goPulse { 50% { transform: scale(1.03); } }

/* ── 完成關卡慶祝、楚橋說話 ── */
.celebrate { position: fixed; inset: 0; z-index: 88; display: grid; place-items: center; align-content: center; gap: 6px; background: radial-gradient(circle, rgba(255, 210, 63, .55), rgba(43, 45, 66, .55)); animation: fadein .25s; cursor: pointer; }
.cb-rays { position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(rgba(255, 255, 255, .28) 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite; pointer-events: none; }
.cb-owl { position: relative; width: min(62vw, 300px); animation: cbIn .7s cubic-bezier(.3, 1.6, .5, 1), hop .6s .7s ease-in-out 3; filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .25)); }
.cb-say { position: relative; max-width: 86vw; padding: 12px 22px; border-radius: 24px; background: #fff; font-size: clamp(20px, 5.6vw, 28px); font-weight: 900; text-align: center; box-shadow: 0 6px 0 #f5b301, 0 12px 26px rgba(0, 0, 0, .2); animation: pop .5s .3s backwards; }
@keyframes cbIn { from { transform: translateY(80vh) scale(.4); } }
.owl .bk-o { opacity: 0; }
.owl.beak-open .bk-o { opacity: 1; }
.owl.beak-open .bk-c { opacity: 0; }
body.talking .owl .bk-o { animation: talkO .28s steps(1) infinite; }
body.talking .owl .bk-c { animation: talkC .28s steps(1) infinite; }
@keyframes talkO { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes talkC { 0% { opacity: 0; } 50% { opacity: 1; } }

/* ── 夢幻主題：粉紫天空、星星閃爍、糖果色按鈕 ── */
:root { --dream1: #f9e7ff; --dream2: #ffe3f1; --dream3: #dff3ff; --glow: rgba(196, 140, 255, .35); }
body {
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 70%, rgba(255, 255, 255, .8) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 88% 82%, rgba(255, 255, 255, .8) 0 2px, transparent 3px),
    radial-gradient(ellipse 160px 60px at 10% 10%, rgba(255, 255, 255, .85) 60%, transparent 62%),
    radial-gradient(ellipse 200px 70px at 90% 16%, rgba(255, 255, 255, .8) 60%, transparent 62%),
    linear-gradient(170deg, #e6dcff 0%, #ffe0f0 45%, #dcf1ff 100%);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, #fff 0 1.5px, transparent 2px), radial-gradient(circle, #fff6b0 0 1.5px, transparent 2px);
  background-size: 140px 160px, 210px 190px; background-position: 20px 30px, 90px 110px; animation: twinkle 3.2s ease-in-out infinite alternate; opacity: .7;
}
#app { position: relative; z-index: 1; }
h1, .lb-logo .logo-sub { color: #6d28d9; }
.btn { background: linear-gradient(#ff9ad5, #c06cff); box-shadow: 0 6px 0 #8b3fd1, 0 10px 22px var(--glow); }
.btn.alt { background: linear-gradient(#8fd8ff, #6b8cff); box-shadow: 0 6px 0 #4256d6, 0 10px 22px rgba(107, 140, 255, .35); }
.card, .arc-card, .lvl, .tile, .ptool, .trophy, .pick, .swatch, .stat, .book-card { box-shadow: 0 6px 0 #e4d4ff, 0 12px 26px var(--glow); }
.icon, .pill, .lvbadge, .lb-me, .lb-days { box-shadow: 0 4px 0 #e4d4ff, 0 6px 14px var(--glow); }
.game .opt { background: linear-gradient(#fff, #fbf5ff); box-shadow: 0 7px 0 #e2cffd, 0 12px 24px var(--glow); }
.game .prompt .bubble, .cheer-bubble, .lb-say { box-shadow: 0 5px 0 #f0b6ff, 0 10px 24px var(--glow); }
.screen.game::before { background: linear-gradient(rgba(250, 240, 255, .5), rgba(255, 240, 250, .72)), var(--wbg, none) center / cover, var(--bg); }
.lb-go { background: linear-gradient(#ffb0e0, #d36bff 55%, #9b5cff); box-shadow: 0 8px 0 #7a35c9, 0 14px 30px rgba(155, 92, 255, .45); }
.lb-ic { background: rgba(255, 255, 255, .88); box-shadow: 0 5px 0 #e4d4ff, 0 0 0 3px rgba(255, 255, 255, .6), 0 10px 22px var(--glow); }
.lb-mission { background: rgba(255, 255, 255, .9); box-shadow: 0 6px 0 #e4d4ff, 0 12px 28px var(--glow); }
.lb-mbar i { background: linear-gradient(90deg, #ff9ad5, #b06cff); }
.node.cur { filter: drop-shadow(0 0 12px rgba(255, 255, 255, .9)); }
@keyframes twinkle { from { opacity: .25; } to { opacity: .85; } }

/* ── 故事書 ── */
.lib-tabs { display: flex; gap: 8px; justify-content: center; }
.lib-levels { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; }
.lib-lv { flex: none; padding: 8px 14px; border-radius: 99px; border: 0; background: #fff; font-weight: 900; color: #7c3aed; box-shadow: 0 4px 0 #e4d4ff; }
.lib-lv.on { background: linear-gradient(#c79bff, #8b5cf6); color: #fff; box-shadow: 0 4px 0 #6d28d9; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.book-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 10px 12px; border: 0; border-radius: 22px; background: #fff; text-align: center; transition: transform .15s; }
.book-card:hover { transform: translateY(-4px) rotate(-1deg); }
.book-card b { font-size: 17px; }
.bk-cover { width: 100%; border-radius: 14px; overflow: hidden; box-shadow: 4px 4px 0 #f0e2ff; }
.bk-cover .scn { aspect-ratio: 3 / 2; }
.reader { max-width: 760px; }
.bk-pic { border-radius: 22px; overflow: hidden; box-shadow: 0 8px 24px var(--glow); }
.bk-pic .scn { aspect-ratio: 3 / 2; }
.bk-pic.small { width: min(70vw, 320px); }
.bk-text { padding: 16px 18px; border-radius: 22px; background: #fffdf8; font-size: clamp(26px, 7vw, 38px); line-height: 2; letter-spacing: .08em; font-weight: 700; box-shadow: 0 6px 0 #f0e2ff; }
.reader.en .bk-text { letter-spacing: 0; font-family: "Arial Rounded MT Bold", "Segoe UI", sans-serif; font-size: clamp(22px, 6vw, 32px); line-height: 1.7; }
.bk-s { border-radius: 10px; transition: background .2s; }
.bk-s.on { background: #fff1a8; box-shadow: 0 0 0 4px #fff1a8; }
.ch { cursor: pointer; border-radius: 6px; }
.ch:hover { background: #f3e8ff; }
.kw { color: #c026d3; border-bottom: 3px dotted #e879f9; cursor: pointer; }
.ch.tap, .kw.tap { animation: pop .35s; background: #fde68a; }
.bk-words { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 800; }
.bk-words .chip { border: 0; cursor: pointer; font-size: 18px; padding: 6px 12px; background: #fdf4ff; box-shadow: 0 3px 0 #f5d0fe; }
.btn-owl { width: 34px; height: 34px; vertical-align: middle; margin: -8px 0; }
.bk-mini { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 18px; background: rgba(255, 255, 255, .9); }
.bk-mini .scn { width: 110px; flex: none; aspect-ratio: 3 / 2; }
.bk-mini p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--soft); }

/* ── 影子配對、分類大挑戰 ── */
.big.shadow img { filter: brightness(0) opacity(.8); }
.big.shadow { padding: 14px 24px; border-radius: 26px; background: linear-gradient(#fffbe8, #ffeec2); }
.sortg { display: flex; flex-direction: column; gap: 14px; }
.sort-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 90px; }
.sort-it { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 22px; background: #fff; box-shadow: 0 6px 0 #e2cffd, 0 10px 20px var(--glow); touch-action: none; cursor: grab; transition: transform .2s; font-size: 52px; }
.sort-it .emo { font-size: 58px; }
.sort-it.drag { transition: none; z-index: 10; }
.sort-it.sel { outline: 4px solid #f59e0b; }
.sort-it.shake { animation: shake .4s; }
.sort-it.done { width: 54px; height: 54px; font-size: 32px; box-shadow: none; background: rgba(255, 255, 255, .85); cursor: default; }
.sort-it.done .emo { font-size: 36px; }
.sort-bins { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sort-bin { position: relative; min-height: 170px; padding: 8px 8px 10px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.sort-bin.b0 { background: linear-gradient(#ffe4f3, #ffc8e8); box-shadow: 0 6px 0 #f49ac8; }
.sort-bin.b1 { background: linear-gradient(#e0f2ff, #bfe3ff); box-shadow: 0 6px 0 #8cc8f5; }
.sort-bin b { font-size: 22px; color: #6d28d9; }
.sort-bin .bin-img { width: 72px; height: 60px; }
.bin-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.sort-bin.bump { animation: squash .3s; }
/* 迷宮：圖畫標籤 */
.mw.mp { padding: 0; background: rgba(255, 255, 255, .7); border-width: 2px; line-height: 0; }
.mw.mp .emo { font-size: calc(min(92vw, 460px, 62vh) / var(--w) * .5); }
.mw.mp img { width: 1em; height: 1em; }
.emo.ph { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; }
.emo.ph i { width: 70%; height: 70%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e9d5ff); box-shadow: 0 0 12px rgba(196, 140, 255, .6); }

/* ── 積木世界 ── */
.blk-game { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.blk-boards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.blk-board { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 22px; background: rgba(255, 255, 255, .9); box-shadow: 0 6px 0 #e4d4ff, 0 10px 22px var(--glow); }
.blk-board b { color: #6d28d9; }
.blk-board.build { background: linear-gradient(#fffaf0, #fff1d6); }
.blk-grid { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 4px; width: 100%; max-width: 220px; padding: 6px 6px 0; border-bottom: 8px solid #c08457; border-radius: 4px; }
.blk-col { display: grid; grid-template-rows: repeat(var(--h), 1fr); gap: 3px; }
.build .blk-col { cursor: pointer; border-radius: 8px; transition: background .15s; }
.build .blk-col:hover { background: rgba(249, 115, 22, .12); }
.blk-cell { aspect-ratio: 1; display: grid; }
.blk { position: relative; display: block; width: 100%; height: 100%; border-radius: 7px; background: var(--bc); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), inset 0 4px 0 rgba(255, 255, 255, .45); }
.blk::before, .blk::after { content: ""; position: absolute; top: -12%; width: 26%; height: 22%; border-radius: 40%; background: var(--bc); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5); }
.blk::before { left: 16%; } .blk::after { right: 16%; }
.blk.drop { animation: blkDrop .3s cubic-bezier(.3, 1.4, .5, 1); }
.blk.bad { animation: shake .4s; outline: 3px solid #fff; filter: grayscale(.3); }
.blk-grid.done { animation: pop .5s; }
.blk-hidden { display: grid; place-items: center; gap: 4px; min-height: 120px; color: #7c3aed; font-weight: 900; }
.blk-hidden .ic { width: 40px; height: 40px; }
.blk-palette { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.blk-pick { width: 64px; height: 64px; padding: 10px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 #e4d4ff; }
.blk-pick.on { box-shadow: 0 5px 0 #c4b5fd, 0 0 0 4px #8b5cf6; transform: translateY(-3px); }
@keyframes blkDrop { from { transform: translateY(-260%); } }
.blk-board > div { width: 100%; display: flex; justify-content: center; }
.play .stim:empty { flex: 0 0 0; min-height: 0; }
.play:has(.stim:empty) { justify-content: center; }

/* ── 升級 ── */
.lvup { position: fixed; inset: 0; z-index: 92; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 214, 250, .8), rgba(76, 29, 149, .88)); animation: fadein .3s; }
.lvup-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: #fff; }
.lvup-title { font-size: clamp(44px, 13vw, 72px); font-weight: 900; letter-spacing: .04em; background: linear-gradient(#fff7b0, #ffb6f0 60%, #c4a5ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 5px 0 #5b21b6); animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.lvup-owl { position: relative; width: min(52vw, 240px); animation: spinHop 1s .3s; }
.lvup-crown { position: absolute; left: 50%; top: -14%; width: 34%; transform: translateX(-50%) rotate(-8deg); color: #ffd23f; filter: drop-shadow(0 4px 0 #b45309); z-index: 2; animation: drop .6s .5s backwards; }
.lvup-crown .ic { width: 100%; height: auto; }
.lvup-lv { font-size: 46px; font-weight: 900; text-shadow: 0 4px 0 #5b21b6; }
.lvup-name { padding: 6px 22px; border-radius: 99px; background: linear-gradient(#ffd1f0, #c79bff); color: #4c1d95; font-size: 24px; font-weight: 900; box-shadow: 0 5px 0 #7c3aed; }
.lvup-gift { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 20px; font-weight: 900; }
.lvup-gift .gem { width: 28px; height: 28px; vertical-align: middle; }
.lvup-gift span { padding: 4px 14px; border-radius: 99px; background: rgba(255, 255, 255, .2); }
.xpfx { position: fixed; left: 50%; top: max(70px, env(safe-area-inset-top)); z-index: 89; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: rgba(255, 255, 255, .95); box-shadow: 0 6px 0 #e4d4ff, 0 10px 26px var(--glow); font-weight: 900; color: #6d28d9; animation: drop .4s; transition: opacity .5s, transform .5s; }
.xpfx.out { opacity: 0; transform: translate(-50%, -20px); }
.xp-bar { width: 120px; height: 14px; border-radius: 99px; background: #ede4ff; overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff9ad5, #a855f7); transition: width 1.4s cubic-bezier(.3, .8, .3, 1); }
.lb-lv b { white-space: nowrap; }

/* ── 帳戶、試用、訂閱 ── */
.welcome { justify-content: space-between; }
.welcome .lb-hero { flex: 1; justify-content: center; }
.welcome-btns { display: flex; flex-direction: column; gap: 12px; }
.auth { max-width: 520px; }
.auth .mid-owl { width: 130px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; }
.auth-form label, .nick { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.auth-form input, .nick input { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 14px; border: 2px solid #e4d4ff; background: #fff; user-select: text; -webkit-user-select: text; }
.auth-form input:focus, .nick input:focus { outline: none; border-color: #a855f7; box-shadow: 0 0 0 4px rgba(168, 85, 247, .18); }
.auth-form .check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 14px; line-height: 1.5; }
.auth-form .check input { width: 22px; height: 22px; flex: none; }
.auth-err { min-height: 1.2em; margin: 0; color: #dc2626; font-weight: 800; }
.kid-skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 420px; }
.kid-skin { padding: 8px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .85); box-shadow: 0 5px 0 #e4d4ff; }
.kid-skin.on { box-shadow: 0 5px 0 #c4b5fd, 0 0 0 4px #a855f7; transform: translateY(-3px); }
.nick { width: 100%; max-width: 420px; }
.trial-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 99px; background: linear-gradient(90deg, #ffe0f4, #e9d5ff); color: #6d28d9; font-weight: 900; box-shadow: 0 4px 0 #e4d4ff; }
.trial-bar b { font-size: 20px; color: #db2777; }
.trial-bar.end { background: #fff7ed; color: #9a3412; }
.plans { display: grid; gap: 8px; width: 100%; }
.plan { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; background: #faf5ff; border: 2px solid #e9d5ff; text-align: left; }
.plan.best { border-color: #a855f7; background: linear-gradient(#fdf4ff, #f3e8ff); }
.plan b { font-size: 18px; color: #6d28d9; }
.plan span { font-weight: 800; font-size: 14px; }
.plan-tag { position: absolute; right: 10px; top: -10px; padding: 2px 10px; border-radius: 99px; background: #db2777; color: #fff; font-size: 12px; font-weight: 900; }
.demo-note { margin: 0; padding: 8px 12px; border-radius: 12px; background: #fef9c3; color: #854d0e; font-weight: 800; font-size: 14px; }

/* ── 選擇世界：一頁看見全部 5 個世界 ── */
.wlist { display: grid; gap: 10px; }
.wtile {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  min-height: clamp(104px, calc((100dvh - 210px) / 5), 140px); padding: 10px 12px; border: 3px solid #fff; border-radius: 26px;
  overflow: hidden; text-align: left; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 55%, #fff), 0 12px 24px var(--glow);
  animation: pop .45s var(--d) backwards; transition: transform .15s;
}
.wtile:hover { transform: translateY(-3px); }
.wtile:active { transform: translateY(3px); }
.wtile .wbg { position: absolute; inset: 0; z-index: 0; }
.wtile .wbg img { object-position: center 35%; }
.wtile::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, rgba(255, 255, 255, .9) 0 38%, rgba(255, 255, 255, .55) 62%, rgba(255, 255, 255, .05)); }
.wtile > *:not(.wbg) { position: relative; z-index: 1; }
.wt-num { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 900; color: #fff; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5) 0 20%, transparent 21%), var(--c); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 60%, #000); }
.wt-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wt-info b { font-size: clamp(19px, 5vw, 24px); color: #2b2d42; }
.wt-info small { font-size: 12.5px; line-height: 1.35; }
.wt-info .wnum { font-size: 12px; }
.wt-info .wprog { font-size: 13px; }
.wt-boss { position: absolute !important; right: 92px; bottom: -6px; width: 64px; height: 64px; opacity: .95; }
.wt-go { padding: 8px 14px; border-radius: 99px; color: #fff; font-weight: 900; white-space: nowrap; background: linear-gradient(#ff9ad5, #c06cff); box-shadow: 0 4px 0 #8b3fd1; }
.wtile.locked .wt-go { background: linear-gradient(#8fd8ff, #6b8cff); box-shadow: 0 4px 0 #4256d6; }
.wtile.locked .wbg { filter: grayscale(.25) brightness(1.05); }
.wtile.locked .wt-num { background: #a3a3c2; box-shadow: 0 4px 0 #6b6b8a; }
.wt-lock { position: absolute !important; left: 42px; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #64748b; color: #fff; border: 2px solid #fff; }
.wt-lock .ic { width: 12px; height: 12px; }
@media (max-width: 400px) { .wt-boss { display: none; } .wt-info small { display: none; } }
@media (min-width: 760px) { .wlist { grid-template-columns: 1fr 1fr; } .wtile:first-child { grid-column: 1 / -1; } }

/* ── 遊樂園地圖 ── */
.park-map { background: linear-gradient(#ffe3f3, #e8ddff 50%, #dcf3ff); }
.ride { position: absolute; transform: translate(-50%, -50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; background: none; animation: pop .45s var(--d) backwards; }
.ride-ic { display: grid; place-items: center; width: 108px; height: 108px; padding: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 40%, color-mix(in srgb, var(--c) 22%, #fff)); border: 5px solid #fff; box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 60%, #000), 0 14px 24px rgba(0, 0, 0, .2); transition: transform .15s; }
.ride-ic > .ic { width: 56%; height: 56%; color: var(--c); }
.ride:hover .ride-ic { transform: translateY(-4px) rotate(-3deg); }
.ride:active .ride-ic { transform: translateY(4px); }
.ride-name { margin-top: 4px; padding: 3px 12px; border-radius: 99px; background: #fff; color: #4c1d95; font-weight: 900; font-size: 15px; white-space: nowrap; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 45%, #fff); }
.ride-stars { display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, .85); font-size: 12px; font-weight: 900; color: #92400e; }
.ride-stars .ic { color: #f5b301; }
.ride-ic.big { width: 120px; height: 120px; margin-top: -4px; }
.ride-levels { display: grid; gap: 8px; width: 100%; }
.rl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-radius: 18px; background: #fff; text-align: left; box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 40%, #fff); font-weight: 800; }
.rl-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 900; }
.rl-n .ic { width: 18px; height: 18px; }
.rl.locked { opacity: .55; box-shadow: 0 4px 0 #e5e7eb; }
.rl.locked .rl-n { background: #cbd5e1; }

/* ── 奧數題 ── */
.oly-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: clamp(34px, 9vw, 52px); }
.oly-plus { font-weight: 900; color: #a855f7; margin: 0 4px; }
.oly-seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.oly-n { min-width: 58px; height: 58px; padding: 0 8px; display: grid; place-items: center; border-radius: 16px; background: #fff; font-size: 30px; font-weight: 900; box-shadow: 0 4px 0 #e4d4ff; }
.oly-n.q { background: #fef08a; color: #b45309; box-shadow: 0 4px 0 #facc15; }
.oly-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; font-size: clamp(32px, 8vw, 46px); }
.oly-eq b { margin: 0 8px; color: #7c3aed; }
.oly-think .oly-owl { width: 120px; }
.oly-me { width: 56px; }
.oly-kid { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #7c3aed; box-shadow: 0 3px 0 #e4d4ff; }
.oly-kid .ic { width: 60%; height: 60%; }
.oly-cubes { width: min(240px, 60vw); }
.vsel { max-width: 170px; padding: 6px 8px; border-radius: 12px; border: 2px solid #e4d4ff; font: inherit; font-size: 13px; background: #fff; }
.set div { align-items: center; }

/* ── 3D 楚橋 ── */
.owl3d { object-fit: contain; aspect-ratio: 1; height: auto; filter: drop-shadow(0 10px 8px rgba(80, 40, 120, .22)); }
body.talking .owl3d { animation: talk3d .32s ease-in-out infinite; }
@keyframes talk3d { 50% { transform: scale(1.04, .96) translateY(2px); } }
.ava .owl3d { width: 84px; }

/* ── 立體介面：厚度、光澤、3D 標誌 ── */
.logo-top span { text-shadow: 0 2px 0 #2b2d42, 0 4px 0 #2b2d42, 0 6px 0 #2b2d42, 0 8px 0 #2b2d42, 0 14px 18px rgba(76, 29, 149, .35); }
.lb-go, .btn, .mbtn { border-bottom: 0; transform: translateZ(0); }
.lb-go { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .15), inset 0 4px 0 rgba(255, 255, 255, .45), 0 10px 0 #6d28d9, 0 18px 30px rgba(109, 40, 217, .45); }
.btn { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .45), 0 7px 0 #8b3fd1, 0 12px 22px var(--glow); }
.btn.alt { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .45), 0 7px 0 #4256d6, 0 12px 22px rgba(66, 86, 214, .35); }
.lb-go:active, .btn:active { transform: translateY(6px); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), 0 2px 0 #6d28d9, 0 4px 10px var(--glow); }
.lb-ic, .ride-ic, .node, .wt-num, .lvl-n, .rl-n { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .1), inset 0 4px 0 rgba(255, 255, 255, .7), 0 6px 0 #d8c4fb, 0 12px 22px var(--glow); }
.node { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), inset 0 4px 0 rgba(255, 255, 255, .45), 0 7px 0 color-mix(in srgb, var(--c, #94a3b8) 55%, #000), 0 14px 18px rgba(0, 0, 0, .25); }
.game .opt { box-shadow: inset 0 -6px 0 rgba(120, 80, 180, .08), inset 0 4px 0 #fff, 0 8px 0 #e2cffd, 0 14px 24px var(--glow); }
.game .opt:active { transform: translateY(6px); box-shadow: inset 0 -3px 0 rgba(120, 80, 180, .08), 0 2px 0 #e2cffd; }
.wtile, .book-card, .card, .lb-mission, .modal { box-shadow: inset 0 -5px 0 rgba(120, 80, 180, .06), 0 8px 0 #e4d4ff, 0 16px 30px var(--glow); }
.lb-owl.owl3d, .mid-owl.owl3d, .cb-owl.owl3d, .lvup-owl .owl3d { filter: drop-shadow(0 18px 14px rgba(76, 29, 149, .3)); }
.lb-hero::after { content: ""; width: 46%; height: 18px; margin-top: -10px; border-radius: 50%; background: radial-gradient(rgba(76, 29, 149, .28), transparent 70%); }

/* 中英對照：中文小字在下面 */
.zh-sub { display: block; margin-top: 3px; font-size: .82em; font-weight: 600; color: var(--soft); letter-spacing: .02em; }
.qbig .zh-sub { font-size: .7em; }
