/* 遊戲界面：頂欄 + 桌面 + 側欄。夜晚桌面換成深色桌布。說書人的操作卡（card）在側欄頂上，沒有卡時那一行高度為 0。
   桌面下方：進度條（prog）和說書人的操作塢（dock），玩家沒有操作塢 */
.game { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top top" "board card" "board side" "prog side" "dock side"; }
.game.side-min { grid-template-columns: minmax(0, 1fr) 44px; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1.5px solid var(--ink); background: var(--card); }
.brand { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 4px; }
.room b { font-family: var(--serif); font-size: 18px; letter-spacing: 2px; }
/* 房間號點開邀請（大號房間號 + 二維碼） */
button.room { background: none; border: 0; padding: 0 2px; border-bottom: 1.5px dashed var(--line-strong); }
button.room:hover { border-bottom-color: var(--ink); }
.who { font-weight: 600; }
/* 鎖房：說書人的開關（鎖上時塗黑），玩家只看到一把鎖；觀戰人數、自己在觀戰 */
.topbar .lock.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.lock-tag, .watchers, .watch-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.lock-tag .ico, .watchers .ico, .watch-tag .ico { width: 17px; height: 17px; }
.watchers b { font: 700 14px var(--serif); }
.watch-tag { padding: 1px 8px; border: 1.5px solid var(--line-strong); border-radius: 999px; font-weight: 600; color: var(--ink); }

.board { grid-area: board; display: flex; min-height: 0; min-width: 0; }
/* .town 是尺寸容器：圓桌取剩下的寬高裏小的那個，操作塢變高時圓桌跟著縮，不會被蓋住 */
.town { flex: 1; display: grid; place-items: center; padding: 6px; min-height: 0; min-width: 0; container-type: size; }
.ring { position: relative; width: min(100cqw, 100cqh); aspect-ratio: 1; }
.ring::before { content: ""; position: absolute; inset: 8%; border: 1.5px dashed var(--line-strong); border-radius: 50%; }
body[data-phase="night"] .ring::before, body[data-phase="dawn"] .ring::before { border-color: #5b6275; }

.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 124px; cursor: pointer; }
/* 寬屏：頭像按相鄰座位的間距縮放（--n 人數，town.js），15 人局名牌和頭像不互相壓 */
@media (min-width: 861px) {
  .ring { --sp: calc(min(100cqw, 100cqh) * 2.5 / var(--n, 8)); --tk: clamp(44px, calc(var(--sp) * .6), 96px); }
  .seat { width: clamp(64px, calc(var(--sp) * .96), 124px); }
  .seat .token:not(.sm):not(.xs) { width: var(--tk); height: var(--tk); }
  .seat .token .token-name, .ring.crowded .token .token-name { font-size: clamp(9px, calc(var(--tk) * .145), 14px); }
  .plate { max-width: 100%; }
}
.seat-token { position: relative; }
/* 說書人看到的假身份：頭像右下角一枚虛線框的小副牌，下面寫名字；懸停看能力 */
.fake-badge { position: absolute; right: -28px; bottom: 4px; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 58%; cursor: help; }
.seat .fake-badge .token.xs { width: 100%; height: auto; aspect-ratio: 1; font-size: inherit; border-style: dashed; box-shadow: 0 0 0 2px var(--card), inset 0 0 0 1.5px var(--card), inset 0 0 0 2.5px var(--team); }
.fake-name { margin-top: -5px; padding: 0 4px; background: var(--card); border: 1.2px dashed var(--ink); border-radius: 3px;
  font: 700 11px/1.35 var(--serif); color: var(--ink); white-space: nowrap; }
.ring.crowded .token .token-name { font-size: 12px; }
.seat.mine .token { outline: 3px solid var(--brass); outline-offset: 3px; }
.seat.nominee .token { outline: 3px solid var(--evil); outline-offset: 3px; }
.seat.onblock .plate { border-color: var(--evil); color: var(--evil); }
.seat.dead .token { filter: grayscale(1); opacity: .55; }
.seat.selectable .token { outline: 2px dashed var(--brass); outline-offset: 4px; }
.seat.selected .token { outline: 4px solid var(--brass); outline-offset: 3px; background: #fff3cf; }
.seat.unselectable { opacity: .4; }
/* 死人：頭像上蓋一枚紅色印章（處決 / 射殺 / 死亡）；還有死亡票的頭頂放一張票 */
.dead-stamp { position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%) rotate(-12deg); pointer-events: none;
  padding: 1px 3px 2px 7px; color: var(--evil); font: 900 17px/1.1 var(--serif); letter-spacing: .2em; white-space: nowrap;
  border: 2px solid currentColor; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--card), inset 0 0 0 2.5px currentColor; mix-blend-mode: multiply; }
