/* 常識升學記・碰皮今夜秀 大型特別企劃（FULL_REDESIGN_SPEC、DESIGN_SYSTEM_PENGPI 方案 C）
   像素角色與棋盤素材（assets/full/）維持 8-bit、最近鄰縮放；播出介面（HUD、主持字幕、題卡、事件卡、成績紙、系統層）是現代深夜秀介面。
   桌面：1920×1080 舞台整張等比縮放（ui.js fitStage）。手機橫放（body.layout-m）：舞台＝可見區域的 CSS px，文字介面用真實 px 排版，
   只有棋盤層（#board-wrap）用鏡頭取景（最後一段）。顏色、字型、圓角、動效一律讀 css/full_tokens.css 的代碼。 */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--pengpi-midnight); color: var(--c-text); font-family: var(--font-body); overflow: hidden;
  -webkit-tap-highlight-color: transparent; user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus { outline: none; }
button:focus-visible { box-shadow: var(--focus-ring); }
img { -webkit-user-drag: none; }

#viewport { position: fixed; inset: 0; }
#stage { position: absolute; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #10224a 0%, var(--pengpi-midnight) 60%, #040914 100%); }

/* ---------- 共通：鍵帽、按鈕主次（SPEC 5.5、6.9；DESIGN_SYSTEM 6.1） ---------- */
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 8px;
  font: 700 18px/1 var(--font-label); color: var(--c-muted); background: rgb(255 255 255 / 6%); border: 2px solid rgb(175 194 232 / 35%); white-space: nowrap; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; line-height: 1.25;
  min-height: 80px; padding: 14px 28px; font-size: var(--fs-body); font-weight: 700; color: var(--c-text);
  background: var(--c-raised); border: var(--bw-s) solid var(--pengpi-slate); border-radius: var(--radius-control);
  transition: transform var(--dur-press) var(--ease-standard), background var(--dur-fast), border-color var(--dur-fast), filter var(--dur-fast); }
.opt small { font-size: 20px; font-weight: 500; color: var(--c-muted); }
.opt b { font-weight: 700; }
.opt > .kbd { position: absolute; left: 12px; top: 10px; }
.opt:active:not(:disabled) { transform: scale(.98); }
@media (hover: hover) { .opt:hover:not(:disabled) { border-color: var(--c-focus); filter: brightness(1.07); } }
.opt.focus { border-color: var(--c-focus); box-shadow: 0 0 0 3px rgb(40 217 255 / 35%); }
.opt:disabled { background: var(--c-disabled-bg); color: var(--c-disabled-ink); border-color: #34466a; filter: none; }
.opt:disabled small { color: var(--c-disabled-ink); }
/* 主按鈕：珊瑚紅底、象牙白字、3px 象牙白內框；每個畫面最多一顆 */
.opt.btn-primary, .opt.primary { background: var(--c-primary); color: var(--c-primary-ink); border: 0; box-shadow: inset 0 0 0 3px rgb(255 248 232 / 85%), 0 8px 24px rgb(255 93 115 / 28%); }
.opt.btn-primary small, .opt.primary small { color: rgb(255 248 232 / 88%); }
.opt.btn-primary .kbd, .opt.primary .kbd { color: var(--c-primary-ink); border-color: rgb(255 248 232 / 60%); background: rgb(0 0 0 / 12%); }
.opt.btn-primary:disabled { background: var(--c-disabled-bg); color: var(--c-disabled-ink); box-shadow: none; }
.opt.btn-primary.focus, .opt.primary.focus { box-shadow: inset 0 0 0 3px var(--pengpi-ivory), var(--focus-ring); }
.opt.btn-secondary { background: var(--c-raised); }
/* 文字連結：回節目首頁、查看詳細、回報問題（觸控區用 padding 撐出 ≥ 48px） */
.opt.btn-text { min-height: 56px; background: transparent; border: 0; box-shadow: none; color: var(--c-muted); padding: 8px 18px; font-size: 22px; font-weight: 500; }
.opt.btn-text b { font-weight: 500; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: rgb(175 194 232 / 45%); }
@media (hover: hover) { .opt.btn-text:hover:not(:disabled) { color: var(--c-text); } }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
/* 小籌碼：卡片、訪客加入、學分展開 */
.btn-chip { pointer-events: auto; }

/* ---------- 播出層（HUD；SPEC 6.3、DESIGN_SYSTEM 6.7）y 0～112 ---------- */
#hud { position: absolute; left: 0; top: 0; width: 1920px; height: var(--hud-h); z-index: var(--z-dock); display: flex; align-items: center; gap: 22px; padding: 0 150px 0 24px;
  background: linear-gradient(180deg, rgb(5 10 22 / 96%), rgb(13 27 56 / 92%)); border-bottom: 2px solid rgb(40 217 255 / 35%); box-shadow: 0 6px 20px rgb(0 0 0 / 35%); }
#hud:empty { display: none; }
#hud small { display: block; font: 600 var(--fs-min)/1.2 var(--font-label); color: var(--c-muted); letter-spacing: .02em; white-space: nowrap; }
.h-brand { display: flex; align-items: center; gap: 12px; flex: none; }
.h-logo { height: 64px; width: auto; image-rendering: pixelated; filter: drop-shadow(0 2px 6px rgb(0 0 0 / 50%)); }
.h-brand-t { display: flex; flex-direction: column; gap: 4px; }
.h-pills { display: flex; gap: 6px; }
.h-onair, .h-label { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font: 800 16px/1 var(--font-label); white-space: nowrap; }
.h-onair { background: var(--c-live); color: var(--pengpi-ink); }
.h-label { background: rgb(135 91 255 / 22%); color: #D9CCFF; border: 2px solid var(--c-special); font-family: var(--font-body); }
.h-game { font-size: 28px; font-weight: 900; letter-spacing: .04em; color: var(--pengpi-ivory); text-shadow: 0 0 14px rgb(135 91 255 / 60%); white-space: nowrap; }
.h-stage { flex: none; min-width: 170px; }
.h-stage b { display: block; font-size: 34px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.h-stage small { color: var(--pengpi-cyan) !important; font-family: var(--font-body) !important; font-size: 20px !important; }
/* 四學級進度：4 節點＋連線，目前學級高亮（已完成實心、目前外圈、未到空心） */
.h-prog { flex: none; display: flex; align-items: flex-start; }
.h-prog span { position: relative; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.h-prog span + span::before { content: ''; position: absolute; top: 9px; right: 50%; width: 74px; height: 4px; background: #2a3b62; z-index: 0; }
.h-prog span.done::before, .h-prog span.now::before { background: var(--c-focus) !important; }
.h-prog i { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: #1a2a4f; border: 3px solid #3b4f7c; }
.h-prog .done i { background: var(--c-focus); border-color: var(--c-focus); }
.h-prog .now i { background: var(--pengpi-ivory); border-color: var(--c-focus); box-shadow: 0 0 0 4px rgb(40 217 255 / 35%); }
.h-prog small { font-family: var(--font-body) !important; font-size: 18px !important; }
.h-prog .now small { color: var(--c-text) !important; font-weight: 800; }
.h-score { flex: none; min-width: 150px; }
.h-score b { display: block; font: 800 40px/1.05 var(--font-number); color: var(--pengpi-amber); font-variant-numeric: tabular-nums; }
.h-lives { flex: none; }
/* 分數、便當變化時強調一次（減少動態效果時只換色，見檔尾） */
.h-score.bump b { animation: hudbump calc(var(--fx, 1) * .5s) var(--ease-enter); color: var(--pengpi-ivory); }
.h-lives.bump span { animation: hudbump calc(var(--fx, 1) * .5s) var(--ease-enter); }
.h-lives.bump-down span { animation: hudbump calc(var(--fx, 1) * .5s) var(--ease-enter); filter: drop-shadow(0 0 6px var(--c-danger)); }
@keyframes hudbump { 0% { transform: scale(1.25); } 100% { transform: none; } }
.h-lives span { display: flex; gap: 6px; margin-top: 6px; }
.h-lives i { width: 26px; height: 26px; border-radius: 7px; background: #1b2b4f; border: 2px solid #3b4f7c; display: block; }
.h-lives i.on { background: var(--pengpi-amber); border-color: #ffe3a3; box-shadow: 0 0 10px rgb(255 200 87 / 45%); }
/* LUCKY 卡槽（小卡圖＋卡名）；書包被坐住時上鎖並寫「本回合不能用卡」 */
.h-hand { flex: none; }
.h-hand span { display: flex; gap: 8px; margin-top: 4px; }
.h-hand i { font-style: normal; display: flex; align-items: center; gap: 6px; min-width: 116px; height: 58px; padding: 2px 10px 2px 4px; border: 2px dashed #3b4f7c; border-radius: 10px; color: #6f81a8; font-size: 20px; justify-content: center; }
.h-hand i.on { border: 2px solid var(--pengpi-amber); color: var(--pengpi-ivory); background: rgb(255 200 87 / 12%); justify-content: flex-start; }
.h-hand i em { font-style: normal; white-space: nowrap; font-weight: 700; }
.h-hand .lcard { width: 36px; }
.h-hand.locked small { color: var(--c-danger) !important; font-family: var(--font-body) !important; }
.h-hand.locked i { opacity: .45; text-decoration: line-through; }
.h-hand.locked i::after { content: '🔒'; font-size: 16px; text-decoration: none; }
/* 學分 n／6：取代常駐的六科章，點了展開 M04 */
.h-credits { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; height: 76px; padding: 4px 12px; border-radius: var(--radius-control);
  background: rgb(40 217 255 / 10%); border: 2px solid rgb(40 217 255 / 55%); color: var(--c-text); }
.h-credits b { font: 800 30px/1 var(--font-number); }
.h-credits b span { font-size: 20px; color: var(--c-muted); }
#stage.in-exam .h-credits { visibility: hidden; }
/* 雙人：主區顯示目前輪到的人；兩人分數與便當 */
.h-duo { flex: none; display: flex; flex-direction: column; gap: 4px; font-size: 20px; }
.h-duo .pl { padding: 2px 12px; border: 2px solid #3b4f7c; border-radius: 10px; color: var(--c-muted); white-space: nowrap; line-height: 1.3; }
#hud .h-duo .pl b { font-size: 22px; margin-right: 4px; color: var(--c-text); }
.h-duo .pl.on { border-color: var(--c-focus); color: var(--c-text); background: rgb(40 217 255 / 12%); }
.h-duo .guest-tag { font-style: normal; font-size: 18px; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--pengpi-amber); color: var(--pengpi-ink); }
/* 考試、高潮卡期間 HUD 降亮度但不消失（考試要看便當與可用卡） */
#stage[data-view="h"] #hud { filter: brightness(.7); }

/* 暫停鈕（⏸，Esc）：右上，取代「✕ 回片頭」；只在一局裡顯示，全畫面時藏起來 */
#btn-pause { display: none; position: absolute; right: 16px; top: 16px; z-index: var(--z-hud-btn); width: 116px; height: 80px; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--c-raised); border: 2px solid var(--pengpi-slate); border-radius: var(--radius-control); color: var(--c-text); font-size: 20px; font-weight: 700; }
#btn-pause .pz-ico { width: 22px; height: 24px; border-left: 7px solid currentColor; border-right: 7px solid currentColor; }
#btn-pause small { font: 600 14px/1 var(--font-label); color: var(--c-muted); }
@media (hover: hover) { #btn-pause:hover { border-color: var(--c-focus); } }
#stage.in-game #btn-pause { display: flex; }
#screen:not([hidden]) ~ #btn-pause { display: none; }

/* ---------- 主舞台：棋盤（校園外景；SPEC 2.1 y 112～750） ---------- */
#board-area { position: absolute; inset: 0; z-index: var(--z-board); pointer-events: none; }
#board-wrap { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
/* 外景框：C_03 的「FIELD PACKAGE」框線 */
#stage[data-board] #board-area::before { content: ''; position: absolute; left: 16px; top: 120px; width: 1888px; height: 622px; border: 2px solid rgb(40 217 255 / 45%); border-radius: var(--radius-feature);
  box-shadow: inset 0 0 0 1px rgb(135 91 255 / 25%); pointer-events: none; }
#board-title { position: absolute; left: 40px; top: 132px; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; border-radius: 12px;
  background: rgb(5 10 22 / 86%); border: 2px solid var(--pengpi-amber); font-size: 24px; white-space: nowrap; }
#board-title:empty { display: none; }
#board-title .bt-kicker { font: 800 16px/1 var(--font-label); padding: 5px 8px; border-radius: 6px; background: var(--pengpi-cyan); color: var(--pengpi-ink); }
#board-title b { font-weight: 800; }
#links { position: absolute; left: 0; top: 0; filter: drop-shadow(0 0 3px #071126) drop-shadow(0 0 2px #071126); }
#links line { stroke: #fff6d8; stroke-width: 8; stroke-dasharray: 2 12; stroke-linecap: round; }
/* 棋盤底圖（學級背景）；下方 dock 區加一層漸暗 */
#stage[data-board] { background-size: 1920px 1080px; background-repeat: no-repeat; image-rendering: pixelated; --dim: rgb(7 17 38 / 18%); --fade: linear-gradient(180deg, rgb(7 17 38 / 0) 62%, rgb(5 10 22 / 82%) 72%, rgb(5 10 22 / 94%) 100%); }
#stage[data-board="elem"] { background-image: var(--fade), url(../assets/full/bg_elem.png);
  background-image: var(--fade), image-set(url(../assets/full/bg_elem.webp) type("image/webp"), url(../assets/full/bg_elem.png) type("image/png")); }
#stage[data-board="junior"] { background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), url(../assets/full/bg_middle.png);
  background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), image-set(url(../assets/full/bg_middle.webp) type("image/webp"), url(../assets/full/bg_middle.png) type("image/png")); }
#stage[data-board="high"] { --dim: rgb(7 17 38 / 30%); background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), url(../assets/full/bg_high.png);
  background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), image-set(url(../assets/full/bg_high.webp) type("image/webp"), url(../assets/full/bg_high.png) type("image/png")); }
#stage[data-board="uni_arts"] { --dim: rgb(7 17 38 / 28%); background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), url(../assets/full/bg_uni_arts.png);
  background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), image-set(url(../assets/full/bg_uni_arts.webp) type("image/webp"), url(../assets/full/bg_uni_arts.png) type("image/png")); }
