﻿/* Ripple（原 Deep Sea Trivia）— 依 Google Stitch 設計稿（專案 5722966402256523926）實作 */
@font-face { font-family: "Inter"; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/inter.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212; }
@font-face { font-family: "Jakarta"; font-weight: 600 800; font-display: swap; src: url(/assets/fonts/jakarta.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212; }

:root {
  --well: 0 10 26; /* 凹槽底色（分段按鈕、輸入框、清單列），淺色版型會換掉 */
  --on-accent: #00222e; /* 主色按鈕上的字 */
  --bg-0: #000b1a; --bg-1: #00132c; --bg-2: #0a2e55;
  --ink: #e8f4ff; --ink-2: #bcc8cf; --ink-3: #8fa9c7; --ink-4: #5d7594;
  --cyan: #4fd1ff; --cyan-soft: rgba(79, 209, 255, .14);
  --amber: #ffb547; --amber-2: #f59e0b; --amber-ink: #2a1a00; --amber-soft: rgba(255, 181, 71, .14);
  --green: #4ade80;
  --danger: #ff8a80;
  --glass: rgba(13, 32, 57, .62); --glass-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .12); --line-2: rgba(79, 209, 255, .28);
  --r: 12px; --r-lg: 18px;
  --sans: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --head: "Jakarta", "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg-0); }
body {
  font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.5;
  background: radial-gradient(120% 70% at 50% -10%, #0f3a66 0%, var(--bg-1) 45%, var(--bg-0) 100%) fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.01em; margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- 共用元件 ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--glass-2); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; text-decoration: none !important;
}
.btn:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .22); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ffc56a, var(--amber-2)); color: var(--amber-ink); border-color: transparent; box-shadow: 0 8px 24px rgba(245, 158, 11, .25); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 30px rgba(245, 158, 11, .35); }
.btn.cyan { background: var(--cyan); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 24px rgba(79, 209, 255, .25); }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn.icon { width: 40px; padding: 0; }
.btn.danger:hover { color: var(--danger); border-color: rgba(255, 138, 128, .45); background: rgba(255, 138, 128, .08); }
.btn.on { background: var(--amber-soft); border-color: rgba(255, 181, 71, .6); color: #ffd99a; }
.field { display: grid; gap: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-4); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgb(var(--well) / .55); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.input::placeholder { color: var(--ink-4); }
textarea.input { height: auto; min-height: 220px; padding: 12px 14px; resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 1.75; }
.input-wrap { position: relative; }
.input-wrap > svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-wrap .input { padding-left: 42px; padding-right: 44px; }
.input-wrap .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-3); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.input-wrap .peek:hover { color: var(--ink); background: var(--glass-2); }
.err { color: var(--danger); min-height: 1.3em; font-size: 13px; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); background: var(--glass-2); white-space: nowrap; }
.pill.cyan { color: var(--cyan); border-color: var(--line-2); background: var(--cyan-soft); }
.pill.amber { color: var(--amber); border-color: rgba(255, 181, 71, .4); background: var(--amber-soft); }
.code-chip { font-family: var(--mono); font-weight: 700; letter-spacing: .08em; color: var(--amber); border: 1px solid rgba(255, 181, 71, .4); background: var(--amber-soft); border-radius: 7px; padding: 1px 8px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; box-shadow: 0 0 0 3px rgba(255, 138, 128, .18); }
.dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, .05); } }
.kbd { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(79, 209, 255, .12); color: var(--cyan); border: 1px solid var(--line-2); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none !important; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }

/* ---------- 海洋背景（登入 / 輸入代碼頁） ---------- */
.ocean-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ocean-bg::before { content: ""; position: absolute; left: 0; right: 0; top: 54%; bottom: 0; background: linear-gradient(180deg, rgba(10, 74, 122, .55), rgba(0, 11, 26, .2) 60%, transparent); }
.ocean-bg .line { position: absolute; left: 0; right: 0; top: 54%; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--cyan) 70%, transparent); box-shadow: 0 0 30px 6px rgba(79, 209, 255, .35); opacity: .6; }
.ocean-bg .glow { position: absolute; left: 50%; top: 54%; width: 90vw; height: 40vh; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(79, 209, 255, .22), transparent); }
.ocean-bg span { position: absolute; font-family: var(--head); font-weight: 700; color: rgba(79, 209, 255, .22); filter: blur(1.5px); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateY(-8px); } to { transform: translateY(8px); } }

/* ---------- 登入 / 加入 ---------- */
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 36px 32px 28px; text-align: center; }
.auth-card .pill { margin-bottom: 18px; }
.auth-card .logo { width: 64px; height: 64px; margin: 0 auto 14px; display: block; filter: drop-shadow(0 8px 24px rgba(255, 181, 71, .35)); }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }
.auth-card form { display: grid; gap: 14px; margin-top: 26px; text-align: left; }
.auth-card .alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.code-input { text-align: center; font-family: var(--mono); font-size: 32px; height: 64px; letter-spacing: .4em; text-transform: uppercase; font-weight: 800; color: var(--amber); padding-left: .4em; }
.page-foot { position: fixed; left: 24px; right: 24px; bottom: 16px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-4); pointer-events: none; }

/* ---------- Dashboard ---------- */
.topnav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(0, 14, 36, .72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topnav .spacer { flex: 1; }
.dash { max-width: 1240px; margin: 0 auto; padding: 40px 32px 64px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.dash-head h1 { font-size: 40px; line-height: 1.15; margin-top: 12px; }
.dash-head p { color: var(--ink-3); margin: 8px 0 0; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash, .topnav { padding-left: 18px; padding-right: 18px; } }
.card { padding: 26px; }
.card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.card-head .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cyan-soft); color: var(--cyan); border: 1px solid var(--line-2); flex: none; }
.card-head h2 { font-size: 20px; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.card-head .grow { flex: 1; min-width: 0; }
.create { display: grid; gap: 20px; }
.linkish { background: none; border: 0; padding: 0; color: var(--amber); font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linkish:hover { text-decoration: underline; }
.room-list { display: grid; gap: 14px; }
.ppt-card { grid-column: 1 / -1; }
.ppt-steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 12px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.ppt-steps b { color: var(--ink); }
.cmd { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; padding: 6px 6px 6px 14px; border-radius: 12px; background: rgb(var(--well) / .6); border: 1px solid var(--line-2); }
.cmd code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; color: var(--cyan); overflow-x: auto; white-space: nowrap; }
.ppt-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ppt-card code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.set-details { border: 1px solid var(--line); border-radius: 14px; background: rgb(var(--well) / .3); padding: 0 16px; }
.set-details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.set-details summary::-webkit-details-marker { display: none; }
.set-details summary .hint { margin-left: auto; text-align: right; }
.set-details[open] summary { border-bottom: 1px solid var(--line); }
.room { display: flex; align-items: center; gap: 16px; padding: 18px 18px 18px 20px; border-radius: 16px; background: rgb(var(--well) / .35); border: 1px solid var(--line); transition: border-color .2s, background .2s, transform .2s; }
.room:hover { border-color: var(--line-2); background: rgba(79, 209, 255, .05); }
.room.latest { border-color: var(--line-2); box-shadow: inset 0 0 0 1px rgba(79, 209, 255, .08), 0 0 40px rgba(79, 209, 255, .06); }
.room .meta { flex: 1; min-width: 0; display: grid; gap: 8px; }
.room .title { font-family: var(--head); font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.room .title span:last-child { overflow: hidden; text-overflow: ellipsis; }
.room .sub { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--ink-3); }
.room .sub > span { display: inline-flex; align-items: center; gap: 5px; }
.room .sub svg.i { width: 14px; height: 14px; }
.room .actions { display: flex; gap: 8px; flex: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 16px; }
.tip { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: rgb(var(--well) / .35); border: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; }
.tip b { color: var(--ink); }
@media (max-width: 560px) { .room { flex-direction: column; align-items: stretch; } .room .actions .btn.primary { flex: 1; } }

/* =====================================================
   講者舞台：一律 100vh、不捲動
   ===================================================== */
html.stage-html, html.stage-html body { overflow: hidden; overscroll-behavior: none; }
.stage { position: fixed; inset: 0; overflow: hidden; overflow: clip; user-select: none; }
.stage.idle { cursor: none; }

.sea-bg { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 0%, #0b2a4d 0%, #020d20 55%, #010714 100%); }
.stars { position: absolute; inset: 0 0 auto 0; height: var(--wl, 52%); background-image: radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 33% 64%, rgba(255,255,255,.35), transparent), radial-gradient(1px 1px at 58% 18%, rgba(255,255,255,.4), transparent), radial-gradient(1.5px 1.5px at 76% 42%, rgba(255,255,255,.45), transparent), radial-gradient(1px 1px at 88% 12%, rgba(255,255,255,.3), transparent), radial-gradient(1px 1px at 22% 82%, rgba(255,255,255,.25), transparent), radial-gradient(1px 1px at 66% 76%, rgba(255,255,255,.3), transparent); transition: height 1.6s cubic-bezier(.22,.8,.25,1); }
.water {
  position: absolute; left: 0; right: 0; bottom: 0; top: var(--wl, 52%);
  background: radial-gradient(70% 45% at 50% 0%, rgba(79, 209, 255, .2), transparent 70%), linear-gradient(180deg, #0b4775 0%, #073560 18%, #04234a 50%, #021230 80%, #010a1c 100%);
  transition: top 1.6s cubic-bezier(.22, .8, .25, 1);
  overflow-x: clip;
}
.water .wave { position: absolute; left: 0; width: 200%; height: 46px; top: -32px; animation: wave 16s linear infinite; }
.water .wave.w2 { top: -24px; animation-duration: 26s; animation-direction: reverse; }
.water .shine { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(160, 235, 255, .9) 25%, rgba(160, 235, 255, .9) 75%, transparent); box-shadow: 0 0 24px 4px rgba(79, 209, 255, .45); opacity: .7; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.water .rays { position: absolute; inset: 0; background: repeating-linear-gradient(100deg, rgba(180, 235, 255, .045) 0 34px, transparent 34px 110px); -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); animation: rays 20s ease-in-out infinite alternate; }
@keyframes rays { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
.water .wl-label { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); z-index: 3; }
.wl-label { font-family: var(--mono); font-size: 11px; letter-spacing: .25em; color: rgba(190, 235, 255, .75); padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(2, 18, 40, .8); white-space: nowrap; }
.bubble { position: absolute; bottom: -20px; border-radius: 50%; border: 1px solid rgba(180, 230, 255, .35); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .03)); animation: bubble linear infinite; }
@keyframes bubble { from { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } to { transform: translateY(calc(-1 * var(--h, 400px))); opacity: 0; } }
#bubbles { position: absolute; inset: 0; overflow: hidden; }

