:root {
  --bg: #1b1d2b; --paper: #fbf6ea; --ink: #2a2433; --muted: #6f6678; --line: #e2d8c3;
  --brand: #34449c; --ok: #2f8a5f; --warn: #b5532f; --tag: #fff9e8; --tag-line: #d9c79c;
  --s: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 480px; margin: 0 auto; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; gap: 10px; }

.hud { color: #e9e4f5; font-variant-numeric: tabular-nums; display: grid; gap: 8px; }
.hud[hidden] { display: none; }
.hud-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.hud-btns { display: flex; gap: 8px; }
.hbtn { border: 1px solid #4a4566; background: transparent; color: #e9e4f5; border-radius: 99px; height: 30px; padding: 0 12px; font-size: 13px; }
.hbtn b { background: #f0c75e; color: #2a2433; border-radius: 99px; padding: 0 6px; margin-left: 2px; font-size: 12px; }
.snd { width: 34px; padding: 0; }
.snd.off { opacity: .4; text-decoration: line-through; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; background: #2a2c44; border: 1px solid #3f4263; border-radius: 12px; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.chip .lbl { font-size: 13px; color: #b9b2cc; }
.chip b { font-size: 24px; color: #fff; margin-left: auto; }
.rbar { flex-basis: 100%; height: 6px; background: #1b1d2b; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.rbar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, #e2a83b, #f0c75e); border-radius: 99px; transition: width .5s; }
.delta { position: absolute; right: 12px; top: -6px; font-style: normal; font-weight: 800; font-size: 16px; opacity: 0; pointer-events: none; }
.delta.up { color: #6be0a0; animation: rise 1.4s ease-out; }
.delta.down { color: #ff8a7a; animation: rise 1.4s ease-out; }
@keyframes rise { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.chip.pulse { animation: pulse .5s; }
@keyframes pulse { 50% { border-color: #f0c75e; background: #34365a; } }

.stage { position: relative; width: 100%; aspect-ratio: 384 / 256; overflow: hidden; border-radius: 10px; background: #000; }
.bg, .fg, .chr, .me { position: absolute; image-rendering: pixelated; background-repeat: no-repeat; }
.bg { inset: 0; background-size: 100% 100%; transition: opacity .4s; }
.fg { background-size: 100% 100%; }
.chr { width: calc(64px * var(--s)); height: calc(128px * var(--s)); left: calc(160px * var(--s)); top: calc(var(--cy, 96px) * var(--s));
  background-size: calc(384px * var(--s)) 100%; animation: idle .9s steps(6) infinite; transition: opacity .3s, transform .3s; }
.me { width: calc(64px * var(--s)); height: calc(128px * var(--s)); left: calc(40px * var(--s)); top: calc(124px * var(--s));
  background-size: calc(384px * var(--s)) 100%; animation: idle 1.1s steps(6) infinite; z-index: 2; }
.chr.out { opacity: 0; transform: translateY(calc(8px * var(--s))); }
@keyframes idle { from { background-position-x: 0; } to { background-position-x: calc(-384px * var(--s)); } }
.night .bg { filter: brightness(.82) saturate(.9); }
.toast { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(20, 20, 35, .82); color: #fff;
  font-size: 13px; padding: 5px 12px; border-radius: 99px; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.toast.on { opacity: 1; }

.box { background: var(--paper); border-radius: 12px; padding: 14px 16px 10px; min-height: 120px; cursor: pointer; border: 2px solid #3a3550; }
.who { font-size: 13px; font-weight: 700; color: var(--brand); min-height: 18px; }
.text { font-size: 18px; line-height: 1.6; margin-top: 4px; }
.text.en { font-size: 20px; font-family: Georgia, "Times New Roman", serif; }
.text.narr { color: var(--muted); font-size: 16px; }
.text .tw { background: #f3e2b3; border-radius: 3px; padding: 0 2px; cursor: pointer; border-bottom: 2px dotted #c9a24a; }
.tw:active { background: #ecd28c; }
.paper .tw { cursor: pointer;  text-decoration: underline; text-decoration-color: #c9a24a; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gloss { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.7; border-top: 1px dashed var(--line); padding-top: 6px; }
.gloss b { color: var(--ink); font-family: Georgia, serif; }
.tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; min-height: 30px; }
.tool { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.more { margin-left: auto; font-size: 12px; color: var(--muted); }
.more[hidden] { display: none; }

.panel { display: grid; gap: 8px; }
.choice { text-align: left; border: 2px solid #3a3550; background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 17px; line-height: 1.45; }
.choice.en { font-family: Georgia, serif; }
.choice:active { transform: scale(.99); }
.choice.sub { background: transparent; color: #cfc8e2; border-color: #4a4566; font-size: 15px; }
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tag { position: relative; background: var(--tag); border: 2px solid var(--tag-line); border-radius: 8px; padding: 10px 8px 8px; text-align: left; min-height: 78px; }
.tag .n { font-family: Georgia, serif; font-weight: 700; font-size: 16px; line-height: 1.25; }
.tag .p { font-size: 13px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tag .d { font-family: Georgia, serif; font-size: 13px; color: var(--ink); margin-top: 4px; line-height: 1.35; }
.tag.sel { border-color: var(--brand); background: #e9ecff; }
.tag.sel::after { content: "✓"; position: absolute; right: 8px; top: 6px; color: var(--brand); font-weight: 800; }
.catalog { grid-template-columns: repeat(2, 1fr); }
.go { width: 100%; border: 0; border-radius: 12px; padding: 14px; background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; }
.go[disabled] { opacity: .45; }
.go.lv { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 4px; }
.go.lv small { font-weight: 400; font-size: 13px; opacity: .8; }
.picker { display: flex; align-items: center; justify-content: space-between; background: var(--paper); border: 2px solid #3a3550; border-radius: 12px; padding: 12px; }
.picker .arr { border: 0; background: #e9e2cf; border-radius: 99px; width: 44px; height: 44px; font-size: 18px; }
.picker .pv { display: flex; gap: 18px; }
.picker .pv i { display: block; width: 64px; height: 128px; background-size: 384px 128px; image-rendering: pixelated; animation: lookidle 1s steps(6) infinite; }
.choice.dice { text-align: center; }
.looks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.look { background: var(--paper); border: 2px solid #3a3550; border-radius: 12px; padding: 12px; display: flex; justify-content: center; }
.look i { display: block; width: 64px; height: 128px; background-size: 384px 128px; image-rendering: pixelated; animation: lookidle 1s steps(6) infinite; }
@keyframes lookidle { from { background-position-x: 0; } to { background-position-x: -384px; } }
.hint-line { color: #cfc8e2; font-size: 14px; text-align: center; }

.note { background: #fffdf5; border-radius: 12px; padding: 16px; border: 2px solid #3a3550; }
.note h2 { margin: 0 0 4px; font-size: 20px; }
.note .sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.note .stat { display: flex; gap: 16px; font-size: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.wordrow { border-top: 1px solid var(--line); padding: 10px 0; }
.wordrow .w { font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.wordrow .z { color: var(--muted); font-size: 14px; margin-left: 6px; }
.wordrow .flag { font-size: 12px; border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.flag.miss { background: #fbe4dc; color: var(--warn); }
.flag.hint { background: #fff1c9; color: #8a6412; }
.flag.ok { background: #dff2e7; color: var(--ok); }
.wordrow .ex { font-family: Georgia, serif; font-size: 14px; line-height: 1.5; margin-top: 4px; color: #3d3646; }
.wordrow .ex mark { background: #f3e2b3; padding: 0 2px; }
.wordrow .src { font-size: 12px; color: var(--muted); }
.paper { background: #f6efdc; border-radius: 6px; padding: 16px; font-family: "Bradley Hand", "Segoe Print", Georgia, serif; font-size: 17px; line-height: 1.8; color: #2d2a3a; border: 1px solid #d8caa4; box-shadow: 0 2px 0 #d8caa4; white-space: pre-line; }
.title-card { color: #efeaf8; text-align: center; padding: 26px 8px 8px; }
.title-card h1 { font-size: 30px; margin: 0; letter-spacing: .06em; }
.title-card p { color: #b9b2cc; margin: 8px 0 0; }
input.name { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid #3a3550; font-size: 17px; }
.credit { margin-top: auto; color: #8d87a3; font-size: 11px; line-height: 1.6; text-align: center; padding-top: 8px; }

/* 單字本（蓋在畫面上的一層） */
body.lock { overflow: hidden; }
.book { position: fixed; inset: 0; background: rgba(15, 16, 28, .72); z-index: 20; overflow-y: auto; padding: 16px; }
.book[hidden] { display: none; }
.book-in { max-width: 480px; margin: 0 auto; background: var(--paper); border-radius: 14px; padding: 16px; border: 2px solid #3a3550; }
.book-head { display: flex; align-items: center; justify-content: space-between; }
.book-head h2 { margin: 0; font-size: 20px; }
.book .x { border: 0; background: #e9e2cf; border-radius: 99px; width: 36px; height: 36px; font-size: 16px; }
.book-sub { color: var(--muted); font-size: 14px; margin: 6px 0 12px; line-height: 1.6; }
.book-empty { color: var(--muted); text-align: center; padding: 20px 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.tabs button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 8px; font-size: 14px; }
.tabs button.on { border-color: var(--brand); background: #e9ecff; color: var(--brand); font-weight: 700; }
.book-acts { display: grid; gap: 8px; margin-bottom: 12px; }
.book-acts.two { grid-template-columns: 1fr 1fr; margin-top: 12px; }
.book-acts .choice.sub { color: var(--muted); border-color: var(--line); text-align: center; }
.brow { border-top: 1px solid var(--line); padding: 12px 0; }
.brow.need .w { color: var(--warn); }
.bw { display: flex; align-items: center; gap: 8px; }
.book .w { font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.book .w.big { font-size: 34px; text-align: center; }
.book .say { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 2px 10px; font-size: 14px; }
.book .lv { font-size: 12px; color: var(--brand); background: #e9ecff; border-radius: 99px; padding: 1px 8px; }
.book .lv.star { color: #8a6412; background: #fff1c9; }
.book .z { color: var(--ink); font-size: 15px; margin-top: 2px; }
.book .z.big { font-size: 22px; text-align: center; margin-top: 12px; font-weight: 700; }
.book .cnt { color: var(--muted); font-size: 12px; margin-top: 2px; }
.book .ctx { font-family: Georgia, serif; font-size: 14px; line-height: 1.55; margin-top: 6px; color: #3d3646; }
.book .ctx span { font-family: -apple-system, "PingFang TC", sans-serif; font-size: 12px; color: var(--muted); margin-right: 4px; }
.book .ctx small { display: block; font-family: -apple-system, "PingFang TC", sans-serif; color: var(--muted); font-size: 12px; }
.book .ctx mark { background: #f3e2b3; padding: 0 2px; }
.book .card { text-align: center; padding: 16px 4px; }
.book .card .say { margin-top: 8px; }
.book .card .ctx { text-align: left; background: #fff; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }

/* 點螢光筆字跳出的小視窗 */
.wrap { position: relative; }
.pop { position: absolute; z-index: 15; width: min(300px, calc(100% - 16px)); background: #fff; border: 2px solid #3a3550; border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.pop[hidden] { display: none; }
.pop .pw { display: flex; align-items: center; gap: 8px; }
.pop .pw b { font-family: Georgia, serif; font-size: 22px; }
.pop .say { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 2px 10px; font-size: 14px; }
.pop .lv { font-size: 12px; color: var(--brand); background: #e9ecff; border-radius: 99px; padding: 1px 8px; }
.pop .pz { font-size: 16px; margin-top: 6px; }
.pop .ps { font-size: 13px; color: var(--muted); margin-top: 8px; }
.pop .pb { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pop .pb .choice { text-align: center; font-size: 15px; padding: 10px; }
.pop .pb .go { font-size: 15px; padding: 10px; }
.pop .pb:has(> :only-child) { grid-template-columns: 1fr; }

/* 進貨畫面上方：早上聽到的話 */
.heard { background: var(--paper); border: 2px solid #3a3550; border-radius: 12px; padding: 10px 12px; }
.heard-t { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.heard-t small { font-weight: 400; color: var(--muted); }
.heard-l { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 6px 0; border-top: 1px dashed var(--line); align-items: start; }
.heard-l .say { grid-row: span 2; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 2px 8px; font-size: 13px; }
.heard-l .hw { font-size: 12px; color: var(--brand); font-weight: 700; }
.heard-l .text.en { font-size: 16px; margin: 0; line-height: 1.5; }

/* 熟客清單 */
.prow { display: grid; grid-template-columns: 52px 1fr; gap: 10px; border-top: 1px solid var(--line); padding: 12px 0; }
.pface { display: block; width: 48px; height: 96px; background-size: 288px 96px; background-position: 0 0; image-rendering: pixelated; margin-top: -14px; }
.prow .hearts { color: #e2566b; font-size: 13px; letter-spacing: 1px; }
.prow .hearts .off { color: #e6dccb; }
.prow ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.hbtn { padding: 0 10px; }

/* 大考題型：文意選填／篇章結構／克漏字 */
.paper.quiz { font-family: Georgia, serif; font-size: 16px; line-height: 2; white-space: normal; }
.paper.quiz .qt { font-family: -apple-system, "PingFang TC", sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.blank { display: inline-block; min-width: 54px; padding: 0 8px; margin: 0 2px; border: 0; border-bottom: 2px solid #8a7a52; background: #fff7df; border-radius: 4px 4px 0 0; font: inherit; font-size: 15px; line-height: 1.6; color: var(--muted); text-align: center; }
.blank.on { color: var(--ink); background: #fff; font-weight: 700; }
.blank.sel { outline: 2px solid var(--brand); }
.blank.right { background: #dff2e7; border-color: var(--ok); }
.blank.wrong { background: #fbe4dc; border-color: var(--warn); text-decoration: line-through; }
.fix { color: var(--ok); font-weight: 700; margin: 0 4px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.sentence { flex-direction: column; }
.chip { border: 2px solid #3a3550; background: #fff; border-radius: 99px; padding: 8px 12px; font-family: Georgia, serif; font-size: 15px; }
.chips.sentence .chip { border-radius: 10px; text-align: left; line-height: 1.45; display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.chip span { margin-left: 4px; }
.chips.sentence .chip span { margin-left: 0; }
.paper.quiz .blank.on { white-space: normal; text-align: left; }
.chip b { font-family: -apple-system, sans-serif; color: var(--brand); margin-right: 2px; }
.chip.used { opacity: .35; }
.crow-list { display: grid; gap: 6px; }
.crow { display: grid; grid-template-columns: 22px repeat(2, 1fr); gap: 6px; align-items: center; background: var(--paper); border-radius: 10px; padding: 8px; }
.crow .cn { grid-row: span 2; font-weight: 800; color: var(--brand); text-align: center; }
.copt { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 8px; font-family: Georgia, serif; font-size: 14px; text-align: left; }
.copt.sel { border-color: var(--brand); background: #e9ecff; }
.copt.right { border-color: var(--ok); background: #dff2e7; }
/* 今天的運氣與昨晚的選擇（roguelike） */
.luck { background: #fff6d8; border: 2px dashed #c79a2b; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; font-size: 14px; line-height: 1.6; color: #4a3a10; }
.luck b { color: #8a5a00; }
/* 連擊 */
.chip { position: relative; }
.combo { position: absolute; right: 8px; top: -10px; font-style: normal; font-size: 12px; font-weight: 700; background: #ff7a1a; color: #fff; border-radius: 999px; padding: 1px 7px; }
/* 只聽模式：字幕先糊掉 */
.text.veil { filter: blur(6px); cursor: pointer; transition: filter .25s; }
/* 設定 */
.prow.set { align-items: center; }
.prow.set .tog { min-width: 64px; margin: 0; }
/* 幕末成績單 */
.report h3 { margin: 14px 0 6px; font-size: 15px; }
.rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.rgrid div { background: #f3efe2; border-radius: 10px; padding: 8px 4px; text-align: center; }
.rgrid b { display: block; font-size: 20px; color: #2d2a6e; }
.rgrid span { font-size: 12px; color: #6b6458; }
/* 標題列：五顆鈕在 375px 也排一行 */
.hud-top { gap: 6px; }
#hudDay { white-space: nowrap; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-btns { gap: 5px; flex-shrink: 0; }
.hbtn { white-space: nowrap; padding: 0 8px; }
#sndBtn, #setBtn { width: 30px; padding: 0; }
@media (max-width: 400px) { .hbtn { font-size: 12px; padding: 0 7px; } #hudDay { font-size: 12px; } }
.prow.set { display: flex; gap: 12px; }
.prow.set .pinfo { flex: 1; min-width: 0; }
.prow.set .tog { flex: 0 0 64px; width: 64px; padding: 8px 0; }
/* 貨品小圖 */
.tag .ic { display: block; width: 32px; height: 32px; image-rendering: pixelated; margin-bottom: 4px; }
.text.narr { white-space: pre-line; }

/* 統計頁 */
.hbtn.ico { width: 34px; padding: 0; }
.hud-top { flex-wrap: wrap; gap: 4px 8px; }
@media (max-width: 430px) { .hbtn .t { display: none; } .hbtn { padding: 0 9px; } .hbtn.ico, .hbtn.snd { padding: 0; } .hud-btns { gap: 6px; } }
.stview h3 { font-size: 15px; margin: 20px 0 8px; }
.st-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-tiles div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 2px; text-align: center; }
.st-tiles b { display: block; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.st-tiles span { font-size: 12px; color: var(--muted); }
.st-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.st-levels { display: grid; gap: 6px; }
.st-lv { display: grid; grid-template-columns: 48px 1fr 62px; gap: 8px; align-items: center; font-size: 13px; }
.st-lv .tr { height: 10px; background: #e9e2cf; border-radius: 99px; overflow: hidden; }
.st-lv .tr i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.st-lv .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-days { display: grid; grid-template-columns: repeat(14, 1fr); height: 84px; border-bottom: 1px solid var(--line); }
.st-d { border: 0; background: transparent; padding: 0 2px; height: 100%; display: flex; align-items: flex-end; }
.st-d i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; }
.st-d:hover i, .st-d:focus-visible i { background: #4f62c9; }
.st-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.st-table th { font-weight: 600; color: var(--muted); font-size: 12px; }
.st-table th, .st-table td { padding: 6px 2px; text-align: right; border-bottom: 1px solid var(--line); }
.st-table th:first-child, .st-table td:first-child { text-align: left; }
.st-hard div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); }
.st-hard .w { font-size: 16px; overflow-wrap: anywhere; }
.st-hard .z { font-size: 13px; }
.st-hard .n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.st-go { width: 100%; margin-top: 10px; text-align: center; font-size: 15px; }
.st-prog > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.st-prog span { color: var(--muted); font-size: 13px; }

/* 小遊戲 */
.mini { background: var(--paper); border: 2px solid #3a3550; border-radius: 12px; padding: 12px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.book .mini { border: 0; padding: 0; margin-top: 8px; }
.mini-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.mini-st { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-how { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 6px 0 8px; }
.mini-q { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 8px; }
.mini-big { font-size: 20px; font-weight: 700; }
.mini-say { padding: 8px 14px; font-size: 14px; }
.mini-sub { font-size: 13px; color: var(--muted); flex-basis: 100%; }
.mini-area { position: relative; border-radius: 10px; overflow: hidden; }
.mini-menu { display: grid; gap: 8px; }
.mini-menu .choice { display: grid; gap: 2px; }
.mini-menu .choice span { font-size: 13px; color: var(--muted); }
.mini-menu .choice:disabled { opacity: .5; }
.mini-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.mini-row .w { font-family: Georgia, serif; font-size: 16px; }
.mini-row.ok span:last-child { color: var(--ok); }
.mini-row.no span:last-child { color: var(--warn); }
.mini-end .go { width: 100%; margin-top: 12px; }
/* 抓老鼠 */
.g-rat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 10px 10px; background: #3b2e2a; }
.crate { position: relative; aspect-ratio: 1; background: url(assets/mini/crate.png) center bottom / 100% 72% no-repeat; image-rendering: pixelated; }
.mouse { position: absolute; left: 6%; right: 6%; bottom: 40%; border: 0; background: transparent; padding: 0; opacity: 0; transform: translateY(30%) scale(.8); transition: opacity .15s, transform .18s; pointer-events: none; display: grid; justify-items: center; gap: 2px; }
.mouse i { width: 64%; aspect-ratio: 16 / 12; background: url(assets/mini/mouse0.png) center / 100% 100% no-repeat; image-rendering: pixelated; animation: miniBob .5s steps(2) infinite; }
.mouse span { background: #fff9e8; border: 2px solid #d9c79c; border-radius: 6px; font-size: 13px; line-height: 1.25; padding: 2px 4px; color: var(--ink); max-width: 100%; overflow-wrap: anywhere; }
.mouse.up { opacity: 1; transform: none; pointer-events: auto; }
.mouse.right span { border-color: var(--ok); background: #e6f6ec; }
.mouse.wrong:not(.right) { opacity: .45; }
.mouse.bonk { transform: scale(.9) translateY(10%); }
.mouse.miss { animation: miniShake .3s; }
@keyframes miniBob { 50% { background-image: url(assets/mini/mouse1.png); } }
/* 海鷗、魚 */
.g-sea { height: 230px; background: linear-gradient(#bfe3f2 0 62%, #4c86a6 62% 100%); }
.g-fish { height: 250px; background: linear-gradient(#4c86a6, #2c5874); }
.mover { position: absolute; left: 0; border: 0; background: transparent; padding: 0; display: grid; justify-items: center; gap: 2px; animation: miniFly linear both; }
.mover i { width: 54px; height: 27px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.mover.gull i { background-image: url(assets/mini/gull0.png); animation: miniFlap .4s steps(2) infinite; }
.mover.fish i { width: 50px; background-image: url(assets/mini/fish0.png); animation: miniSwim .6s steps(2) infinite; }
.mover.fish.rev { animation-name: miniFlyRev; }
.mover.fish.rev i { transform: scaleX(-1); }
.mover span { background: #fff; border: 2px solid #34449c; border-radius: 6px; font-family: Georgia, serif; font-size: 16px; padding: 1px 6px; color: var(--ink); white-space: nowrap; }
.mover.right span { border-color: var(--ok); background: #e6f6ec; }
.mover.wrong:not(.right) { opacity: .4; }
.mover.caught { transform: translateY(-14px) scale(1.08); }
.mover.miss span { border-color: var(--warn); }
@keyframes miniFly { from { transform: translateX(-90px); } to { transform: translateX(calc(var(--w, 320px) + 10px)); } }
@keyframes miniFlyRev { from { transform: translateX(calc(var(--w, 320px) + 10px)); } to { transform: translateX(-90px); } }
@keyframes miniFlap { 50% { background-image: url(assets/mini/gull1.png); } }
@keyframes miniSwim { 50% { background-image: url(assets/mini/fish1.png); } }
/* 招牌 */
.g-sign { background: #2c3a35; padding: 16px 10px; display: grid; gap: 16px; }
.board { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.board i { width: 30px; height: 40px; border-bottom: 3px solid #efe9d8; font: 700 26px/40px Georgia, serif; color: #efe9d8; text-align: center; font-style: normal; }
.board i.show { color: #f2a28f; }
.board.right i { color: #9be0b4; border-color: #9be0b4; }
.tiles { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tile { width: 42px; height: 46px; border: 0; border-radius: 8px; background: #efe9d8; font: 700 22px Georgia, serif; color: #2c3a35; box-shadow: 0 3px 0 #b9b19a; }
.tile:disabled { opacity: .25; }
.tile.shake { animation: miniShake .3s; background: #f2c5b8; }
@keyframes miniShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
/* 配對 */
.g-match { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; background: #3b2e2a; }
.mcard { aspect-ratio: 1 / .8; border: 0; border-radius: 8px; background: url(assets/mini/crate.png) center / 100% 100% no-repeat; image-rendering: pixelated; padding: 4px; }
.mcard span { visibility: hidden; display: block; background: #fff9e8; border-radius: 6px; font-size: 14px; line-height: 1.3; padding: 4px 2px; color: var(--ink); overflow-wrap: anywhere; image-rendering: auto; }
.mcard.open span, .mcard.done span { visibility: visible; }
.mcard.done span { background: #e6f6ec; }
.mcard.done { opacity: .75; }

/* 學測英文教材連結（v29）：一行字，不搶戲 */
.bookhook { display: block; margin: 10px 0 4px; padding: 10px 12px; border: 1px dashed #8b93ff; border-radius: 10px; color: #c9ccff; font-size: 14px; line-height: 1.5; text-decoration: none; background: rgba(139,147,255,.08); }
.bookhook span { display: block; color: #fff; font-weight: 700; margin-bottom: 2px; }
.note .bookhook, .book-in .bookhook { color: #4b4fd8; background: rgba(75,79,216,.06); border-color: #8b93ff; }
.note .bookhook span, .book-in .bookhook span { color: #2a2d6e; }

/* v30 問卷：選項多時排兩欄 */
#panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#panel.two .choice { margin: 0; padding: 10px 10px; font-size: 15px; }