#stage[data-board="uni_sci"] { background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), url(../assets/full/bg_uni_sci.png);
  background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), image-set(url(../assets/full/bg_uni_sci.webp) type("image/webp"), url(../assets/full/bg_uni_sci.png) type("image/png")); }
#stage[data-board="uni_intl"] { --dim: rgb(7 17 38 / 24%); background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), url(../assets/full/bg_uni_intl.png);
  background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), image-set(url(../assets/full/bg_uni_intl.webp) type("image/webp"), url(../assets/full/bg_uni_intl.png) type("image/png")); }
#stage[data-board="summer"] { --dim: rgb(7 17 38 / 36%); background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), url(../assets/full/bg_summer.png);
  background-image: var(--fade), linear-gradient(var(--dim), var(--dim)), image-set(url(../assets/full/bg_summer.webp) type("image/webp"), url(../assets/full/bg_summer.png) type("image/png")); }
/* 地點名稱（高中環島、大學學院棋盤）：格子正下方的小字牌 */
#cells .place { position: absolute; transform: translateX(-50%); font-size: 19px; line-height: 1; padding: 4px 10px; border-radius: 8px; white-space: nowrap;
  background: rgb(5 10 22 / 86%); color: #fff6d8; border: 1px solid rgb(40 217 255 / 35%); pointer-events: none; }
/* 格子：深藍底（配合像素圖），中央圖示、下方文字標籤，外框是科目色 */
#cells .cell { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: rgb(13 27 56 / 94%); border: 5px solid #8a97c8; border-radius: 14px; line-height: 1.1; padding: 2px; white-space: nowrap; overflow: hidden;
  box-shadow: 0 6px 0 rgb(0 0 0 / 45%); text-shadow: 0 2px 0 #000; color: var(--pengpi-ivory); }
#cells .cell b { font-weight: 800; }
#cells .cell small { font-size: .7em; color: #eee; }
#cells .cell .ico { width: 52%; height: auto; image-rendering: pixelated; flex: none; margin-bottom: 2px; }
#cells .cell .ico.sm { width: 40%; margin: 0; }
#cells .cell .ico.choice { width: 64%; margin: -7px 0 -6px; }
#cells .cell .pair { display: flex; gap: 4px; justify-content: center; }
#cells .cell .pair.chip b { padding: 1px 4px 2px; border-radius: 4px; color: #fff; }
#cells .t-subject { border-color: var(--sc); padding: 6px 0 0; justify-content: space-between; }
#cells .t-subject b { align-self: stretch; background: var(--sc); padding: 2px 0 3px; }
#cells .t-choice { border-color: var(--sc); border-right-color: var(--sc2); border-bottom-color: var(--sc2); font-size: .82em; }
#cells .t-lucky { border-color: var(--pengpi-amber); color: var(--pengpi-amber); }
#cells .t-extra { border-style: double; border-width: 8px; }
#cells .t-genius { border-color: #fff; background: rgb(60 56 130 / 95%); }
#cells .t-trouble { border-color: var(--c-danger); color: #ffd0d6; background: rgb(74 20 40 / 95%); }
#cells .t-rest { border-color: var(--pengpi-cyan); background: rgb(16 60 92 / 95%); }
#cells .t-mystery { border-style: dashed; }
#cells .t-start, #cells .t-exam { background: rgb(5 10 22 / 96%); border-color: #ddd; }
#cells .t-exam { border-color: var(--pengpi-amber); }
#cells .cell.visited { filter: brightness(.55) saturate(.35); }
#cells .t-genius b, #cells .t-extra b { font-size: .92em; letter-spacing: -1px; }
#cells .cell .ls { display: none; }
#cells .t-trouble b { font-size: .78em; letter-spacing: -1px; }
#cells .t-lesson { border-color: var(--sc); border-right-color: var(--sc2); border-bottom-color: var(--sc2); border-width: 8px; background: rgb(84 62 28 / 95%); font-size: .82em; }
#cells .t-lesson small { color: #ffe6b0; }
/* 目前格：放大＋青色外圈（SPEC C03 當前格放大） */
#cells .cell.here { filter: none; outline: 6px solid var(--pengpi-cyan); outline-offset: 4px; z-index: 1; }
#cells .cell.flash { animation: flash .5s steps(2) 2; }
@keyframes flash { 50% { filter: brightness(1.8); } }
#cells .cell.fork-pick { filter: none; box-shadow: 0 0 0 6px rgb(135 91 255 / 80%), 0 0 24px rgb(135 91 255 / 60%); }
/* 前方預覽的高亮與點數標籤（右上角） */
#cells .cell.reach { filter: none; box-shadow: 0 0 0 6px rgb(255 200 87 / 70%); }
#cells .cell.reach-bell { box-shadow: 0 0 0 6px rgb(255 93 115 / 80%); }
#cells .reach-tag { position: absolute; right: -2px; top: -2px; font-style: normal; font: 900 22px/1.3 var(--font-number); color: var(--pengpi-ink); background: var(--pengpi-amber);
  border-radius: 0 8px 0 10px; padding: 0 7px; z-index: 1; text-shadow: none; box-shadow: -2px 2px 0 rgb(0 0 0 / 50%); }
/* 棋子：1P 黑皮、2P 碰碰（256×256 像素圖縮成 84px）；兩影格由 ui.js 每 400 ms 切換 #board-wrap.f2 */
#pawn, #pawn2 { position: absolute; left: -200px; top: 0; width: 84px; height: 84px; margin-left: -42px; transition: left .2s steps(3), top .2s steps(3); z-index: 2; color: transparent; }
#pawn img, #pawn2 img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgb(0 0 0 / 55%)); }
#pawn .f2, #pawn2 .f2, #board-wrap.f2 #pawn .f1, #board-wrap.f2 #pawn2 .f1 { visibility: hidden; }
#board-wrap.f2 #pawn .f2, #board-wrap.f2 #pawn2 .f2 { visibility: visible; }
#pawn .tag, #pawn2 .tag { position: absolute; left: 70px; top: 22px; font-style: normal; font-size: 20px; font-weight: 900; padding: 0 8px; border-radius: 6px;
  background: var(--pengpi-amber); color: var(--pengpi-ink); border: 2px solid var(--pengpi-ink); white-space: nowrap; }
#pawn2 .tag { background: var(--pengpi-cyan); }
#pawn.tag-left .tag, #pawn2.tag-left .tag { left: auto; right: 70px; }
#pawn .tag:empty, #pawn2 .tag:empty { display: none; }
#pawn.active, #pawn2.active { z-index: 3; }
#pawn.active img, #pawn2.active img { filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 3px 0 rgb(0 0 0 / 55%)); }
.cam-more { display: none; }
/* 題卡、考試、全畫面時棋盤退場（SPEC 3.16：Q、E 棋盤退場；考試時棋盤、路線都不出現） */
#stage[data-view="q"] #board-area, #stage.in-exam #board-area { visibility: hidden; opacity: 0; } /* 棋子影格的 visibility: visible 會蓋過繼承，所以另外設透明 */
#stage[data-view="q"], #stage.in-exam { background: radial-gradient(120% 90% at 50% 0%, #14295a 0%, var(--pengpi-midnight) 58%, #040914 100%) !important; }

/* ---------- 主持與操作層（dock；y 750～1080） ---------- */
#dock { position: absolute; left: 0; top: 750px; width: 1920px; height: var(--dock-h); z-index: var(--z-dock); display: flex; gap: 24px; padding: 14px 32px 22px; align-items: stretch; }
/* 主持字幕（Host subtitle；SPEC 6.4）：頭像壓在框外、名牌只寫黑皮／碰碰、台詞最多 2 行；左側訊號色條 */
#dialog { position: relative; flex: 0 0 1100px; height: 230px; align-self: center; display: flex; gap: 24px; align-items: center; padding: 18px 30px 18px 190px;
  background: rgb(5 10 22 / 94%); border: 2px solid rgb(101 120 159 / 70%); border-left: 12px solid var(--c-special); border-radius: var(--radius-card); box-shadow: var(--shadow-hard); }
#dialog.wait { border-color: var(--pengpi-cyan); border-left-color: var(--c-special); cursor: pointer; }
#dialog.wait::after { content: '點一下繼續・Enter'; position: absolute; right: 22px; bottom: 12px; font-size: 18px; color: var(--pengpi-cyan); }
#dialog.pop { animation: pop calc(var(--fx, 1) * .2s) var(--ease-enter); }
@keyframes pop { from { transform: translateY(8px); opacity: .6; } }
#dlg-face { --av: 180px; position: absolute; left: 4px; bottom: 0; width: var(--av); height: calc(var(--av) + 30px); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
#dlg-avatar { display: block; width: auto; height: calc(var(--av) * 476 / 481); max-width: none; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 35%)); }
#dlg-name { display: inline-block; font-size: 20px; font-weight: 800; color: var(--pengpi-amber); letter-spacing: .1em; }
#dlg-text { margin: 6px 0 0; font-size: 34px; line-height: 1.38; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#dialog.talk #dlg-avatar { animation: talk .26s steps(2) infinite; }
#dialog.talk #dlg-name::after { content: ' ♪'; }
@keyframes talk { 50% { transform: translateY(-4px); } }
#actions { position: relative; flex: 1; display: flex; gap: 20px; align-items: stretch; min-width: 0; }
/* 擲骰時：dock 三欄（主持 600｜骰子 300｜前方預覽其餘） */
#dock.dicing #dialog { flex-basis: 600px; padding-left: 150px; }
#dock.dicing #dlg-face { --av: 140px; }
#dock.dicing #dlg-text { font-size: 28px; }
.dice-col { flex: 0 0 300px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 14px 14px; background: rgb(5 10 22 / 92%); border: 2px solid var(--pengpi-amber); border-radius: var(--radius-card); }
.slot { position: relative; width: 100%; height: 150px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; pointer-events: auto; flex: none; }
.slot-label { font-size: 22px; font-weight: 800; color: var(--pengpi-amber); white-space: nowrap; }
.slot-win { margin: 2px auto 0; width: 150px; height: 100px; display: flex; align-items: center; justify-content: center; }
.slot-win b { font: 900 76px/1 var(--font-number); color: var(--pengpi-ivory); font-variant-numeric: tabular-nums; }
.slot-range { font-size: 18px; line-height: 1.1; color: var(--c-muted); }
.slot.art .slot-win { width: 96px; height: 96px; position: relative; }
.slot.art .slot-win b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.slot.art .dice-img { width: 96px; height: 96px; image-rendering: pixelated; }
.slot.shake .slot-win { animation: shake .12s steps(2) infinite; }
@keyframes shake { 50% { transform: translateX(4px) rotate(2deg); } }
.slot.reveal .slot-win { transform: scale(1.18); }
.slot.reveal .dice-img { filter: drop-shadow(0 0 8px var(--pengpi-amber)); }
.slot.reveal .slot-win b { color: var(--pengpi-amber); }
/* 主按鈕「停！」：轉動中就是這一顆；外圈是 4.7 秒自動停的倒數 */
.opt.stop { width: 100%; min-height: 72px; flex: 1 1 auto; flex-direction: row; gap: 14px; font-size: 34px; font-weight: 900; padding: 0 18px; overflow: hidden; }
.opt.stop > .kbd { position: static; }
.opt.stop .ring { position: absolute; left: 10px; top: 50%; width: 44px; height: 44px; margin-top: -22px; transform: rotate(-90deg); pointer-events: none; }
.opt.stop .ring circle { fill: none; stroke: var(--pengpi-ivory); stroke-width: 10; opacity: .9; }
.opt.stop span { position: relative; padding-left: 30px; }
.m-only { display: none !important; }
.dice-tip { position: absolute; left: 0; top: -66px; z-index: 4; padding: 8px 18px; border-radius: 12px; background: var(--pengpi-cyan); color: var(--pengpi-ink);
  font-size: 24px; font-weight: 800; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 16px rgb(0 0 0 / 40%); animation: tipin calc(var(--fx, 1) * .3s) var(--ease-enter) both; }