/* 頂列：永遠單行 */
.topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 40; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: linear-gradient(180deg, rgba(1, 8, 22, .85), rgba(1, 8, 22, 0)); }
.live-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .3); color: #9ff0bf; font-weight: 700; font-size: 12px; letter-spacing: .14em; flex: none; }
.live-pill.off { background: rgba(255, 138, 128, .1); border-color: rgba(255, 138, 128, .3); color: #ffc2bb; }
.topbar .title { font-family: var(--head); font-weight: 800; font-size: clamp(18px, 1.7vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.stat { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-3); white-space: nowrap; flex: none; }
.stat b { font-family: var(--head); font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat.amber b { color: var(--amber); }
.stat svg.i { width: 16px; height: 16px; color: var(--cyan); }
.topbar .spacer { flex: 1 1 0; min-width: 0; }
.tools { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: rgb(var(--well) / .55); border: 1px solid var(--line); backdrop-filter: blur(12px); flex: none; transition: opacity .4s; }
/* 窄螢幕（手機、縮小的視窗）：工具列移到底部置中，可左右滑；鍵盤提示收起；活動切換保留可讀寬度 */
@media (max-width: 760px) {
  html:not(.embed) .stage .tools { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
  html:not(.embed) .stage .help { display: none; }
  html:not(.embed) .topbar { gap: 8px; padding: 0 10px; }
  html:not(.embed) .topbar .act-box { flex: 1 1 auto; min-width: 96px; max-width: none; }
  /* 理解量表、清除留言讓出底部給工具列，且不超出畫面 */
  html:not(.embed) .stage .meter-box { left: 10px; right: 10px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 56px); display: flex; justify-content: center; }
  html:not(.embed) .stage .meter-box .meter-bar { max-width: 100%; min-width: 0; }
  html:not(.embed) .stage .meter-box .mb-track { flex: 1 1 auto; width: auto; min-width: 40px; }
  html:not(.embed) .stage .dm-clear { right: 10px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 108px); }
  /* QR 卡縮成小卡（只留 QR 與代碼），點一下仍可放大 */
  html:not(.embed) .stage .qr-card { width: 116px !important; right: 10px; top: 72px; padding: 8px; }
  html:not(.embed) .stage .qr-card :is(.qh, .cl, .url, .cap) { display: none; }
  html:not(.embed) .stage .qr-card img { padding: 5px; border-radius: 8px; }
  html:not(.embed) .stage .qr-card .code { margin-top: 6px; font-size: 15px; padding: 4px; }
  html:not(.embed) .stage .surface-cap { display: none; } /* 操作提示，窄螢幕放不下 */
}
@media (max-width: 560px) { html:not(.embed) .topbar .title { display: none; } }
.tool { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.tool:hover { background: rgba(255, 255, 255, .09); color: var(--ink); }
.tool.on { background: var(--amber-soft); color: #ffd99a; }
.tool .lbl { display: none; }
@media (min-width: 1500px) { .tool .lbl { display: inline; } }
.tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.stage.idle .tools, .stage.idle .help { opacity: 0; }
@media (max-width: 900px) { .stat .t { display: none; } }

/* 名詞 */
#termLayer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.term { position: absolute; left: 0; top: 0; transform-origin: 0 0; border: 0; background: none; padding: 0; color: inherit; cursor: default; pointer-events: auto; transition: transform 1.9s cubic-bezier(.2, .75, .25, 1), opacity .8s; will-change: transform; font-family: var(--head); }
.term .bob { display: inline-flex; align-items: center; gap: 10px; animation: bob var(--d, 6s) ease-in-out var(--dl, 0s) infinite alternate; transition: background .5s, box-shadow .5s, color .5s, opacity .8s, filter .8s; }
@keyframes bob { from { transform: translateY(-5px) rotate(-.5deg); } to { transform: translateY(5px) rotate(.5deg); } }
.term .txt { white-space: nowrap; }
.term .badge { display: none; }
.term .ck { display: none; }
/* 水下：純文字、依深度不同大小與透明度 */
.term.sea .bob { padding: 4px 8px; opacity: var(--op, .6); filter: blur(var(--bl, 0px)); }
.term.sea .txt { font-size: 20px; font-weight: 600; color: #a9dcff; text-shadow: 0 0 14px rgba(79, 209, 255, .35); }
.term.sea.explained .bob { opacity: .75; filter: none; padding: 5px 12px 5px 10px; border-radius: 999px; border: 1px solid rgba(74, 222, 128, .25); background: rgba(74, 222, 128, .06); }
.term.sea.explained .txt { color: #b9d6ea; text-shadow: none; }
.term.sea.explained .ck { display: inline-flex; color: var(--green); }
.term.sea.explained .ck svg { width: 18px; height: 18px; }
/* 水面上：毛玻璃白膠囊 + 琥珀票數 */
.term.risen { z-index: 10; cursor: pointer; }
.term.risen .bob { padding: 12px 14px 12px 26px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(222, 238, 252, .92)); color: #06213d; box-shadow: 0 14px 40px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .7) inset, 0 0 34px rgba(79, 209, 255, .18); animation-duration: 4.6s; }
.term.risen .txt { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.term.risen .badge { display: inline-flex; align-items: center; gap: 3px; font-family: var(--head); font-size: 20px; font-weight: 800; padding: 3px 14px; border-radius: 999px; background: linear-gradient(180deg, #ffc66b, var(--amber)); color: var(--amber-ink); font-variant-numeric: tabular-nums; }
.term.risen.top .bob { background: linear-gradient(180deg, #fffaf0, #ffe9c4); box-shadow: 0 14px 44px rgba(0, 0, 0, .4), 0 0 0 3px var(--amber) inset, 0 0 60px rgba(255, 181, 71, .45); }
.term.risen:hover .bob, .term.risen:focus-visible .bob { box-shadow: 0 14px 40px rgba(0, 0, 0, .4), 0 0 0 3px var(--cyan) inset, 0 0 40px rgba(79, 209, 255, .4); }
.term.risen:focus-visible { outline: none; }
.badge.bump { animation: bump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: scale(1.45); } }
.term.leaving { opacity: 0; }
.term .rank { display: none; }

/* 題目：舞台上方大字，投影 15 公尺外也看得清楚 */
.prompt-h { position: absolute; top: 72px; z-index: 6; margin: 0; text-align: center; font-family: var(--head); font-weight: 800; font-size: clamp(26px, 3.2vw, 56px); line-height: 1.2; letter-spacing: -.01em; color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, .55); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; pointer-events: none; }
.prompt-h[hidden] { display: none !important; }
.con-prompt { margin: 4px 0 0; font-size: 13px; color: var(--cyan); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.surface-cap { position: absolute; left: 50%; transform: translateX(-50%); top: 78px; z-index: 6; display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(2, 14, 34, .55); font-size: 13px; color: var(--ink-2); letter-spacing: .08em; white-space: nowrap; transition: opacity .6s; }
.surface-cap i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.empty-hint { position: absolute; left: 0; right: 0; text-align: center; z-index: 6; pointer-events: none; transition: opacity .6s; }
.empty-hint .big { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 2.4vw, 34px); color: var(--ink); }
.empty-hint .small { margin-top: 8px; color: var(--ink-3); font-size: clamp(14px, 1.2vw, 18px); }

/* QR 卡 */
.qr-card { position: absolute; right: 22px; top: 82px; z-index: 30; width: var(--qrw, 260px); padding: 18px; cursor: zoom-in; text-align: center; transition: opacity .4s, transform .4s; }
.qr-card.hidden { opacity: 0; transform: translateX(30px); pointer-events: none; }
.qr-card .qh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--amber); }
.qr-card .qh span { display: inline-flex; align-items: center; gap: 8px; }
.qr-card .qh i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.qr-card img { width: 100%; aspect-ratio: 1; display: block; background: #fff; border-radius: 14px; padding: 10px; }
.qr-card .cl { margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.qr-card .code { margin-top: 6px; display: flex; justify-content: space-around; padding: 8px 6px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .45); background: var(--amber-soft); font-family: var(--head); font-weight: 800; font-size: 28px; color: var(--amber); }
.qr-card .url { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-card .cap { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.qr-card .lock { margin-top: 12px; padding: 8px; border-radius: 10px; background: var(--amber-soft); color: #ffd99a; font-size: 13px; font-weight: 600; }

.help { position: absolute; left: 22px; bottom: 18px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: rgba(2, 14, 34, .6); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); transition: opacity .4s; white-space: nowrap; }
.help .s { opacity: .4; }

/* 大 QR */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(1, 8, 22, .9); backdrop-filter: blur(10px); cursor: zoom-out; }
.qr-big { display: flex; align-items: center; gap: 6vw; padding: 4vh 5vw; }
.qr-big img { height: min(70vh, 46vw); aspect-ratio: 1; background: #fff; border-radius: 26px; padding: 18px; box-shadow: 0 0 80px rgba(79, 209, 255, .25); }
.qr-big .side { display: grid; gap: 2.4vh; text-align: left; }
.qr-big .k { font-size: clamp(16px, 1.6vw, 24px); color: var(--ink-3); }
.qr-big .t { font-family: var(--head); font-weight: 800; font-size: clamp(30px, 3.6vw, 60px); line-height: 1.15; }
.qr-big .u { font-family: var(--mono); font-size: clamp(16px, 1.8vw, 28px); color: var(--cyan); }
.qr-big .code { font-family: var(--head); font-weight: 800; font-size: clamp(44px, 6vw, 100px); letter-spacing: .25em; color: var(--amber); text-shadow: 0 0 40px rgba(255, 181, 71, .35); }

/* 編輯抽屜 */
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100% - 24px)); z-index: 90; padding: 24px; display: flex; flex-direction: column; gap: 16px; transform: translateX(110%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); user-select: text; }
.drawer.open { transform: none; }
.drawer .field.grow { flex: 1; min-height: 0; grid-template-rows: auto 1fr; }
.drawer textarea.input { min-height: 0; height: 100%; resize: none; }
.drawer .row { display: flex; gap: 10px; justify-content: flex-end; }
.drawer h2 { font-size: 20px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 120; transform: translate(-50%, 30px); opacity: 0; display: flex; gap: 14px; align-items: center; padding: 10px 10px 10px 18px; transition: transform .3s, opacity .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.banner { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(1, 8, 22, .92); }

/* ---------- 舞台：呈現方式 ---------- */
.kbd.dark { background: rgba(0, 0, 0, .15); color: inherit; border-color: transparent; }
.reveal-btn { height: 40px; flex: none; animation: glowPulse 2.2s ease-in-out infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 181, 71, .18), 0 8px 30px rgba(245, 158, 11, .45); } }
.next-btn, .pend-btn { flex: none; }
.pend-btn { border-color: rgba(255, 181, 71, .5); color: #ffd99a; background: var(--amber-soft); }
.pend-btn b { font-variant-numeric: tabular-nums; }
.stage:not(.view-sea) .wl-label { opacity: 0; }
.wl-label { transition: opacity .5s; }
.stage:not(.view-sea):not(.view-cloud) #termLayer { pointer-events: none; }
.stage:not(.view-sea):not(.view-cloud) .term { opacity: 0; }

/* 文字雲：純文字，票越多越大 */
.term.cloud .bob { padding: 2px 8px; animation-duration: 7s; }
.term.cloud .txt { font-size: 26px; font-weight: 800; color: var(--cc, #8fb6d9); letter-spacing: -.01em; transition: color .6s, text-shadow .6s; }
.term.cloud:not(.hot) .bob { opacity: .35; }
.term.cloud.hot { cursor: pointer; z-index: 10; }
.term.cloud.hot .txt, .term.cloud.top .txt { text-shadow: none; }
.term.cloud.hot:hover .txt { color: #fff; }
.term.cloud .badge, .term.cloud .ck { display: none !important; }
.term.by-aud .txt::before { content: ""; display: inline-block; width: .32em; height: .32em; margin-right: .35em; border-radius: 50%; background: var(--cyan); vertical-align: .2em; box-shadow: 0 0 8px var(--cyan); }
.term.sea.by-aud .txt::before { opacity: .7; }

/* 長條圖 */
.bars { position: absolute; z-index: 8; display: none; }
.view-bars .bars { display: block; }
.bar-row {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--rh) - 10px);
  display: grid; grid-template-columns: calc(var(--rh) * .9) minmax(0, 26%) 1fr calc(var(--rh) * 1.6); align-items: center; gap: 14px;
  padding: 0 14px 0 6px; border: 0; border-radius: 14px; background: rgba(13, 32, 57, .45); color: var(--ink);
  font-family: var(--head); font-size: clamp(14px, calc(var(--rh) * .4), 30px); cursor: pointer; text-align: left;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .6s, background .3s, box-shadow .3s;
}
.bar-row.new, .bar-row.out { opacity: 0; }
.bar-row:hover { background: rgba(79, 209, 255, .1); box-shadow: inset 0 0 0 2px var(--cyan); }
.bar-row .rank { font-weight: 800; color: var(--ink-3); text-align: center; font-size: .85em; }
.bar-row .bname { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 62%; border-radius: 999px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.bar-row .fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #1b8fd1, var(--cyan)); box-shadow: 0 0 20px rgba(79, 209, 255, .35); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.bar-row .bval { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.bar-row.top { background: linear-gradient(90deg, rgba(255, 181, 71, .16), rgba(13, 32, 57, .45)); }
.bar-row.top .rank, .bar-row.top .bval { color: var(--amber); }
.bar-row.top .fill { background: linear-gradient(90deg, #f59e0b, #ffc56a); box-shadow: 0 0 26px rgba(255, 181, 71, .5); }
.bar-row.by-aud .bname::before { content: ""; display: inline-block; width: .35em; height: .35em; margin-right: .4em; border-radius: 50%; background: var(--cyan); vertical-align: .18em; }
.bar-more { position: absolute; left: 0; right: 0; top: 0; padding: 10px 20px; color: var(--ink-3); font-size: 15px; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }

/* 甜甜圈 */
.donut { position: absolute; z-index: 8; display: none; align-items: center; justify-content: center; gap: 5vw; }
.view-donut .donut { display: flex; }
.d-chart { position: relative; width: var(--ds); height: var(--ds); flex: none; }
.d-chart svg { width: 100%; height: 100%; overflow: visible; }
.d-track { fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: 30; }
.d-seg { fill: none; stroke-width: 30; cursor: pointer; transition: stroke-dasharray 1s cubic-bezier(.2, .8, .2, 1), stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1), stroke-width .2s; filter: drop-shadow(0 0 8px rgba(0, 0, 0, .3)); }
.d-seg:hover { stroke-width: 36; }
.d-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.d-center b { font-family: var(--head); font-weight: 800; font-size: calc(var(--ds) * .2); line-height: 1; font-variant-numeric: tabular-nums; }
.d-center span { color: var(--ink-3); font-size: calc(var(--ds) * .06); margin-top: 6px; }
.d-legend { display: grid; gap: 10px; min-width: 0; flex: 0 1 46%; font-size: clamp(16px, calc(var(--ds) / (var(--n) + 3) * .55), 30px); }
.lrow { display: grid; grid-template-columns: .8em minmax(0, 1fr) auto 3.2em; align-items: center; gap: 14px; padding: .35em .6em; border: 0; border-radius: 12px; background: none; color: var(--ink); font-family: var(--head); font-size: 1em; text-align: left; cursor: pointer; transition: background .2s; }
div.lrow { cursor: default; color: var(--ink-3); }
button.lrow:hover { background: rgba(79, 209, 255, .1); }
.lrow .ld { width: .8em; height: .8em; border-radius: 50%; }
.lrow .ln { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lv { font-variant-numeric: tabular-nums; }
.lrow .lp { color: var(--ink-3); font-size: .8em; text-align: right; font-variant-numeric: tabular-nums; }
.lrow.top .ln { color: var(--amber); }

/* 揭曉前的等待面板 */
.waiting { position: absolute; z-index: 25; transform: translate(-50%, -50%); padding: 34px 54px; text-align: center; min-width: min(560px, 80vw); }
.w-k { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: .14em; color: var(--cyan); font-weight: 700; }
.w-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); animation: pulse 1.6s infinite; }
.w-nums { display: flex; justify-content: center; gap: 70px; margin: 22px 0 18px; }
.w-nums div { display: grid; gap: 4px; }
.w-nums b { font-family: var(--head); font-weight: 800; font-size: clamp(56px, 7vw, 110px); line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff, #9fdcff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.w-nums span { color: var(--ink-3); font-size: 16px; }
.w-hint { color: var(--ink-3); font-size: 15px; }
.stage.flash::after { content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none; background: radial-gradient(60% 50% at 50% 45%, rgba(255, 210, 140, .35), transparent 70%); animation: flash 1.2s ease-out forwards; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* 設定抽屜與設定元件 */
.settings-drawer { gap: 0; padding: 0; }
.sd-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.sd-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 22px 22px; overscroll-behavior: contain; }
.set-group { border: 0; margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; min-width: 0; }
.set-group:last-child { border-bottom: 0; }
.set-group legend { padding: 0; margin-bottom: 10px; }
.set-hint { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgb(var(--well) / .55); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 8px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg label svg.i { width: 15px; height: 15px; }
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: var(--cyan); color: var(--on-accent); box-shadow: 0 4px 14px rgba(79, 209, 255, .3); }
.seg input:focus-visible + label { outline: 2px solid var(--cyan); outline-offset: 2px; }
.input.mini { height: 36px; width: auto; padding: 0 10px; font-size: 13px; }
.btn.mini { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn.ok:hover { color: var(--green); border-color: rgba(74, 222, 128, .45); background: rgba(74, 222, 128, .08); }
.pend-head { display: flex; justify-content: space-between; align-items: center; }
.pend-list { display: grid; gap: 8px; }
.pend-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: rgb(var(--well) / .45); border: 1px dashed var(--line-2); }
.pend-row .pt { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.pend-row .btn.icon { width: 36px; height: 36px; }
.cl-row { display: flex; gap: 14px; align-items: center; }
.cl-row img { width: 96px; height: 96px; border-radius: 10px; background: #fff; padding: 4px; flex: none; }
.cl-row .url { font-family: var(--mono); font-size: 12px; color: var(--cyan); margin-bottom: 8px; word-break: break-all; }

/* =====================================================
   聽眾手機頁：App shell，整頁不捲動，名詞自動縮放塞滿一屏
   ===================================================== */
html.aud-html, html.aud-html body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.aud { height: 100vh; height: 100dvh; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 16px 0; }
.aud-top { display: flex; justify-content: space-between; align-items: center; }
.aud-top .conn { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.aud-head { margin: 14px 0 12px; }
.aud-head .over { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cyan); letter-spacing: .04em; }
.aud-head h1 { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.2; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aud-head p { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.lock-banner { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .5); background: var(--amber-soft); color: #ffd99a; font-size: 13px; }
.cloud { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none; font-size: var(--fs, 17px); margin: 0 -16px; }
.cloud::-webkit-scrollbar { display: none; }
.pg { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: calc(var(--fs, 17px) * .55); padding: 2px 16px 12px; }
.pager { flex: none; display: flex; justify-content: center; align-items: center; gap: 8px; height: 26px; font-size: 12px; color: var(--ink-3); }
.pager button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .25); cursor: pointer; transition: width .25s, background .25s; }
.pager button.on { width: 22px; background: var(--cyan); }
.pager .sw { margin-left: 6px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: .45em; max-width: 100%;
  min-height: 2.6em; padding: .45em .55em .45em .95em; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  background: rgba(13, 32, 57, .7); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--head); font-weight: 700; font-size: 1em; line-height: 1.2; text-align: left;
  transition: background .2s, border-color .2s, transform .12s, box-shadow .2s, opacity .2s;
}
.chip:active { transform: scale(.96); }
.chip .name { overflow-wrap: anywhere; }
.chip .n { font-family: var(--sans); font-size: .68em; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip .st { width: 1.55em; height: 1.55em; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); color: var(--cyan); background: var(--cyan-soft); }
.chip .st svg { width: .9em; height: .9em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chip .st .ok { display: none; }
.chip[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 181, 71, .28), rgba(255, 181, 71, .14)); border-color: var(--amber); box-shadow: 0 0 22px rgba(255, 181, 71, .22); color: #fff3df; }
.chip[aria-pressed="true"] .n { color: #ffd99a; }
.chip[aria-pressed="true"] .st { background: var(--amber); border-color: transparent; color: var(--amber-ink); }
.chip[aria-pressed="true"] .st .ok { display: block; }
.chip[aria-pressed="true"] .st .plus { display: none; }
.chip.explained:not([aria-pressed="true"]) { opacity: .6; border-color: rgba(74, 222, 128, .3); }
.chip.explained:not([aria-pressed="true"]) .st { border-color: rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .1); color: var(--green); }
.chip.explained:not([aria-pressed="true"]) .st .ok { display: block; }
.chip.explained:not([aria-pressed="true"]) .st .plus { display: none; }
.chip[disabled] { opacity: .4; cursor: not-allowed; }
.chip.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 50% { transform: scale(1.08); } }
.aud-foot { flex: none; margin: 0 -16px; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); background: rgb(var(--well) / .85); border-top: 1px solid var(--line); backdrop-filter: blur(14px); display: flex; align-items: center; gap: 12px; }
.aud-foot .cnt { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 18px; color: var(--amber); border: 1px solid rgba(255, 181, 71, .45); background: var(--amber-soft); }
.aud-foot .tx { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.aud-foot .tx small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.aud-foot .legend { display: flex; gap: 10px; font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.aud-foot .legend span { display: inline-flex; align-items: center; gap: 4px; }
.aud-foot .legend i { width: 8px; height: 8px; border-radius: 50%; }
.empty-cloud { margin: auto; text-align: center; color: var(--ink-3); }
.hidden-banner { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--cyan-soft); color: #bfeeff; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.hidden-banner svg.i { width: 16px; height: 16px; }
.add-btn { flex: none; height: 40px; border-color: var(--line-2); color: var(--cyan); background: var(--cyan-soft); }
.chip.pend { cursor: default; border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--ink-2); padding-right: .95em; }
.chip.pend .n { color: var(--cyan); }
.sheet-bg { position: fixed; inset: 0; z-index: 140; background: rgba(1, 8, 22, .6); backdrop-filter: blur(3px); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; margin: 0 auto; max-width: 680px; padding: 20px 18px max(18px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; display: grid; gap: 12px; animation: sheetIn .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheetIn { from { transform: translateY(100%); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 20px; }
.sheet-sub { margin: 0; font-size: 13px; color: var(--ink-3); }
.snack { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); z-index: 160; transform: translate(-50%, -140%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; background: rgba(13, 32, 57, .96); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .3s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.snack.show { transform: translate(-50%, 0); }
.snack:not(.show) { visibility: hidden; transition: transform .3s, visibility 0s .3s; }
.snack.err { border-color: rgba(255, 138, 128, .5); color: #ffd1cc; }
.snack.ok { border-color: rgba(74, 222, 128, .45); color: #c8f7d8; }
@media (max-height: 700px) {
  .aud-head { margin: 10px 0 8px; }
  .aud-head p, .aud-head .over { display: none; }
  .aud-head h1 { font-size: 21px; -webkit-line-clamp: 1; }
  .aud-foot { padding-top: 9px; padding-bottom: max(9px, env(safe-area-inset-bottom)); }
}

/* 講者手機控制台 */
.con .aud-head h1 { font-size: 22px; -webkit-line-clamp: 1; }
.con-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.con-stats div { display: grid; padding: 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); text-align: center; }
.con-stats b { font-family: var(--head); font-size: 24px; font-variant-numeric: tabular-nums; }
.con-stats span { font-size: 12px; color: var(--ink-3); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgb(var(--well) / .55); border: 1px solid var(--line); margin-bottom: 12px; }
.tab { flex: 1; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--ink-3); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tab.on { background: var(--cyan); color: var(--on-accent); }
.tab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: var(--amber-ink); font-size: 12px; display: inline-grid; place-items: center; }
.tab-panel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.tab-panel[hidden] { display: none; }
.con-row { display: flex; gap: 8px; }
.con-row .btn:first-child { flex: 1; }
.con-row .btn.icon { width: 52px; }
.con-list { display: grid; gap: 8px; }
.con-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 22px; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); text-align: left; cursor: pointer; font-family: var(--head); font-size: 16px; }
.con-item:active { transform: scale(.98); }
.con-item .ci-r { color: var(--ink-3); font-weight: 800; }
.con-item .ci-n { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-item .ci-v { color: var(--amber); font-variant-numeric: tabular-nums; }
.con-item svg.i { color: var(--green); }
.con-item.top { border-color: rgba(255, 181, 71, .55); background: var(--amber-soft); }

/* ---------- 嵌入模式（PowerPoint 投影片內） ---------- */
html.embed .tools, html.embed .help, html.embed #bPending, html.embed #bNext, html.embed .w-hint { display: none !important; }
html.embed .reveal-btn .kbd { display: none; }


/* ---------- PowerPoint 增益集外框 ---------- */
html.addin, html.addin body { height: 100%; overflow: hidden; background: #000b1a; }
.ad-frame { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #000b1a; }
.ad-panel { position: absolute; inset: 0; overflow-y: auto; display: grid; place-items: center; padding: 20px; background: radial-gradient(120% 70% at 50% -10%, #0f3a66 0%, var(--bg-1) 45%, var(--bg-0) 100%); }
.ad-card { width: min(560px, 100%); padding: 24px; display: grid; gap: 14px; }
.ad-card h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.ad-card h1 img { width: 32px; height: 32px; }
.ad-rooms { display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
.ad-room { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgb(var(--well) / .4); color: var(--ink); text-align: left; cursor: pointer; }
.ad-room:hover, .ad-room.sel { border-color: var(--cyan); background: var(--cyan-soft); }
.ad-room .t { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ad-row .input { flex: 1; min-width: 140px; }
.ad-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.ad-check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.ad-bar { position: absolute; left: 10px; bottom: 10px; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 12px; background: rgba(2, 14, 34, .88); border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); backdrop-filter: blur(8px); }
.ad-bar .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.ad-bar b { color: var(--amber); font-family: var(--mono); letter-spacing: .08em; }

@media (prefers-reduced-motion: reduce) {
  .term .bob, .wave, .rays, .bubble, .ocean-bg span, .dot.live { animation: none !important; }
  .term { transition-duration: .4s; }
}


/* =====================================================
   Ripple P1：多活動、問題清單、簡報中
   ===================================================== */
/* 頂列的活動切換器 */
.act-box { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); flex: 0 1 auto; min-width: 0; max-width: 34vw; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.act-box:hover { border-color: var(--line-2); }
.act-step { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--ink-2); cursor: pointer; flex: none; padding: 0; }
.act-step:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: var(--ink); }
.act-step:disabled { opacity: .3; cursor: default; }
.act-step svg.i { width: 16px; height: 16px; }
.act-pos { font-family: var(--head); font-weight: 800; color: var(--cyan); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.act-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.act-name:empty { display: none; }
html.embed .act-box { display: none; }

/* 活動清單抽屜 */
.acts-drawer { left: 12px; right: auto; transform: translateX(calc(-100% - 24px)); }
.acts-drawer.open { transform: none; }
.act-list { display: grid; gap: 8px; }
.act-row { display: flex; align-items: stretch; gap: 6px; border-radius: 14px; border: 1px solid var(--line); background: rgb(var(--well) / .4); padding: 4px; }
.act-row.on { border-color: var(--cyan); background: var(--cyan-soft); }
.act-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; text-align: left; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.act-main:hover:not(:disabled) { background: rgba(255, 255, 255, .06); }
.act-main:disabled { cursor: default; }
.act-n { width: 22px; text-align: center; font-family: var(--head); font-weight: 800; color: var(--ink-3); flex: none; }
.act-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--glass-2); color: var(--cyan); flex: none; }
.act-t { display: grid; min-width: 0; }
.act-t b { font-family: var(--head); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-t small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-live { height: 22px; font-size: 11px; flex: none; }
.act-tools { display: grid; grid-template-columns: repeat(2, 30px); gap: 2px; align-content: center; }
.act-tools .btn.icon.mini { width: 30px; height: 26px; padding: 0; border-radius: 8px; }
.act-tools svg.i { width: 15px; height: 15px; }
.act-new { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.act-new-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.act-new-row .btn { padding: 0 8px; }

/* 問題清單 */
.qlist { position: absolute; z-index: 6; display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: min-content; align-content: start; gap: 12px 18px; overflow: hidden; font-size: var(--qfs, 22px); }
.qcard { position: relative; display: flex; align-items: center; gap: .7em; padding: .6em .9em .6em .6em; border-radius: 16px; border: 1px solid var(--line); background: rgba(13, 32, 57, .72); color: var(--ink); text-align: left; cursor: pointer; font-family: var(--head); font-size: 1em; line-height: 1.3; overflow: hidden; transition: background .4s, border-color .4s, opacity .5s; animation: qin .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes qin { from { opacity: 0; transform: translateY(14px); } }
.qcard:hover { border-color: var(--cyan); }
.qcard .qtx { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qcard .qup { flex: none; display: grid; justify-items: center; min-width: 2.6em; padding: .25em .3em; border-radius: 12px; background: var(--amber-soft); color: var(--amber); }
.qcard .qup svg.i { width: .8em; height: .8em; transform: rotate(-90deg); }
.qcard .qv { font-size: 1.05em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.qcard .qm { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--amber-2), var(--amber)); transition: width .8s; }
.qcard.top { border-color: rgba(255, 181, 71, .65); background: linear-gradient(90deg, rgba(255, 181, 71, .18), rgba(13, 32, 57, .72)); }
.qcard.by-aud .qtx::before { content: ""; display: inline-block; width: .32em; height: .32em; margin: 0 .4em .12em 0; border-radius: 50%; background: var(--cyan); vertical-align: middle; }
.qcard.answered { opacity: .45; background: rgba(13, 32, 57, .4); }
.qcard.answered .qup { background: rgba(74, 222, 128, .12); color: var(--green); }
.qcard.answered .qtx { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
.qmore { position: absolute; z-index: 6; text-align: center; font-size: 14px; color: var(--ink-3); }
.stage.view-list .wl-label { opacity: 0; }

/* 名詞海：長文字換行（最多 3 行），水下最多 2 行 */
.term .txt { white-space: normal; max-width: 15em; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; line-height: 1.2; }
.term.sea .txt { -webkit-line-clamp: 2; max-width: 13em; }

/* 簡報中 */
.listen { position: absolute; left: 0; right: 0; top: 34%; z-index: 7; text-align: center; padding: 0 340px 0 40px; pointer-events: none; }
.idle-k { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(2, 18, 40, .7); color: #bfeeff; font-weight: 700; letter-spacing: .12em; font-size: clamp(13px, 1vw, 16px); }
.idle-t { margin-top: 18px; font-family: var(--head); font-weight: 800; font-size: clamp(30px, 4vw, 68px); line-height: 1.15; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.idle-s { margin-top: 12px; color: var(--ink-3); font-size: clamp(15px, 1.3vw, 20px); }
.stage.is-idle #termLayer, .stage.is-idle .bars, .stage.is-idle .donut, .stage.is-idle .qlist, .stage.is-idle .qmore, .stage.is-idle .wl-label { opacity: 0; pointer-events: none; }
.stage.is-idle .stat.amber, .stage.is-idle #bView, .stage.is-idle #bUndo, .stage.is-idle #bLock, .stage.is-idle #bEdit, .stage.is-idle #bReset { display: none; }
.stage.scene-in #termLayer, .stage.scene-in .bars, .stage.scene-in .donut, .stage.scene-in .qlist, .stage.scene-in .prompt-h, .stage.scene-in .listen { animation: sceneIn .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes sceneIn { from { opacity: 0; transform: translateY(24px); } }

/* 聽眾手機：長文字（問答）改成一列一則 */
.cloud.long .pg { flex-direction: column; flex-wrap: nowrap; gap: calc(var(--fs, 17px) * .45); }
.cloud.long .chip { width: 100%; border-radius: 16px; justify-content: space-between; min-height: 2.8em; }
.cloud.long .chip .name { flex: 1; min-width: 0; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cloud.long .chip .st { width: auto; height: 1.8em; padding: 0 .55em; border-radius: 999px; gap: .2em; display: inline-flex; align-items: center; font-family: var(--sans); font-size: .78em; font-weight: 800; }
.cloud.long .chip .st::after { content: "+1"; }
.cloud.long .chip[aria-pressed="true"] .st::after { content: "已 +1"; }
.cloud.long .chip .st svg { display: none !important; }
.aud-idle { flex: 1; display: grid; place-content: center; text-align: center; gap: 12px; padding-bottom: 12vh; }
.aud-idle .ring { width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; position: relative; }
.aud-idle .ring::before, .aud-idle .ring::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; animation: ripple 2.8s ease-out infinite; }
.aud-idle .ring::after { animation-delay: 1.4s; }
@keyframes ripple { from { transform: scale(.6); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
.aud-idle .ring i { width: 18px; height: 18px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 18px var(--amber); }
.aud-idle h2 { font-size: 22px; }
.aud-idle p { margin: 0; color: var(--ink-3); font-size: 14px; }
.aud.switching .cloud, .aud.switching .aud-head { animation: sceneIn .45s cubic-bezier(.2, .8, .2, 1); }
.act-dots { display: inline-flex; gap: 4px; align-items: center; }
.act-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.act-dots i.on { width: 16px; border-radius: 999px; background: var(--cyan); }

/* 手機控制台：活動切換 */
.con-act { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--cyan-soft); margin-bottom: 12px; }
.con-act .btn.icon { width: 44px; height: 44px; flex: none; }
.con-act .ca-t { flex: 1; min-width: 0; display: grid; text-align: center; }
.con-act .ca-t small { font-size: 12px; color: var(--cyan); font-weight: 700; }
.con-act .ca-t b { font-family: var(--head); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.con-acts .act-row { padding: 2px; }
.con-acts .act-tools { display: none; }

.gone { display: none !important; }
.sheet textarea.input { resize: none; min-height: 64px; line-height: 1.4; padding-top: 10px; }

/* 建立場次：第一個活動的範本 */
.tpl-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.tpl-pick legend { padding: 0; margin-bottom: 8px; }
.tpl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl span { display: grid; gap: 2px; justify-items: start; height: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgb(var(--well) / .4); cursor: pointer; transition: border-color .2s, background .2s; }
.tpl span svg.i { color: var(--cyan); margin-bottom: 2px; }
.tpl b { font-family: var(--head); font-size: 15px; }
.tpl small { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.tpl input:checked + span { border-color: var(--cyan); background: var(--cyan-soft); }
.tpl input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.acts-drawer > .set-hint, .acts-drawer > .act-new { padding-left: 22px; padding-right: 22px; }
.acts-drawer > .act-new { padding-bottom: 20px; }
.acts-drawer > .set-hint { margin: 12px 0 4px; }
.topbar .title { flex: 0 0 auto; max-width: 26vw; }

/* =====================================================
   Ripple P2：嵌入選項（保留區、配色、省電）
   ===================================================== */
html.embed .stage { inset: var(--rt, 0) var(--rr, 0) var(--rb, 0) var(--rl, 0); }
html.embed, html.embed body { background: #010714; }
html.no-bar .topbar { display: none; }
html.no-bar .prompt-h { top: 12px; }
html.no-bar .qr-card { top: 16px; }
html.embed .stage .listen { padding-right: 300px; }
/* 省電：去掉氣泡、光束、波浪、浮動、毛玻璃 */
html.lite .water .rays, html.lite #bubbles, html.lite .water .wave { animation: none !important; }
html.lite #bubbles { display: none; }
html.lite .term .bob { animation: none !important; }
html.lite .glass, html.lite .tools { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lite .glass { background: rgba(10, 26, 48, .94); }
html.lite .term.sea .bob { filter: none; }
html.lite .aud-idle .ring::before, html.lite .aud-idle .ring::after { animation: none; }

/* 平面配色：淺色 / 自訂（不用深海背景） */
html.th-flat { --th-bg: #ffffff; --th-ac: #0b6bcb; }
html.th-flat, html.th-flat body { background: var(--th-bg); }
html.th-flat .sea-bg { background: var(--th-bg); }
html.th-flat .stars, html.th-flat .water .rays, html.th-flat #bubbles, html.th-flat .water .shine { display: none; }
html.th-flat .water { background: linear-gradient(180deg, color-mix(in srgb, var(--th-ac) 22%, var(--th-bg)), color-mix(in srgb, var(--th-ac) 8%, var(--th-bg))); }
html.th-flat .water .wave path { fill: color-mix(in srgb, var(--th-ac) 22%, var(--th-bg)); opacity: 1; }
html.th-flat .water .wave.w2 { display: none; }
html.th-flat .topbar { background: none; }
html.th-flat .wl-label { background: var(--th-bg); color: var(--th-ac); border-color: color-mix(in srgb, var(--th-ac) 40%, transparent); }
html.th-flat .qr-card { background: color-mix(in srgb, var(--th-bg) 92%, #000); }
/* 淺色背景上的文字（淺色主題、或自訂的淺背景） */
html.th-light, html.th-onlight { --ink: #0b1e3a; --ink-2: #2b4060; --ink-3: #4f6585; --ink-4: #7a8ba3; --line: rgba(11, 30, 58, .14); --glass: rgba(255, 255, 255, .85); --glass-2: rgba(11, 30, 58, .05); color-scheme: light; }
html.th-light .stage, html.th-onlight .stage { color: var(--ink); }
html.th-light .prompt-h, html.th-onlight .prompt-h, html.th-light .idle-t, html.th-onlight .idle-t { color: #0b1e3a; text-shadow: none; }
html.th-light .term.sea .txt, html.th-onlight .term.sea .txt { color: color-mix(in srgb, var(--th-ac) 75%, #0b1e3a); text-shadow: none; }
html.th-light .term.risen .bob, html.th-onlight .term.risen .bob { background: #fff; box-shadow: 0 6px 22px rgba(11, 30, 58, .16), 0 0 0 1px rgba(11, 30, 58, .1) inset; }
html.th-light .term.cloud .txt, html.th-onlight .term.cloud .txt { color: var(--cc, #4f6585); }
html.th-light .qcard, html.th-onlight .qcard, html.th-light .bar-row, html.th-onlight .bar-row { background: #fff; border-color: rgba(11, 30, 58, .12); color: var(--ink); box-shadow: 0 4px 14px rgba(11, 30, 58, .06); }
html.th-light .qr-card, html.th-onlight .qr-card { background: #fff; box-shadow: 0 8px 30px rgba(11, 30, 58, .12); }
html.th-light .glass, html.th-onlight .glass { background: rgba(255, 255, 255, .95); }
html.th-light .live-pill, html.th-onlight .live-pill { color: #0f7a3d; }
html.th-light .idle-k, html.th-onlight .idle-k { background: #fff; color: var(--th-ac); }
html.th-light .d-track, html.th-onlight .d-track { stroke: rgba(11, 30, 58, .08); }
html.th-light .stage .stat, html.th-onlight .stage .stat { background: rgba(11, 30, 58, .05); }

/* 增益集 v2 外框 */
.ad-sleep { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(80% 60% at 50% 0%, #0b2a4d 0%, #020d20 55%, #010714 100%); color: rgba(232, 244, 255, .55); text-align: center; }
.ad-sleep > div { display: grid; justify-items: center; gap: 6px; }
.ad-sleep img { width: 9vmin; height: 9vmin; opacity: .7; }
.ad-sleep b { font-family: var(--head); font-size: 4.2vmin; color: rgba(232, 244, 255, .8); }
.ad-sleep span { font-size: 2.6vmin; }
.ad-sleep.light { color: rgba(11, 30, 58, .5); }
.ad-sleep.light b { color: rgba(11, 30, 58, .7); }
.ad-reserve { position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    repeating-linear-gradient(135deg, rgba(255, 181, 71, .16) 0 10px, transparent 10px 20px) top / 100% var(--t) no-repeat,
    repeating-linear-gradient(135deg, rgba(255, 181, 71, .16) 0 10px, transparent 10px 20px) bottom / 100% var(--b) no-repeat,
    repeating-linear-gradient(135deg, rgba(255, 181, 71, .16) 0 10px, transparent 10px 20px) left / var(--l) 100% no-repeat,
    repeating-linear-gradient(135deg, rgba(255, 181, 71, .16) 0 10px, transparent 10px 20px) right / var(--r) 100% no-repeat; }
.ad-reserve::after { content: "保留給投影片內容（放映時不顯示斜線）"; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px; background: rgba(2, 14, 34, .85); color: #ffd99a; font-size: 12px; white-space: nowrap; }
.ad-bar { flex-wrap: nowrap; max-width: calc(100% - 20px); }
.ad-bar-act { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 34vw; }
.ad-opts { position: absolute; right: 10px; top: 10px; bottom: 10px; z-index: 20; width: min(400px, calc(100% - 20px)); display: flex; flex-direction: column; padding: 0; }
.ad-opts .sd-body { font-size: 14px; }
.ad-opts .set-group { gap: 8px; }
.ad-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ad-pads label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.ad-pads select { width: 100%; }
.ad-opts .seg label { font-size: 12.5px; padding: 0 4px; }
.ad-opts input[type=color] { width: 40px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: none; padding: 0; vertical-align: middle; }
.ad-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ad-choices .btn { height: auto; min-height: 84px; flex-direction: column; align-items: flex-start; text-align: left; padding: 12px 14px; white-space: normal; }
.ad-choices .btn small { font-weight: 400; font-size: 12.5px; opacity: .8; }
.ad-theme { position: absolute; width: 0; height: 0; overflow: hidden; }
.ad-room small.hint { white-space: nowrap; }
.act-new-row .btn.on { border-color: var(--cyan); background: var(--cyan-soft); color: var(--ink); }
html.th-light .surface-cap, html.th-onlight .surface-cap { background: rgba(11, 30, 58, .05); color: var(--ink-3); }
html.th-light .qr-card .code, html.th-onlight .qr-card .code { color: #b86e00; }
html.th-light .stage .wl-label, html.th-onlight .stage .wl-label { display: none; }
.donut { gap: clamp(20px, 4vw, 80px); }
.d-legend { flex: 1 1 0; max-width: 620px; }
.lrow .ln { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; overflow-wrap: anywhere; }
.ad-reserve::after { left: var(--lx, 50%); top: var(--ly, 6px); }
html.th-light .term.sea .bob, html.th-onlight .term.sea .bob { opacity: calc(var(--op, .6) + .3); }

/* =====================================================
   Ripple P3：互動（表情、彈幕、理解度）
   ===================================================== */
.fx-layer { position: absolute; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; }
.fx-emo { position: absolute; bottom: 4%; line-height: 1; animation: fxRise var(--dur, 3.6s) cubic-bezier(.25, .7, .3, 1) forwards; will-change: transform, opacity; }
@keyframes fxRise { 0% { transform: translate(0, 20px) scale(.4); opacity: 0; } 12% { transform: translate(0, 0) scale(1.1); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--drift, 0), var(--rise, -300px)) scale(.9); opacity: 0; } }
.fx-burst { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: grid; place-items: center; }
.fx-big { font-size: min(22vh, 220px); line-height: 1; animation: fxBurst 2.2s cubic-bezier(.2, 1.4, .4, 1) forwards; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .35)); }
.fx-ring { position: absolute; width: min(30vh, 300px); height: min(30vh, 300px); border-radius: 50%; border: 6px solid var(--amber); animation: fxRing 1.6s ease-out forwards; }
@keyframes fxBurst { 0% { transform: scale(.2); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes fxRing { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
.fx-dm { position: absolute; left: 0; white-space: nowrap; font-family: var(--head); font-weight: 800; color: #fff; padding: .12em .6em; border-radius: 999px; background: rgba(2, 14, 34, .55); border: 1px solid rgba(255, 255, 255, .18); text-shadow: 0 2px 6px rgba(0, 0, 0, .6); animation: fxDm 9s linear forwards; }
@keyframes fxDm { from { transform: translateX(var(--from, 100vw)); } to { transform: translateX(var(--to, -100%)); } }
html.th-light .fx-dm, html.th-onlight .fx-dm { color: #0b1e3a; background: rgba(255, 255, 255, .88); border-color: rgba(11, 30, 58, .15); text-shadow: none; box-shadow: 0 4px 14px rgba(11, 30, 58, .12); }
.meter-box { position: absolute; right: 22px; bottom: 18px; z-index: 36; }
.meter-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: rgba(2, 14, 34, .72); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.meter-bar .mb-l { font-weight: 700; }
.meter-bar .mb-track { display: flex; width: 180px; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.meter-bar .mb-track i { flex: 1 1 0; transition: flex-grow .8s, opacity .8s; }
.meter-bar b { font-variant-numeric: tabular-nums; color: var(--ink); }
.meter-bar .mb-avg { font-weight: 700; color: var(--green); }
.meter-bar .mb-avg.warn { color: var(--amber); }
html.th-light .meter-bar, html.th-onlight .meter-bar { background: rgba(255, 255, 255, .92); }

/* 只放互動（增益集細條 / 角落） */
.ov-demo { position: absolute; inset: 8px; z-index: 34; display: grid; place-content: center; text-align: center; gap: 4px; border: 2px dashed var(--line-2); border-radius: 14px; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.ov-demo b { font-family: var(--head); font-size: 18px; color: var(--ink-2); }

/* 設定面板：互動 */
.ov-group { gap: 4px; }
.ov-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; }
.ov-row > span { display: grid; min-width: 0; }
.ov-row b { font-size: 14px; }
.ov-row small { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.ov-sub { padding: 0 0 8px 14px; margin-left: 4px; border-left: 2px solid var(--line); }
.ov-sub .ov-row { padding: 5px 0; }
.ov-sub .ov-row b { font-weight: 600; font-size: 13px; color: var(--ink-2); }
input.sw { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, .15); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
input.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
input.sw:checked { background: var(--cyan); }
input.sw:checked::after { transform: translateX(18px); }
.ov-emo-head { display: flex; justify-content: space-between; margin: 4px 0; }
.ov-emojis { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.ov-emo { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: rgb(var(--well) / .4); font-size: 18px; cursor: pointer; padding: 0; opacity: .45; filter: grayscale(.7); }
.ov-emo[aria-pressed="true"] { opacity: 1; filter: none; border-color: var(--cyan); background: var(--cyan-soft); }
.dm-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.dm-recent { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.dm-item { padding: 6px 10px; border-radius: 10px; background: rgb(var(--well) / .45); border: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }

/* 聽眾手機：互動列 */
.ov-bar { flex: none; margin: 0 -16px; padding: 6px 12px; border-top: 1px solid var(--line); background: rgb(var(--well) / .55); display: grid; gap: 6px; }
.ov-emos { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior: contain; padding: 2px; }
.ov-emos::-webkit-scrollbar { display: none; }
.ov-emos button { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(13, 32, 57, .7); font-size: 24px; line-height: 1; cursor: pointer; touch-action: manipulation; padding: 0; transition: transform .1s; }
.ov-emos button:active { transform: scale(.88); }
.ov-meter { display: flex; align-items: center; gap: 6px; }
.ov-meter .ml { font-size: 12px; color: var(--ink-3); white-space: nowrap; flex: none; width: 3.3em; }
.ov-meter .ml.r { text-align: right; }
.ov-meter .mbtns { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ov-meter .mbtns button { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(13, 32, 57, .7); font-size: 18px; cursor: pointer; padding: 0; opacity: .6; filter: grayscale(.6); }
.ov-meter .mbtns button[aria-pressed="true"] { opacity: 1; filter: none; border-color: var(--amber); background: var(--amber-soft); transform: scale(1.06); }
.ph-emo { position: fixed; z-index: 170; pointer-events: none; font-size: 30px; animation: phEmo 1s ease-out forwards; }
@keyframes phEmo { from { transform: translateY(0) scale(.8); opacity: 1; } to { transform: translateY(-120px) scale(1.3); opacity: 0; } }
.dm-btn { flex: none; height: 40px; width: 44px; padding: 0; border-color: var(--line-2); color: var(--cyan); background: var(--cyan-soft); }
.aud-foot.ov-only-foot .cnt, .aud-foot.ov-only-foot .tx { display: none; }
.aud-foot.ov-only-foot { justify-content: flex-end; }
@media (max-height: 700px) { .ov-emos button { width: 40px; height: 40px; font-size: 21px; } .ov-meter .mbtns button { height: 30px; } }
.con .meter-bar { border-radius: 14px; justify-content: space-between; flex-wrap: wrap; }
.con .meter-bar .mb-track { flex: 1; width: auto; min-width: 120px; }
.con-emo { display: flex; flex-wrap: wrap; gap: 6px; }
.con-emo .ce { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 18px; }
.con-emo .ce b { font-size: 13px; color: var(--amber); }
.con .tab { font-size: 14px; padding: 0 4px; }
.ov-emojis { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.con .ov-emojis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.con .ov-group, .con .ov-sub { min-width: 0; }
@media (max-height: 200px) { .ad-bar { bottom: 50%; transform: translateY(50%); padding: 3px 4px 3px 10px; } .ad-bar-act { display: none; } }

/* =====================================================
   Ripple P4：搶答
   ===================================================== */
.stage.is-quiz #termLayer, .stage.is-quiz .bars, .stage.is-quiz .donut, .stage.is-quiz .qlist, .stage.is-quiz .qmore, .stage.is-quiz .wl-label { display: none !important; }
.stage.is-quiz #bView, .stage.is-quiz #bUndo, .stage.is-quiz #bLock { display: none; }
.quiz { position: absolute; z-index: 8; display: flex; flex-direction: column; gap: calc(var(--qzfs) * .6); font-size: var(--qzfs, 26px); }
.qz-head { display: flex; align-items: center; gap: 1em; flex: none; }
.qz-timer { display: flex; align-items: center; gap: .6em; flex: 1; min-width: 0; }
.qz-timer b { min-width: 2.2em; height: 2.2em; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--amber-ink); font-family: var(--head); font-size: 1.1em; font-variant-numeric: tabular-nums; box-shadow: 0 0 30px rgba(255, 181, 71, .35); }
.qz-timer.low b { background: #ff5b5b; color: #fff; animation: qzPulse .5s ease-in-out infinite alternate; }
@keyframes qzPulse { to { transform: scale(1.12); } }
.qz-bar { flex: 1; height: .42em; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.qz-bar i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--amber-2), var(--amber)); transition: width .25s linear; }
.qz-timer.low .qz-bar i { background: #ff5b5b; }
.qz-status { flex: none; font-size: .62em; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.qz-opts { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: .5em; }
.qz-opts[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qz-opts[data-n="5"], .qz-opts[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qz-opt { position: relative; display: flex; align-items: center; gap: .6em; padding: .4em .8em; border-radius: 18px; background: var(--qc); color: #fff; font-family: var(--head); font-weight: 800; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .25), inset 0 -4px 0 rgba(0, 0, 0, .18); transition: opacity .5s, transform .5s, filter .5s; min-height: 0; }
.qz-l { flex: none; width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .18); font-size: .9em; }
.qz-opt { container-type: inline-size; }
.qz-t { flex: 1; min-width: 0; overflow-wrap: break-word; font-size: min(1em, 9cqi); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; text-shadow: 0 2px 6px rgba(0, 0, 0, .25); position: relative; z-index: 1; }
.qz-c { flex: none; font-size: 1.15em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.qz-fill { position: absolute; left: 0; bottom: 0; height: .32em; background: rgba(255, 255, 255, .6); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.qz-opt.wrong { opacity: .32; filter: saturate(.4); transform: scale(.97); }
.qz-opt.right { box-shadow: 0 0 0 5px #fff, 0 0 50px rgba(74, 222, 128, .55); }
.qz-opt.right .qz-l::after { content: "✓"; position: absolute; }
.qz-opt.right .qz-l { color: transparent; position: relative; }
.qz-opt.right .qz-l::after { color: #fff; }
.qz-board { flex: 1; min-height: 0; display: grid; align-content: start; gap: .32em; max-width: 1000px; width: 100%; margin: 0 auto; overflow: hidden; }
.qz-row { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: center; gap: .6em; padding: .32em .8em; border-radius: 14px; background: rgba(13, 32, 57, .78); border: 1px solid var(--line); font-family: var(--head); font-size: .82em; animation: qzRow .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.qz-row.top { background: linear-gradient(90deg, rgba(255, 181, 71, .2), rgba(13, 32, 57, .78)); border-color: rgba(255, 181, 71, .5); }
.qz-rk { text-align: center; font-weight: 800; color: var(--ink-3); }
.qz-nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-sc { color: var(--amber); font-variant-numeric: tabular-nums; }
.qz-empty { text-align: center; color: var(--ink-3); }
@keyframes qzRow { from { opacity: 0; transform: translateY(20px); } }
.qz-edit-row { display: flex; gap: 12px; flex-wrap: wrap; }
.qz-edit-row label { display: flex; align-items: center; gap: 6px; }
.act-new-row { grid-template-columns: repeat(4, 1fr); }
html.th-light .qz-row, html.th-onlight .qz-row { background: #fff; border-color: rgba(11, 30, 58, .12); }
/* 聽眾手機：搶答 */
.aud-quiz { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.aq-timer { display: flex; align-items: center; gap: 10px; flex: none; }
.aq-timer b { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--amber-ink); font-family: var(--head); font-size: 18px; font-variant-numeric: tabular-nums; }
.aq-timer.low b { background: #ff5b5b; color: #fff; }
.aq-timer .qz-bar { height: 8px; }
.aq-timer.low .qz-bar i { background: #ff5b5b; }
.aq-opts { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; }
.aq-opts[data-n="3"], .aq-opts[data-n="5"] { grid-template-columns: 1fr; }
.aq-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 0; border-radius: 18px; background: var(--qc); color: #fff; font-family: var(--head); font-weight: 800; font-size: 17px; line-height: 1.25; cursor: pointer; touch-action: manipulation; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2); min-height: 0; overflow: hidden; }
.aq-opts[data-n="3"] .aq-opt, .aq-opts[data-n="5"] .aq-opt { flex-direction: row; justify-content: flex-start; }
.aq-opt:active { transform: scale(.97); }
.aq-opt:disabled { opacity: .45; }
.aq-opt .qz-l { width: 38px; height: 38px; font-size: 20px; flex: none; }
.aq-t { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: center; }
.aq-opts[data-n="3"] .aq-t, .aq-opts[data-n="5"] .aq-t { text-align: left; }
.aq-card { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 16px; }
.aq-card p { margin: 0; color: var(--ink-3); font-size: 14px; }
.aq-big { font-family: var(--head); font-weight: 800; font-size: 30px; }
.aq-big.ok { color: var(--green); }
.aq-big.no { color: var(--danger); }
.aq-pts { font-family: var(--head); font-weight: 800; font-size: 44px; color: var(--amber); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.aq-pick { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: var(--qc); color: #fff; font-family: var(--head); font-weight: 800; font-size: 17px; max-width: 100%; overflow-wrap: anywhere; }
.aq-score { display: flex; gap: 16px; margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.aq-score b { font-family: var(--head); font-size: 22px; color: var(--ink); }
.aq-nick { flex: none; align-self: center; }
.aq-nick.warn { border-color: var(--amber); color: #ffd99a; }
.tpl-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stage.qz-closed .qz-timer { visibility: hidden; }
.stage.qz-closed .qz-head { justify-content: center; }
.stage.qz-closed .qz-timer { flex: 0 0 0; }
.con-quiz { display: grid; gap: 10px; }
.con-quiz > .btn.lg { width: 100%; }
.con-quiz .con-row { align-items: center; }
.con-quiz .cq-nick { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
html.embed .quiz-btn .kbd { display: none; }

/* Fluent Emoji 圖片 */
img.emo { width: 1em; height: 1em; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.ov-emos button, .ov-meter .mbtns button, .ov-emo { display: grid; place-items: center; }
.ov-emos button img.emo { width: 30px; height: 30px; }
.ov-meter .mbtns button img.emo { width: 24px; height: 24px; }
.ov-emo img.emo { width: 72%; height: 72%; }
.fx-emo img.emo, .ph-emo img.emo { width: 1em; height: 1em; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .3)); }
.fx-big img.emo { width: 1em; height: 1em; }
.con-emo .ce img.emo { width: 22px; height: 22px; }
@media (max-height: 700px) { .ov-emos button img.emo { width: 27px; height: 27px; } .ov-meter .mbtns button img.emo { width: 21px; height: 21px; } }

/* =====================================================
   純互動、每個活動的互動選項、細條、清除彈幕
   ===================================================== */
/* 新增活動選擇器 */
.act-new { display: grid; gap: 8px; }
.pk-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pk-type { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 64px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgb(var(--well) / .4); color: var(--ink-2); cursor: pointer; font: inherit; text-align: center; }
.pk-type svg.i { width: 20px; height: 20px; color: var(--cyan); }
.pk-type b { font-family: var(--head); font-size: 14px; color: var(--ink); }
.pk-type small { display: none; font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.pk-type:hover { border-color: var(--line-2); }
.pk-type[aria-checked="true"] { border-color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }
.pk-type.pk-rc svg.i { color: var(--amber); }
.fx-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fx-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgb(var(--well) / .4); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.fx-chip svg.i { width: 16px; height: 16px; }
.fx-chip[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-soft); color: #ffe2b0; }
.fx-chip[aria-pressed="true"]::after { content: "✓"; font-size: 12px; }
.pk-warn { min-height: 1.4em; }
.act-new > .btn.primary { justify-self: stretch; }
.fx-field { gap: 8px; }
html.th-light .fx-chip[aria-pressed="true"], html.th-onlight .fx-chip[aria-pressed="true"] { color: #8a5300; }

/* 舞台：純互動 */
/* 純互動（網頁舞台）：提示小字放在水面上方一行，不佔中央 */
.stage .react { position: absolute; left: 0; right: 0; top: calc(var(--wl, 90%) - 56px); z-index: 7; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; pointer-events: none; text-align: center; }
.rc-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(2, 18, 40, .45); font-weight: 700; font-size: clamp(12px, 1vw, 15px); color: var(--ink-2); }
.rc-chip svg.i { width: 1em; height: 1em; color: var(--amber); }
.rc-hint { color: var(--ink-3); font-size: clamp(12px, 1vw, 15px); }
.stage.is-react #termLayer, .stage.is-react .bars, .stage.is-react .donut, .stage.is-react .qlist, .stage.is-react .qmore, .stage.is-react .quiz, .stage.is-react .wl-label { display: none !important; }
.stage.is-react #bView, .stage.is-react #bUndo, .stage.is-react #bLock, .stage.is-react #bReset, .stage.is-react .stat.amber { display: none; }
html.th-light .rc-chip, html.th-onlight .rc-chip { background: #fff; }

/* 細條（增益集拉得很矮）：只留互動效果與小 QR */
.stage.strip .topbar, .stage.strip .prompt-h, .stage.strip .surface-cap, .stage.strip .empty-hint, .stage.strip .waiting, .stage.strip .qr-card, .stage.strip .listen, .stage.strip .react,
.stage.strip #termLayer, .stage.strip .bars, .stage.strip .donut, .stage.strip .qlist, .stage.strip .qmore, .stage.strip .quiz, .stage.strip .water, .stage.strip .stars { display: none !important; }
.strip-qr { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 37; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 10px; background: rgba(2, 14, 34, .75); border: 1px solid var(--line); }
.strip-qr img { height: min(84px, 70vh); aspect-ratio: 1; background: #fff; border-radius: 6px; padding: 2px; }
.strip-qr span { display: grid; line-height: 1.15; }
.strip-qr b { font-family: var(--mono); font-size: 16px; color: var(--amber); letter-spacing: .1em; }
.strip-qr small { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.stage.strip .fx-layer { left: 130px; }
.stage.strip .meter-box { top: 50%; bottom: auto; right: 10px; transform: translateY(-50%); }
.stage.strip .meter-bar .mb-track { width: 110px; }
.stage.strip .ov-demo span { display: none; }
html.th-light .strip-qr, html.th-onlight .strip-qr { background: rgba(255, 255, 255, .92); }

/* 清除彈幕、理解度重新計算 */
.dm-clear { position: absolute; right: 22px; bottom: 64px; z-index: 38; background: rgba(2, 14, 34, .8); }
.stage.idle .dm-clear { opacity: .35; }
.meter-bar .mb-reset { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: pointer; }
.meter-bar .mb-reset:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }
.meter-bar .mb-reset svg.i { width: 14px; height: 14px; }
/* 聽眾手機：純互動 */
.aud-react { flex: none; display: grid; gap: 10px; padding: 6px 0 4px; }
.aud-react .rc-dm { width: 100%; height: 56px; font-size: 17px; border-color: var(--line-2); color: var(--cyan); background: var(--cyan-soft); }
.aud-react .set-hint { text-align: center; }
.aud.react-mode .ov-bar { flex: 1; min-height: 0; margin: 0; padding: 4px 0 max(14px, env(safe-area-inset-bottom)); border: 0; background: none; align-content: start; gap: 16px; }
.aud.react-mode .ov-emos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; overflow: visible; }
.aud.react-mode .ov-emos button { width: 100%; height: auto; aspect-ratio: 1; max-height: 72px; border-radius: 16px; }
.aud.react-mode .ov-emos button img.emo { width: 52%; height: 52%; }
.aud.react-mode .ov-meter { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(13, 32, 57, .5); border: 1px solid var(--line); }
.aud.react-mode .ov-meter .ml { display: none; }
.aud.react-mode .ov-meter::before { content: "你聽懂了嗎？（左：聽懂了　右：聽不懂）"; font-size: 13px; color: var(--ink-3); text-align: center; }
.aud.react-mode .ov-bar { order: 1; }
.aud.react-mode .aud-react { order: 2; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.aud.react-mode .ov-bar { flex: 1 1 auto; }
.aud.react-mode .ov-meter .mbtns button { height: 52px; }
.aud.react-mode .ov-meter .mbtns button img.emo { width: 30px; height: 30px; }
.aud.react-mode .aud-head { margin-bottom: 6px; }
@media (max-height: 700px) { .aud.react-mode .ov-emos { gap: 6px; } .aud.react-mode .ov-emos button { max-height: 54px; border-radius: 12px; } .aud.react-mode .ov-meter .mbtns button { height: 44px; } .aud-react .rc-dm { height: 48px; } }
/* 增益集安裝：Windows / Mac 切換 */
.os-tabs { width: max-content; margin: 4px 0 12px; }
.os-tabs button { min-height: 32px; padding: 0 16px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-3); background: transparent; border: 0; cursor: pointer; }
.os-tabs button[aria-selected="true"] { background: rgba(84, 214, 255, .16); color: var(--ink); }
.os-tabs button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
/* ---------- 登入：Google + 管理員密碼 ---------- */
.auth-go { display: grid; gap: 10px; margin-top: 26px; text-align: left; }
.auth-go .hint { font-size: 12.5px; color: var(--ink-3); margin: 0; line-height: 1.6; }
.btn.google { justify-content: center; gap: 12px; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 700; }
.btn.google:hover { background: #f1f3f4; }
.btn.google img { width: 20px; height: 20px; }
.btn.disabled { opacity: .45; pointer-events: none; }
.admin-pw { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left; }
.admin-pw summary { cursor: pointer; font-size: 13px; color: var(--ink-3); width: max-content; }
.admin-pw summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.admin-pw form { margin-top: 14px; }
.who { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
/* ---------- 首頁（產品介紹） ---------- */
.landing { overflow-y: auto; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.landing main { width: min(1160px, 100%); margin: 0 auto; padding: 0 28px; }
.ld-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; min-height: min(720px, calc(100vh - 70px)); padding: 40px 0 56px; }
.ld-copy h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.15; margin: 18px 0 18px; letter-spacing: -.01em; }
.ld-copy > p { font-size: 18px; color: var(--ink-2); line-height: 1.7; margin: 0; max-width: 34em; }
.ld-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.ld-note { margin-top: 14px !important; font-size: 13.5px !important; color: var(--ink-3) !important; }
.ld-visual { position: relative; height: 420px; }
.ld-screen { position: absolute; inset: 0 70px 40px 0; padding: 18px 22px; overflow: hidden; }
.ld-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: #4ade80; letter-spacing: .08em; }
.ld-bar b { color: var(--ink); font-size: 14px; letter-spacing: 0; margin-left: 6px; }
.ld-bar em { margin-left: auto; font-style: normal; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.ld-screen h3 { text-align: center; font-size: 22px; margin: 26px 0 0; }
.ld-sea { position: absolute; left: 0; right: 0; bottom: 0; height: 52%; background: linear-gradient(180deg, rgba(30, 120, 200, .35), rgba(4, 30, 70, .7)); border-top: 2px solid rgba(79, 209, 255, .5); }
.ld-sea span { position: absolute; left: var(--x); top: var(--y); font-family: var(--head); font-weight: 800; font-size: calc(20px * var(--s)); color: rgba(220, 240, 255, .85); animation: drift 7s ease-in-out infinite alternate; }
.ld-sea span:nth-child(2n) { animation-delay: -3s; }
.ld-emo { position: absolute; right: 135px; bottom: 14%; display: grid; gap: 6px; }
.ld-emo img { width: 34px; height: 34px; animation: ldFloat 3.2s ease-in-out infinite; }
.ld-emo img:nth-child(2) { animation-delay: -1s; margin-left: 18px; }
.ld-emo img:nth-child(3) { animation-delay: -2s; }
@keyframes ldFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ld-phone { position: absolute; right: 0; bottom: 0; width: 180px; padding: 16px 14px; border-radius: 26px; display: grid; gap: 8px; font-size: 13px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.ld-phone small { color: var(--ink-3); } .ld-phone small b { color: var(--amber); font-family: var(--mono); }
.ld-phone p { margin: 0; font-weight: 800; font-family: var(--head); }
.ld-phone span { padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; }
.ld-phone span.on { border-color: var(--amber); color: var(--amber); background: rgba(255, 181, 71, .1); }
.ld-sec { padding: 56px 0; }
.ld-sec > h2 { font-size: clamp(24px, 3vw, 34px); text-align: center; margin: 0 0 32px; }
.ld-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ld-card { padding: 24px; }
.ld-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(79, 209, 255, .25); }
.ld-ico svg { width: 22px; height: 22px; }
.ld-card h3 { font-size: 19px; margin: 16px 0 8px; }
.ld-card p, .ld-steps p, .ld-ppt p { margin: 0; color: var(--ink-2); line-height: 1.7; font-size: 15px; }
.ld-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ld-steps li { padding: 24px; }
.ld-steps b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(180deg, #ffc56a, var(--amber-2)); color: var(--amber-ink); font-family: var(--head); }
.ld-steps h3 { font-size: 19px; margin: 14px 0 8px; }
.ld-ppt { display: flex; align-items: center; gap: 32px; padding: 36px 40px; margin: 40px 0 72px; }
.ld-ppt h2 { margin: 0 0 10px; font-size: 26px; }
.ld-ppt > div { flex: 1; }
.ld-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; padding: 28px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.ld-foot a { color: var(--ink-2); }
@media (max-width: 900px) {
  .ld-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; gap: 36px; }
  .ld-visual { height: 340px; }
  .ld-grid, .ld-steps { grid-template-columns: 1fr; }
  .ld-ppt { flex-direction: column; align-items: flex-start; padding: 28px; }
}
@media (max-width: 560px) {
  .landing main { padding: 0 18px; }
  .landing .topnav { padding: 12px 16px; gap: 8px; }
  .landing .topnav .ghost { display: none; }
  .ld-copy > p { font-size: 16px; }
  .ld-visual { height: 300px; }
  .ld-screen { inset: 0 40px 30px 0; }
  .ld-phone { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .ld-sea span, .ld-emo img { animation: none; } }

/* ---------- 隱私權政策 / 服務條款 ---------- */
.doc { overflow-y: auto; }
.doc main { width: min(820px, 100%); margin: 0 auto; padding: 40px 24px 72px; }
.doc article { padding: 36px 40px; line-height: 1.85; color: var(--ink-2); font-size: 15.5px; }
.doc h1 { font-size: 30px; color: var(--ink); margin: 0 0 6px; }
.doc .meta { color: var(--ink-3); font-size: 13.5px; margin: 0 0 28px; }
.doc h2 { font-size: 19px; color: var(--ink); margin: 30px 0 8px; }
.doc ul { padding-left: 1.3em; margin: 8px 0; }
.doc a { color: var(--cyan); }
@media (max-width: 560px) { .doc article { padding: 24px 20px; } }

/* ---------- 增益集配對確認 / 管理統計 ---------- */
.pair-code { text-align: center; font-family: var(--mono); font-size: 44px; font-weight: 800; letter-spacing: .3em; color: var(--amber); margin: 18px 0 6px; padding-left: .3em; }
.adm { overflow-y: auto; }
.adm main { width: min(1160px, 100%); margin: 0 auto; padding: 32px 28px 64px; }
.adm h1 { font-size: 30px; margin: 0 0 22px; }
.adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.adm-kpi { padding: 20px 22px; }
.adm-kpi b { display: block; font-family: var(--head); font-size: 34px; color: var(--ink); }
.adm-kpi span { color: var(--ink-3); font-size: 13.5px; }
.adm-table { padding: 8px 0; overflow-x: auto; }
.adm-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table th { color: var(--ink-3); font-weight: 700; font-size: 12.5px; }
.adm-table td.num { font-family: var(--mono); }
.adm-table img { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }
@media (max-width: 800px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auth-legal { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); }
.auth-legal a { color: var(--ink-2); }

.doc .topnav a.brand { color: var(--ink); }
/* ---------- 活動編輯器（建立場次、舞台新增 / 編輯共用） ---------- */
.ae-sec { display: grid; gap: 12px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); min-width: 0; }
.ae-sec[hidden] { display: none; }
.ae-h { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; }
.ae-n { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--cyan-soft); color: var(--cyan); font-family: var(--head); font-size: 13px; border: 1px solid rgba(79, 209, 255, .3); }
.ae-n[hidden] { display: none; }
.ae-types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ae-type { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; text-align: left; border-radius: 14px; border: 1px solid var(--line); background: rgb(var(--well) / .35); color: var(--ink-2); cursor: pointer; font: inherit; min-width: 0; }
.ae-type svg.i { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--cyan); }
.ae-type.rc svg.i { color: var(--amber); }
.ae-type span { display: grid; gap: 3px; min-width: 0; }
.ae-type b { font-family: var(--head); font-size: 15px; color: var(--ink); }
.ae-type small { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.ae-type:hover { border-color: var(--line-2); }
.ae-type:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ae-type[aria-checked="true"] { border-color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }
.ae-qrows { display: grid; gap: 8px; }
.ae-qrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px 36px; gap: 8px; align-items: center; }
.ae-shape { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--qc); color: #fff; font-size: 14px; }
.ae-ok { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink-3); font-size: 18px; font-weight: 800; cursor: pointer; }
.ae-ok[aria-pressed="true"] { background: #30a46c; border-color: #30a46c; color: #fff; }
.ae-ok:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ae-qfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ae-qfoot .btn { margin-right: auto; }
.ae-more { margin-bottom: 18px; }
.ae-more[hidden] { display: none; }

/* ---------- 建立新場次頁 ---------- */
.nw { overflow-y: auto; }
.nw-main { width: min(1180px, 100%); margin: 0 auto; padding: 28px 28px 64px; }
.nw-head h1 { font-size: 32px; margin: 0 0 6px; }
.nw-head p { margin: 0 0 22px; color: var(--ink-3); }
.nw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.nw-form { padding: 26px 28px; min-width: 0; }
.nw-form > .ae-sec:last-of-type { border-bottom: 0; }
.nw-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.nw-actions .primary { flex: 1; min-width: 200px; }
.nw-pvbtn, .nw-pvclose { display: none; }
.nw-pv { position: sticky; top: 92px; }
@media (max-width: 1060px) {
  .nw-grid { grid-template-columns: minmax(0, 1fr); }
  .nw-pvbtn { display: inline-flex; }
  .nw-pv { display: none; }
  .nw-pv.show { display: grid; place-items: center; position: fixed; inset: 0; z-index: 50; background: rgba(0, 6, 18, .82); backdrop-filter: blur(6px); padding: 20px; }
  .nw-pv.show .nw-pvclose { display: inline-grid; position: absolute; top: 16px; right: 16px; }
}
@media (max-width: 560px) {
  .nw-main { padding: 18px 14px 48px; }
  .nw-form { padding: 20px 16px; }
  .nw-head h1 { font-size: 26px; }
  .ae-types { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* ---------- 手機畫面預覽 ---------- */
.pv-phone { position: relative; width: 300px; height: 600px; margin: 0 auto; padding: 12px; border-radius: 40px; background: #050b16; border: 2px solid rgba(255, 255, 255, .12); box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.pv-notch { position: absolute; top: 14px; left: 50%; width: 80px; height: 18px; transform: translateX(-50%); border-radius: 999px; background: #000; z-index: 2; }
.pv-screen { height: 100%; overflow: hidden; border-radius: 30px; padding: 40px 14px 14px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(120% 60% at 50% -10%, #0f3a66 0%, var(--bg-1) 50%, var(--bg-0) 100%); font-size: 12px; }
.pv-top { display: flex; justify-content: space-between; align-items: center; }
.pv-live, .pv-code { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 10.5px; color: var(--ink-2); font-weight: 700; }
.pv-live i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.pv-code b { color: var(--amber); font-family: var(--mono); }
.pv-over { display: flex; align-items: center; gap: 5px; color: var(--cyan); font-weight: 700; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pv-over svg { width: 13px; height: 13px; flex: none; }
.pv-title { margin: 0; font-size: 18px; line-height: 1.3; font-family: var(--head); color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pv-body { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; overflow: hidden; }
.pv-sub { margin: 0; color: var(--ink-3); font-size: 11px; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-chips span, .pv-opt, .pv-q { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-weight: 700; color: var(--ink-2); overflow-wrap: anywhere; }
.pv-chips span.on { border-color: var(--amber); color: var(--amber); background: rgba(255, 181, 71, .1); }
.pv-opt { padding: 10px 12px; }
.pv-q { display: flex; align-items: center; gap: 8px; }
.pv-q span { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pv-q b { color: var(--cyan); font-size: 11px; padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(79, 209, 255, .4); }
.pv-empty { margin: 10px 0; color: var(--ink-3); text-align: center; }
.pv-ask { margin-top: auto; align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(79, 209, 255, .4); color: var(--cyan); font-weight: 800; }
.pv-ask svg, .pv-dm svg, .pv-dmbig svg { width: 14px; height: 14px; }
.pv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pv-tiles span { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 8px; border-radius: 12px; background: var(--qc); color: #fff; font-weight: 800; overflow-wrap: break-word; min-width: 0; }
.pv-tiles i { font-style: normal; opacity: .8; }
.pv-bar { margin: auto -14px -14px; padding: 8px 10px 12px; border-top: 1px solid var(--line); background: rgba(0, 8, 22, .7); display: grid; gap: 6px; }
.pv-emorow { display: flex; gap: 5px; overflow: hidden; }
.pv-emorow span, .pv-emogrid span { display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.pv-emorow span { width: 36px; height: 36px; flex: none; }
.pv-emorow img, .pv-meter img { width: 20px; height: 20px; }
.pv-emogrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pv-emogrid span { aspect-ratio: 1; }
.pv-emogrid img { width: 28px; height: 28px; }
.pv-meter { display: flex; align-items: center; gap: 4px; }
.pv-meter small { color: var(--ink-3); font-size: 9.5px; white-space: nowrap; }
.pv-meter span { flex: 1; display: grid; place-items: center; height: 30px; border-radius: 8px; border: 1px solid var(--line); filter: grayscale(.8); opacity: .7; }
.pv-meter span.on { filter: none; opacity: 1; border-color: var(--amber); }
.pv-dm, .pv-dmbig { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid rgba(79, 209, 255, .4); color: var(--cyan); font-weight: 800; }
.pv-dmbig { margin-top: auto; padding: 14px; font-size: 14px; }
.pv-cap { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 12px 0 0; }
/* ---------- 我的場次（單欄）與小螢幕導覽列 ---------- */
.dash-head { align-items: center; }
.dash-col { display: grid; gap: 24px; max-width: 1000px; }
.dash-col .ppt-card { padding-bottom: 0; }
.ppt-card > summary { list-style: none; cursor: pointer; margin-bottom: 0; border-bottom: 0; }
.ppt-card > summary::-webkit-details-marker { display: none; }
.ppt-card > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 12px; }
.ppt-card[open] > summary { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.ppt-card:not([open]) { padding-bottom: 6px; }
.ppt-card[open] { padding-bottom: 28px; }
.ppt-chev { width: 20px; height: 20px; color: var(--ink-3); transition: transform .2s; }
.ppt-card[open] .ppt-chev { transform: rotate(180deg); }
.ppt-card code { overflow-wrap: anywhere; }
.room-list .empty { display: grid; justify-items: center; gap: 14px; }
.topnav { min-width: 0; }
.topnav .who { min-width: 0; }
@media (max-width: 640px) {
  .topnav { gap: 8px; padding: 10px 14px; }
  .topnav .brand { font-size: 18px; }
  .topnav .who span, .hide-sm { display: none; }
  #adminLink { padding: 0 10px; font-size: 0; gap: 0; }
  #adminLink svg { width: 18px; height: 18px; }
  .dash { padding: 22px 14px 48px; }
  .dash-head h1 { font-size: 30px; }
  .dash-head .btn { width: 100%; justify-content: center; }
  .room .actions { flex-wrap: wrap; }
  .room .actions > a:first-child { flex: 1; justify-content: center; }
}
/* 舞台：活動編輯抽屜、這一場的名稱 */
.ed-drawer { width: min(520px, calc(100% - 24px)); }
.ed-drawer .sd-body { padding-top: 18px; }
.ed-drawer .ae-sec:last-of-type { margin-bottom: 18px; }
.ed-foot { padding: 12px 22px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ed-foot .err:empty { display: none; }
.ed-drawer .ae-types { grid-template-columns: 1fr 1fr; }
.ed-drawer textarea.input { height: auto; min-height: 140px; resize: vertical; }
.sname-row { display: flex; gap: 8px; }
.sname-row .input { flex: 1; min-width: 0; }
.acts-drawer .act-new .btn.primary { width: 100%; justify-content: center; }
@media (max-width: 760px) { .ae-types, .ed-drawer .ae-types { grid-template-columns: 1fr; } .ae-type { flex-direction: row; gap: 12px; } }
.ed-drawer .ae-types { grid-template-columns: 1fr 1fr; } .ed-drawer .ae-type { flex-direction: row; gap: 10px; }
/* 純色背景（增益集「海面」關閉）：沒有水面、波浪、星點與氣泡 */
html.no-sea .water, html.no-sea .stars, html.no-sea #bubbles, html.no-sea .surface-cap { display: none !important; }
html.no-sea, html.no-sea body, html.no-sea .stage, html.no-sea .sea-bg { background: var(--th-bg, var(--bg-1)) !important; background-image: none !important; }
html.no-sea .ov-demo { inset: 6px; }
/* ---------- 增益集小工具模式：只顯示有開的互動效果，貼合整個框 ---------- */
html.widget .stage > :not(.fx-layer):not(.meter-box):not(.strip-qr):not(.ov-demo):not(.sea-bg) { display: none !important; }
html.embed body > .drawer, html.embed body > .toast { display: none !important; } /* 增益集裡沒有講者工具，抽屜在窄框會露出來 */
html.widget .stage .sea-bg { background: var(--th-bg, var(--bg-1)) !important; }
html.widget .fx-layer { inset: 0; }
html.widget .stage:has(.strip-qr:not([hidden])) .fx-layer { right: calc(var(--wqr, 0px) + 10px); }
html.widget .strip-qr { right: 4px; top: 50%; transform: translateY(-50%); padding: 3px; gap: 6px; background: rgba(2, 14, 34, .6); }
html.widget .strip-qr img { height: var(--wqr, 60px); max-height: calc(100% - 8px); }
html.widget .strip-qr span { display: none; }
html.widget .ov-demo { inset: 3px; border-radius: 8px; font-size: 12px; gap: 2px; }
html.widget .ov-demo b { font-size: 13px; }
@media (max-height: 90px) { html.widget .ov-demo span { display: none; } }
@media (max-width: 150px) { html.widget .ov-demo span { display: none; } }
/* 理解度：單獨 → 撐滿；和其他互動一起 → 貼右（橫）或貼底（直） */
html.widget .meter-box { font-size: var(--wfs, 13px); }
html.widget .meter-bar { font-size: 1em; gap: .6em; padding: .5em .9em; }
html.widget .meter-bar .mb-track { width: 10em; height: .7em; }
html.widget .meter-bar .mb-reset { display: none; }
html.widget .w-meter-only .meter-box { inset: 6px; right: 6px; bottom: 6px; display: grid; }
html.widget .w-meter-only .meter-bar { width: 100%; height: 100%; justify-content: center; border-radius: 1em; background: none; border: 0; padding: 0 .3em; }
html.widget .w-meter-only .meter-bar .mb-track { flex: 1; width: auto; min-width: 3em; }
html.widget .w-compact .meter-bar .mb-l, html.widget .w-compact .meter-bar .mb-avg { display: none; }
html.widget .w-meter-only.w-vert .meter-bar { flex-direction: column; padding: .3em 0; }
html.widget .w-meter-only.w-vert .meter-bar .mb-track { flex: 1 1 auto; flex-direction: column; width: .8em; height: auto; min-height: 3em; align-self: center; }
html.widget .w-meter-only.w-vert .meter-bar .mb-l, html.widget .w-meter-only.w-vert .meter-bar .mb-avg { display: none; }
html.widget .w-meter-only.w-vert .meter-bar b { white-space: nowrap; }
html.widget .w-meter-side .meter-box { right: 6px; bottom: 6px; top: auto; max-width: calc(100% - 12px); }
html.widget .w-meter-side .meter-bar { max-width: 100%; }
html.widget .w-meter-side .meter-bar .mb-track { flex: 1 1 4em; width: auto; min-width: 3em; }
html.widget .w-meter-side .meter-bar .mb-avg { white-space: nowrap; }
html.widget .w-meter-side.w-vert .meter-box { left: 6px; right: 6px; bottom: 6px; }
html.widget .w-meter-side.w-vert .meter-bar { justify-content: center; }
html.widget .w-meter-side.w-vert .meter-bar .mb-track { flex: 1; width: auto; }
html.widget .w-meter-side.w-vert .meter-bar .mb-l, html.widget .w-meter-side.w-vert .meter-bar .mb-avg { display: none; }
html.widget .w-meter-side .fx-layer { bottom: 0; }
html.widget .w-meter-side.w-vert .fx-layer { bottom: 3em; }
@media (max-height: 60px) { html.widget .meter-bar .mb-l, html.widget .meter-bar .mb-avg { display: none; } }
/* 增益集外框：框太小時工具列收成一顆齒輪 */
.ad-bar-mini { position: absolute; left: 6px; bottom: 6px; z-index: 10; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(2, 14, 34, .85); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; }
.ad-bar-mini svg { width: 15px; height: 15px; }
.ad-tip { position: absolute; left: 6px; bottom: 40px; z-index: 11; max-width: calc(100% - 12px); padding: 8px 10px; border-radius: 8px; background: rgba(2, 14, 34, .92); border: 1px solid var(--line); color: var(--ink); font-size: 12px; line-height: 1.4; }
@media (max-height: 120px) { .ad-sleep span { display: none; } .ad-sleep b { font-size: 12px; } .ad-sleep img { width: 20px; height: 20px; } }
@media (max-width: 220px) { .ad-sleep span, .ad-sleep b { display: none; } .ad-sleep img { width: 22px; height: 22px; } }
.ld-uses { text-align: center; color: var(--ink-2); font-size: 15px; line-height: 1.9; margin: 0 auto; max-width: 760px; }