.ghost-vote { position: absolute; left: 50%; top: -15px; z-index: 2; width: 28px; height: 28px; transform: translateX(-50%) rotate(-10deg); color: var(--brass); pointer-events: none; }
.ghost-vote .ico { width: 100%; height: 100%; }
.hand { position: absolute; right: -14px; top: -6px; background: var(--brass); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 2px; }
.guess { opacity: .45; }
.plate { margin-top: 6px; display: flex; gap: 5px; align-items: center; max-width: 118px; background: var(--card); border: 1px solid var(--ink); border-radius: 3px; padding: 0 7px; font-size: 13px; }
.plate b { font-family: var(--serif); }
.plate .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate .off { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.fake { font-size: 11px; color: #d8cfb9; margin-top: 2px; }
.phase-day .fake, .phase-lobby .fake, .phase-ended .fake { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 3px; max-width: 130px; }
.tag { font-size: 11px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 2px; padding: 0 4px; }
.tag.bad { border-color: var(--evil); color: var(--evil); }

.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: 46%; pointer-events: none; }
.phase-title { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: 4px; }
.phase-sub { color: var(--muted); }
/* 夜裏桌布是深藍：字換成淺色（跟著背景的天色，入夜演出到天黑那一拍才換） */
.center, .phase-sub { transition: color 1.4s ease; }
body[data-phase="night"] .center, body[data-phase="dawn"] .center { color: #ece5d3; }
body[data-phase="night"] .phase-sub, body[data-phase="dawn"] .phase-sub { color: #a9a493; }

/* 側欄 */
.side { grid-area: side; display: flex; flex-direction: column; gap: 8px; padding: 10px; min-height: 0; border-left: 1.5px solid var(--ink); background: var(--paper); }
.mycard { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.mycard b { font-family: var(--serif); font-size: 16px; }
.mycard .team { font-size: 12px; margin-left: 6px; }
.ab { font-size: 12.5px; color: var(--muted); }
.picked { font-weight: 600; }
.opt { border-top: 1px dashed var(--line); padding: 8px 0; display: grid; gap: 6px; }
.opt-k { font-size: 12px; color: var(--muted); }
.upcoming { margin-top: 10px; font-size: 12px; color: var(--muted); }
.tabs { display: flex; border-bottom: 1.5px solid var(--ink); }
.side-panel { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.side-rail { display: none; flex-direction: column; align-items: center; gap: 4px; }
.tab-min, .rail-btn { background: none; border: 0; color: var(--muted); padding: 4px 8px; font-size: 15px; }
.tab-min:hover, .rail-btn:hover { color: var(--ink); }
.rail-tab { position: relative; background: none; border: 0; writing-mode: vertical-rl; letter-spacing: 3px; padding: 10px 4px; color: var(--muted); }
.rail-tab:hover { color: var(--ink); }
.count { font-style: normal; display: inline-block; min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px; margin-left: 4px; border-radius: 9px;
  background: var(--evil); color: #fff; font-size: 11px; font-weight: 700; text-align: center; letter-spacing: 0; vertical-align: 1px; }
.rail-tab .count { writing-mode: horizontal-tb; margin: 4px 0 0; }
/* 私聊氣泡：座位右上方，尾巴指向頭像 */
.chat-pop { position: absolute; left: 62%; bottom: 82%; z-index: 4; display: flex; align-items: center; gap: 4px; width: max-content; max-width: 200px;
  padding: 4px 9px; background: #fff; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 12px 12px 12px 3px;
  font-size: 15px; line-height: 1.35; box-shadow: 0 3px 8px #2a262233; cursor: pointer; pointer-events: auto; animation: pop-in .25s ease-out; }
.chat-pop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-pop b { flex: none; }
.chat-pop .count { margin-left: 0; flex: none; }
.chat-pop::before { content: ""; position: absolute; left: -1.5px; bottom: -7px; border: 4px solid transparent; border-left-color: var(--ink); border-top-color: var(--ink); }
.chat-pop:hover { transform: translateY(-1px); }
.center .chat-pop { position: relative; left: auto; bottom: auto; margin: 10px auto 0; max-width: 100%; border-radius: 12px; font-size: 17px; padding: 6px 14px; }
.center .chat-pop::before { display: none; }
@keyframes pop-in { from { transform: scale(.6) translateY(6px); opacity: 0; } }
@media (min-width: 861px) {
  .side-min .side { padding: 8px 0; }
  .side-min .side-panel { display: none; }
  .side-min .side-rail { display: flex; }
}

/* 底部操作塢：左階段狀態、中間提示、右邊主按鈕 */
.dock { grid-area: dock; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 18px; min-height: 84px; min-width: 0; background: var(--card); border-top: 1.5px solid var(--ink); }
/* 進度條（progress.js）：沒有底框，一串紙牌掛在桌面（天空）下方。
   --n 張牌等距排開（兩端各留 --pad），--stp 牌距，--pn 牌的大小隨牌距縮；所有牌的頂端掛在 --ty 這條線上，
   線段（.pg-seg）從一張牌的頂上連到下一張，按牌距下垂（--sag 越寬垂得越多）。
   線的顏色：--th0 沒走到的淡線，--th1 走過的金線（夜晚在深色天空上換亮一點的金） */
.prog { grid-area: prog; container-type: inline-size; min-width: 0; padding: 0 16px; position: relative; z-index: 2; }
.prog.day { --th0: #2a262273; --th1: var(--brass); --ring: var(--brass); --edge: #f4eedfd9; }
.prog.night { --th0: #efe5cc73; --th1: #d6b462; --ring: #e2c272; --edge: #141826c0; }
.pg { --pad: 20px; --stp: calc((100cqw - 2 * var(--pad)) / (var(--n) - 1)); --pn: clamp(13px, calc(var(--stp) - 8px), 30px);
  --ps: calc(var(--pn) * 1.16); --ty: 5px; --sag: clamp(4px, calc(var(--stp) * .3), 22px);
  position: relative; height: calc(var(--ty) + var(--pn) * 1.42 + 6px); }
.pg-seg { position: absolute; z-index: 0; top: calc(var(--ty) - 1px); left: calc(var(--pad) + var(--i) * var(--stp)); width: var(--stp); height: var(--sag);
  transition: left .5s ease, width .5s ease, height .5s ease; animation: pg-fade .4s ease calc(var(--i) * 45ms + .1s) backwards; }
@keyframes pg-fade { from { opacity: 0; } }
.pg-seg > i { position: absolute; inset: 0; }
.pg-seg svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pg-seg path { fill: none; stroke-linecap: round; }
.pg-seg path.u { stroke: var(--edge); }
.pg-t0 path.l { stroke: var(--th0); stroke-width: 1.25px; }
.pg-t0 path.u { stroke-width: 3.5px; }
.pg-t1 path.l { stroke: var(--th1); stroke-width: 2.25px; }
.pg-t1 path.u { stroke-width: 4.5px; }
/* 金線：這段走過了才從左往右描出來（描完正好接上新的當前牌的章） */
.pg-t1 { clip-path: inset(-6px 100% -6px -2px); transition: clip-path .5s cubic-bezier(.6, 0, .4, 1); }
.pg-seg.done .pg-t1 { clip-path: inset(-6px -2px -6px -2px); }
/* 牌：頂端掛在線上，以頂端為軸在風裏輕輕晃（每張相位錯開，像一串真的紙牌）；兩端的章是釘住的，不晃 */
.pg-it { position: absolute; z-index: 1; top: var(--ty); left: calc(var(--pad) + var(--i) * var(--stp)); width: var(--pn); height: var(--pn);
  margin-left: calc(var(--pn) / -2); display: grid; place-items: center; font-size: calc(var(--pn) / 1.6);
  border-radius: 50%; background: var(--card); box-shadow: 0 2px 3px #2a26222e;
  transform-origin: 50% 0; transition: scale .3s cubic-bezier(.2, .9, .3, 1.4) .42s, left .5s ease;
  /* 剛掛上去（入夜 / 天亮換一串、白天多了一次提名）：從上面一張張落下來掛好，再跟著晃 */
  animation: pg-hang .55s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i) * 45ms) backwards, pg-sway 5.6s ease-in-out calc(var(--i) * -.93s) infinite; }
@keyframes pg-hang { from { translate: 0 -16px; rotate: -16deg; opacity: 0; } }
@keyframes pg-sway { 0%, 100% { rotate: -2.6deg; } 50% { rotate: 2.6deg; } }
.pg-it > .token.xs, .pg-it > .sb { width: 100%; height: 100%; box-sizing: border-box; }
.pg-it > .sb { font-size: calc(var(--pn) * .5); }
.pg-it.sym > .ico { width: 64%; height: 64%; color: var(--brass); }
.pg-it.sym { box-shadow: 0 2px 3px #2a26222e, inset 0 0 0 1.5px var(--line-strong); }
/* 打結的地方：線在牌頂上打個小結，走過的是金色 */
.pg-knot { position: absolute; z-index: 2; left: 50%; top: -2px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--th0); box-shadow: 0 0 0 1px var(--edge); }
.pg-it.done > .pg-knot, .pg-it.now > .pg-knot { background: var(--th1); }
/* 走過的牌褪色（牌底保持不透明，線不從牌裏穿過去） */
.pg-it.done > :not(.pg-knot) { opacity: .45; filter: grayscale(.75); transition: opacity .6s, filter .6s; }
.pg-it.done.block > :not(.pg-knot) { opacity: 1; filter: none; }
/* 當前這張：金線描到它的時候被拽一下、放大一點，蓋上一圈雙線金章（從大到小砸下來），再散開一圈墨暈 */
.pg-it.now { z-index: 3; scale: 1.18;
  animation: pg-hang .55s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i) * 45ms) backwards, pg-sway 5.6s ease-in-out calc(var(--i) * -.93s) infinite,
    pg-tug .55s cubic-bezier(.3, 1.6, .5, 1) .4s; }
@keyframes pg-tug { 0% { translate: 0 0; } 35% { translate: 0 4px; } 100% { translate: 0 0; } }
.pg-it.now::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ring); outline: 1px solid var(--ring); outline-offset: 2px;
  pointer-events: none; animation: pg-stamp .3s cubic-bezier(.2, .9, .3, 1.25) .42s both; }
@keyframes pg-stamp { from { scale: 2.4; rotate: -12deg; opacity: 0; } 70% { opacity: 1; } to { scale: 1; rotate: 0deg; opacity: 1; } }
.pg-it.now::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--ring); pointer-events: none; opacity: 0;
  animation: ink-ring .7s ease-out .66s; }
/* 說書人：假裝叫醒的空格，虛線牌（不在場 / 死了今晚不醒） */
.pg-it.ghost { background: transparent; box-shadow: none; }
.pg-it.ghost > .token { border-style: dashed; box-shadow: none; background: #fbf8f0a6; }
.pg-it.ghost > .token .token-icon { opacity: .45; }
/* 牌下面的小名牌（和圓桌座位的名牌一樣：米白底、墨線框）：說書人的座位號、白天的票數；紅框是處決台 */
.pg-tag { position: absolute; z-index: 2; left: 50%; bottom: calc(var(--pn) * -.3); translate: -50% 0; display: inline-flex; align-items: center; gap: 1px;
  height: max(10px, calc(var(--pn) * .42)); padding: 0 max(2px, calc(var(--pn) * .1)); border: 1px solid var(--ink); border-radius: 2px; box-sizing: border-box;
  background: var(--card); color: var(--ink); font: 700 max(8px, calc(var(--pn) * .32)) / 1 var(--serif); white-space: nowrap; }
.pg-tag .ico { width: 1.1em; height: 1.1em; color: var(--brass); }
.pg-tag.red { border-color: var(--evil); color: var(--evil); }
.pg-tag.red .ico { color: var(--evil); }
/* 兩端的章：雙線圓章（印章是唯一的標誌元素），夜晚月亮、白天太陽 */
.pg-it.seal { width: var(--ps); height: var(--ps); margin-left: calc(var(--ps) / -2); animation: pg-hang .55s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i) * 45ms) backwards; }
.pg-it.seal.now { animation: pg-hang .55s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i) * 45ms) backwards, pg-tug .55s cubic-bezier(.3, 1.6, .5, 1) .4s; }
.pg-seal { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--ink); }
.pg-seal .ico { width: 54%; height: 54%; }
.pg-seal.moon { color: #4a5272; }
.pg-seal.sun { color: var(--brass); }
.pg-it.seal.done > :not(.pg-knot) { opacity: 1; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .pg-it, .pg-it.now, .pg-it.seal, .pg-it.seal.now, .pg-it.now::after, .pg-it.now::before, .pg-seg { animation: none; }
  .pg-t1, .pg-it, .pg-seg { transition: none; }
}
.dock-me { flex: none; display: grid; justify-items: start; gap: 0; background: none; border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 10px; text-align: left; line-height: 1.3; }
.dock-me b { font-family: var(--serif); font-size: 16px; }
.dock-me .team { font-size: 11.5px; }
.dock-me:hover { background: #efe7d4; }
.dock-status { flex: 0 1 auto; min-width: 0; max-width: 260px; }
.dock-big { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.3; }
.dock-big .good { color: var(--good); }
.dock-big .evil { color: var(--evil); }
/* 放不下時按鈕換到第二行，不擠扁中間、不出滾動條 */
.dock-mid { flex: 1 1 220px; min-width: 0; font-size: 13.5px; }
.dock-mid p { margin: 2px 0; }
.dock-mid .hint { margin: 4px 0; }
.dock-act { flex: 0 1 auto; margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.btn.big { padding: 10px 22px; font-size: 15px; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; }
.step-chip { font-size: 12px; padding: 1px 9px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--card); white-space: nowrap; }
.step-chip.done { opacity: .55; text-decoration: line-through; }
.step-chip.now { background: var(--brass); border-color: var(--brass); color: #fff; font-weight: 600; }
.center-block { margin-top: 6px; font-family: var(--serif); font-weight: 700; color: var(--evil); }
.tab { flex: 1; background: none; border: 0; padding: 7px 4px; color: var(--muted); position: relative; }
.tab.on { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px var(--ink); }
.tab .dot { position: absolute; top: 6px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--evil); }
.tab-body { flex: 1; overflow: auto; min-height: 120px; }
.tab-body.chat { display: flex; flex-direction: column; overflow: hidden; }
.msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; max-width: 90%; align-self: flex-start; }
.msg.mine { align-self: flex-end; border-color: var(--line-strong); background: #efe7d4; }
.msg.sys { align-self: stretch; max-width: none; background: none; border: 0; border-left: 3px solid var(--ink); border-radius: 0; font-family: var(--serif); }
.msg-k { font-size: 11.5px; color: var(--muted); }

/* 遊戲日誌（gamelog.js）：按輕重排版。分割線 = 階段；gl-2 重（死亡 / 處決，大字紅條）；gl-1 普通；gl-0 淡小字；橫幅 = 終局 */
.glog { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px 0 8px; }
.gl-div { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--ink); font: 700 15px/1 var(--serif); letter-spacing: .12em; }
.gl-div:first-child { margin-top: 2px; }
.gl-div::before, .gl-div::after { content: ""; flex: 1; border-top: 1.5px solid var(--line-strong); }
.gl-div::before { flex: 0 0 10px; }
.gl-div span { display: inline-flex; align-items: center; gap: 5px; }
.gl-div small { font: 600 12px var(--sans); color: var(--muted); letter-spacing: 0; }
.gl-div .ico { width: 17px; height: 17px; }
.gl-div.night { color: #4a5272; }
.gl-div.night::before, .gl-div.night::after { border-color: #9aa0bd; }
.gl-div.day .ico { color: var(--brass); }
.gl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 4px; }
.gl-row .ico { width: 1.15em; height: 1.15em; }
.gl-row.gl-0 { font-size: 12px; padding: 1px 6px; color: var(--muted); }
.gl-row.gl-0 .w { font: 400 12px/1.3 var(--sans); }
.gl-row.gl-0 .ico { color: var(--line-strong); }
.gl-row.gl-1 { font-size: 15px; }
.gl-row.gl-15 { font-size: 15px; background: #8a1c1c0d; }
.gl-row.gl-2 { font-size: 18px; margin: 4px 0; padding: 6px 8px; background: var(--card); border-left: 4px solid var(--evil); border-radius: 0 4px 4px 0; }
.gl-row.gl-2 > .ico { color: var(--evil); }
.gl-row.gl-2 .w { font-size: 16px; }
.gl-who { display: inline-flex; align-items: center; gap: 3px; }
.gl-name { font: 600 .82em/1 var(--sans); }
.gl-num { font: 700 1.05em/1 var(--serif); }
.gl-num small { font-weight: 400; color: var(--muted); }
.gl-voters { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding-left: 2px; color: var(--brass); font-size: 13px; }
.gl-voters .sb { font-size: 13px; }
.gl-aim { color: var(--evil); }
.gl-win { display: grid; justify-items: center; gap: 2px; margin: 14px 0 6px; padding: 10px 8px; border: 2.5px double currentColor; border-radius: 6px; background: var(--card); text-align: center; }
.gl-win b { font: 900 22px/1.2 var(--serif); letter-spacing: .25em; padding-left: .25em; }
.gl-win small { font-size: 12px; color: var(--muted); }
.gl-win.good { color: var(--good); }
.gl-win.evil { color: var(--evil); }
.gl-st { margin: 4px 0; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 0 4px 4px 0; font: 15px/1.5 var(--serif); }
.gl-st-k { display: flex; align-items: center; gap: 4px; font: 700 11.5px var(--sans); color: var(--brass); letter-spacing: .1em; }
.gl-say { font-size: 13px; padding: 1px 6px; }
.gl-say-k { color: var(--muted); font-size: 12px; margin-right: 6px; }

/* 說書人的私聊收件箱：每個座位一行，點開浮窗 */
.inbox { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.ib-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; background: none; border: 0; border-radius: 6px; text-align: left; font-size: 15px; }
.ib-row:hover { background: #2a26220d; }
.ib-row.open { background: #efe7d4; }
.ib-name { flex: none; font: 600 13px var(--sans); }
.ib-last { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.ib-row.unread .ib-name, .ib-row.unread .ib-last { color: var(--ink); font-weight: 700; }
.ib-row .count { margin: 0; flex: none; }
.log { font-size: 13px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.log-k { display: inline-block; min-width: 34px; font-size: 11.5px; color: var(--muted); margin-right: 6px; }
.info { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 4px; padding: 6px 10px; margin-bottom: 8px; }
.check { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.check input { width: auto; margin-top: 3px; }
.sheet-team { font-family: var(--serif); font-weight: 700; margin: 10px 0 6px; }
.sheet-row { display: flex; gap: 10px; margin-bottom: 8px; }
.guess-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.guess-pick { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px; border-radius: 4px; font-size: 13px; }
.guess-pick:hover { background: #efe7d4; }

/* 手機頂欄的側欄標籤、抽屜的遮罩和 ✕、「規則」短字只在窄屏出現 */
.m-tabs, .sheet-x, .side-mask, .topbar .short { display: none; }
.room i { font-style: normal; }
.sheet-x { background: none; border: 0; color: var(--muted); padding: 4px 10px; font-size: 15px; }

/* 手機：一屏放下、不滾動。頂欄 / 桌面 / 操作塢三行，桌面按剩下的高寬取正方形；側欄變成頂欄標籤打開的底部抽屜 */
@media (max-width: 860px) {
  .game, .game.side-min { height: 100%; height: 100dvh; overflow: hidden; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "top" "board" "prog" "card" "dock"; }
  .topbar { gap: 5px; padding: 5px 8px; }
  .topbar .brand, .topbar .who, .room i, .topbar .long, .topbar .help, .topbar .sound, .topbar .script-name { display: none; }
  .topbar .more { flex: none; }
  .topbar .short { display: inline; }
  .topbar .btn.sm { padding: 3px 8px; }
  .topbar .warn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .m-tabs { display: flex; gap: 4px; flex: none; }
  .m-tabs .btn { position: relative; }
  .m-tabs .count { position: absolute; top: -7px; right: -7px; margin: 0; }

  .board { min-height: 0; }
  .prog { padding: 0 6px; }
  .pg { --pad: 14px; }
  .dock { flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px; min-height: 0; }
  .dock-status { flex: 1 1 110px; min-width: 0; }
  .dock-big { font-size: 16px; }
  .dock .btn.big { padding: 8px 14px; font-size: 14px; }
  .dock-mid { order: 3; flex-basis: 100%; font-size: 12.5px; }
  .dock-mid:empty { display: none; }
  .dock-act { flex: 1 1 auto; margin-left: 0; max-width: none; gap: 6px; }
  .dock .btn { padding: 6px 10px; font-size: 13.5px; }

  /* 桌面：.town 是尺寸容器，圓桌取寬高裏小的那個；頭像跟著圓桌大小縮放（--tk） */
  .town { flex: 1; contain: layout; padding: 4px; }
  /* 左右留一點邊：3 點、9 點方向的名牌不被屏幕邊緣切掉 */
  .ring { width: min(92cqw, 100cqh); --tk: clamp(34px, 15.5cqmin, 62px); }
  .ring.crowded { --tk: clamp(30px, 12.5cqmin, 50px); }
  .seat { width: calc(var(--tk) * 1.35); }
  .seat .token:not(.sm):not(.xs) { width: var(--tk); height: var(--tk); }
  .seat .token .token-name { font-size: clamp(8px, calc(var(--tk) * .17), 11px); padding: 0 2px; }
  .ring.crowded .token .token-name { display: none; }
  .plate { font-size: 11px; padding: 0 4px; max-width: calc(var(--tk) * 1.35); margin-top: 4px; }
  .tags, .fake { display: none; }
  .phase-title { font-size: clamp(16px, 5.5cqmin, 24px); letter-spacing: 2px; }
  .phase-sub { font-size: 12px; }

  /* 側欄：底部抽屜，上面一塊半透明遮罩，點遮罩或 ✕ 收起 */
  .side, .side-min .side { display: none; position: fixed; inset: 0; z-index: 40; flex-direction: column; gap: 0; padding: 0; border: 0; background: none; }
  .side.open { display: flex; }
  .side-mask { display: block; flex: 1; min-height: 18%; background: #2a262266; }
  .side .side-panel { display: flex; flex: none; height: 72%; padding: 2px 10px calc(10px + env(safe-area-inset-bottom)); background: var(--paper);
    border-top: 1.5px solid var(--ink); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px #0004; animation: sheet-in .22s ease-out; }
  .side .side-rail, .tab-min { display: none; }
  .sheet-x { display: block; }
  .tab-body { max-height: none; }
}
@keyframes sheet-in { from { transform: translateY(40%); opacity: 0; } }
.bots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.bots select { width: auto; }
.small { font-size: 12px; }

.peekbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 10px; align-items: center;
  background: var(--brass); color: #fff; padding: 5px 6px 5px 14px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.board { position: relative; }
.preview { margin: 8px 0 0; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 4px; font-size: 13px; }
.preview.good { border: 1.5px solid var(--good); }
.preview.good b { color: var(--good); }
.preview.bad { border: 1.5px solid var(--evil); }
.preview.bad b { color: var(--evil); }
.preview.empty { color: var(--muted); }
.doc { max-width: 680px; }
.doc-sec h3 { font-family: var(--serif); margin: 14px 0 4px; font-size: 16px; }
.doc-sec ul { margin: 0; padding-left: 20px; }
.doc-sec li { margin: 3px 0; }
.credit { color: var(--muted); font-size: 12px; margin-top: 16px; }
.info-pop .info { font-size: 15px; }
@media (max-width: 860px) {
  .board { flex-direction: column; }
  .peekbar { position: static; transform: none; justify-content: space-between; border-radius: 0; font-size: 13px; white-space: normal; }
}

/* 信息表單：「可」= 隱士 / 間諜可以被當作的身份（合規） */
.alt-mark { font-style: normal; font-size: 10px; margin-left: 4px; padding: 0 3px; border-radius: 2px; background: #b5651d; color: #fff; }
.preview.alt { border: 1.5px solid #b5651d; }
.preview.alt b { color: #b5651d; }
.chips.col { flex-direction: column; align-items: stretch; }
.chips.col .chip { text-align: left; padding: 6px 10px; }
.hint { font-size: 12.5px; color: var(--muted); border-left: 3px solid var(--line-strong); padding-left: 8px; }
.lastnight { font-family: var(--serif); font-weight: 700; color: var(--evil); }
.clockline { font-weight: 700; color: var(--brass); }

/* 座位：今天的提名情況、計票時鐘 */
.daytags { display: flex; gap: 3px; margin-top: 3px; }
.daytags span { font-size: 10.5px; line-height: 15px; padding: 0 4px; border-radius: 2px; background: var(--ink); color: var(--card); white-space: nowrap; }
.seat.clock .token { outline: 4px solid var(--brass); outline-offset: 4px; }
.seat.clock .plate { background: var(--brass); color: #fff; border-color: var(--brass); }
.seat.counted .plate { opacity: .6; }

/* 角色配置 / 更換角色 */
.setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.setup-role { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 4px; text-align: left; }
.setup-role span { flex: 1; font-size: 13px; }
.setup-role i { font-style: normal; font-size: 11px; color: var(--muted); }
.setup-role.lock { border-color: var(--good); background: #e8eff6; }
.setup-role.lock i { color: var(--good); font-weight: 700; }
.setup-role.ban { opacity: .5; border-style: dashed; }
.setup-role.ban i { color: var(--evil); font-weight: 700; }
.guess-pick.on { background: #efe7d4; outline: 1.5px solid var(--ink); }
.guess-pick small { margin-left: auto; }
.lang-lobby { justify-self: center; }

@media (max-width: 860px) {
  .center { width: 42%; }
  .center.has-nom .phase-title, .center.has-nom .phase-sub { display: none; }
  .vmark { width: 22px; height: 22px; right: -7px; top: -6px; }
  .vmark .ico { width: 13px; height: 13px; }
  .vbtn { padding: 8px 12px; font-size: 15px; }
  .daytags span { font-size: 9px; line-height: 13px; padding: 0 2px; }
  .seat.clock .token { outline-width: 3px; outline-offset: 2px; }
  .chat-pop { max-width: 120px; font-size: 13px; padding: 2px 7px; }
  .center .chat-pop { font-size: 14px; padding: 4px 10px; }
}

/* 提名：中央計票牌、提名箭頭、座位上的贊成 / 反對圓標、操作塢的兩個投票按鈕 */
.center { z-index: 3; }
.seat { z-index: 2; }
.nom-verb { font: 700 15px var(--serif); color: var(--evil); letter-spacing: .1em; }
.nom-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.nom-line line { stroke: #b3261e; stroke-width: .7; stroke-linecap: round; stroke-dasharray: 2.2 1.4; animation: nomdash 1s linear infinite; }
@keyframes nomdash { to { stroke-dashoffset: -3.6; } }
.seat.nominator .token { outline: 3px dashed var(--evil); outline-offset: 3px; }
.vmark { position: absolute; right: -10px; top: -8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  border: 2px solid var(--card); box-shadow: 0 2px 6px #0005; color: #fff; }
.vmark .ico { width: 17px; height: 17px; }
.vmark.yes { background: #c9962c; }
.vmark.no { background: #6b7280; }
.vbtn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 2px solid; background: var(--card); font: 700 16px var(--serif); letter-spacing: .08em; cursor: pointer; }
.vbtn .ico { width: 20px; height: 20px; }
.vbtn.yes { border-color: #c9962c; color: #8a6a1c; }
.vbtn.yes.on { background: #c9962c; color: #fff; }
.vbtn.no { border-color: #6b7280; color: #4b5563; }
.vbtn.no.on { background: #4b5563; color: #fff; }
.vbtn.disabled { opacity: .45; pointer-events: none; }

/* 聊天：側欄頂部的私聊對象條；私聊浮窗（桌面右下角並排，手機貼底） */
.chan-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 0 4px; border-bottom: 1px dashed var(--line); }
.chan-k { font-size: 12px; color: var(--muted); margin-right: 2px; }
.chan-chip { position: relative; display: inline-flex; align-items: center; padding: 2px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-size: 14px; }
.chan-chip:hover { border-color: var(--ink); }
.chan-chip.open { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chan-chip .count { position: absolute; top: -7px; right: -7px; margin: 0; }
.composer input { flex: 1; min-width: 0; }
.chat-wins { position: absolute; right: 10px; bottom: 10px; z-index: 20; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 8px; pointer-events: none; max-width: calc(100% - 20px); }
.cwin { pointer-events: auto; width: 272px; height: 340px; max-height: calc(100vh - 200px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--card) url(../img/grain.svg); border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: 0 10px 28px #2a262255; animation: cwin-in .22s ease-out; }
.cwin.min { height: auto; width: auto; max-width: 180px; }
.cwin.min.unread .cwin-head { background: var(--evil); animation: cwin-blink 1.2s ease-in-out 3; }
.cwin-head { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 8px; background: var(--ink); color: var(--card); cursor: pointer; font-size: 13px; font-weight: 600; }
.cwin-head .w, .cwin-head .w.ink, .cwin-head .w.muted { color: var(--card); }
.cwin-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cwin-head .count { margin: 0; }
.cwin-x { background: none; border: 0; color: inherit; opacity: .7; padding: 0 4px; font-size: 13px; margin-left: auto; cursor: pointer; }
.cwin-x:hover { opacity: 1; }
.cwin .msgs { margin: 0; padding: 8px; }
.cwin .composer { padding: 6px; border-top: 1px solid var(--line); gap: 6px; }
/* 入場從底邊往上長：往下位移會越出頁面底部，閃出滾動條，整頁跟著左右一跳 */
.cwin { transform-origin: 50% 100%; }
@keyframes cwin-in { from { transform: scale(.94); opacity: 0; } }
@keyframes cwin-blink { 0%, 100% { background: var(--evil); } 50% { background: var(--ink); } }
.cwin-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 8px; background: #efe7d4; border-bottom: 1px solid var(--line); }
.cwin-marks .pm { font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .cwin.min.unread .cwin-head { animation: none; background: var(--evil); } }
@media (max-width: 860px) {
  /* 手機：展開的浮窗佔滿寬貼底，收起的縮成小條在右下角並排，少擋座位 */
  .chat-wins { position: fixed; left: 8px; right: 8px; bottom: 8px; flex-direction: row-reverse; flex-wrap: wrap-reverse; align-items: flex-end; gap: 6px; max-width: none; }
  .cwin { width: 100%; height: 46vh; height: 46dvh; order: 1; }
  .cwin.min { width: auto; max-width: 48%; border-radius: 16px; order: 0; }
  .cwin.min .cwin-head { padding: 4px 6px 4px 8px; }
}


/* 審判牌（trial.js）：提名期間蓋在桌面上的一張紙牌。平塗、墨線、印章，和其他卡片一個風格 */
.town { position: relative; }
.trial { position: absolute; inset: 0; margin: auto; z-index: 8; width: min(580px, calc(100% - 24px)); height: fit-content; max-height: calc(100% - 24px); overflow: auto;
  display: grid; gap: 10px; padding: 14px 16px 12px; background: var(--card) url(../img/grain.svg); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 0 18px 40px #2a262240; font-family: var(--serif); color: var(--ink); }
.trial.fx-pop { animation: tr-drop .42s cubic-bezier(.2,1.25,.4,1) both; animation-delay: var(--fx-delay, 0s); }
@keyframes tr-drop { from { transform: translateY(26px) scale(.95); opacity: 0; } }
.tr-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; gap: 10px; }
.tr-who { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.tr-who .token { width: 80px; height: 80px; }
.tr-who .token.blank { font-size: 30px; }
.tr-who.to .token { outline: 3px solid var(--evil); outline-offset: 4px; }
.tr-plate { display: inline-flex; align-items: center; gap: 6px; max-width: 170px; padding: 1px 9px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 3px; font: 700 14px var(--serif); }
.tr-plate span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-verb { display: grid; justify-items: center; gap: 2px; color: var(--evil); }
.tr-verb .ico { width: 42px; height: 42px; }
.tr-stamp { padding: 4px 6px 6px 12px; font: 900 24px/1 var(--serif); letter-spacing: .2em; border: 2.5px solid currentColor; border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3.5px currentColor; transform: rotate(-6deg); }
.tr-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; padding-top: 10px; border-top: 1.5px solid var(--line); }
.tr-k { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; font: 700 15px var(--serif); letter-spacing: .12em; }
.tr-k .ico { width: 20px; height: 20px; }
.tr-k i { font: 600 13px var(--sans); color: var(--muted); letter-spacing: 0; }
.tr-side.yes .tr-k { color: var(--brass); justify-content: flex-end; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-side.yes .tr-chips { justify-content: flex-end; }
.tr-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; max-width: 124px; padding: 0 8px; border: 1.5px solid var(--ink); border-radius: 3px;
  background: var(--card); color: var(--ink); font: 700 13.5px var(--serif); white-space: nowrap; animation: tr-in .34s cubic-bezier(.2,1.4,.4,1) both; }
.tr-chip > span { overflow: hidden; text-overflow: ellipsis; }
.tr-chip b { font: 800 14px var(--serif); }
.tr-side.yes .tr-chip { background: var(--brass); color: var(--card); }
.tr-idle .tr-chip { border-style: dashed; border-color: var(--line-strong); color: var(--muted); }
.tr-chip.mine { outline: 2px solid var(--ink); outline-offset: 2px; }
.tr-chip.spent { opacity: .45; }
@keyframes tr-in { 0% { transform: scale(1.6); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: none; opacity: 1; } }
.tr-mid { display: grid; justify-items: center; gap: 5px; min-width: 96px; }
.tr-num { font: 900 60px/.9 var(--serif); animation: tr-bump .34s cubic-bezier(.2,1.5,.4,1); }
@keyframes tr-bump { 0% { transform: scale(1.6); } }
.tr-mid.enough .tr-num { color: var(--evil); }
.tr-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 150px; }
.tr-slots i { width: 14px; height: 14px; border: 1.5px solid var(--line-strong); border-radius: 3px; transition: background .2s, border-color .2s; }
.tr-slots i.on { background: var(--brass); border-color: var(--brass); }
.tr-mid.enough .tr-slots i.on { background: var(--evil); border-color: var(--evil); }
.tr-mid small { font: 600 13px var(--sans); color: var(--muted); }
.tr-foot { display: grid; gap: 8px; padding-top: 10px; border-top: 1.5px dashed var(--line); }
.tr-idle, .tr-clock { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.tr-idle .tr-k, .tr-clock .tr-k { margin: 0 4px 0 0; }
.tr-idle .tr-k { color: var(--muted); }
.tr-clock .tr-k { color: var(--brass); }
.tr-clock .sb { font-size: 16px; transition: transform .2s, background .2s; }
.tr-clock .sb.past { background: var(--line); color: var(--muted); }
.tr-clock .sb.past.up { background: var(--brass); border-color: var(--brass); color: var(--card); }
.tr-clock .sb.now { background: var(--ink); color: var(--card); transform: scale(1.3); }
@media (max-width: 860px) {
  .trial { width: calc(100% - 12px); max-height: calc(100% - 12px); gap: 8px; padding: 10px; border-radius: 10px; }
  .tr-who .token { width: 60px; height: 60px; }
  .tr-who .token.blank { font-size: 22px; }
  .tr-who .token .token-name { font-size: 9px; }
  .tr-plate { max-width: 110px; padding: 1px 6px; font-size: 12px; }
  .tr-verb .ico { width: 28px; height: 28px; }
  .tr-stamp { font-size: 17px; padding: 3px 4px 4px 8px; }
  .tr-body { gap: 8px; padding-top: 8px; }
  .tr-k { margin-bottom: 4px; font-size: 12px; }
  .tr-k .ico { width: 15px; height: 15px; }
  .tr-chip { height: 22px; max-width: 96px; padding: 0 5px; font-size: 11.5px; gap: 3px; }
  .tr-chip b { font-size: 12px; }
  .tr-mid { min-width: 64px; }
  .tr-num { font-size: 44px; }
  .tr-slots i { width: 10px; height: 10px; }
  .tr-foot { padding-top: 6px; gap: 6px; }
  .tr-clock .sb { font-size: 13px; }
}

/* 投票倒數（提名後 5 分鐘）：墨色，最後 30 秒變紅，暫停時變灰；說書人旁邊兩個圓鈕：暫停 / 繼續、重置 */
.tr-auto { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 0 8px; color: var(--ink); overflow: hidden; }
.tr-auto > .ico { width: 20px; height: 20px; }
.tr-clock .tr-k-ico { width: 18px; height: 18px; color: var(--brass); }
.tr-auto b { font: 900 22px/1 var(--serif); min-width: 2.6em; text-align: center; font-variant-numeric: tabular-nums; }
.tr-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ink); transform-origin: left; transition: transform 1s linear; }
.tr-auto.low { color: var(--evil); }
.tr-auto.low .tr-bar { background: var(--evil); }
.tr-auto.paused { color: var(--muted); }
.tr-auto.paused .tr-bar { background: var(--line-strong); }
.tr-auto.paused b { animation: tr-blink 1.2s steps(2) infinite; }
@keyframes tr-blink { 50% { opacity: .35; } }
.tr-tbtn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; }
.tr-tbtn .ico { width: 15px; height: 15px; }
.tr-tbtn:hover { background: var(--ink); color: var(--card); }
/* 棄權欄的「僅你與說書人可見」 */
.tr-priv { display: flex; align-items: center; gap: 3px; margin: -4px 0 6px; font: 600 11.5px var(--sans); color: var(--muted); white-space: nowrap; }
.tr-priv .ico { width: 14px; height: 14px; }
@media (max-width: 860px) { .tr-priv { font-size: 10px; margin-top: -2px; } .tr-tbtn { width: 26px; height: 26px; } }

/* 處決台（town.js blockSeat）：台上的人坐在圓桌中間，掛在絞刑架下；座位上留虛線空位 */
.token.blank.away { opacity: .5; }
.token.blank.solid { border: 2px solid var(--ink); color: var(--ink); background: var(--card); }
.blk { position: absolute; left: 50%; top: 50%; z-index: 3; width: 150px; height: 214px; transform: translate(-50%, -54%); pointer-events: none; }
.blk .gallows { position: absolute; left: 0; top: 0; width: 150px; height: 170px; }
.gallows .g-wood { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: square; }
.gallows .g-rope { fill: none; stroke: var(--brass); stroke-width: 3.5; }
.blk-tok { position: absolute; left: 33px; top: 62px; }
.blk-tok .token { width: 84px; height: 84px; }
.blk-tok .token.blank { font-size: 30px; }
.blk-n { position: absolute; left: 106px; top: 122px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px 1px 5px; border-radius: 12px;
  background: var(--evil); color: var(--card); font: 800 15px/1.4 var(--serif); }
.blk-n .ico { width: 14px; height: 14px; }
.blk-plate { position: absolute; left: 50%; top: 178px; transform: translateX(-36%); display: inline-flex; align-items: center; gap: 5px; max-width: 150px;
  padding: 0 8px; background: var(--card); border: 1.5px solid var(--evil); border-radius: 3px; color: var(--evil); font: 700 13px var(--serif); white-space: nowrap; }
.blk-plate span { overflow: hidden; text-overflow: ellipsis; }
/* 上台：頭像從座位飛到中間，絞刑架隨後落下；下台：從中間飛回座位 */
.blk.fx-blkin { animation: blk-in .65s cubic-bezier(.3,.8,.3,1) both; animation-delay: var(--fx-delay, 0s); }
@keyframes blk-in { from { left: var(--sx); top: var(--sy); } }
.blk.fx-blkin .gallows, .blk.fx-blkin .blk-n, .blk.fx-blkin .blk-plate { animation: gal-in .35s cubic-bezier(.3,1.3,.5,1) both; animation-delay: calc(.45s + var(--fx-delay, 0s)); }
@keyframes gal-in { from { transform: translateY(-24px); opacity: 0; } }
.blk.fx-blkin .blk-plate { animation-name: plate-in; }
@keyframes plate-in { from { opacity: 0; } }
.blk-ret { position: absolute; z-index: 3; transform: translate(-50%, -50%); pointer-events: none; }
.blk-ret .token { width: 84px; height: 84px; }
.blk-ret.fx-blkret { animation: blk-ret .65s cubic-bezier(.4,0,.3,1) both; animation-delay: var(--fx-delay, 0s); }
@keyframes blk-ret { from { left: 50%; top: 50%; } }
.center.has-blk { display: none; }
@media (max-width: 860px) {
  .blk { transform: translate(-50%, -54%) scale(.62); }
  .blk-ret .token { width: 56px; height: 56px; }
}
@media (max-width: 860px) { .dead-stamp { font-size: 11px; padding: 0 2px 1px 5px; border-width: 1.5px; } .ghost-vote { width: 20px; height: 20px; top: -11px; } }

/* 審判牌上的投票按鈕（欄頂） */
.tr-k .vbtn { padding: 6px 14px; font-size: 15px; gap: 5px; min-width: 96px; justify-content: center; }
.tr-k .vbtn i { font: 600 13px var(--sans); opacity: .75; letter-spacing: 0; }
.tr-k .vbtn .ico { width: 18px; height: 18px; }
@media (max-width: 860px) { .tr-k .vbtn { padding: 4px 8px; font-size: 13px; } .tr-k .vbtn .ico { width: 14px; height: 14px; } }

/* 玩家的圓桌中央：死訊、主人、輪到自己時的選人確認、準備階段按鈕 */
.cx { display: grid; justify-items: center; gap: 8px; margin-top: 10px; pointer-events: auto; }
.cx .dock-frm { justify-content: center; font-size: 16px; }

/* 輪到自己行動：圓桌中央的紙牌。行動用語義色：毒綠 / 保護、查驗藍 / 殺紅 / 主人金 */
.turn-pane { --tone: var(--ink); gap: 10px; margin-top: 8px; padding: 12px 14px 14px; color: var(--ink); background: var(--card) url(../img/grain.svg);
  border: 2px solid var(--tone); border-radius: 12px; box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4.5px var(--tone), 0 12px 28px #0005;
  animation: bubble-in .3s cubic-bezier(.2,.9,.3,1.2); }
.turn-pane.poison { --tone: #3d8b3d; }
.turn-pane.good { --tone: var(--good); }
.turn-pane.evil { --tone: var(--evil); }
.turn-pane.brass { --tone: var(--brass); }
.tp-head { display: flex; align-items: center; gap: 10px; }
.tp-head .token { width: 72px; height: 72px; cursor: default; }
.tp-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--tone); color: var(--card);
  box-shadow: inset 0 0 0 3px var(--tone), inset 0 0 0 4.5px var(--card); }
.tp-ico .ico { width: 60%; height: 60%; }
.tp-say { font: 700 17px/1.45 var(--serif); }
.tp-say b { color: var(--tone); font-size: 1.15em; }
.turn-pane .slots { font-size: 26px; }
.center:has(.turn-pane) .phase-sub { display: none; }
@media (max-width: 860px) {
  /* 手機上圓桌中間放不下標題和牌：輪到自己時只留牌，免得壓到下面的座位 */
  .center:has(.turn-pane) .phase-title { display: none; }
  .turn-pane { gap: 5px; margin-top: 0; padding: 7px 8px 9px; }
  .tp-head .token { width: 42px; height: 42px; }
  .tp-head .token .token-name { display: none; }
  .tp-ico { width: 30px; height: 30px; }
  .tp-say { font-size: 12.5px; line-height: 1.35; }
  .turn-pane .slots { font-size: 18px; }
  .turn-pane .btn.big { padding: 5px 16px; font-size: 13.5px; }
}

/* 獵手：其他活著的人頭上（左上角）一個瞄準鈕，點開先講規則再開槍 */
.aim-btn { position: absolute; left: -10px; top: -10px; z-index: 3; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border-radius: 50%; background: var(--card); color: var(--evil); border: 2px solid var(--evil); box-shadow: 0 2px 6px #2a262240; cursor: pointer;
  animation: vstamp .3s cubic-bezier(.5,0,.7,1) both; }
.aim-btn:hover { background: var(--evil); color: var(--card); }
.aim-btn .ico { width: 72%; height: 72%; }
.aim-rule { display: grid; gap: 10px; }
.aim-row { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.aim-row > span:not([class]) { font: 700 15px var(--serif); }
.aim-rule .btn .ico { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
@media (max-width: 860px) { .aim-btn { width: 24px; height: 24px; left: -7px; top: -7px; } }