.dice-tip::after { content: ''; position: absolute; left: 120px; bottom: -14px; border: 8px solid transparent; border-top-color: var(--pengpi-cyan); }
@keyframes tipin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* 前方預覽（SPEC 6.12）：1～4 四列，每列＝點數、格子名、地點名、標記；預覽與棋盤高亮同一份資料 */
.pv-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; background: rgb(5 10 22 / 92%); border: 2px solid var(--pengpi-amber); border-radius: var(--radius-card); }
.pv-head { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.pv-head > b { font-size: 24px; font-weight: 800; color: var(--pengpi-amber); white-space: nowrap; }
.pv-head > small { font-size: 18px; color: var(--c-muted); white-space: nowrap; }
.dice-preview { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; min-height: 0; }
.dice-preview .pv { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; column-gap: 10px; padding: 6px 12px; background: var(--c-panel); border: 2px solid #33477a; border-radius: var(--radius-control); line-height: 1.15; overflow: hidden; min-height: 0; }
.dice-preview .pv b { font: 900 46px/1 var(--font-number); color: var(--pengpi-amber); text-align: center; }
.dice-preview .pv .dest { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dice-preview .pv .d1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dice-preview .pv .dest i { font-style: normal; font-size: 26px; font-weight: 800; white-space: nowrap; }
.dice-preview .pv .dest em { font-style: normal; font-size: 18px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dice-preview .pv.fork .dest i { font-size: 22px; }
.dice-preview .pv small { font-size: 18px; font-weight: 700; color: var(--c-muted); white-space: nowrap; }
.dice-preview .pv.bell small { color: var(--c-danger); }
.dice-preview .pv.exam small { color: var(--pengpi-amber); }
.dice-preview .pv.hit { border-color: var(--pengpi-amber); background: rgb(255 200 87 / 18%); }
.dice-preview.faces .pv .dest i { color: var(--pengpi-amber); }
/* 擲骰前用卡、訪客加入：前方預覽標題列右側的籌碼 */
.dock-cards { margin-left: auto; display: flex; gap: 10px; }
.card-use { position: relative; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 4px 14px 4px 6px; border-radius: var(--radius-control); font-size: 20px; font-weight: 700;
  background: rgb(255 200 87 / 14%); border: 2px solid var(--pengpi-amber); color: var(--pengpi-ivory); pointer-events: auto; text-align: left; }
.card-use .cu-txt { display: flex; flex-direction: column; line-height: 1.15; }
.card-use small { font-size: 16px; font-weight: 500; color: var(--c-muted); white-space: nowrap; }
.card-use .lcard { width: 34px; }
.card-use:disabled { opacity: .5; }
.card-use.join { background: rgb(40 217 255 / 12%); border-color: var(--pengpi-cyan); padding-left: 14px; }
.card-use.wait { opacity: .7; cursor: progress; }
@media (hover: hover) { .card-use:hover:not(:disabled) { filter: brightness(1.12); } }

/* ---------- 主舞台面板（任務卡、決策卡、高潮卡、資訊卡；SPEC 6.5～6.7） ---------- */
#overlay { position: absolute; left: 0; top: var(--hud-h); width: 1920px; height: 638px; z-index: var(--z-panel); display: flex; align-items: center; justify-content: center;
  background: var(--c-dim); }
#overlay[hidden] { display: none; }
#panel { position: relative; width: 1500px; max-height: 620px; padding: 30px 44px; background: rgb(5 10 22 / 97%); border: var(--bw-l) solid var(--pengpi-cyan); border-radius: var(--radius-feature);
  box-shadow: var(--shadow-hard), inset 0 3px 0 rgb(135 91 255 / 80%); animation: panelin calc(var(--fx, 1) * .24s) var(--ease-enter); }
@keyframes panelin { from { transform: translateY(24px); opacity: .4; } }
.p-kicker { align-self: flex-start; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; margin-bottom: 12px; border-radius: 10px; background: var(--c-special); color: #fff; font-size: 22px; font-weight: 800; }
.p-title { margin: 0 0 8px; font-size: var(--fs-h2); font-weight: 900; line-height: 1.25; }
.p-desc { margin: 0 0 20px; font-size: 24px; line-height: 1.45; color: var(--c-muted); }
.p-body { font-size: 28px; line-height: 1.5; }
.p-body p { margin: 8px 0; }
.trivia-q { font-weight: 800; font-size: 32px; }
.trivia-a { color: var(--pengpi-amber); font-weight: 800; }
.trivia-x { color: #dfe7fb; font-size: 26px; }
/* 決策卡（D 型）：2～3 個大選項（中性色；A～D 色只用在答題）；選項本身就是主行動 */
.p-options { display: flex; gap: 24px; }
.p-options .opt { flex: 1; }
.p-options.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.opt.dec { min-height: 160px; padding: 22px 26px 20px; align-items: flex-start; justify-content: flex-start; text-align: left; background: var(--c-panel); border-color: #3a4f80; }
.opt.dec .o-txt { display: flex; flex-direction: column; gap: 8px; padding-top: 30px; }
.opt.dec b { font-size: 32px; font-weight: 900; }
.opt.dec small { font-size: 22px; line-height: 1.4; white-space: pre-line; color: #c5d3f0; }
.opt.dec.focus { border-color: var(--pengpi-cyan); background: #12254d; }
.opt.dec.with-card { flex-direction: row; align-items: center; gap: 18px; }
.opt.dec.with-card .o-txt { padding-top: 0; }
.opt.dec.with-card .lcard { width: 84px; }
.opt.mid { min-height: 120px; }
.opt.dec.on { background: rgb(75 227 163 / 16%); border-color: var(--pengpi-green); }
.opt.dec .o-state { position: absolute; right: 16px; top: 14px; font-style: normal; font-size: 20px; font-weight: 800; color: var(--pengpi-green); }
.opt.dec.locked { border-style: double; border-width: 6px; cursor: default; }
.opt.dec.locked .o-state { color: var(--pengpi-amber); }
#panel.choose.n3 .p-options .opt.dec { min-height: 180px; }
#panel.c-college .opt.dec { min-height: 230px; }
.opt.confirm { margin: 22px auto 0; min-height: 76px; width: 560px; font-size: 26px; flex-direction: row; gap: 14px; }
.opt.confirm > .kbd { position: static; }
.opt.confirm small { margin-left: 4px; }
.opt.confirm.hold b { letter-spacing: .3em; }
.opt.confirm .auto-bar { position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: rgb(255 248 232 / 70%); transform-origin: 0 50%; animation: autobar linear forwards; border-radius: 0 0 12px 12px; }
@keyframes autobar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
#stage.paused .auto-bar, #stage.paused .dice-tip, #stage.paused .slot.shake .slot-win { animation-play-state: paused !important; }
.p-clock { position: absolute; right: 40px; top: 30px; display: flex; align-items: baseline; gap: 6px; }
.p-clock b { font: 900 56px/1 var(--font-number); color: var(--pengpi-amber); font-variant-numeric: tabular-nums; }
.p-clock small { font-size: 20px; color: var(--c-muted); }
.p-clock.low b { color: var(--c-danger); transform: scale(1.15); }
.p-clock.low::before { content: '!'; font: 900 40px/1 var(--font-label); color: var(--c-danger); }
#panel.multi { width: 1560px; }
#panel.multi .p-clock { top: 98px; }
#panel.multi .opt.dec { min-height: 112px; padding-top: 16px; }
#panel.multi .opt.dec .o-txt { padding-top: 26px; }
/* 分歧選路（C05）：決策卡收到 dock 右側（主持字幕留左側），棋盤上兩條路同時高亮、完全不被遮住 */
#stage[data-view="dr"] #overlay { top: 750px; height: 330px; background: transparent; justify-content: flex-end; padding: 0 32px 12px 0; pointer-events: none; }
#stage[data-view="dr"] #panel { pointer-events: auto; width: 1210px; max-height: 310px; padding: 16px 26px; }
#stage[data-view="dr"] .p-kicker { height: 32px; font-size: 18px; margin-bottom: 4px; }
#stage[data-view="dr"] .p-title { font-size: 30px; margin: 0; display: inline; }
#stage[data-view="dr"] .p-desc { font-size: 20px; margin: 4px 0 10px; }
#stage[data-view="dr"] .opt.dec { min-height: 120px; padding: 14px 20px; }
#stage[data-view="dr"] .opt.dec .o-txt { padding-top: 22px; gap: 4px; }
#stage[data-view="dr"] .opt.dec b { font-size: 28px; }
#stage[data-view="dr"] #dock { z-index: 9; pointer-events: none; }
#stage[data-view="dr"] #dock #dialog { flex-basis: 600px; padding-left: 150px; }
#stage[data-view="dr"] #dock #dlg-face { --av: 140px; }
#stage[data-view="dr"] #dock #dlg-text { font-size: 28px; }
/* 事件卡（SPEC 6.6）：H1 獎勵、H2 危機（1420 寬、左圖右文、一個主按鈕）；I 資訊卡（≤ 1200×520，小一級） */
#panel.ev .ev-body { display: flex; gap: 48px; align-items: center; }
#panel.ev .ev-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#panel.ev .ev-text .opt.confirm { margin: 18px 0 0; width: 440px; }
#panel.ev .ev-art { flex: none; display: flex; align-items: center; justify-content: center; }
#panel.reward, #panel.crisis { width: 1420px; min-height: 480px; padding: 36px 56px; display: flex; flex-direction: column; justify-content: center; }
#panel.reward { border-color: var(--c-reward); box-shadow: var(--shadow-hard), 0 0 60px rgb(255 200 87 / 22%), inset 0 3px 0 rgb(255 200 87 / 90%); }
#panel.reward .p-kicker { background: var(--c-reward); color: var(--pengpi-ink); }
#panel.crisis { border-color: var(--c-crisis); background: linear-gradient(160deg, rgb(56 12 26 / 97%), rgb(5 10 22 / 97%)); box-shadow: var(--shadow-hard), 0 0 60px rgb(255 93 115 / 25%), inset 0 3px 0 rgb(255 93 115 / 90%); }
#panel.crisis .p-kicker { background: var(--c-crisis); color: var(--pengpi-ink); }
#panel.reward .p-title, #panel.crisis .p-title { font-size: var(--fs-h1); }
.ev-effect { font-size: 32px; font-weight: 800; margin: 6px 0; }
.ev-effect.big { font-size: 38px; }
.ld-when { font-size: 24px; color: var(--pengpi-amber); font-weight: 700; }
.ev-list { margin: 4px 0; padding-left: 1.2em; font-size: 28px; line-height: 1.6; }
.ev-icon { display: flex; align-items: center; justify-content: center; width: 260px; height: 260px; border-radius: var(--radius-feature); background: rgb(255 93 115 / 14%); border: 3px solid var(--c-crisis); }
.ev-icon img { width: 180px; height: 180px; image-rendering: pixelated; }
#panel.info { width: 1200px; max-height: 520px; overflow: auto; }
#panel.info .p-title { font-size: 34px; }
#panel.info .p-body { font-size: 26px; }
/* 考試結果印章 */
#panel.exam-result .stamp { width: 260px; height: 260px; image-rendering: pixelated; transform: rotate(-8deg); animation: stamp calc(var(--fx, 1) * .35s) steps(3) both; }
#panel.exam-result.fail .stamp { transform: rotate(6deg); }
#panel.exam-result.pass .p-title { color: var(--pengpi-green); }
#panel.exam-result.fail .p-title { color: var(--c-crisis); }
@keyframes stamp { 0% { transform: rotate(-8deg) scale(2.2); opacity: 0; } 70% { transform: rotate(-8deg) scale(.92); opacity: 1; } 100% { transform: rotate(-8deg) scale(1); } }

/* ---------- 題目卡（Q 型；SPEC 6.5、DESIGN_SYSTEM 6.2）：1600×650，題卡打開時棋盤退場，主持字幕縮成一條在卡下方 ---------- */
#stage[data-view="q"] #overlay { top: var(--hud-h); height: 714px; background: transparent; align-items: center; }
#stage[data-view="q"] #dock { top: 826px; height: 254px; padding-top: 10px; }
#stage[data-view="q"] #dialog { flex-basis: 1180px; height: 150px; padding-left: 140px; align-self: flex-start; }
#stage[data-view="q"] #dlg-face { --av: 120px; }
#stage[data-view="q"] #dlg-text { font-size: 28px; -webkit-line-clamp: 2; }
#stage[data-view="q"] #actions { display: none; }
#panel.question { width: 1600px; max-height: 690px; padding: 24px 44px 22px; border-color: var(--c-special); display: flex; flex-direction: column; }
.q-top { position: relative; display: flex; align-items: center; gap: 18px; min-height: 52px; }
.q-head { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.q-kind { display: inline-flex; align-items: center; height: 46px; padding: 0 20px; border-radius: 10px; background: var(--c-special); color: #fff; font-size: 24px; font-weight: 800; white-space: nowrap; }
.q-head .tag { font-size: 20px; font-weight: 700; padding: 4px 12px; border: 2px solid rgb(40 217 255 / 55%); border-radius: 999px; color: #cdefff; white-space: nowrap; }
.q-timer { flex: none; display: flex; align-items: center; gap: 12px; width: 360px; }
.q-timer .bar { flex: 1; height: 14px; background: #1a2a4f; border-radius: 7px; overflow: hidden; }
.q-timer .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pengpi-cyan), var(--pengpi-green)); }
.q-timer .sec { min-width: 54px; text-align: right; font: 800 40px/1 var(--font-number); color: var(--pengpi-cyan); font-variant-numeric: tabular-nums; }
.q-timer small { font-size: 20px; color: var(--c-muted); }
/* 最後 3 秒：數字放大、加驚嘆號（不只靠顏色） */
.q-timer.low .bar i { background: var(--c-danger); }
.q-timer.low .sec { color: var(--c-danger); transform: scale(1.25); }
.q-timer.low small::after { content: ' !'; color: var(--c-danger); font-weight: 900; }
.q-prompt { margin: 22px 0 22px; font-size: var(--fs-h1); font-weight: 800; line-height: 1.32; text-align: center; min-height: 64px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.q-options { display: grid; gap: 22px 32px; }
.q-options.n2, .q-options.n4 { grid-template-columns: 1fr 1fr; }
.q-options.n3 { grid-template-columns: 1fr 1fr 1fr; }
/* 選項：A～D 代號塊（珊瑚／青／綠／琥珀）＋描邊；答案文字區統一灰藍 */
.opt.ans { --ac: var(--c-ans-a); min-height: 112px; flex-direction: row; justify-content: flex-start; gap: 20px; padding: 12px 22px 12px 12px; background: var(--c-panel); border: var(--bw-m) solid var(--ac); text-align: left; }
.opt.ans.a1 { --ac: var(--c-ans-b); } .opt.ans.a2 { --ac: var(--c-ans-c); } .opt.ans.a3 { --ac: var(--c-ans-d); }
.opt.ans .kbd.code { position: static; flex: none; width: 64px; height: 84px; border-radius: 10px; border: 0; background: var(--ac); color: var(--pengpi-ink); font: 900 34px/1 var(--font-label); }
.opt.ans b { flex: 1; font-size: 34px; font-weight: 800; line-height: 1.25; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) { .opt.ans:hover:not(:disabled) { background: #14295a; border-color: var(--ac); box-shadow: 0 0 0 3px rgb(255 255 255 / 12%); } }
.opt.ans.gone { opacity: .35; text-decoration: line-through; }
.opt.ans.gone b { text-decoration: line-through; }
.opt.ans:disabled { background: var(--c-panel); color: var(--c-text); }
#panel.answered .opt.ans:not(.picked):not(.right) { opacity: .55; }
.opt.ans.picked { box-shadow: 0 0 0 4px var(--pengpi-ivory); }
/* 揭曉：正解綠描邊＋「✓ 正解」、選錯的珊瑚描邊＋「✗ 你的答案」（不只靠紅綠） */
.opt.ans.right { --ac: var(--pengpi-green); background: rgb(75 227 163 / 18%); opacity: 1 !important; }
.opt.ans.wrong { --ac: var(--c-danger); background: rgb(255 93 115 / 16%); opacity: 1 !important; }
.opt.ans .mark { flex: none; font-style: normal; font-size: 22px; font-weight: 900; padding: 4px 12px; border-radius: 8px; background: var(--ac); color: var(--pengpi-ink); white-space: nowrap; }
.q-foot { display: flex; align-items: center; gap: 18px; margin-top: 16px; min-height: 40px; }
.q-source { font-size: 18px; color: var(--c-muted); }
.q-cards { margin-left: auto; display: flex; gap: 12px; }
.q-cards .card-use { min-height: 64px; }
.q-cards .card-use .lcard { width: 40px; }
.q-skip { position: absolute; right: 30px; top: -64px; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; font-size: 22px; border-radius: var(--radius-control); background: var(--c-raised); border: 2px solid var(--pengpi-slate); }
/* 判定中（E04）：固定在標頭右側，不移位；減少動態效果時不轉圈 */
.q-judging { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 18px; border-radius: 10px;
  background: var(--pengpi-ink); border: 2px solid var(--pengpi-amber); font-size: 26px; font-weight: 800; color: var(--pengpi-amber); z-index: 2; }
.q-judging i { width: 24px; height: 24px; border: 4px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: q-spin .7s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }
.q-reveal { display: flex; gap: 28px; align-items: flex-start; margin-top: 16px; padding: 14px 20px; border-radius: var(--radius-control); background: rgb(255 255 255 / 4%); border: 2px solid #2b3d66; }
.q-result { flex: none; display: flex; flex-direction: column; gap: 4px; min-width: 260px; font-size: 24px; }
.q-result b { font-size: 40px; font-weight: 900; }
.q-result.ok b { color: var(--pengpi-green); }
.q-result.ng b { color: var(--c-danger); }
.q-result.void b { color: var(--pengpi-amber); font-size: 32px; }
.q-result span { color: var(--pengpi-amber); font-weight: 700; }
.q-explain { flex: 1; min-width: 0; font-size: 24px; line-height: 1.45; color: #e3eafb; cursor: pointer; }
.q-explain p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.q-explain small { display: block; color: var(--c-muted); font-size: 20px; margin-top: 4px; }
.q-explain em { display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-style: normal; color: var(--c-muted); font-size: 18px; margin-top: 4px; }
#panel.revealed .q-prompt { font-size: 38px; margin: 12px 0; }
#panel.revealed .opt.ans { min-height: 86px; }
/* 搶答對決（L03）：題目照常顯示、選項只給看，下面兩個大搶答鈕（1P 左、2P 右，同等大小） */
#panel.buzz .q-options.preview .opt.ghost { cursor: default; }
.buzz-row { display: flex; gap: 40px; margin-top: 20px; }
.buzz-row .buzz-btn { flex: 1; min-height: 110px; font-size: 38px; font-weight: 900; border-width: 3px; }
.buzz-row .buzz-btn.p1 { background: rgb(40 217 255 / 18%); border-color: var(--pengpi-cyan); }
.buzz-row .buzz-btn.p2 { background: rgb(255 93 115 / 18%); border-color: var(--pengpi-coral); }
.buzz-row .buzz-btn small { display: block; font-size: 20px; }
/* 考試段落列（E 型；SPEC 6.7）：考試名、學級 → 下一學級、及格進度節點（對／錯／空）＋「已答對 n／門檻」 */
.exam-bar { display: flex; align-items: center; gap: 16px; margin: -6px 0 14px; padding: 8px 14px; border-radius: var(--radius-control); background: rgb(255 200 87 / 10%); border: 2px solid rgb(255 200 87 / 55%); }
.exam-bar .eb-name { padding: 6px 14px; border-radius: 8px; background: var(--pengpi-amber); color: var(--pengpi-ink); font-size: 22px; font-weight: 900; white-space: nowrap; }
.exam-bar .eb-path { font-size: 22px; font-weight: 700; white-space: nowrap; }
.exam-bar .eb-dots { display: flex; gap: 8px; margin-left: auto; }
.exam-bar .eb-dots i { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #4a5d8a; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 18px; font-weight: 900; }
.exam-bar .eb-dots i.ok { background: var(--pengpi-green); border-color: var(--pengpi-green); color: var(--pengpi-ink); }
.exam-bar .eb-dots i.ng { background: rgb(255 93 115 / 25%); border-color: var(--c-danger); color: #ffd6dc; }
.exam-bar .eb-need { font-size: 24px; font-weight: 900; color: var(--pengpi-amber); white-space: nowrap; }
.exam-bar .eb-left { font-size: 22px; font-weight: 800; color: var(--pengpi-cyan); white-space: nowrap; }
#panel.exam { border-color: var(--pengpi-amber); }

/* ---------- 轉場字卡（X 型：學級段落牌、升學考試段落牌；SPEC 6.11） ---------- */
.bumper { position: absolute; left: 0; top: var(--hud-h); right: 0; bottom: 0; z-index: var(--z-bumper); display: flex; align-items: center; justify-content: center;
  background: linear-gradient(100deg, rgb(5 10 22 / 96%) 0%, rgb(13 27 56 / 94%) 100%); cursor: pointer; }
.bp-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 46px 120px; border-radius: var(--radius-feature); border: var(--bw-l) solid var(--pengpi-cyan);
  background: rgb(5 10 22 / 92%); box-shadow: var(--shadow-hard), inset 0 4px 0 var(--c-special); animation: wipe calc(var(--fx, 1) * .4s) var(--ease-enter) both; }
.bumper.b-exam .bp-card { border-color: var(--pengpi-amber); box-shadow: var(--shadow-hard), inset 0 4px 0 var(--pengpi-amber); }
.bp-kicker { font: 800 26px/1 var(--font-label); padding: 8px 18px; border-radius: 999px; background: var(--c-live); color: var(--pengpi-ink); }
.bp-title { font-size: 120px; font-weight: 900; line-height: 1.05; letter-spacing: .06em; text-shadow: 0 0 28px rgb(135 91 255 / 70%); }
.bp-sub { font-size: 40px; font-weight: 800; color: var(--pengpi-cyan); }
.bp-line { font-size: 28px; color: var(--c-muted); }
@keyframes wipe { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 鐘響截停（C06）：lower third 風格的橫幅 */
.bell-banner { position: absolute; left: 50%; top: 300px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 26px; padding: 22px 46px 22px 22px; border-radius: var(--radius-card);
  background: rgb(5 10 22 / 96%); border: var(--bw-l) solid var(--c-danger); box-shadow: var(--shadow-hard); animation: wipe calc(var(--fx, 1) * .3s) var(--ease-enter) both; }
.bb-kicker { font: 800 24px/1 var(--font-label); padding: 12px 16px; border-radius: 10px; background: var(--c-danger); color: var(--pengpi-ink); }
.bb-text { display: flex; flex-direction: column; gap: 4px; }
.bb-text b { font-size: 60px; font-weight: 900; color: var(--pengpi-ivory); letter-spacing: .08em; }
.bb-text small { font-size: 28px; font-weight: 700; color: #ffd6dc; }
/* 飛卡（F02）：棋盤中央飛出一張卡 */
.card-fx { position: absolute; left: 50%; top: 220px; transform: translateX(-50%); z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: cardfx calc(var(--fx, 1) * .9s) steps(6) both; pointer-events: none; }
.card-fx .lcard { width: 180px; --cw: 180px; filter: drop-shadow(0 8px 12px rgb(0 0 0 / 50%)); }
.card-fx-label { font-size: 40px; font-weight: 900; color: var(--pengpi-amber); text-shadow: 0 3px 0 #000; }
@keyframes cardfx { 0% { transform: translate(-50%, 60px) scale(.6); opacity: 0; } 25%, 75% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { transform: translate(-50%, -40px) scale(1); opacity: 0; } }
/* 首次提示（M03）：一行、≤ 20 字、不擋操作 */
.tip-bar { position: absolute; left: 50%; top: 690px; transform: translateX(-50%); z-index: var(--z-tip); padding: 10px 24px; border-radius: 999px; background: var(--pengpi-cyan); color: var(--pengpi-ink);
  font-size: 26px; font-weight: 800; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 24px rgb(0 0 0 / 45%); animation: tipin calc(var(--fx, 1) * .3s) var(--ease-enter) both; }
.tip-bar[hidden] { display: none; }
#stage[data-view="q"] .tip-bar { top: 768px; }
#stage[data-view="d"] .tip-bar, #stage[data-view="h"] .tip-bar, #stage[data-view="i"] .tip-bar { top: 124px; }
#screen.scr-title:not([hidden]) ~ .tip-bar { top: 804px; left: 380px; }

/* ---------- LUCKY 卡圖：240×336；卡名寫在卡面上方的空白標籤；flip 先顯示卡背再翻面 ---------- */
.lcard { position: relative; display: inline-block; flex: none; width: 120px; aspect-ratio: 240 / 336; line-height: 1; vertical-align: middle; }
.lcard img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.lcard .back { opacity: 0; }
.lcard-name { position: absolute; left: 12%; right: 12%; top: 8.5%; height: 14%; display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cw, 240px) * .105); font-weight: 900; color: #3a2a12; white-space: nowrap; letter-spacing: 1px; text-shadow: none; }
.lcard.big { width: 240px; --cw: 240px; filter: drop-shadow(0 12px 20px rgb(0 0 0 / 50%)); }
.lcard.big .lcard-name { font-size: calc(var(--cw) * .14); letter-spacing: 0; }
.lcard.flip { animation: cardflip calc(var(--fx, 1) * .6s) steps(6) both; }
.lcard.flip .back { animation: cardback calc(var(--fx, 1) * .6s) steps(1) both; }
.lcard.flip .lcard-name { animation: cardname calc(var(--fx, 1) * .6s) steps(1) both; }
@keyframes cardflip { 0% { transform: scaleX(1); } 50% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@keyframes cardback { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes cardname { 0% { opacity: 0; } 50% { opacity: 1; } }

/* ---------- 全畫面（片頭 T、成績單 R、典禮 C、GAME OVER H3） ---------- */
#screen { position: absolute; inset: 0; z-index: var(--z-screen); display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: radial-gradient(110% 90% at 50% 10%, #13285a 0%, var(--pengpi-midnight) 55%, #030812 100%); }
#screen[hidden] { display: none; }
.scr-body { width: 1600px; text-align: center; }
.scr-body h1 { font-size: 100px; margin: 0 0 10px; letter-spacing: 4px; }
.scr-body p { font-size: 30px; line-height: 1.5; margin: 10px 0; }
.scr-body .small { font-size: 24px; color: var(--c-muted); }
.scr-buttons { display: flex; gap: 24px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.scr-buttons .opt { min-width: 300px; min-height: 84px; font-size: 28px; padding-left: 60px; padding-right: 30px; }
.scr-buttons .opt.btn-primary, .scr-buttons .opt.primary { min-width: 380px; min-height: 96px; font-size: 32px; }
.scr-buttons .opt.btn-text { min-width: 0; padding: 8px 16px; font-size: 22px; }
/* 系統列（ON AIR 列；SPEC 6.2）：節目標籤、開放 Beta、條款、回報問題 */
.sysbar { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 28px; background: rgb(5 10 22 / 96%); border-top: 2px solid rgb(40 217 255 / 30%); font-size: 20px; }
.sysbar::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--pengpi-cyan); }
.sb-pill { flex: none; padding: 6px 14px; border-radius: 8px; background: var(--c-live); color: var(--pengpi-ink); font: 800 18px/1 var(--font-label); }
.sb-text { color: var(--c-text); font-weight: 700; white-space: nowrap; }
.sb-links { margin-left: auto; display: flex; align-items: center; gap: 18px; color: var(--c-muted); white-space: nowrap; }
.sb-links a, .sb-links .linkish { color: inherit; text-underline-offset: 4px; min-height: 48px; display: inline-flex; align-items: center; }
.sb-beta { padding: 3px 10px; border-radius: 6px; border: 2px solid var(--pengpi-amber); color: var(--pengpi-amber); font-weight: 700; }

/* ---- 節目首頁（A02；T 型；設計稿 C_08） ---- */
.scr-title { background: linear-gradient(180deg, rgb(5 10 22 / 55%) 0%, rgb(5 10 22 / 30%) 40%, rgb(5 10 22 / 88%) 78%), url(../assets/full/bg_high.png) center / cover no-repeat !important;
  background-image: linear-gradient(180deg, rgb(5 10 22 / 55%) 0%, rgb(5 10 22 / 30%) 40%, rgb(5 10 22 / 88%) 78%), image-set(url(../assets/full/bg_high.webp) type("image/webp"), url(../assets/full/bg_high.png) type("image/png")) !important;
  image-rendering: pixelated; justify-content: flex-start !important; }
.scr-title .scr-body { position: relative; width: 1920px; height: 1016px; }
.t-top { position: absolute; left: 50px; right: 50px; top: 40px; display: flex; justify-content: space-between; align-items: flex-start; }
.t-bug { height: 104px; width: auto; image-rendering: pixelated; filter: drop-shadow(0 6px 16px rgb(0 0 0 / 50%)); }
.t-special { padding: 14px 26px; border-radius: 12px; background: var(--c-live); color: var(--pengpi-ink); font: 800 26px/1 var(--font-label); }
.t-logo { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); }
.t-logo img { display: block; width: 1000px; height: auto; filter: drop-shadow(0 12px 28px rgb(0 0 0 / 55%)); }
.scr-body .t-line { position: absolute; left: 0; right: 0; top: 400px; margin: 0; font-size: 24px; color: var(--c-muted); text-shadow: 0 2px 8px #000; }
.scr-body .t-ask { position: absolute; left: 0; right: 0; top: 436px; margin: 0; font-size: 36px; font-weight: 800; text-shadow: 0 2px 10px #000; }
.t-modes { position: absolute; left: 110px; right: 110px; top: 506px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.opt.mode-card { min-height: 290px; padding: 26px 30px 22px; align-items: flex-start; justify-content: flex-start; text-align: left; gap: 10px; background: rgb(13 27 56 / 94%); border: 3px solid rgb(101 120 159 / 70%); border-radius: var(--radius-feature); box-shadow: var(--shadow-hard); }
.opt.mode-card > .kbd { left: auto; right: 22px; top: 24px; }
.mode-card .mc-tag { padding: 8px 16px; border-radius: 10px; font: 800 22px/1 var(--font-label); background: var(--pengpi-cyan); color: var(--pengpi-ink); }
.mode-card.m-arcade .mc-tag { background: var(--pengpi-coral); }
.mode-card.m-duo .mc-tag { background: var(--pengpi-amber); }
.mode-card .mc-name { font-size: 46px; font-weight: 900; margin-top: 6px; }
.mode-card .mc-sub { font-size: 22px !important; color: #c5d3f0 !important; font-weight: 500; }
.mode-card .mc-diff { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; visibility: hidden; }
.mode-card .mc-diff em { font-style: normal; font-size: 20px; font-weight: 700; padding: 4px 12px; border-radius: 8px; background: rgb(255 255 255 / 8%); color: var(--pengpi-ivory); }
.mode-card.focus .mc-diff { visibility: visible; }
.mode-card .mc-best { font-size: 18px !important; color: var(--pengpi-amber) !important; }
.mode-card .mc-go { position: absolute; right: 26px; bottom: 20px; font-size: 22px; font-weight: 800; color: var(--pengpi-cyan); }
.mode-card.m-arcade .mc-go { color: var(--pengpi-coral); }
.mode-card.m-duo .mc-go { color: var(--pengpi-amber); }
.opt.mode-card.focus { border-color: var(--pengpi-cyan); background: rgb(16 36 74 / 96%); box-shadow: var(--shadow-hard), 0 0 0 4px rgb(40 217 255 / 35%); transform: translateY(-6px); }
.mode-card.m-arcade.focus { border-color: var(--pengpi-coral); box-shadow: var(--shadow-hard), 0 0 0 4px rgb(255 93 115 / 35%); }
.mode-card.m-duo.focus { border-color: var(--pengpi-amber); box-shadow: var(--shadow-hard), 0 0 0 4px rgb(255 200 87 / 35%); }
/* 沒有存檔時，升學旅程卡就是唯一主行動（主按鈕的珊瑚紅外框標記） */
.opt.mode-card.btn-primary { background: rgb(13 27 56 / 94%); color: var(--c-text); box-shadow: var(--shadow-hard), inset 0 0 0 3px var(--pengpi-coral); }
.opt.mode-card.btn-primary small { color: #c5d3f0; }
.opt.mode-card.btn-primary .kbd { color: var(--c-muted); background: rgb(255 255 255 / 6%); border-color: rgb(175 194 232 / 35%); }
.opt.mode-card.btn-primary.focus { box-shadow: var(--shadow-hard), inset 0 0 0 3px var(--pengpi-coral), 0 0 0 4px rgb(40 217 255 / 35%); }
.t-actions { position: absolute; left: 110px; right: 110px; top: 824px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.t-actions .opt { min-height: 76px; font-size: 26px; padding: 8px 28px 8px 70px; }
.t-actions .opt.resume { min-width: 760px; }
.t-actions .opt.settings { padding-left: 28px; min-width: 260px; }
.t-actions .opt.more { display: none; }
.more-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-links .opt { text-decoration: none; min-height: 56px; }
.t-host { position: absolute; left: 50px; bottom: 6px; display: flex; align-items: flex-end; gap: 14px; max-width: 1100px; }
.t-host img { height: 96px; width: auto; image-rendering: pixelated; }
.t-host-t { display: flex; flex-direction: column; gap: 2px; padding: 8px 18px; margin-bottom: 6px; border-radius: 12px; background: rgb(5 10 22 / 90%); border-left: 8px solid var(--c-special); text-align: left; }
.t-host-t b { font-size: 18px; color: var(--pengpi-amber); }
.t-host-t span { font-size: 24px; font-weight: 700; }

/* ---- 成績紙（R 型；設計稿 C_04、06）：象牙白紙卡、青色外框、深藍頁首；按鈕在紙外面 ---- */
.scr-report, .scr-quit, .scr-ending, .scr-gradReport { justify-content: center !important; padding-bottom: 64px; }
.scr-body.paper-body { width: 1760px; }
.paper { position: relative; text-align: left; color: var(--c-ink); background: var(--c-paper); border: var(--bw-l) solid var(--pengpi-cyan); border-radius: var(--radius-feature); overflow: hidden;
  box-shadow: var(--shadow-hard); padding: 0 40px 22px; }
.paper.print { animation: feed calc(var(--fx, 1) * 1.2s) var(--ease-standard) both; }
@keyframes feed { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.rp-head { display: flex; align-items: center; gap: 26px; margin: 0 -40px 18px; padding: 14px 40px; background: var(--pengpi-ink); color: var(--pengpi-ivory); }
.rp-logo { height: 80px; width: auto; }
.rp-title { flex: 1; min-width: 0; }
.scr-body .paper .rp-title h1 { font-size: 44px; margin: 0; letter-spacing: .04em; text-align: left; line-height: 1.15; }
.scr-body .paper .rp-title h2 { font-size: 22px; margin: 4px 0 0; color: var(--pengpi-cyan); text-align: left; font-weight: 700; }
.rp-date { font: 700 20px/1 var(--font-number); color: var(--pengpi-cyan); white-space: nowrap; }
.report { text-align: left; }
.rp-top { display: grid; grid-template-columns: 170px 380px 1fr; gap: 24px; align-items: stretch; }
.rp-grade { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 2px solid #e2d6b8; }
.rp-grade small { font-size: 22px; font-weight: 800; color: var(--c-ink-muted); }
.report .big-g { font-size: 128px; line-height: 1; font-weight: 900; color: #C8283F; }
.rp-nums p { margin: 6px 0; font-size: 24px; color: var(--c-ink-muted); }
.rp-nums .rp-correct b { font: 800 46px/1.1 var(--font-number); color: var(--c-ink); }
.rp-nums .rp-score b { font: 800 30px/1.1 var(--font-number); color: #C8283F; }
.rp-high { padding: 14px 22px; border-radius: var(--radius-card); background: #FDEFC3; border: 2px solid #E2B44A; }
.rp-high small { font-size: 20px; font-weight: 800; color: #9a2a1e; }
.report .unique { margin: 6px 0; font-size: 28px; font-weight: 800; line-height: 1.4; color: var(--c-ink); }
.rp-conduct, .rp-title-name { margin: 4px 0 0; font-size: 22px; color: var(--c-ink-muted); }
.rp-title-name { font-size: 28px; font-weight: 900; color: #9a2a1e; }
.rp-subj { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 22px; margin: 18px 0 14px; }
.rp-subj.four { grid-template-columns: repeat(4, 1fr); }
.rp-subj .sc { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; padding: 10px 18px; border-radius: var(--radius-control);
  background: #fff; border: 2px solid #e2d6b8; border-left: 10px solid var(--sc, var(--pengpi-slate)); }
.rp-subj .sc b { font-size: 24px; font-weight: 800; }
.rp-subj .sc .g { grid-row: 1 / 3; grid-column: 2; font-size: 52px; font-weight: 900; color: #C8283F; }
.rp-subj .sc small { font-size: 18px; color: var(--c-ink-muted); }
.rp-subj .sc.none { opacity: .7; }
.rp-subj .sc.none .g { color: #8a93a8; }
.rp-foot { border-top: 2px solid #e2d6b8; padding-top: 10px; }
.report .teacher { font-size: 24px; margin: 4px 0; color: var(--c-ink); display: flex; gap: 20px; align-items: baseline; }
.report .parent { margin-left: auto; color: #9a2a1e; font-size: 20px; white-space: nowrap; }
.report .saved { font-size: 22px; color: #1f8a5a; font-weight: 800; margin: 4px 0 0; }
.scr-body .paper .small { font-size: 20px; color: var(--c-ink-muted); margin: 4px 0 0; }
.rp-detail { margin-top: 12px; border-top: 2px dashed #e2d6b8; padding-top: 10px; }
.rp-detail h3 { margin: 0 0 6px; font-size: 22px; color: var(--c-ink-muted); }
.report table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 20px; line-height: 1.3; }
.report th, .report td { border: 2px solid #e2d6b8; padding: 4px 12px; }
.report th { background: #f3e8c8; color: var(--c-ink); font-weight: 700; white-space: nowrap; }
.report td { background: #fff; }
.report td.g { font-weight: 900; color: #C8283F; text-align: center; }
.report .note { color: var(--c-ink-muted); }
/* 查看詳細展開時，上面幾區收小一點，整張紙仍在舞台內 */
/* 查看詳細的科目表已經有六科等級：上面的六科等級卡先收起來 */
#screen.show-detail .rp-subj { display: none; }
#screen.show-detail .rp-head { padding: 8px 40px; margin-bottom: 10px; }
#screen.show-detail .rp-logo { height: 56px; }
#screen.show-detail .report .big-g { font-size: 96px; }
#screen.show-detail .rp-foot { display: none; }
.paper-body .scr-buttons { margin-top: 18px; }
.scr-report, .scr-quit { background: radial-gradient(110% 90% at 50% 0%, #13285a 0%, var(--pengpi-midnight) 60%, #030812 100%) !important; }
.scr-ending, .scr-gradReport, .scr-graduation { background: linear-gradient(rgb(5 10 22 / 72%), rgb(5 10 22 / 82%)), url(../assets/full/bg_graduation.png) center / 1920px 1080px no-repeat !important;
  background-image: linear-gradient(rgb(5 10 22 / 72%), rgb(5 10 22 / 82%)), image-set(url(../assets/full/bg_graduation.webp) type("image/webp"), url(../assets/full/bg_graduation.png) type("image/png")) !important;
  image-rendering: pixelated; }

/* ---- 畢業典禮（J04；C 型；設計稿 07）：證書置中、主持人兩側；主「分享畢業成績」、次「再玩一次」 ---- */
.scr-graduation { justify-content: flex-start !important; padding-top: 20px; }
.scr-graduation .scr-body { width: 1500px; }
.ceremony { position: relative; }
.cer-pill { display: inline-block; padding: 12px 40px; border-radius: 14px; background: var(--c-special); color: #fff; font-size: 32px; font-weight: 900; letter-spacing: .1em; box-shadow: var(--shadow-hard); }
.diploma.art { position: relative; width: 900px; height: 637px; margin: 14px auto 0; background: url(../assets/full/diploma.png) 0 0 / 100% 100% no-repeat;
  background-image: image-set(url(../assets/full/diploma.webp) type("image/webp"), url(../assets/full/diploma.png) type("image/png")); image-rendering: pixelated; filter: drop-shadow(0 16px 24px rgb(0 0 0 / 55%)); color: #3a2a12; }
.diploma.art .d-in { position: absolute; left: 13%; right: 13%; top: 29%; bottom: 17%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.diploma.art h3 { font-size: 42px; margin: 0 0 2px; letter-spacing: 16px; color: #7a1f1f; }
.scr-body .diploma.art p { margin: 2px 0; line-height: 1.3; }
.scr-body .diploma.art .d-who { font-size: 24px; }
.scr-body .diploma.art .d-college { font-size: 27px; color: #5a3e12; }
.scr-body .diploma.art .d-title { font-size: 42px; font-weight: 900; color: #7a1f1f; margin: 0; }
.scr-body .diploma.art .d-ending { display: inline-block; font-size: 26px; font-weight: 900; color: #fff; background: #b8452e; padding: 2px 22px; border-radius: 8px; }
.scr-body .diploma.art .d-desc { font-size: 21px; max-width: 500px; align-self: flex-start; text-align: left; color: #5a4a2a; }
.scr-body .diploma.art .d-sign, .scr-body .diploma.art .d-date { align-self: flex-start; font-size: 19px; margin: 0; line-height: 1.25; text-align: left; color: #6a5430; }
.grad-host { position: absolute; bottom: 120px; image-rendering: pixelated; filter: drop-shadow(0 10px 14px rgb(0 0 0 / 50%)); }
.grad-host.l { left: -190px; height: 440px; }
.grad-host.r { right: -190px; height: 445px; }
.scr-body .cer-sum { margin: 10px 0 0; font-size: 32px; font-weight: 800; }
.scr-body .cer-sum b { color: var(--pengpi-amber); font-family: var(--font-number); }
.scr-body .ceremony .bento { margin: 2px 0 0; font-size: 20px; color: var(--c-muted); }
.scr-graduation .scr-buttons { margin-top: 12px; }
/* 彩帶只爆一次（減少動態效果時不放） */
#screen.confetti::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--pengpi-amber) 0 5px, transparent 6px), radial-gradient(circle, var(--pengpi-cyan) 0 5px, transparent 6px), radial-gradient(circle, var(--pengpi-coral) 0 5px, transparent 6px), radial-gradient(circle, var(--pengpi-green) 0 5px, transparent 6px);
  background-size: 220px 260px, 300px 240px, 260px 300px, 340px 280px; background-position: 20px 0, 140px 60px, 80px 120px, 200px 30px; animation: confetti calc(var(--fx, 1) * 1.6s) ease-out both; }
@keyframes confetti { from { transform: translateY(-260px); opacity: 1; } to { transform: translateY(140px); opacity: 0; } }

/* ---- GAME OVER（K01；H3 全螢幕危機）：絕不出現購買、價格、付款字樣 ---- */
.scr-gameover { background: radial-gradient(90% 80% at 50% 40%, #4a0f22 0%, #1a0614 55%, #05020a 100%) !important; }
.go-card, .err-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.go-kicker { padding: 8px 18px; border-radius: 999px; background: var(--c-crisis); color: var(--pengpi-ink); font: 800 24px/1 var(--font-label); }
.scr-gameover .scr-body h1 { color: var(--c-crisis); font-size: 150px; font-family: var(--font-label); text-shadow: 0 0 40px rgb(255 93 115 / 50%); margin: 8px 0 0; }
.continue { font: 900 80px/1.1 var(--font-label); color: var(--pengpi-amber); margin: 14px 0; }
.continue b { display: inline-block; min-width: 1.2em; }
.scr-error .scr-body h1 { font-size: 72px; margin: 14px 0 0; }

/* ---------- 系統層（S 型：暫停頁、離開確認、遊戲設定、學分章、結局圖鑑；SPEC 6.10）：完全不透明蓋住下面（防偷看） ---------- */
.sys-sheet { position: absolute; inset: 0; z-index: var(--z-pause); display: flex; align-items: center; justify-content: center; background: var(--pengpi-midnight); }
.sys-sheet .ss-panel { width: 1560px; max-height: 1020px; display: flex; flex-direction: column; gap: 14px; padding: 30px 46px 30px; background: var(--c-panel); border: var(--bw-l) solid var(--pengpi-cyan);
  border-radius: var(--radius-feature); box-shadow: var(--shadow-hard), inset 0 4px 0 var(--c-special); }
.sys-sheet.light .ss-panel, #settings-sheet .ss-panel, #endings-sheet .ss-panel { width: 1180px; }
.sh-title { margin: 0; font-size: 44px; font-weight: 900; }
.sh-body { min-height: 0; overflow: auto; }
.sh-btns { display: flex; gap: 22px; justify-content: center; margin-top: 6px; }
.sh-btns .opt { min-width: 420px; min-height: 88px; font-size: 30px; flex-direction: row; gap: 14px; }
.sh-btns .opt > .kbd { position: static; }
.pz-lead { margin: 0 0 6px; font-size: 24px; color: var(--c-muted); }
.pz-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; }
.pz-col h3 { margin: 14px 0 8px; font-size: 24px; color: var(--pengpi-amber); }
.pz-col h3:first-child { margin-top: 0; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bg-item { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius-control); background: var(--c-raised); border: 2px solid #33477a; }
.bg-item img { grid-row: 1 / 3; width: 52px; height: 52px; image-rendering: pixelated; opacity: .35; filter: grayscale(1); }
.bg-item.on img { opacity: 1; filter: none; }
.bg-item.on { border-color: var(--sc); }
.bg-item b { font-size: 22px; font-weight: 800; }
.bg-item.goal b { color: var(--pengpi-amber); }
.bg-item small { font-size: 16px; color: var(--c-muted); }
.pz-count { margin: 10px 0 0; font-size: 22px; font-weight: 700; }
.pz-rules { margin: 0; padding-left: 1.2em; font-size: 22px; line-height: 1.55; }
.pz-hand { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pz-card { display: flex; gap: 14px; align-items: center; }
.pz-card .lcard { width: 48px; }
.pz-card span { display: flex; flex-direction: column; }
.pz-card b { font-size: 22px; }
.pz-card small { font-size: 18px; color: var(--c-muted); }
.pz-empty { font-size: 20px; color: var(--c-muted); }
.pz-keys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 20px; }
.pz-keys li { display: flex; align-items: center; gap: 10px; }
.pz-fb { margin-top: 10px; align-self: flex-start; }
.pz-warns p { font-size: 28px; line-height: 1.5; margin: 10px 0; }
.pz-warns .warn { color: #ffc2cb; font-weight: 800; padding-left: 16px; border-left: 6px solid var(--c-danger); }
.pz-note { font-size: 20px; color: var(--c-muted); margin: 12px 0 0; }
.set-list { display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 76px; padding: 10px 18px; text-align: left; background: var(--c-raised); border: 2px solid var(--pengpi-slate); border-radius: var(--radius-control); }
@media (hover: hover) { .set-row:hover { border-color: var(--c-focus); } }
.set-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-t b { font-size: 24px; }
.set-t small { font-size: 17px; color: var(--c-muted); line-height: 1.35; }
.set-val { flex: none; min-width: 84px; text-align: center; padding: 8px 12px; border-radius: 10px; background: var(--pengpi-ink); color: var(--pengpi-cyan); font-size: 22px; font-weight: 800; }
.endings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.endings-list li { display: flex; flex-direction: column; padding: 12px 18px; border-radius: var(--radius-control); background: var(--c-raised); border: 2px solid #33477a; color: var(--c-muted); }
.endings-list li.on { border-color: var(--pengpi-amber); color: var(--c-text); }
.endings-list b { font-size: 26px; }
.endings-list small { font-size: 18px; }

/* ---------- 分享面板（js/full/share_panel.js；M01） ---------- */
#share-sheet { position: absolute; inset: 0; z-index: var(--z-share); background: var(--pengpi-scrim); display: flex; align-items: center; justify-content: center; }
#share-sheet .ss-box { width: 1640px; max-height: 1040px; background: var(--c-panel); border: var(--bw-l) solid var(--pengpi-cyan); border-radius: var(--radius-feature); padding: 24px 36px 26px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-hard), inset 0 4px 0 var(--c-special); }
#share-sheet .ss-title { color: var(--c-text); font-size: 40px; font-weight: 900; text-align: center; }
#share-sheet .ss-preview { display: flex; gap: 26px; align-items: center; background: var(--pengpi-ink); border-radius: var(--radius-card); padding: 16px; }
#share-sheet .ss-img { width: 600px; height: 315px; flex: none; background: var(--c-raised); border-radius: 10px; object-fit: cover; }
#share-sheet .ss-img:not([src]) { visibility: hidden; }
#share-sheet .ss-text { margin: 0; flex: 1; max-height: 315px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: var(--font-body); font-size: 24px; line-height: 1.45; color: var(--c-text); user-select: text; }
#share-sheet .ss-status { margin: 0; min-height: 36px; text-align: center; font-size: 26px; color: var(--pengpi-cyan); }
#share-sheet .ss-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
#share-sheet .ss-btn { min-height: 92px; padding: 10px 18px; font-size: 32px; }
#share-sheet .ss-btn small { font-size: 20px; }
#share-sheet .ss-btn.wide { grid-column: 1 / -1; }
#share-sheet .ss-btn.hot { background: var(--c-primary); border-color: var(--c-primary); }
#share-sheet .ss-btn[hidden] { display: none; }
#share-sheet .ss-btn[data-how="facebook"] { background: #23407a; }
#share-sheet .ss-btn[data-how="threads"], #share-sheet .ss-btn[data-how="x"] { background: #111827; }
#share-sheet .ss-btn[data-how="line"] { background: #11673a; }
#share-sheet .ss-btn[data-how="ig"] { background: #7a2f68; }
#share-sheet .ss-btn:disabled { opacity: .55; }
#share-sheet .ss-close { align-self: center; min-height: 76px; min-width: 360px; font-size: 30px; }

/* ---------- 回報問題表單（js/ops.js；M02，沿用第 73 條） ---------- */
#turnstile-box { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%) scale(1.6); transform-origin: 50% 100%; z-index: 60; }
#turnstile-box:empty { display: none; }
.ops-overlay { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: var(--pengpi-scrim); }
.ops-box { width: 1100px; background: var(--c-panel); color: var(--c-text); border: var(--bw-l) solid var(--pengpi-cyan); border-radius: var(--radius-feature); padding: 30px 44px 28px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-hard); }
.ops-box h2 { margin: 0; font-size: 40px; }
.ops-kinds { border: 0; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.ops-kinds legend { font-size: 22px; color: var(--c-muted); margin-bottom: 8px; padding: 0; }
.ops-kind { cursor: pointer; }
.ops-kind input { position: absolute; opacity: 0; pointer-events: none; }
.ops-kind span { display: inline-block; font-size: 26px; font-weight: 700; padding: 8px 22px; background: var(--c-raised); border: 2px solid var(--pengpi-slate); border-radius: 10px; }
.ops-kind input:checked + span { background: rgb(40 217 255 / 18%); border-color: var(--pengpi-cyan); color: #fff; }
.ops-kind input:focus-visible + span { box-shadow: var(--focus-ring); }
.ops-field { display: flex; flex-direction: column; gap: 6px; font-size: 22px; color: var(--c-muted); position: relative; }
.ops-field textarea, .ops-field input { font: 26px/1.45 var(--font-body); color: #12182a; background: #f6f6f2; border: 3px solid var(--pengpi-slate); border-radius: 10px; padding: 10px 14px;
  resize: none; user-select: text; -webkit-user-select: text; }
.ops-field textarea:focus, .ops-field input:focus { outline: none; border-color: var(--pengpi-cyan); }
.ops-count { position: absolute; right: 14px; bottom: 10px; font-size: 18px; color: #6b7280; }
.ops-auto { margin: 0; font-size: 18px; color: var(--c-muted); line-height: 1.5; }
.ops-status { margin: 0; min-height: 30px; font-size: 22px; font-weight: 700; }
.ops-status[data-state="ok"] { color: var(--c-success); } .ops-status[data-state="error"] { color: var(--c-danger); }
.ops-buttons { display: flex; gap: 24px; justify-content: center; }
.ops-buttons button { font-size: 28px; font-weight: 700; padding: 12px 44px; min-height: 64px; background: var(--c-raised); border: 2px solid var(--pengpi-slate); border-radius: 12px; color: var(--c-text); }
.ops-buttons .ops-send { border: 0; background: var(--c-primary); box-shadow: inset 0 0 0 3px rgb(255 248 232 / 85%); }
.ops-buttons button:hover:not(:disabled), .ops-buttons button:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.ops-buttons button:disabled { opacity: .5; }
.ops-box.sent .ops-kinds, .ops-box.sent .ops-field, .ops-box.sent .ops-auto { opacity: .5; }

/* ---------- 直放提示（A05）：由 ui.js 依實際寬高加上 body.is-portrait ---------- */
#rotate-hint { display: none; position: fixed; inset: 0; z-index: var(--z-rotate); background: var(--pengpi-midnight); color: var(--c-text); font-size: 28px; text-align: center;
  font-family: var(--font-body); align-items: center; justify-content: center; line-height: 1.6; }
body.is-portrait #rotate-hint { display: flex; }
#rotate-hint small { display: block; font-size: 18px; color: var(--c-muted); margin-top: 6px; }
#rotate-hint small.lock { margin: 14px 24px 18px; font-size: 16px; line-height: 1.5; }
#btn-portrait-ok { min-width: 180px; min-height: 48px; font-size: 18px; background: var(--c-raised); border: 2px solid var(--pengpi-slate); border-radius: 12px; padding: 8px 18px; }

/* ---------- 減少動態效果（SPEC 5.6）：轉場直接切換、不閃爍、不位移；保留透明度切換 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .q-judging i { border-right-color: currentColor; }
}

/* =====================================================================================================
   手機橫放專用版面（body.layout-m；SPEC 第 8 節、DESIGN_SYSTEM 第 9 節）
   舞台＝可見區域（例：844×390），不整張縮放。三層：手機 HUD 48px／棋盤鏡頭（中間）／操作 dock 88px。
   觸控 ≥ 48px、主按鈕與選項 ≥ 64px、關鍵字 ≥ 14px、主要閱讀 16～20px；鍵帽與快捷鍵說明全部隱藏；沒有水平捲動。
   ===================================================================================================== */
body.layout-m { --hud-h: 48px; --dock-h: 88px; --fs-min: 14px; }
body.layout-m #stage { width: 100vw; height: 100vh; }
body.layout-m .kbd, body.layout-m .pz-kh, body.layout-m .pz-keys, body.layout-m #dialog.wait::after, body.layout-m .card-use .hk, body.layout-m .q-explain em .kbd { display: none !important; }
body.layout-m .m-only { display: inline !important; }
/* 手機 HUD（8.4）：常識升學記、學級、分數、便當、模式小標、暫停鈕；省略節目標籤、四學級進度、LUCKY 卡槽、學分 */
body.layout-m #hud { width: 100%; height: 48px; gap: 12px; padding: 0 60px 0 10px; }
body.layout-m .h-logo, body.layout-m .h-pills, body.layout-m .h-prog, body.layout-m .h-hand, body.layout-m .h-credits, body.layout-m .h-duo { display: none; }
body.layout-m .h-game { font-size: 16px; text-shadow: none; }
body.layout-m .h-stage { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
body.layout-m .h-stage b { font-size: 16px; color: var(--pengpi-amber); }
body.layout-m .h-stage small { font-size: 14px !important; }
body.layout-m .h-score { min-width: 0; display: flex; align-items: baseline; gap: 4px; margin-left: auto; }
body.layout-m .h-score small { font-size: 14px; }
body.layout-m .h-score b { font-size: 18px; }
body.layout-m .h-lives { display: flex; align-items: center; gap: 4px; }
body.layout-m .h-lives small { font-size: 14px; }
body.layout-m .h-lives span { margin: 0; gap: 3px; }
body.layout-m .h-lives i { width: 12px; height: 12px; border-radius: 3px; }
body.layout-m #hud[data-m]:not([data-m=""])::after { content: attr(data-m); font-size: 14px; font-weight: 700; color: var(--pengpi-cyan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
body.layout-m #hud[data-m]:not([data-m=""]) .h-stage small { display: none; }
body.layout-m #stage.in-game:has(.h-hand.locked) #hud .h-game::after { content: ' 🔒本回合不能用卡'; font-size: 14px; color: var(--c-danger); }
body.layout-m #btn-pause { right: 0; top: 0; width: 52px; height: 48px; border-radius: 0 0 0 12px; border-width: 0 0 2px 2px; }
body.layout-m #btn-pause b, body.layout-m #btn-pause small { display: none; }
body.layout-m #btn-pause .pz-ico { width: 18px; height: 20px; border-left-width: 6px; border-right-width: 6px; }
/* 棋盤鏡頭（8.2、8.3）：y 48～(高 − 88)；只有 #board-wrap 用 transform 取景 */
body.layout-m #board-area { inset: auto; left: 0; right: 0; top: 48px; bottom: 88px; overflow: hidden; }
body.layout-m #stage[data-board] #board-area::before { display: none; }
body.layout-m #board-title { display: none; }
body.layout-m #board-wrap { transition: transform calc(var(--fx, 1) * .25s) linear; }
body.layout-m #stage[data-board] { background-size: cover; background-position: center; --fade: linear-gradient(180deg, rgb(5 10 22 / 0) 70%, rgb(5 10 22 / 90%) 82%); }
/* 鏡頭模式的格子字級補償：max(格子 × 0.2, 14px ÷ k)，視覺字高 ≥ 14px */
body.layout-m #cells .cell { font-size: max(24.8px, calc(14px / var(--cam-k, .6))) !important; }
body.layout-m #cells .cell .ls { display: inline; }
body.layout-m #cells .cell .lf { display: none; }
body.layout-m #cells .t-genius b, body.layout-m #cells .t-extra b { font-size: 1em; letter-spacing: -1px; }
/* TROUBLE 七個字母在鏡頭字級下比格子寬：字高維持 ≥ 14px，只把寬度壓成 78%（不縮字、不截字） */
body.layout-m #cells .t-trouble b { font-size: 1em; letter-spacing: -1px; display: inline-block; transform: scaleX(.78); }
body.layout-m #cells .cell .ico { width: 44%; }
body.layout-m #cells .t-lesson .ico, body.layout-m #cells .t-lesson .ms, body.layout-m #cells .t-choice .ico { display: none; }
body.layout-m #cells .t-lesson .pair, body.layout-m #cells .t-choice .pair { flex-direction: column; gap: 0; line-height: 1.04; }
body.layout-m #cells .t-lesson small, body.layout-m #cells .t-choice small { font-size: 1em; line-height: 1.04; }
body.layout-m #cells .reach-tag { font-size: max(22px, calc(14px / var(--cam-k, .6))); top: -2px; right: -2px; }
body.layout-m #cells .place { font-size: max(19px, calc(12px / var(--cam-k, .6))); line-height: 1.05; text-align: center; }
body.layout-m #cells .place span { display: block; }
body.layout-m #pawn .tag, body.layout-m #pawn2 .tag { font-size: max(20px, calc(14px / var(--cam-k, .6))); }
body.layout-m .cam-more { display: block; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 10px; background: rgb(5 10 22 / 90%); border: 2px solid var(--pengpi-amber); color: var(--pengpi-amber); font-size: 14px; font-weight: 800; }
/* 操作 dock（88px）：左 主持短句 30%｜中 主行動 34%｜右 前方預覽摘要 36% */
body.layout-m #dock { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 88px; gap: 8px; padding: 6px 8px; }
body.layout-m #dialog, body.layout-m #dock.dicing #dialog { flex: 1 1 100%; height: 76px; padding: 6px 10px 6px 58px; border-left-width: 6px; border-radius: 12px; gap: 8px; }
body.layout-m #dock.dicing #dialog { flex: 0 0 30%; }
body.layout-m #dlg-face, body.layout-m #dock.dicing #dlg-face { --av: 50px; left: 2px; height: 74px; }
body.layout-m #dlg-name { font-size: 14px; letter-spacing: 0; }
body.layout-m #dlg-text, body.layout-m #dock.dicing #dlg-text { font-size: 16px; line-height: 1.3; margin-top: 1px; }
body.layout-m #dialog.wait { border-color: var(--pengpi-cyan); }
body.layout-m #actions { gap: 8px; }
body.layout-m .dice-col { flex: 0 0 48.5%; flex-direction: row; gap: 6px; padding: 4px 6px; border-radius: 12px; }
body.layout-m .slot { width: 58px; height: 64px; }
body.layout-m .slot-label, body.layout-m .slot-range { display: none; }
body.layout-m .slot.art .slot-win, body.layout-m .slot.art .dice-img { width: 58px; height: 58px; }
body.layout-m .slot-win { width: 58px; height: 58px; margin: 3px 0 0; }
body.layout-m .slot-win b { font-size: 40px; }
body.layout-m .opt.stop { min-height: 64px; font-size: 22px; flex-direction: column; gap: 0; padding: 0 6px 0 30px; }
body.layout-m .opt.stop span { padding-left: 0; }
body.layout-m .opt.stop small { font-size: 14px; }
body.layout-m .opt.stop .ring { width: 26px; height: 26px; margin-top: -13px; left: 4px; }
body.layout-m .pv-col { flex: 1 1 51.5%; padding: 4px 6px; gap: 2px; border-radius: 12px; }
body.layout-m .pv-head { min-height: 0; gap: 6px; }
body.layout-m .pv-head > b { font-size: 14px; }
body.layout-m .pv-head > small { display: none; }
body.layout-m .dice-preview { gap: 2px 6px; grid-auto-rows: auto; }
body.layout-m .dice-preview .pv { grid-template-columns: 16px 1fr; padding: 0 4px; border-width: 1px; border-radius: 6px; column-gap: 4px; }
body.layout-m .dice-preview .pv b { font-size: 15px; }
body.layout-m .dice-preview .pv .dest { flex-direction: row; gap: 0; overflow: hidden; white-space: nowrap; }
body.layout-m .dice-preview .pv .d1 + .d1::before { content: '／'; font-size: 14px; color: var(--c-muted); }
body.layout-m .dice-preview .pv .dest i, body.layout-m .dice-preview .pv.fork .dest i { font-size: 14px; }
body.layout-m .dice-preview .pv .dest em, body.layout-m .dice-preview .pv small { display: none; }
/* 擲骰前卡與訪客加入：棋盤鏡頭右上的籌碼列（每顆 ≥ 48px 高） */
body.layout-m .dock-cards { position: fixed; right: 8px; top: 56px; z-index: 6; flex-direction: column; gap: 8px; }
body.layout-m .card-use { min-height: 48px; padding: 2px 10px 2px 4px; font-size: 14px; border-radius: 10px; background: rgb(5 10 22 / 92%); }
body.layout-m .card-use small { font-size: 14px; }
body.layout-m .card-use .lcard { width: 26px; }
body.layout-m .dice-tip { position: fixed; left: 50%; top: auto; bottom: 94px; transform: translateX(-50%); font-size: 14px; padding: 6px 12px; }
body.layout-m .dice-tip::after { display: none; }
/* 面板（Q、E、D、H、I）：HUD 下方全部可用高度；題目與考試時看不到棋盤與主持字幕框 */
body.layout-m #overlay, body.layout-m #stage[data-view="q"] #overlay { left: 0; top: 48px; width: 100%; height: auto; bottom: 0; padding: 0; align-items: stretch; background: var(--pengpi-midnight); }
body.layout-m #stage[data-view="d"] #overlay, body.layout-m #stage[data-view="h"] #overlay, body.layout-m #stage[data-view="i"] #overlay { background: rgb(7 17 38 / 96%); }
/* 分歧選路：決策卡收成鏡頭下方兩顆大鈕，鏡頭同時取景兩條路 */
body.layout-m #stage[data-view="dr"] #board-area { bottom: 132px; }
body.layout-m #stage[data-view="dr"] #overlay { top: auto; bottom: 0; height: 132px; background: var(--pengpi-ink); padding: 0; justify-content: stretch; pointer-events: auto; }
body.layout-m #stage[data-view="dr"] #panel { width: 100%; height: 100%; max-height: none; padding: 4px 8px 6px; border-radius: 0; }
body.layout-m #stage[data-view="dr"] .p-kicker, body.layout-m #stage[data-view="dr"] .p-desc { display: none; }
body.layout-m #stage[data-view="dr"] .p-title { font-size: 15px; display: block; margin: 0 0 4px; }
body.layout-m #stage[data-view="dr"] .opt.dec { min-height: 88px; padding: 6px 10px; }
body.layout-m #stage[data-view="dr"] .opt.dec .o-txt { padding-top: 0; }
body.layout-m #stage[data-view="dr"] .opt.dec b { font-size: 17px; }
body.layout-m #stage[data-view="dr"] #dock { display: none; }
body.layout-m #stage[data-view="q"] #dock, body.layout-m #stage[data-view="d"] #dock, body.layout-m #stage[data-view="h"] #dock, body.layout-m #stage[data-view="i"] #dock { display: none; }
body.layout-m #panel, body.layout-m #panel.question, body.layout-m #panel.reward, body.layout-m #panel.crisis, body.layout-m #panel.info, body.layout-m #panel.multi { width: 100%; max-height: none; min-height: 0; height: 100%; margin: 0; padding: 8px 12px; border-width: 0; border-top: 2px solid var(--pengpi-cyan); border-radius: 0; overflow-y: auto; animation: none; box-shadow: none; }
body.layout-m .p-kicker { height: 28px; padding: 0 10px; font-size: 14px; margin-bottom: 4px; border-radius: 8px; }
body.layout-m .p-title, body.layout-m #panel.info .p-title, body.layout-m #panel.reward .p-title, body.layout-m #panel.crisis .p-title { font-size: 18px; margin: 0 0 2px; }
body.layout-m .p-desc { font-size: 14px; margin: 0 0 6px; line-height: 1.35; }
body.layout-m .p-body, body.layout-m #panel.info .p-body { font-size: 16px; line-height: 1.45; }
body.layout-m .trivia-q { font-size: 16px; } body.layout-m .trivia-x { font-size: 15px; }
body.layout-m .p-options { gap: 8px; }
body.layout-m .p-options.grid3 { gap: 8px; }
body.layout-m .opt { min-height: 48px; padding: 6px 10px; font-size: 16px; }
body.layout-m .opt small { font-size: 14px; }
body.layout-m .opt.dec, body.layout-m #panel.choose.n3 .p-options .opt.dec, body.layout-m #panel.c-college .opt.dec { min-height: 96px; padding: 8px 10px; }
body.layout-m #panel.multi .opt.dec { min-height: 64px; }
body.layout-m .opt.dec .o-txt { padding-top: 0; gap: 2px; }
body.layout-m .opt.dec b { font-size: 17px; }
body.layout-m .opt.dec small { font-size: 14px; line-height: 1.3; }
body.layout-m .opt.dec.with-card .lcard { width: 40px; }
body.layout-m .opt.dec .o-state { font-size: 14px; right: 8px; top: 6px; }
body.layout-m .opt.confirm, body.layout-m #panel.ev .ev-text .opt.confirm { width: 100%; min-height: 64px; margin: 8px 0 0; font-size: 17px; position: sticky; bottom: 0; }
body.layout-m .p-clock { right: 12px; top: 8px; }
body.layout-m #panel.multi .p-clock { top: 48px; }
body.layout-m #panel.multi .opt.dec { padding-top: 6px; }
body.layout-m #panel.multi .opt.dec .o-txt { padding-top: 0; }
body.layout-m .p-clock b { font-size: 26px; }
body.layout-m .p-clock small { font-size: 14px; }
body.layout-m #panel.ev .ev-body { gap: 14px; height: 100%; }
body.layout-m #panel.ev .ev-text { height: 100%; }
body.layout-m .lcard.big { width: 120px; --cw: 120px; }
body.layout-m .ev-icon { width: 120px; height: 120px; }
body.layout-m .ev-icon img { width: 84px; height: 84px; }
body.layout-m #panel.exam-result .stamp { width: 140px; height: 140px; }
body.layout-m .ev-effect, body.layout-m .ev-effect.big { font-size: 18px; }
body.layout-m .ld-when { font-size: 15px; }
body.layout-m .ev-list { font-size: 16px; }
/* 題卡（844×342）：標頭 40、題幹 ≤ 3 行、選項 2×2 每顆 ≥ 64、可用卡收在標頭右側 */
body.layout-m #panel.question { display: flex; flex-direction: column; padding: 6px 10px 6px; }
body.layout-m .q-top { min-height: 36px; gap: 8px; }
body.layout-m .q-kind { height: 30px; padding: 0 10px; font-size: 14px; }
body.layout-m .q-head { gap: 4px; flex-wrap: nowrap; overflow: hidden; }
body.layout-m .q-head .tag { font-size: 14px; padding: 2px 8px; }
body.layout-m .q-timer { width: 150px; gap: 6px; }
body.layout-m .q-timer .sec { font-size: 22px; min-width: 28px; }
body.layout-m .q-timer small { font-size: 14px; }
body.layout-m .q-prompt { font-size: 20px; margin: 8px 0 10px; min-height: 0; line-height: 1.35; }
body.layout-m #panel.revealed .q-prompt { font-size: 18px; margin: 4px 0 6px; }
body.layout-m #panel.revealed .q-options { grid-auto-rows: 64px; }
body.layout-m .q-options { gap: 8px; grid-auto-rows: minmax(64px, 92px); }
body.layout-m .opt.ans, body.layout-m #panel.revealed .opt.ans { min-height: 64px; padding: 6px 8px 6px 6px; gap: 8px; }
body.layout-m .opt.ans .kbd.code { display: flex !important; width: 30px; height: 44px; font-size: 18px; }
body.layout-m .opt.ans b { font-size: 17px; }
body.layout-m .opt.ans .mark { font-size: 14px; padding: 2px 6px; }
body.layout-m .q-foot { margin-top: 6px; min-height: 0; }
body.layout-m .q-source { display: none; }
body.layout-m .q-cards { position: absolute; right: 168px; top: 6px; gap: 6px; }
body.layout-m .q-cards .card-use { min-height: 48px; padding: 2px 8px 2px 2px; }
body.layout-m .q-cards .card-use small { display: none; }
body.layout-m .q-skip { top: 6px; right: 170px; min-height: 48px; font-size: 14px; }
body.layout-m .q-judging { font-size: 15px; padding: 4px 10px; }
body.layout-m .q-reveal { gap: 10px; margin-top: 6px; padding: 6px 10px; }
body.layout-m .q-result { min-width: 120px; font-size: 14px; }
body.layout-m .q-result b { font-size: 18px; }
body.layout-m .q-explain { font-size: 15px; }
body.layout-m .q-explain p { -webkit-line-clamp: 4; }
body.layout-m .q-explain small, body.layout-m .q-explain em { font-size: 14px; }
body.layout-m .exam-bar { margin: 0 0 4px; padding: 4px 8px; gap: 8px; }
body.layout-m .exam-bar .eb-name, body.layout-m .exam-bar .eb-path, body.layout-m .exam-bar .eb-need, body.layout-m .exam-bar .eb-left { font-size: 14px; }
body.layout-m .exam-bar .eb-name { padding: 2px 8px; }
body.layout-m .exam-bar .eb-dots i { width: 26px; height: 26px; font-size: 14px; border-width: 2px; }
body.layout-m .buzz-row { gap: 12px; margin-top: 8px; }
body.layout-m .buzz-row .buzz-btn { min-height: 96px; font-size: 20px; }
body.layout-m .buzz-row .buzz-btn small { display: none; }
/* 轉場、鐘響、飛卡、提示 */
body.layout-m .bumper { top: 48px; }
body.layout-m .bp-card { padding: 16px 36px; gap: 6px; }
body.layout-m .bp-kicker { font-size: 14px; padding: 6px 12px; }
body.layout-m .bp-title { font-size: 40px; }
body.layout-m .bp-sub { font-size: 18px; }
body.layout-m .bp-line { font-size: 15px; }
body.layout-m .bell-banner { top: 56px; padding: 8px 16px 8px 8px; gap: 10px; max-width: 94%; }
body.layout-m .bb-kicker { font-size: 14px; padding: 6px 8px; }
body.layout-m .bb-text b { font-size: 22px; }
body.layout-m .bb-text small { font-size: 14px; }
body.layout-m .card-fx { top: 60px; }
body.layout-m .card-fx .lcard { width: 90px; --cw: 90px; }
body.layout-m .card-fx-label { font-size: 20px; }
body.layout-m .tip-bar, body.layout-m #stage[data-view] .tip-bar { top: auto; bottom: 96px; left: 50%; right: auto; transform: translateX(-50%); font-size: 14px; padding: 6px 14px; }
body.layout-m #stage:not([data-view="board"]) .tip-bar { bottom: 8px; }
/* 決策卡、事件卡：底部是選項或固定的主按鈕，提示改放右上角（標題在左邊） */
body.layout-m #stage[data-view="d"] .tip-bar, body.layout-m #stage[data-view="dr"] .tip-bar, body.layout-m #stage[data-view="h"] .tip-bar, body.layout-m #stage[data-view="i"] .tip-bar { bottom: auto; top: 54px; left: auto; right: 8px; transform: none; }
body.layout-m #screen.scr-title:not([hidden]) ~ .tip-bar { bottom: 8px; left: 50%; }
/* 全畫面 */
body.layout-m #screen { overflow-y: auto; justify-content: flex-start; }
body.layout-m .scr-body { width: 100%; padding: 8px 12px 70px; }
body.layout-m .scr-body h1 { font-size: 30px; }
body.layout-m .scr-body p { font-size: 16px; margin: 4px 0; }
body.layout-m .scr-body .small { font-size: 14px; }
body.layout-m .scr-buttons { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; gap: 8px; margin: 0; padding: 6px 8px; background: rgb(5 10 22 / 96%); flex-wrap: nowrap; justify-content: center; }
body.layout-m .scr-buttons .opt, body.layout-m .scr-buttons .opt.btn-primary { min-width: 0; min-height: 56px; font-size: 16px; padding: 4px 12px; flex: 1 1 auto; }
body.layout-m .scr-buttons .opt.btn-primary { flex-grow: 2; min-height: 64px; }
body.layout-m .scr-buttons .opt.btn-text { flex: 0 0 auto; min-height: 48px; min-width: 56px; font-size: 14px; padding: 4px 6px; }
body.layout-m .scr-buttons .opt small { font-size: 14px; }
body.layout-m .sysbar { position: static; height: auto; min-height: 48px; padding: 4px 12px; gap: 10px; flex-wrap: wrap; font-size: 14px; }
body.layout-m .sb-pill { font-size: 14px; padding: 4px 8px; }
body.layout-m .sb-text { white-space: normal; }
body.layout-m .sb-links { gap: 10px; margin-left: 0; flex-wrap: wrap; }
/* 節目首頁（T）：小 Logo＋節目標籤（96px）→ 三張模式卡橫排（≥ 120px 高）→ 繼續上次＋設定 */
body.layout-m .scr-title .scr-body { width: 100%; height: auto; min-height: calc(100vh - 52px); padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
body.layout-m .t-top, body.layout-m .t-logo, body.layout-m .scr-body .t-line, body.layout-m .scr-body .t-ask, body.layout-m .t-modes, body.layout-m .t-actions, body.layout-m .t-host { position: static; transform: none; }
body.layout-m .t-top { display: none; }
body.layout-m .t-logo { align-self: center; }
body.layout-m .t-logo img { width: auto; height: 84px; }
body.layout-m .scr-body .t-line { display: none; }
body.layout-m .scr-body .t-ask { font-size: 16px; }
body.layout-m .t-modes { gap: 8px; }
body.layout-m .opt.mode-card { min-height: 128px; padding: 8px 10px; gap: 2px; border-radius: 14px; }
body.layout-m .mode-card .mc-tag { font-size: 14px; padding: 4px 8px; }
body.layout-m .mode-card .mc-name { font-size: 20px; margin-top: 2px; }
body.layout-m .mode-card .mc-sub { font-size: 14px !important; line-height: 1.3; }
body.layout-m .mode-card .mc-diff { display: none; }
body.layout-m .mode-card .mc-best { font-size: 14px !important; }
body.layout-m .mode-card .mc-go { position: static; font-size: 14px; margin-top: auto; }
body.layout-m .opt.mode-card.focus { transform: none; }
body.layout-m .t-actions { gap: 8px; flex-wrap: wrap; }
body.layout-m .t-actions .opt, body.layout-m .t-actions .opt.resume, body.layout-m .t-actions .opt.settings { min-width: 0; min-height: 64px; font-size: 16px; padding: 4px 14px; flex: 1 1 auto; }
body.layout-m .t-actions .opt.settings, body.layout-m .t-actions .opt.btn-text { flex: 0 1 auto; min-height: 48px; }
body.layout-m .t-host { display: none; }
body.layout-m .t-actions .opt.more { display: flex; }
body.layout-m .scr-title .sysbar { display: none; }
body.layout-m .more-links .opt { min-height: 48px; font-size: 15px; }
body.layout-m .scr-title { background-size: cover !important; }
/* 成績紙（R）：不縮整張紙；上方等級與高光、科目橫向卡片（容器內左右捲動）、按鈕固定底部 */
body.layout-m .scr-body.paper-body { width: 100%; padding: 6px 8px 76px; }
body.layout-m .paper { padding: 0 12px 12px; border-width: 2px; border-radius: 14px; }
body.layout-m .rp-head { margin: 0 -12px 8px; padding: 6px 12px; gap: 10px; }
body.layout-m .rp-logo { height: 34px; }
body.layout-m .scr-body .paper .rp-title h1 { font-size: 18px; }
body.layout-m .scr-body .paper .rp-title h2 { font-size: 14px; }
body.layout-m .rp-date { display: none; }
body.layout-m .rp-top { grid-template-columns: 70px 1fr; gap: 8px; }
body.layout-m .rp-high { grid-column: 1 / -1; padding: 6px 10px; }
body.layout-m .report .big-g, body.layout-m #screen.show-detail .report .big-g { font-size: 52px; }
body.layout-m .rp-grade small { font-size: 14px; }
body.layout-m .rp-nums p { font-size: 15px; margin: 2px 0; }
body.layout-m .rp-nums .rp-correct b { font-size: 22px; }
body.layout-m .rp-nums .rp-score b { font-size: 18px; }
body.layout-m .rp-high small { font-size: 14px; }
body.layout-m .report .unique { font-size: 16px; }
body.layout-m .rp-conduct, body.layout-m .rp-title-name { font-size: 15px; }
body.layout-m .rp-subj, body.layout-m .rp-subj.four { display: flex; overflow-x: auto; gap: 8px; margin: 8px 0; padding-bottom: 4px; }
body.layout-m .rp-subj .sc { flex: 0 0 132px; padding: 6px 10px; }
body.layout-m .rp-subj .sc b { font-size: 15px; }
body.layout-m .rp-subj .sc .g { font-size: 28px; }
body.layout-m .rp-subj .sc small { font-size: 14px; }
body.layout-m .report .teacher { font-size: 15px; flex-wrap: wrap; gap: 4px; }
body.layout-m .report .parent { margin-left: 0; font-size: 14px; white-space: normal; }
body.layout-m .report .saved { font-size: 15px; }
body.layout-m .scr-body .paper .small { font-size: 14px; }
body.layout-m .report table { font-size: 14px; }
body.layout-m .report th, body.layout-m .report td { padding: 2px 6px; }
body.layout-m #screen.show-detail .rp-foot { display: block; }
body.layout-m #screen.show-detail .rp-subj { display: flex; }
/* 典禮（C）：證書縮成摘要卡（稱號、結局、總分），按鈕固定底部 */
body.layout-m .scr-graduation .scr-body { width: 100%; }
body.layout-m .cer-pill { font-size: 16px; padding: 6px 16px; }
body.layout-m .diploma.art { width: 100%; max-width: 560px; height: auto; margin: 8px auto 0; background: var(--c-paper); border: 3px solid var(--pengpi-amber); border-radius: 14px; filter: none; padding: 10px 14px; }
body.layout-m .diploma.art .d-in { position: static; gap: 2px; }
body.layout-m .diploma.art h3 { font-size: 18px; letter-spacing: 8px; }
body.layout-m .scr-body .diploma.art .d-who, body.layout-m .scr-body .diploma.art .d-sign, body.layout-m .scr-body .diploma.art .d-date { display: none; }
body.layout-m .scr-body .diploma.art .d-college { font-size: 15px; }
body.layout-m .scr-body .diploma.art .d-title { font-size: 22px; }
body.layout-m .scr-body .diploma.art .d-ending { font-size: 15px; }
body.layout-m .scr-body .diploma.art .d-desc { font-size: 14px; max-width: none; align-self: center; text-align: center; }
body.layout-m .grad-host { display: none; }
body.layout-m .scr-body .cer-sum { font-size: 17px; margin-top: 6px; }
body.layout-m .scr-body .ceremony .bento { font-size: 14px; }
body.layout-m .scr-gameover .scr-body h1 { font-size: 46px; }
body.layout-m .continue { font-size: 64px; margin: 4px 0; }
body.layout-m .go-kicker { font-size: 14px; }
/* 系統層（S）：全螢幕面板，可捲動；主按鈕固定底部 */
body.layout-m .sys-sheet { align-items: stretch; }
body.layout-m .sys-sheet .ss-panel, body.layout-m .sys-sheet.light .ss-panel, body.layout-m #settings-sheet .ss-panel, body.layout-m #endings-sheet .ss-panel { width: 100%; max-height: none; height: 100%; padding: 8px 12px 0; gap: 6px; border-width: 0; border-radius: 0; overflow-y: auto; }
body.layout-m .sh-title { font-size: 20px; }
body.layout-m .sh-btns { position: sticky; bottom: 0; margin: auto -12px 0; padding: 6px 8px; gap: 8px; background: var(--c-panel); }
body.layout-m .sh-btns .opt { min-width: 0; flex: 1; min-height: 56px; font-size: 17px; }
body.layout-m .sh-btns .opt.btn-primary { min-height: 64px; }
body.layout-m .pz-lead { font-size: 14px; }
body.layout-m .pz-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
body.layout-m .pz-col h3 { font-size: 15px; margin: 8px 0 4px; }
body.layout-m .badge-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
body.layout-m .bg-item { grid-template-columns: 30px 1fr; padding: 4px 6px; }
body.layout-m .bg-item img { width: 30px; height: 30px; }
body.layout-m .bg-item b { font-size: 14px; }
body.layout-m .bg-item small { font-size: 14px; }
body.layout-m .pz-count, body.layout-m .pz-rules, body.layout-m .pz-empty, body.layout-m .pz-note { font-size: 14px; }
body.layout-m .pz-card b { font-size: 14px; } body.layout-m .pz-card small { font-size: 14px; }
body.layout-m .pz-warns p { font-size: 16px; }
body.layout-m .set-row { min-height: 56px; padding: 6px 10px; }
body.layout-m .set-t b { font-size: 16px; }
body.layout-m .set-t small { font-size: 14px; }
body.layout-m .set-val { font-size: 15px; min-width: 60px; }
body.layout-m .endings-list b { font-size: 16px; } body.layout-m .endings-list small { font-size: 14px; }
body.layout-m #share-sheet .ss-box { width: 100%; height: 100%; max-height: none; border-radius: 0; border-width: 0; padding: 8px 12px; gap: 6px; overflow-y: auto; }
body.layout-m #share-sheet .ss-title { font-size: 18px; }
body.layout-m #share-sheet .ss-preview { padding: 6px; gap: 10px; }
body.layout-m #share-sheet .ss-img { width: 240px; height: 126px; }
body.layout-m #share-sheet .ss-text { font-size: 14px; max-height: 126px; }
body.layout-m #share-sheet .ss-status { font-size: 14px; min-height: 18px; }
body.layout-m #share-sheet .ss-btns { gap: 6px; }
body.layout-m #share-sheet .ss-btn { min-height: 48px; font-size: 16px; padding: 4px 8px; }
body.layout-m #share-sheet .ss-btn small { font-size: 14px; }
body.layout-m #share-sheet .ss-close { min-height: 48px; font-size: 16px; min-width: 200px; }
body.layout-m .ops-box { width: 100%; height: 100%; border-radius: 0; padding: 10px 14px; gap: 8px; overflow-y: auto; }
body.layout-m .ops-box h2 { font-size: 20px; }
body.layout-m .ops-kind span { font-size: 15px; padding: 8px 12px; }
body.layout-m .ops-field, body.layout-m .ops-kinds legend { font-size: 14px; }
body.layout-m .ops-field textarea, body.layout-m .ops-field input { font-size: 16px; }
body.layout-m .ops-auto, body.layout-m .ops-status { font-size: 14px; }
body.layout-m .ops-buttons button { font-size: 16px; padding: 8px 20px; min-height: 48px; }
