* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(160deg, #1e1b3a 0%, #2d1b4e 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  /* 玩家手機上長按畫面上的文字/圖案（不管是狀態列的提示字、拼布花紋、還是搶答按鈕），
     手機瀏覽器預設都會當成「選取文字/圖片」處理，跳出「複製／分享／全選／網頁搜尋」
     這種原生選單蓋住整個畫面、擋住遊戲操作。整個 App 除了「輸入暱稱」那個輸入框以外
     本來就不需要任何文字被選取，所以直接整頁關掉選取／長按彈出選單／點擊高亮，
     下面另外把 input/textarea 排除掉，暱稱輸入框還是可以正常打字、選字。 */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* 避免手指滑到畫面邊緣時觸發瀏覽器自己的「下拉刷新」或前後頁手勢，這些手勢很容易在
     搶答、拖曳卡片的時候被誤觸發，把整個畫面刷新掉或滑走。 */
  overscroll-behavior: none;
  /* iPhone Safari 快速連續點擊按鈕（搶答、裁縫大師轉布片等）很容易被系統誤判成
     「雙指點兩下＝放大」的手勢，畫面整個 zoom in 卡住、玩家自己完全滑不回來。
     manipulation 會關掉「雙擊放大」跟點擊那 300ms 延遲，但保留正常的滑動／捲動，
     跟 <meta viewport> 裡的 user-scalable=no 是兩層不同的保險，光靠其中一個在部分
     iOS 版本上還是會被吃掉，兩個一起設才穩。個別元件（例如拖曳中的卡片）已經另外
     設過 touch-action:none，會蓋掉這裡繼承下來的值，不受影響。 */
  touch-action: manipulation;
}
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
.container {
  width: 100%;
  max-width: 480px;
  margin-top: 12px;
}
h1 {
  text-align: center;
  font-size: 26px;
  margin: 8px 0 24px;
  letter-spacing: 2px;
}
h1 .sub { display:block; font-size: 13px; opacity: 0.6; font-weight: normal; margin-top:4px; }
/* 開桌設定裡的下拉選單（目前只有電畫傳情的「玩法／輪數／秒數」用到） */
select.cfg-select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 15px; margin: 4px 0 2px;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 36px;
}
select.cfg-select option { color: #1e1b3a; background: #fff; }
.card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
input[type=text], input[type=number], input[type=password] {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.25);
  color: #fff;
  margin-bottom: 12px;
}
button {
  width: 100%;
  padding: 15px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff5f9e, #ff8a5b);
  color: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform 0.1s;
}
button:active { transform: scale(0.97); }
button.secondary {
  background: rgba(255,255,255,0.12);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li {
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.player-list li.dead { opacity: 0.4; text-decoration: line-through; }
.player-list li.speaking {
  background: linear-gradient(135deg, rgba(255,95,158,0.35), rgba(255,138,91,0.35));
  border: 1px solid #ff8a5b;
}
.word-box {
  text-align: center;
  padding: 40px 16px;
  font-size: 34px;
  font-weight: bold;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
.word-box .label { display:block; font-size: 14px; opacity: 0.6; margin-bottom: 10px; font-weight: normal;}
.center { text-align: center; }
.muted { opacity: 0.6; font-size: 14px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,0.15);
}
.badge.civilian { background: #2e8b57; }
.badge.undercover { background: #c0392b; }
.badge.blank { background: #7f8c8d; }

/* 「準備好了」清單：所有遊戲共用的通用樣式（不綁定任何一款遊戲的配色），
   放在每一桌的設定畫面裡，顯示誰準備好了、誰是房主。 */
.ready-chip-row { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.ready-chip {
  display:inline-flex; align-items:center; gap:4px; padding:5px 10px; border-radius:999px;
  font-size:12.5px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.18);
}
.ready-chip.is-ready { background:rgba(46,204,113,0.2); border-color:rgba(46,204,113,0.5); }
.ready-chip .crown { font-size:11px; }
.vote-btn {
  background: rgba(255,255,255,0.1);
  text-align: left;
}
.vote-btn.selected {
  background: linear-gradient(135deg, #ff5f9e, #ff8a5b);
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.speak-entry {
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}
/* 誰是臥底：投票候選人後面附上他這輪講的話、確認投票、歷史回顧 */
.vote-btn .uc-said { display:block; font-size:13px; opacity:0.75; margin-top:3px; font-weight:normal; word-break:break-word; }
.vote-btn .uc-said-old { display:block; font-size:12px; opacity:0.5; margin-top:2px; font-weight:normal; word-break:break-word; }
#uc-voteConfirmBtn { margin-top:10px; }
#uc-historyDetails summary { cursor:pointer; font-weight:600; padding:4px 0; }
.uc-person { margin-top:10px; padding:9px 11px; background:rgba(255,255,255,0.05); border-radius:10px; }
.uc-person.out { opacity:0.6; }
.uc-person-name { margin-bottom:4px; font-size:15px; }
.uc-out-tag { font-size:12px; opacity:0.8; }
.uc-line { font-size:14px; line-height:1.45; padding:2px 0; word-break:break-word; }
.uc-line.current { font-weight:600; }
.uc-round-tag { display:inline-block; min-width:3.6em; font-size:12px; opacity:0.6; margin-right:6px; }
.player-list li button {
  width: auto;
  padding: 6px 12px;
  font-size: 13px;
  margin: 0;
}
.game-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.badge:not(.civilian):not(.undercover):not(.blank) {
  background: linear-gradient(135deg, #ff5f9e, #ff8a5b);
}

/* ---- 遊戲說明：主持人一選定遊戲，玩家畫面的「等待開始」畫面上就會顯示這個，
   讓還沒玩過這款遊戲的人也知道等一下要怎麼玩 ---- */
.rules-box{ margin-top:14px; padding-top:14px; border-top:1px dashed rgba(255,255,255,0.15); }
.rules-box .rules-title{ font-size:13px; font-weight:700; margin-bottom:8px; }
.rules-box ol{ margin:0; padding-left:22px; text-align:left; }
.rules-box li{ font-size:13.5px; line-height:1.65; color:#d8d3ee; margin-bottom:7px; }
.rules-box li:last-child{ margin-bottom:0; }

/* ---- 頭像（拍照或自動產生的都共用這組樣式） ---- */
.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-fallback {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

/* =====================================================================
   海戰棋
   ===================================================================== */
:root {
  --bs-accent: #33e0a4;
  --bs-accent-dim: rgba(51,224,164,0.16);
  --bs-hit: #ff6b4a;
  --bs-hit-dim: rgba(255,107,74,0.18);
  --bs-miss: #7fb3cf;
  --bs-gold: #ffcf5c;
  --bs-line: rgba(140,180,200,0.18);
  --bs-cell-bg: #335777;
  --bs-cell-bg-hover: #3f688a;
  --bs-surface-2: rgba(255,255,255,0.06);
}

.setup-status {
  display:flex; align-items:center; gap:6px; justify-content:center;
  color: var(--bs-accent); font-size:13px; font-weight:700; margin-bottom:14px;
}
.setup-status .dot {
  width:7px; height:7px; border-radius:50%; background: var(--bs-accent);
  animation: bs-pulse 1.4s ease-in-out infinite;
}
@keyframes bs-pulse { 0%,100%{ opacity:.35; } 50%{ opacity:1; } }

.fleet-legend-compact{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:14px; }
.fleet-legend-compact span{
  font-size:12px; color:#cfe3ea; background: var(--bs-surface-2);
  border:1px solid var(--bs-line); padding:5px 10px; border-radius:999px;
}

/* ---- 對手清單 ---- */
.opp-list{ display:flex; flex-direction:column; gap:8px; }
.opp-card{
  display:flex; align-items:center; gap:10px;
  background: var(--bs-surface-2); border:1px solid var(--bs-line);
  border-radius: 12px; padding:9px 11px; cursor:pointer;
}
.opp-card.selected{ border-color: var(--bs-accent); background: var(--bs-accent-dim); }
.opp-card.out{ opacity:.45; cursor:default; }
.opp-card .info{ flex:1; min-width:0; }
.opp-card .info .nm{ font-size:13.5px; font-weight:700; }
.opp-card .hp-txt{ font-size:12px; color:#8fa7b3; white-space:nowrap; }

/* ---- 血條共用元件 ---- */
.hp-bar{ display:flex; gap:2px; margin-top:5px; }
.hp-bar i{ display:block; height:6px; flex:1; border-radius:2px; background: var(--bs-accent); }
.hp-bar i.dead{ background: var(--bs-hit-dim); }
.overview-row .hp-bar, .opp-card .hp-bar{ flex:1; }

/* ---- 戰場格子 ---- */
.board-wrap{ margin-top:14px; }
.board-hdr{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.board-hdr .who{ display:flex; align-items:center; gap:8px; }
.board-hdr .who .nm{ font-weight:700; font-size:14px; }

.board{
  display:grid; grid-template-columns: 18px repeat(8, 1fr);
  gap:3px; position:relative;
}
.board .colhead, .board .rowhead{
  display:flex; align-items:center; justify-content:center;
  font-size:11px; color:#8fa7b3;
}
.cell{ position:relative; aspect-ratio:1/1; border-radius:4px; background: var(--bs-cell-bg); border:1px solid var(--bs-line); }
.cell.unknown{ cursor:pointer; }
.cell.unknown:hover{ background: var(--bs-cell-bg-hover); box-shadow: 0 0 0 1px var(--bs-accent) inset; }
.cell.miss::after{
  content:""; position:absolute; inset:0; margin:auto; width:28%; height:28%;
  border-radius:50%; background: var(--bs-miss); opacity:0.8;
}
.cell.hit{ background: var(--bs-hit-dim); border-color: rgba(255,107,74,0.5); z-index:1; }
.cell.hit::after{
  /* 原本這裡用 emoji 🔥 當作命中特效，改成 Lucide 的 flame 向量圖示（data URI），
     避免不同手機/瀏覽器 emoji 字型畫出來不一樣。用 filter:drop-shadow 取代原本的
     text-shadow 做出同樣的發光效果。 */
  content:""; position:absolute; inset:0; margin:auto; width:60%; height:60%;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff8c28' stroke='%23ff8c28' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:center; background-size:contain;
  filter: drop-shadow(0 0 6px rgba(255,140,40,0.85));
  animation: bs-fireFlicker 0.85s ease-in-out infinite;
}
@keyframes bs-fireFlicker{
  0%,100%{ transform: scale(1) rotate(-4deg); opacity:0.88; }
  25%{ transform: scale(1.14, 1.22) rotate(3deg); opacity:1; }
  50%{ transform: scale(0.94, 0.9) rotate(-2deg); opacity:0.82; }
  75%{ transform: scale(1.08, 1.16) rotate(2deg); opacity:1; }
}
.ship-fx{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; z-index:3; }
.ship-fx.flame{
  inset:auto;
  left:50%; top:50%;
  transform:translate(-50%,-50%);
  display:block;
  font-size:42cqmin;
  text-shadow: 0 0 6px rgba(255,140,40,0.9);
  animation: bs-fireFlicker 0.85s ease-in-out infinite;
}
.ship-fx.smoke{ justify-content:center; gap:6%; }
.ship-fx.smoke .puff{
  width:15%; aspect-ratio:1/1; border-radius:50%;
  background: radial-gradient(circle, #dfe6e6, #b9c4c4 70%); opacity:0;
  animation: bs-smokeRise 3.2s ease-out infinite;
}
.ship-fx.smoke .puff:nth-child(2){ animation-delay:1.05s; }
.ship-fx.smoke .puff:nth-child(3){ animation-delay:2.1s; }
@keyframes bs-smokeRise{
  0%{ transform: translate(0,0) scale(0.5); opacity:0; }
  12%{ opacity:0.55; }
  60%{ opacity:0.3; }
  100%{ transform: translate(0,-120%) scale(1.8); opacity:0; }
}
.cell.picked{ box-shadow: 0 0 0 2px var(--bs-accent) inset; background: var(--bs-accent-dim); }
.cell.ping::before{
  content:""; position:absolute; inset:0; border-radius:4px; border:2px solid var(--bs-accent);
  animation: bs-ping 0.55s ease-out forwards;
}
@keyframes bs-ping{ from{ opacity:1; transform:scale(0.5);} to{ opacity:0; transform:scale(1.5);} }

/* 開火結果提示：蓋在最上層，不管當下畫面是「輪到我」還是已經跳到「等待中」都看得到，
   停留一小段時間後自動淡出，讓開火的人第一時間就知道剛剛那發有沒有打中。 */
.bs-fire-toast{
  position:fixed; top:16px; left:50%;
  transform:translate(-50%,-14px);
  z-index:80; pointer-events:none;
  max-width:min(92vw,380px);
  background:rgba(18,26,36,0.95);
  border:1px solid var(--bs-line);
  border-radius:999px;
  padding:11px 22px;
  font-size:14px; font-weight:700; color:#eafff6;
  text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  box-shadow:0 10px 28px rgba(0,0,0,0.4);
  opacity:0;
  transition:opacity .22s ease, transform .22s ease;
}
.bs-fire-toast.show{ opacity:1; transform:translate(-50%,0); }
.bs-fire-toast.miss{ border-color:var(--bs-miss); color:#cfe9f7; }
.bs-fire-toast.hit{ border-color:var(--bs-accent); color:#d8fff0; }
.bs-fire-toast.sunk{ border-color:var(--bs-hit); color:#ffe3da; }

/* 被打中提示：跟開火結果提示是不同的元素（自己開火 vs 被別人打中，兩件事可能前後腳發生），
   位置刻意往下錯開一點避免萬一同時出現會疊在一起，配色也刻意更警示一點（紅底）。 */
#bs-hitToast{ top:70px; background:rgba(58,14,14,0.95); border-color:var(--bs-hit); color:#ffdede; }
#bs-hitToast.show{ animation: bs-hitshake .38s ease; }
@keyframes bs-hitshake{
  0%{ transform:translate(-50%,0) translateX(0); }
  25%{ transform:translate(-50%,0) translateX(-6px); }
  50%{ transform:translate(-50%,0) translateX(5px); }
  75%{ transform:translate(-50%,0) translateX(-3px); }
  100%{ transform:translate(-50%,0) translateX(0); }
}

.ship-slot{ position:relative; pointer-events:none; z-index:2; border-radius:4px; overflow:hidden; container-type:size; }
.ship-slot svg{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.ship-slot.vertical{ container-type:size; overflow:visible; }
.ship-slot.vertical svg{
  position:absolute; inset:auto; top:50%; left:50%;
  width:100cqh; height:100cqw;
  transform: translate(-50%,-50%) rotate(90deg);
}

.fire-bar{
  margin-top:16px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: var(--bs-surface-2); border:1px solid var(--bs-accent);
  border-radius: 12px; padding:10px 14px;
}
.fire-bar .coord{ font-weight:700; color: var(--bs-accent); font-size:15px; }
.fire-bar button{
  width:auto; margin:0; font-size:13.5px;
  background: var(--bs-accent); color:#04160f; border:none; border-radius:999px;
  padding:9px 18px; cursor:pointer;
}

.mini-fleet-wrap{ margin-top:16px; padding-top:14px; border-top:1px dashed var(--bs-line); }
.mini-fleet-hdr{ display:flex; align-items:center; justify-content:space-between; }
.mini-fleet-hdr .lbl{ font-size:12px; color:#8fa7b3; }
.mini-fleet-hdr .hp-txt{ font-size:12px; color:#cfe3ea; }

/* ---- 等待畫面 ---- */
.waiting-hero{ text-align:center; padding: 10px 0 6px; }
.radar{
  width:96px; height:96px; margin:0 auto 16px; position:relative;
  border-radius:50%; border:1px solid rgba(255,255,255,0.15);
  background: radial-gradient(circle, var(--bs-accent-dim), transparent 70%);
}
.radar::before, .radar::after{ content:""; position:absolute; inset:14px; border-radius:50%; border:1px solid rgba(255,255,255,0.15); }
.radar::after{ inset:34px; }
.radar .sweep{
  position:absolute; inset:0; border-radius:50%;
  background: conic-gradient(from 0deg, var(--bs-accent) 0deg, transparent 55deg);
  animation: bs-spin 2.2s linear infinite; opacity:0.65;
}
@keyframes bs-spin{ to{ transform: rotate(360deg); } }
.waiting-hero .who{ font-size:15.5px; font-weight:700; }
.waiting-hero .sub{ font-size:12.5px; color:#8fa7b3; margin-top:4px; }

.overview-list{ display:flex; flex-direction:column; gap:7px; margin-top:14px; }
.overview-row{ display:flex; align-items:center; gap:9px; padding:7px 9px; border-radius:8px; }
.overview-row.current{ background: var(--bs-accent-dim); }
.overview-row .nm{ font-size:12.5px; width:76px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.overview-row .hp-txt{ font-size:11px; color:#8fa7b3; width:32px; text-align:right; }
.overview-row.spectate-row{ cursor:pointer; border:1px solid transparent; }
.overview-row.spectate-row:hover{ background: var(--bs-surface-2); }
.overview-row.spectate-row.active{ background: var(--bs-accent-dim); border-color: var(--bs-accent); }
.overview-row .chevron{ color:#8fa7b3; font-size:14px; flex-shrink:0; }
.overview-row.spectate-row.active .chevron{ color: var(--bs-accent); }

.reveal-panel{ margin-top:16px; padding-top:14px; border-top:1px dashed var(--bs-line); }

.log{ margin-top:16px; padding-top:14px; border-top:1px dashed var(--bs-line); }
.log .lbl{ font-size:12px; color:#8fa7b3; margin-bottom:8px; }
.log ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.log li{ font-size:12.5px; color:#cfe3ea; line-height:1.5; }
.log li b{ color:#fff; font-weight:700; }
.log li.dmg b.hit-txt{ color: var(--bs-hit); }

/* ---- 淘汰 / 結束畫面 ---- */
.end-hero{ text-align:center; padding: 8px 0 4px; }
.end-hero .emoji{ font-size:48px; }
.end-hero h2{ font-size:20px; margin:8px 0 4px; }
.end-hero p{ font-size:13px; color:#cfe3ea; margin:0; }
.stat-row{ display:flex; justify-content:space-between; margin-top:18px; background: var(--bs-surface-2); border-radius:12px; padding:12px 16px; }
.stat-row .stat{ text-align:center; flex:1; }
.stat-row .stat b{ display:block; font-size:20px; color: var(--bs-accent); }
.stat-row .stat span{ font-size:11px; color:#8fa7b3; }

.rank-list{ display:flex; flex-direction:column; gap:8px; margin-top:16px; }
.rank-row{ display:flex; align-items:center; gap:10px; background: var(--bs-surface-2); border-radius:12px; padding:9px 12px; border:1px solid var(--bs-line); }
.rank-row.win{ border-color: var(--bs-gold); background: rgba(255,207,92,0.1); }
.rank-row .place{ font-weight:700; width:22px; color:#8fa7b3; }
.rank-row.win .place{ color: var(--bs-gold); }
.rank-row .nm{ flex:1; font-size:13.5px; font-weight:500; }
.rank-row .note{ font-size:11.5px; color:#8fa7b3; }

/* ---- 小標籤、頭像 ---- */
.pill{ font-size:10px; letter-spacing:0.05em; padding:2px 7px; border-radius:999px; background: var(--bs-accent-dim); color: var(--bs-accent); }
.pill.out{ background: var(--bs-hit-dim); color: var(--bs-hit); }

.bs-avatar-wrap{ flex-shrink:0; border-radius:50%; overflow:hidden; }
.bs-avatar-wrap img, .bs-avatar-wrap .avatar-fallback{ width:100%; height:100%; }

/* =====================================================================
   一眼秒殺(Dobble / Spot it)
   ===================================================================== */
:root {
  --db-accent: #ff8a3f;
  --db-accent-2: #35d0b0;
  --db-danger: #ff5473;
  --db-card: #f8efd9;
  --db-card-edge: #e4d3a1;
  --db-ink: #2a2145;
}

.db-topbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.db-remain{ font-size:12.5px; color:#9d93c2; font-weight:700; }
.db-remain b{ color:#fff; font-size:15px; font-variant-numeric:tabular-nums; }

.db-tower-wrap{ display:flex; flex-direction:column; align-items:center; margin-bottom:16px; }
.db-tower-disc{
  position:relative; width:228px; height:228px; max-width:70vw; max-height:70vw; border-radius:50%;
  background: radial-gradient(circle at 32% 28%, #fffceb, var(--db-card) 60%);
  border:5px solid var(--db-card-edge);
  box-shadow: 0 0 0 6px rgba(255,138,63,0.16), 0 20px 40px -12px rgba(0,0,0,0.5);
  container-type:size;
}
.db-tower-disc.flash{
  animation: db-towerPop .4s ease;
  box-shadow: 0 0 0 10px rgba(255,138,63,0.35), 0 20px 40px -12px rgba(0,0,0,0.5);
}
@keyframes db-towerPop{ 0%{ transform:scale(0.86) rotate(-5deg); } 60%{ transform:scale(1.05) rotate(2deg); } 100%{ transform:scale(1) rotate(0); } }
.db-tower-caption{ margin-top:10px; font-size:12.5px; color:#9d93c2; font-weight:700; }
.db-tower-caption b{ color:#fff; }

.db-mini-rank-label{ font-size:11px; color:#9d93c2; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; margin:0 2px 8px; }
.db-mini-rank{ display:flex; gap:7px; overflow-x:auto; padding-bottom:4px; margin-bottom:8px; }
.db-mini-rank-chip{
  flex:none; display:flex; align-items:center; gap:6px;
  background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12); border-radius:999px;
  padding:6px 12px; font-size:12.5px; font-weight:700; color:#9d93c2; white-space:nowrap;
}
.db-mini-rank-chip .dot{ width:8px; height:8px; border-radius:50%; flex:none; }
.db-mini-rank-chip .cnt{ color:#fff; font-variant-numeric:tabular-nums; margin-left:2px; }
.db-mini-rank-chip.me{ border-color:var(--db-accent); box-shadow:0 0 0 1px var(--db-accent) inset; color:#fff; }
.db-mini-rank-chip.lead .cnt{ color:var(--db-accent-2); }

.db-leader-note{ text-align:center; font-size:12.5px; color:var(--db-accent-2); font-weight:700; min-height:18px; margin-bottom:6px; }

.db-strip-label{ margin:6px 2px 8px; }
.db-strip-label span{ font-size:12px; color:#9d93c2; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; }

.db-pcard{
  background: rgba(255,255,255,0.07); border:1px solid rgba(255,255,255,0.12); border-radius:22px;
  padding:18px 16px 32px; text-align:center;
}
.db-pcard.shake{ animation: db-shakeX .38s ease; }
@keyframes db-shakeX{ 0%,100%{transform:translateX(0);} 20%{transform:translateX(-9px);} 40%{transform:translateX(8px);} 60%{transform:translateX(-5px);} 80%{transform:translateX(4px);} }

.db-pcard.urgent{ animation: db-urgentPulse 1.1s ease-in-out infinite; }
@keyframes db-urgentPulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(255,84,115,0); }
  50%{ box-shadow:0 0 0 8px rgba(255,84,115,0.22); }
}
.db-pcard.urgent .db-pcard-disc{ border-color:var(--db-danger); }

.db-pcard-stack{ position:relative; width:100%; max-width:260px; margin:0 auto; }
.db-stack-ghost{
  position:absolute; top:0; left:0; width:100%; aspect-ratio:1/1; border-radius:50%;
  background: radial-gradient(circle at 32% 28%, #fffceb, var(--db-card) 62%);
  border:5px solid var(--db-card-edge);
  box-shadow:0 12px 24px -14px rgba(0,0,0,0.45);
  transition: opacity .25s ease, transform .25s ease;
}
.db-stack-ghost.g1{ transform:translate(7px,8px) rotate(-3deg); z-index:2; }
.db-stack-ghost.g2{ transform:translate(13px,15px) rotate(-6deg); z-index:1; opacity:0.8; }
.db-stack-ghost.g3{ transform:translate(19px,22px) rotate(-9deg); z-index:0; opacity:0.6; }
.db-stack-ghost.hidden-ghost{ opacity:0; transform:translate(2px,2px) rotate(0deg) scale(0.9); }

.db-pcard-disc{
  position:relative; z-index:3; width:100%; aspect-ratio:1/1; border-radius:50%;
  background: radial-gradient(circle at 32% 28%, #fffceb, var(--db-card) 62%);
  border:5px solid var(--db-card-edge); cursor:pointer;
  box-shadow:0 16px 32px -14px rgba(0,0,0,0.5);
  container-type:size;
}
/* 圖示本質上是文字（emoji），手機瀏覽器預設會把文字當成可以「長按選取」的內容，
   長按或點的姿勢稍微久一點就會跳出「用 Google 搜尋⚪」這種原生選單，蓋住整個畫面、
   完全擋住點圖案這個動作。這裡把圖示（跟裝它們的圓盤）都設成不能被選取、不觸發
   長按選單，點擊才會單純只是點擊。 */
.db-tower-disc, .db-pcard-disc, .db-sym{
  -webkit-user-select:none; -moz-user-select:none; user-select:none;
  -webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
}
.db-sym{
  position:absolute; line-height:1;
  text-shadow:
    0 1.5px 0 rgba(42,33,69,0.35), 0 -1.5px 0 rgba(42,33,69,0.35),
    1.5px 0 0 rgba(42,33,69,0.35), -1.5px 0 0 rgba(42,33,69,0.35),
    0 2px 5px rgba(0,0,0,0.25);
}
.db-sym.match{ animation: db-symMatch .5s ease; }
@keyframes db-symMatch{
  0%{ transform:translate(-50%,-50%) scale(1); }
  45%{ transform:translate(-50%,-50%) scale(1.7); filter:drop-shadow(0 0 6px var(--db-accent)); }
  100%{ transform:translate(-50%,-50%) scale(0); }
}

@media (max-width:380px){
  .db-tower-disc{ width:190px; height:190px; }
  .db-pcard-stack{ max-width:210px; }
}

/* =====================================================================
   裁縫大師
   ===================================================================== */
:root {
  --tl-accent: #e0a83c;
  --tl-card-face: #f6ecd9;
  --tl-card-edge: #caa96b;
  --tl-card-line: #b3925f;
  --tl-good: #5cb87a;
  --tl-bad: #ff6b6b;
}

.tl-topbar{ display:flex; gap:14px; align-items:flex-start; margin-bottom:12px; }

.tl-target-swatch{
  width:70px; height:70px; position:relative; overflow:hidden; border-radius:15px; flex:none;
  background:#000; filter:drop-shadow(0 8px 14px rgba(0,0,0,0.45));
}
.tl-target-swatch.big{ width:150px; height:150px; margin:0 auto 14px; border-radius:22px; }
.tl-fabric-layer{ position:absolute; left:0; top:0; }
.tl-fabric-layer svg{ display:block; }
.tl-card-svg{ position:absolute; inset:0; width:100%; height:100%; }

.tl-roster{
  flex:1; min-width:0; display:grid; grid-auto-flow:column; grid-template-rows:repeat(4,auto);
  column-gap:16px; row-gap:5px; align-content:center;
}
.tl-roster-row{ display:flex; align-items:baseline; gap:7px; font-size:12px; min-width:0; }
.tl-roster-row .dot{ width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,0.35); flex:none; }
.tl-roster-row .nm{ color:rgba(255,255,255,0.65); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tl-roster-row .sc{ font-weight:800; font-size:13.5px; color:rgba(255,255,255,0.65); margin-left:auto; font-variant-numeric:tabular-nums; }
.tl-roster-row.me .dot{ background: var(--tl-accent); }
.tl-roster-row.me .nm{ color:#fff; font-weight:700; }
.tl-roster-row.me .sc{ color: var(--tl-accent); }
.tl-roster-row.out .nm{ opacity:0.4; text-decoration:line-through; }
.tl-roster-row.out .sc{ opacity:0.4; }

.tl-status-strip{
  text-align:center; font-size:12.5px; font-weight:700; padding:9px 10px; border-radius:12px;
  margin-bottom:10px; background:rgba(255,255,255,0.06); color:rgba(255,255,255,0.65);
  border:1px solid rgba(255,255,255,0.1); min-height:16px; transition:background .2s, color .2s;
}
.tl-status-strip.good{ background:rgba(92,184,122,0.18); color: var(--tl-good); border-color:rgba(92,184,122,0.4); }
.tl-status-strip.bad{ background:rgba(255,107,107,0.18); color: var(--tl-bad); border-color:rgba(255,107,107,0.4); }

.tl-board-wrap{
  position:relative; width:100%; aspect-ratio:1/1; border-radius:20px; overflow:visible;
  box-shadow:0 18px 40px rgba(0,0,0,0.5); touch-action:none;
}
.tl-board-wrap .tl-board-bg{ position:absolute; inset:0; border-radius:20px; overflow:hidden; }
.tl-board-wrap .tl-board-bg svg{ display:block; width:100%; height:100%; }

.tl-drag-card{
  position:absolute; cursor:grab; filter:drop-shadow(0 10px 20px rgba(0,0,0,0.55));
  transition:filter .15s; touch-action:none;
}
.tl-drag-card:active{ cursor:grabbing; }
.tl-drag-card.locked{ pointer-events:none; opacity:0.5; filter:grayscale(0.6) drop-shadow(0 6px 12px rgba(0,0,0,0.4)); }
.tl-drag-card svg{ display:block; width:100%; height:100%; overflow:visible; }
.tl-card-face{ fill: var(--tl-card-face); stroke: var(--tl-card-edge); stroke-width:2.5; }
.tl-card-inset{ fill:none; stroke: var(--tl-card-line); stroke-width:2; stroke-dasharray:5 5; opacity:0.85; }
.tl-card-tick{ stroke: var(--tl-card-line); stroke-width:2.4; stroke-linecap:round; opacity:0.85; }
.tl-card-dot{ fill:none; stroke: var(--tl-card-line); stroke-width:2.4; opacity:0.85; }

.tl-controls{ display:flex; align-items:center; gap:12px; margin-top:14px; }
.tl-type-toggle{
  flex:none; width:58px; height:58px; padding:7px; margin:0; border-radius:16px;
  border:1px solid rgba(255,255,255,0.12); background:rgba(255,255,255,0.07);
  display:flex; align-items:center; justify-content:center;
}
.tl-type-toggle svg{ width:100%; height:100%; display:block; overflow:visible; }
.tl-buzzer{
  flex:1; height:58px; margin:0;
  background:linear-gradient(180deg,#f0bd5c,var(--tl-accent)); color:#2e1c02;
}
.tl-buzzer:disabled{ background:#4a4038; color:#8a7c66; }

.tl-rot-hint{ margin-top:14px; font-size:11px; line-height:1.6; }

.tl-reveal-swatchwrap{ display:flex; justify-content:center; }

.tl-audio-bar{ display:flex; justify-content:flex-end; margin-bottom:8px; }
/* 還在等人的時候沒有聲音可以關，先不顯示（見 client.js 的 is-setup） */
body.is-setup .tl-audio-bar{ display:none; }
.tl-mute-btn{
  flex:none; width:34px; height:34px; padding:0; margin:0; border-radius:50%;
  border:1px solid rgba(255,255,255,0.14); background:rgba(255,255,255,0.07);
  color:rgba(255,255,255,0.85); font-size:15px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.tl-mute-btn.is-muted{ opacity:0.5; }

/* 公布結果快閃提示：不切換畫面，直接疊在搶答畫面上方，秀一下就自動淡出 */
.tl-result-toast{
  position:fixed; top:14px; left:50%; transform:translateX(-50%) translateY(-14px);
  z-index:40; max-width:min(92vw, 420px); text-align:center;
  padding:12px 22px; border-radius:999px; font-size:15px; font-weight:700;
  background:rgba(20,16,10,0.92); color:#fff; box-shadow:0 10px 26px rgba(0,0,0,0.4);
  border:1px solid rgba(255,255,255,0.14);
  opacity:0; pointer-events:none; transition:opacity 0.22s ease, transform 0.22s ease;
}
.tl-result-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.tl-result-toast.good{ border-color:var(--tl-good); color:var(--tl-good); }
.tl-result-toast.bad{ border-color:var(--tl-bad); color:var(--tl-bad); }

/* ===================== 全域聊天室（浮動按鈕 + 從下滑出的面板） ===================== */
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  z-index: 500;
}
.chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #e63c30;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #241f42;
}
.chat-panel {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  height: min(70vh, 560px);
  /* 手機瀏覽器對 vh 的計算通常「不會」把彈出的螢幕鍵盤算進去，導致鍵盤跳出來的時候
     這個用 vh 算出來的高度沒有跟著縮小，面板整個被鍵盤蓋住大半。dvh（動態視窗高度）
     在支援的瀏覽器上會隨鍵盤開關即時調整，所以在後面用同樣的寫法再蓋一次高度：
     不支援 dvh 的瀏覽器會直接忽略這行，維持上面 vh 的寫法。真正精準的定位還是靠
     client.js 用 visualViewport API 動態設定 inline style（見 syncChatPanelViewport）。 */
  height: min(70dvh, 560px);
  max-height: 90vh;
  max-height: 90dvh;
  background: #201c3d;
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  z-index: 501;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.45);
  /* bottom/height 會在鍵盤開啟時被 JS 覆寫成 inline style，這裡加一點過渡讓調整不要太突兀 */
  transition: bottom 0.15s ease;
}
.chat-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 600;
  flex: none;
}
.chat-abort-btn {
  width: auto;
  padding: 5px 10px;
  margin: 0 8px 0 auto;
  background: rgba(255,90,90,0.18);
  border: 1px solid rgba(255,120,120,0.45);
  color: #ffb3b3;
  font-size: 13px;
  font-weight: 600;
}
.chat-close-btn {
  width: auto;
  padding: 5px 12px;
  margin: 0;
  background: rgba(255,255,255,0.1);
  font-size: 14px;
  font-weight: 600;
}
/* 分頁式聊天室：本桌／大廳切換列，只在坐著的時候才會顯示（見 client.js updateChatTabsUI）。 */
.chat-tabs {
  display: none;
  gap: 6px;
  padding: 10px 16px 0;
  flex: none;
}
.chat-tab {
  flex: 1;
  width: auto;
  margin: 0;
  padding: 8px 0;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.07);
  color: inherit;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.6;
  transition: background 0.15s, opacity 0.15s;
}
.chat-tab.active {
  background: rgba(255,255,255,0.18);
  opacity: 1;
}
.chat-tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e63c30;
  margin-left: 5px;
  vertical-align: middle;
}
.chat-message-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-msg .chat-avatar { flex: none; }
.chat-msg .chat-body { display: flex; flex-direction: column; max-width: 76%; }
.chat-msg .chat-meta {
  font-size: 11px;
  opacity: 0.55;
  margin-bottom: 3px;
}
.chat-msg .chat-bubble {
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 14.5px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg.me { flex-direction: row-reverse; }
.chat-msg.me .chat-body { align-items: flex-end; }
.chat-msg.me .chat-bubble {
  background: linear-gradient(135deg, #ff5f9e, #ff8a5b);
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex: none;
}
.chat-input-row input {
  margin: 0;
  flex: 1;
}
.chat-send-btn {
  width: 46px;
  padding: 0;
  margin: 0;
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-send-btn svg { width: 22px; height: 22px; }

/* ---- 快捷語句列＋「催一下」名單（client.js 的「本桌彈幕＋催一下＋快捷語句」那一段） ---- */
.chat-quick-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 2px;
  overflow-x: auto;
  flex: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chat-quick-row::-webkit-scrollbar { display: none; }
.chat-chip {
  flex: none;
  width: auto;
  margin: 0;
  padding: 7px 13px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ecebff;
  white-space: nowrap;
}
.chat-chip-nudge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #f2c14e, #f0904a);
  border: none;
  color: #2b1700;
}
.chat-nudge-menu {
  position: absolute;
  left: 12px;
  bottom: 120px;
  width: min(260px, calc(100% - 24px));
  max-height: 50%;
  overflow-y: auto;
  background: #2d2958;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  padding: 8px;
  z-index: 2;
}
.chat-nudge-title { font-size: 13px; opacity: 0.7; padding: 4px 8px 6px; }
.chat-nudge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  text-align: left;
}
.chat-nudge-row:not(:disabled):hover { background: rgba(242,193,78,0.16); }
.chat-nudge-row:disabled { opacity: 0.55; }
.chat-nudge-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-nudge-hint { font-size: 12px; font-weight: 500; color: #f2c14e; white-space: nowrap; }
.chat-nudge-row:disabled .chat-nudge-hint { color: inherit; opacity: 0.8; }

/* ---- 本桌彈幕：從右邊飛到左邊，不擋點擊 ---- */
.danmaku-layer {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 14vh);
  height: 168px;
  overflow: hidden;
  pointer-events: none;
  z-index: 499;
}
.danmaku-item {
  position: absolute;
  left: 100%;
  white-space: nowrap;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 1px 4px #000, 0 0 8px rgba(0,0,0,0.8);
  animation-name: danmaku-fly;
  animation-timing-function: linear;
  animation-fill-mode: both;
}
.danmaku-item.nudge { color: #ffd76a; }
.danmaku-name { font-size: 14px; color: #ffd76a; margin-right: 6px; }
@keyframes danmaku-fly {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 100%)); }
}

/* ---- 被「催一下」時的提醒框 ---- */
.nudge-alert {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(5,10,9,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.nudge-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px #e3b650, inset 0 0 70px rgba(227,182,80,0.6);
  animation: nudge-pulse 1.1s ease-in-out infinite;
}
@keyframes nudge-pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.nudge-card {
  position: relative;
  width: min(330px, 100%);
  background: linear-gradient(180deg, #24453c, #1a332c);
  border: 1.5px solid #e3b650;
  border-radius: 22px;
  padding: 26px 20px 18px;
  text-align: center;
  color: #efe6cf;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.nudge-alert.show .nudge-card { animation: nudge-shake 0.6s ease-in-out 2; }
@keyframes nudge-shake {
  0%,100% { transform: translateX(0); }
  15%,45%,75% { transform: translateX(-7px); }
  30%,60%,90% { transform: translateX(7px); }
}
.nudge-bell {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: #e3b650;
  background: rgba(227,182,80,0.16);
  animation: nudge-ring 1.6s ease-in-out infinite;
  transform-origin: 50% 10%;
}
@keyframes nudge-ring {
  0%,40%,100% { transform: rotate(0); }
  5% { transform: rotate(16deg); } 10% { transform: rotate(-14deg); } 15% { transform: rotate(12deg); }
  20% { transform: rotate(-10deg); } 25% { transform: rotate(6deg); } 30% { transform: rotate(-3deg); }
}
.nudge-title { font-size: 22px; font-weight: 800; }
.nudge-sub { font-size: 15px; opacity: 0.7; margin: 6px 0 18px; }
.nudge-ok { background: #e3b650; color: #1a1404; font-weight: 800; margin: 0; }
.nudge-from { font-size: 13px; color: #e3b650; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .nudge-glow, .nudge-bell, .nudge-alert.show .nudge-card { animation: none; }
}

/* ---- 線上版語音（public/voice.js 動態加進來；離線版沒有這些元素） ---- */
.vc-mic {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: inherit;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.vc-mic svg { width: 22px; height: 22px; }
.vc-mic .vc-ic-off { display: none; }
.vc-mic.is-live { background: rgba(61,220,151,0.18); border-color: #3ddc97; color: #3ddc97; }
.vc-mic.is-live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 15px;
  border: 2px solid #3ddc97;
  opacity: 0;
  animation: vc-ring 1.6s infinite;
  pointer-events: none;
}
.vc-mic.is-muted { background: rgba(255,93,93,0.16); border-color: #ff5d5d; color: #ff5d5d; }
.vc-mic.is-muted .vc-ic-on { display: none; }
.vc-mic.is-muted .vc-ic-off { display: block; }
@keyframes vc-ring { 0% { opacity: .8; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.2); } }
.vc-fabbadge {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: #3ddc97;
  color: #06281a;
  border: 2px solid #241f42;
}
.vc-fabbadge svg { width: 12px; height: 12px; }
.vc-fabbadge .vc-ic-off { display: none; }
.vc-fabbadge.is-live, .vc-fabbadge.is-muted { display: flex; }
.vc-fabbadge.is-muted { background: #ff5d5d; color: #fff; }
.vc-fabbadge.is-muted .vc-ic-on { display: none; }
.vc-fabbadge.is-muted .vc-ic-off { display: block; }
.vc-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 10px 16px 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(61,220,151,0.1);
  border: 1px solid rgba(61,220,151,0.35);
  flex: none;
}
.vc-bar.show { display: flex; }
.vc-bar.is-muted { background: rgba(255,93,93,0.1); border-color: rgba(255,93,93,0.4); }
.vc-bar .vc-lbl { font-size: 12px; font-weight: 700; color: #3ddc97; white-space: nowrap; }
.vc-bar.is-muted .vc-lbl { color: #ff5d5d; }
.vc-people { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.vc-p { display: flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.vc-p .vc-av { width: 20px; height: 20px; border-radius: 50%; background: #8ecbff; color: #1a1433; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; box-shadow: 0 0 0 0 rgba(61,220,151,0); transition: box-shadow .12s; overflow: hidden; }
.vc-p .vc-av img { width: 100%; height: 100%; object-fit: cover; }
.vc-p.talk .vc-av { box-shadow: 0 0 0 3px #3ddc97; }
.vc-p .vc-wait { font-size: 11px; opacity: .6; }
.vc-toast {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
}
.vc-toast.show { opacity: 1; transform: translateX(-50%); }

/* =====================================================================
   上流社會
   這款遊戲刻意不用 App 原本活潑的桃紅／橘漸層，改用低調奢華、偏金屬感的配色
   （墨綠絨布 + 金色鑲邊 + 酒紅警示色），跟卡牌美術本身那種老油畫＋燙金畫框的
   質感比較搭，是使用者明確要求的「低調奢華」方向。
   ===================================================================== */
:root {
  --hs-felt-1: #0d2b20;
  --hs-felt-2: #153c2b;
  --hs-gold: #e8c574;
  --hs-gold-soft: rgba(232,197,116,0.4);
  --hs-gold-dim: rgba(232,197,116,0.16);
  --hs-cream: #f5ecd6;
  --hs-burgundy-1: #3a1220;
  --hs-burgundy-2: #541c2c;
  --hs-burgundy-line: rgba(232,197,116,0.3);
  --hs-brass-1: #5c4324;
  --hs-brass-2: #a9793f;
  --hs-ivory-ring: #cdbfa0;
}
#game-highsociety { font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif; }
#game-highsociety .rules-box { }

.hs-status-line { display:flex; justify-content:space-between; font-size:12.5px; color:var(--app-muted, rgba(255,255,255,0.6)); margin-bottom:14px; padding:0 2px; }
.hs-status-line b { color:var(--hs-cream); font-weight:700; }

.hs-stage {
  position:relative;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(232,197,116,0.16), transparent 60%),
    linear-gradient(160deg, var(--hs-felt-2), var(--hs-felt-1));
  border:1px solid var(--hs-gold-soft);
  border-radius:18px;
  padding:20px 16px 18px;
  text-align:center;
  overflow:hidden;
}
.hs-stage.warn {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(232,197,116,0.14), transparent 60%),
    linear-gradient(160deg, var(--hs-burgundy-2), var(--hs-burgundy-1));
  border-color:var(--hs-burgundy-line);
}
.hs-stage-eyebrow {
  font-family:"Cinzel",serif; font-size:11px; letter-spacing:3px; font-weight:600;
  color:var(--hs-gold); text-transform:uppercase; margin-bottom:12px; line-height:1.8;
}
.hs-stage-card-img { width:172px; max-width:60%; border-radius:10px; box-shadow:0 10px 26px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.3); margin-bottom:14px; }
.hs-stage-card-name { font-family:"Cinzel",serif; font-size:14px; font-weight:600; letter-spacing:0.5px; color:var(--hs-cream); margin-bottom:14px; }
.hs-stage-bid-label { font-size:12px; color:var(--hs-gold-soft); margin-bottom:8px; }
.hs-stage-bid-value { font-family:"Cinzel",serif; font-size:21px; font-weight:700; color:var(--hs-cream); line-height:1.1; }
.hs-stage-bid-who { font-size:12.5px; color:var(--app-muted, rgba(255,255,255,0.6)); margin-top:6px; }
.hs-stage-bid-who b { color:var(--hs-gold); font-weight:700; }

.hs-warn-ribbon {
  display:flex; align-items:center; gap:8px; text-align:left;
  background:rgba(0,0,0,0.28); border:1px solid var(--hs-burgundy-line);
  border-radius:12px; padding:10px 12px; margin:14px 0 4px; font-size:12.5px; line-height:1.5;
}
.hs-warn-ribbon .ico { font-size:18px; flex:none; }
/* 「只剩最後一張特殊卡」倒數提醒：用金色而不是負面卡的酒紅色，語氣是提醒不是警告 */
.hs-warn-ribbon-final { border-color:var(--hs-gold-soft); background:var(--hs-gold-dim); }

/* 玩家頭像列：不管 3、4 還是 5 人都要塞在「同一行」，不能被擠到換行——所以改成
   flex-wrap:nowrap，每個頭像格子用 flex:1 1 0 讓它們在窄螢幕上一起等比例縮小，
   而不是維持固定寬度硬擠到換行。名字/出價文字太長就用 ellipsis 省略號截斷。 */
.hs-players-strip { display:flex; flex-wrap:nowrap; justify-content:center; gap:6px; padding:22px 2px 4px; }
.hs-pchip { position:relative; flex:1 1 0; min-width:0; max-width:76px; text-align:center; }
.hs-pchip.passed { opacity:0.4; }
.hs-pchip .hs-avatar-wrap { width:44px; height:44px; border-radius:50%; margin:0 auto 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); overflow:hidden; }
.hs-pchip.leading .hs-avatar-wrap { box-shadow:0 0 0 3px var(--hs-gold), inset 0 0 0 1px rgba(255,255,255,0.12); }
.hs-pchip.turn .hs-avatar-wrap { box-shadow:0 0 0 2px var(--hs-ivory-ring), inset 0 0 0 1px rgba(255,255,255,0.12); animation:hs-turn-pulse 1.8s ease-in-out infinite; }
@keyframes hs-turn-pulse { 0%,100% { box-shadow:0 0 0 2px var(--hs-ivory-ring); } 50% { box-shadow:0 0 0 4px rgba(205,191,160,0.35); } }
.hs-pchip .hs-pname { font-size:11.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hs-pchip .hs-pbid { font-size:10.5px; color:var(--app-muted, rgba(255,255,255,0.6)); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hs-pchip.leading .hs-pbid { color:var(--hs-gold); font-weight:700; }

/* 「舉牌出價」提示：有人出價的瞬間，頭像正上方彈出一個像拍賣官舉牌一樣的金額氣泡 */
.hs-bid-callout {
  position:absolute; left:50%; top:0; z-index:6;
  transform:translate(-50%, 10px) scale(0.7); opacity:0; pointer-events:none;
  background:linear-gradient(135deg, #f0d38f, #b98f4e); color:#2a1d0c;
  font-size:11px; font-weight:800; white-space:nowrap;
  padding:3px 9px; border-radius:999px; box-shadow:0 4px 10px rgba(0,0,0,0.45);
}
.hs-bid-callout.play { animation:hs-bid-callout-anim 1.6s cubic-bezier(.32,1.4,.5,1) forwards; }
@keyframes hs-bid-callout-anim {
  0% { opacity:0; transform:translate(-50%, 10px) scale(0.65); }
  18% { opacity:1; transform:translate(-50%, -28px) scale(1.08); }
  28% { transform:translate(-50%, -25px) scale(1); }
  78% { opacity:1; transform:translate(-50%, -25px) scale(1); }
  100% { opacity:0; transform:translate(-50%, -34px) scale(0.94); }
}

.hs-turn-banner {
  text-align:center; font-size:13px; font-weight:700; color:#1e1b3a;
  background:var(--hs-gold); border-radius:999px; padding:6px 14px; margin:2px auto 14px; width:fit-content;
}

.hs-hand-section-title { font-size:12px; color:var(--app-muted, rgba(255,255,255,0.6)); margin:0 0 8px; display:flex; justify-content:space-between; }
.hs-played-pile { display:flex; align-items:center; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.hs-played-pile .hs-chip-mini { width:48px; border-radius:5px; box-shadow:0 3px 8px rgba(0,0,0,0.4); }
.hs-played-pile .hs-pile-total { display:flex; align-items:center; font-size:12.5px; color:var(--hs-gold); font-weight:700; padding-left:4px; }

/* 手牌：像真的拿在手上一樣扇形攤開，用 JS 依卡片數量算出每張的旋轉角度 */
.hs-hand-fan-wrap { overflow-x:auto; padding:44px 10px 14px; }
.hs-hand-fan { display:flex; width:fit-content; margin:0 auto; padding-left:36px; }
.hs-hand-fan img {
  width:92px; border-radius:8px; flex:none; cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,0.45);
  margin-left:-48px; transform-origin:bottom center;
  transition:box-shadow .15s ease, opacity .15s ease;
  position:relative;
}
.hs-hand-fan img:first-child { margin-left:0; }
.hs-hand-fan img.selected { box-shadow:0 0 0 1.5px var(--hs-gold), 0 10px 20px rgba(0,0,0,0.55); z-index:9; }
.hs-hand-fan img.disabled { opacity:0.35; cursor:not-allowed; }

/* 「我準備好了」確認面板：純粹給大家互相確認參考用，不會鎖住開始遊戲的按鈕 */
.hs-ready-btn {
  display:block; width:100%; padding:11px 6px; border-radius:10px; font-size:13px; font-weight:700;
  font-family:inherit; cursor:pointer; text-align:center;
  background:rgba(255,255,255,0.05); color:var(--hs-cream); border:1px solid var(--hs-gold-soft);
}
.hs-ready-btn.is-ready {
  background:linear-gradient(135deg, #d9b976, #96723c); color:#2a1d0c; border-color:transparent;
  box-shadow:0 4px 14px rgba(150,114,60,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
}

.hs-btn-row { display:flex; gap:8px; }
.hs-btn-row button {
  flex:1; padding:10px 6px; border:none; border-radius:10px; font-size:13px; font-weight:700;
  font-family:inherit; cursor:pointer; text-align:center; line-height:1.4; margin-bottom:0;
}
.hs-btn-primary {
  background:linear-gradient(135deg, #d9b976, #96723c);
  color:#2a1d0c;
  box-shadow:0 4px 14px rgba(150,114,60,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
}
.hs-btn-outline {
  background:rgba(255,255,255,0.05); color:var(--hs-cream);
  border:1px solid var(--hs-gold-soft) !important;
}
.hs-btn-row button:disabled { opacity:0.4; cursor:not-allowed; }
.hs-helper-note { text-align:center; font-size:11.5px; color:var(--app-muted, rgba(255,255,255,0.6)); margin-top:8px; }

/* ---------- 成交／定案畫面 ---------- */
.hs-sold-stage {
  position:relative; width:100%; max-width:260px; aspect-ratio:9/16; margin:0 auto;
  border-radius:22px; overflow:hidden; background:#000;
  border:1px solid var(--hs-gold-soft); box-shadow:0 20px 46px rgba(0,0,0,0.55);
}
.hs-sold-stage video { width:100%; height:100%; object-fit:cover; display:block; }
/* 第 4 張特殊卡「遊戲結束」提示：不是真的成交，不播放落槌動畫，改成靜態秀出這張卡本身 */
.hs-sold-end-bg { display:none; position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.hs-sold-stage.gameend video { display:none; }
.hs-sold-stage.gameend .hs-sold-end-bg { display:block; }
.hs-sold-stage.gameend { border-color:var(--hs-gold); box-shadow:0 20px 46px rgba(0,0,0,0.55), 0 0 0 1px var(--hs-gold-soft) inset; }
.hs-sold-stage.gameend .hs-sold-overlay { opacity:1; transform:translateY(0); background:linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0.15)); }
/* 負面卡定案：落槌動畫是「拍賣成交」的意象，跟「你倒楣了」的負面卡不搭，使用者反應
   不需要這段——改成跟遊戲結束畫面同一招，直接靜態秀出這張卡本身，配色調成偏酒紅／
   低飽和，呼應負面卡一貫的警示語氣，不會有落槌的視覺（也就不會有對應的落槌音效）。 */
.hs-sold-stage.negative video { display:none; }
.hs-sold-stage.negative .hs-sold-end-bg { display:block; filter:saturate(0.5) sepia(0.35) hue-rotate(-22deg) brightness(0.8) contrast(1.12); }
.hs-sold-stage.negative { border-color:var(--hs-burgundy-line); box-shadow:0 20px 46px rgba(0,0,0,0.55), 0 0 0 1px rgba(139,58,58,0.35) inset; }
.hs-sold-stage.negative .hs-sold-overlay { opacity:1; transform:translateY(0); }
.hs-sold-overlay {
  position:absolute; inset:auto 0 0 0; display:flex; align-items:center; gap:10px;
  padding:14px; background:linear-gradient(0deg, rgba(0,0,0,0.85), rgba(0,0,0,0));
  opacity:0; transform:translateY(8px); transition:opacity .3s ease, transform .3s ease;
}
.hs-sold-overlay.show { opacity:1; transform:translateY(0); }
.hs-sold-overlay img { width:42px; border-radius:5px; box-shadow:0 4px 10px rgba(0,0,0,0.5); flex:none; }
.hs-sold-kicker { font-size:10.5px; letter-spacing:2px; color:var(--hs-gold); text-transform:uppercase; }
.hs-sold-name { font-family:"Cinzel",serif; font-size:17px; font-weight:700; color:var(--hs-cream); line-height:1.25; }
.hs-sold-sub { font-size:12.5px; color:var(--hs-cream); margin-top:2px; line-height:1.4; }

/* ---------- 雅賊夜訪：選一張要棄掉的奢侈品卡 ---------- */
.hs-theft-choices { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:12px; }
.hs-theft-choices img { width:76px; border-radius:8px; cursor:pointer; box-shadow:0 4px 10px rgba(0,0,0,0.45); transition:transform .15s ease, box-shadow .15s ease; }
.hs-theft-choices img:hover { transform:translateY(-4px); box-shadow:0 0 0 2px var(--hs-gold), 0 10px 20px rgba(0,0,0,0.55); }

/* ---------- 結算畫面 ---------- */
.hs-final-header { text-align:center; margin-bottom:16px; }
.hs-final-header .big { font-family:"Cinzel",serif; font-size:22px; color:var(--hs-gold); font-weight:700; }
.hs-final-header .sub { font-size:12.5px; color:var(--app-muted, rgba(255,255,255,0.6)); margin-top:4px; }
.hs-rank-row { display:flex; align-items:center; gap:12px; padding:12px 4px; border-bottom:1px solid rgba(255,255,255,0.08); }
.hs-rank-row:last-child { border-bottom:none; }
.hs-rank-row.out { opacity:0.45; }
.hs-rank-num { width:22px; text-align:center; font-family:"Cinzel",serif; font-weight:700; color:var(--app-muted, rgba(255,255,255,0.6)); flex:none; }
.hs-rank-row.win .hs-rank-num { color:var(--hs-gold); font-size:18px; }
.hs-rank-avatar { width:40px; height:40px; border-radius:50%; flex:none; overflow:hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.hs-rank-mid { flex:1; min-width:0; }
.hs-rank-name { font-size:14px; font-weight:700; display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.hs-rank-cash { font-size:11.5px; color:var(--app-muted, rgba(255,255,255,0.6)); margin-top:1px; }
.hs-rank-items { display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; }
.hs-rank-items .hs-item-wrap { position:relative; flex:none; }
.hs-rank-items .hs-item-thumb { display:block; width:26px; border-radius:4px; box-shadow:0 2px 5px rgba(0,0,0,0.4); }
.hs-rank-items .hs-badge { position:absolute; bottom:-4px; right:-4px; background:var(--hs-gold); color:#1e1b3a; font-size:8.5px; font-weight:800; border-radius:999px; padding:1px 3px; line-height:1.3; min-width:12px; text-align:center; }
.hs-rank-score { font-family:"Cinzel",serif; font-size:20px; font-weight:700; color:var(--hs-cream); flex:none; text-align:right; }
.hs-rank-row.win .hs-rank-score { color:var(--hs-gold); }
.hs-out-tag { font-size:10.5px; font-weight:700; color:#ff9a9a; background:rgba(255,80,80,0.12); border-radius:999px; padding:2px 7px; }

/* ---------- 現金／地位分數／「我的收藏」入口：貼在玩家頭像下面 ---------- */
.hs-score-row {
  display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap;
  background:rgba(0,0,0,0.22); border:1px solid var(--hs-gold-soft);
  border-radius:14px; padding:10px 12px; margin:14px 0;
}
/* 現金金額換算成中文之後（例如「一億六百萬」）字數不算少，這裡務必 nowrap：CJK 文字
   在空間不夠時預設會逐字換行，一旦跟旁邊的「我的收藏」按鈕擠在同一個 flex row 裡，
   曾經整組數字被拆成一直行、一個字一行的慘況（真的碰到大額現金測出來的）；改成
   nowrap 之後，真的放不下就靠 .hs-score-row 的 flex-wrap 讓按鈕整個換到下一行，
   金額本身永遠維持同一行不會被拆散。 */
.hs-score-text { font-size:13px; color:var(--app-muted, rgba(255,255,255,0.6)); white-space:nowrap; }
.hs-score-text b { color:var(--hs-gold); font-family:"Cinzel",serif; font-size:15px; font-weight:700; }
.hs-collection-btn {
  display:flex; align-items:center; gap:6px; flex:none; white-space:nowrap;
  background:var(--hs-gold-dim); border:1px solid var(--hs-gold-soft); color:var(--hs-cream);
  border-radius:999px; padding:8px 13px; font-size:12.5px; font-weight:600;
  font-family:inherit; cursor:pointer; transition:transform .15s ease, background .15s ease;
}
.hs-collection-btn:hover { background:var(--hs-gold-soft); }
.hs-collection-btn:active { transform:scale(0.96); }
.hs-collection-count {
  background:var(--hs-gold); color:#231705; border-radius:999px;
  font-size:11px; font-weight:800; padding:1px 7px; font-family:"Cinzel",serif;
}

/* ---------- 「我的收藏」全螢幕瀏覽 ---------- */
.hs-collection-overlay {
  position:fixed; inset:0; z-index:60;
  max-width:480px; margin:0 auto;
  background:linear-gradient(180deg, rgba(10,14,10,0.98), rgba(5,8,6,0.995));
  display:flex; flex-direction:column;
}
.hs-collection-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:calc(env(safe-area-inset-top, 0px) + 16px) 16px 6px;
  border-bottom:1px solid var(--hs-gold-soft); flex:none;
}
.hs-collection-head h2 { font-family:"Cinzel",serif; font-size:16px; letter-spacing:1px; margin:0; color:var(--hs-cream); font-weight:700; }
.hs-collection-score-pill { font-size:12px; color:var(--app-muted, rgba(255,255,255,0.6)); margin:3px 0 0; }
.hs-collection-score-pill b { color:var(--hs-gold); font-family:"Cinzel",serif; font-size:15px; }
.hs-collection-close {
  width:34px; height:34px; border-radius:50%; border:1px solid var(--hs-gold-soft);
  background:rgba(255,255,255,0.05); color:var(--hs-cream); font-size:17px; line-height:1;
  cursor:pointer; display:flex; align-items:center; justify-content:center; flex:none;
}
.hs-collection-viewport {
  flex:1; display:flex; align-items:stretch; justify-content:center; gap:2px;
  padding:18px 4px 6px; min-height:0; touch-action:pan-y;
}
.hs-collection-nav {
  flex:none; align-self:center; width:38px; padding:12px 2px;
  background:none; border:none; color:var(--hs-gold);
  font-size:34px; line-height:1; font-family:Georgia,"Cinzel",serif; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:opacity .15s ease, transform .15s ease;
}
.hs-collection-nav:hover { opacity:0.7; }
.hs-collection-nav:active { transform:scale(0.88); }
.hs-collection-nav[disabled] { opacity:0.2; cursor:default; }
.hs-collection-slot {
  flex:1; min-height:0; max-width:250px; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:10px; min-width:0;
}
.hs-collection-art-wrap {
  position:relative; flex:1 1 auto; min-height:0; width:auto; max-width:220px; aspect-ratio:2/3;
  border-radius:16px; overflow:hidden;
  border:1px solid var(--hs-gold-soft); box-shadow:0 18px 40px rgba(0,0,0,0.55);
  background:linear-gradient(160deg, var(--hs-felt-2), var(--hs-felt-1));
}
.hs-collection-art-wrap.negative { background:linear-gradient(160deg, var(--hs-burgundy-2), var(--hs-burgundy-1)); border-color:var(--hs-burgundy-line); }
.hs-collection-art-wrap img { width:100%; height:100%; object-fit:cover; display:block; }
.hs-collection-card-name { flex:none; font-family:"Cinzel",serif; font-size:15px; font-weight:700; color:var(--hs-cream); text-align:center; line-height:1.3; }
.hs-collection-card-effect { flex:none; font-size:12.5px; color:var(--hs-gold); text-align:center; font-weight:600; }
.hs-collection-card-meta { flex:none; font-size:11px; color:var(--app-muted, rgba(255,255,255,0.6)); text-align:center; }
.hs-collection-pager { flex:none; display:flex; flex-direction:column; align-items:center; gap:10px; padding:8px 16px 18px; }
.hs-collection-pager-count { font-family:"Cinzel",serif; font-size:13px; color:var(--hs-cream); letter-spacing:1px; }
.hs-collection-pager-count b { color:var(--hs-gold); }
.hs-collection-dots { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; max-width:280px; }
.hs-collection-dots span { width:6px; height:6px; border-radius:50%; background:rgba(245,236,214,0.25); transition:background .2s ease, transform .2s ease; flex:none; }
.hs-collection-dots span.active { background:var(--hs-gold); transform:scale(1.3); }
.hs-collection-filmstrip { flex:none; display:flex; gap:8px; padding:0 16px 16px; overflow-x:auto; scrollbar-width:none; }
.hs-collection-filmstrip::-webkit-scrollbar { display:none; }
.hs-collection-filmstrip button {
  flex:none; width:40px; height:56px; border-radius:8px; padding:0; overflow:hidden;
  border:1.5px solid transparent; background:rgba(255,255,255,0.04); cursor:pointer;
  opacity:0.55; transition:opacity .15s ease, border-color .15s ease;
}
.hs-collection-filmstrip button.active { opacity:1; border-color:var(--hs-gold); }
.hs-collection-filmstrip img { width:100%; height:100%; object-fit:cover; display:block; }
.hs-collection-breakdown { flex:none; margin:0 16px 16px; border-top:1px dashed var(--hs-gold-soft); padding-top:10px; }
.hs-collection-breakdown summary { font-size:11.5px; color:var(--app-muted, rgba(255,255,255,0.6)); cursor:pointer; list-style:none; }
.hs-collection-breakdown summary::-webkit-details-marker { display:none; }
.hs-collection-breakdown summary::before { content:"▸ "; color:var(--hs-gold); }
.hs-collection-breakdown[open] summary::before { content:"▾ "; }
.hs-collection-breakdown-body { font-size:12px; color:var(--hs-cream); margin-top:8px; line-height:1.9; }
.hs-collection-breakdown-body .row { display:flex; justify-content:space-between; }
.hs-collection-breakdown-body .final { color:var(--hs-gold); font-weight:700; font-family:"Cinzel",serif; font-size:14px; border-top:1px solid var(--hs-gold-soft); margin-top:6px; padding-top:6px; }

/* =====================================================================
   阿瓦隆（Avalon）專屬樣式：深藍夜幕＋金色紋章的圓桌騎士風格，跟大廳／其他遊戲
   共用同一份深色底盤，只有 #game-avalon 內部套用這組配色。
   ===================================================================== */
/* 跟設計稿一樣用襯線字（Noto Serif TC）營造中世紀羊皮紙的質感，不是平台其他遊戲慣用
   的無襯線字——這是阿瓦隆刻意跟其他遊戲拉開的視覺差異，不要改回無襯線。 */
#game-avalon { font-family: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif; }

/* ---- 整頁沉浸主題：坐在阿瓦隆這一桌時，body 本身的背景／通用標題都換成阿瓦隆的深藍
   底盤，不要露出大廳共用的粉紫色背景跟「派對遊戲」標題——這是跟設計稿差最多的地方，
   設計稿是滿版沉浸畫面，沒有平台共用的外層 chrome。由 client.js / host.js 在 body 上
   切換這個 class，離開這一桌／回大廳就會自動拿掉，不影響其他遊戲。 ---- */
body.theme-avalon {
  background: radial-gradient(120% 70% at 50% -10%, #1c2b52 0%, #101a33 45%, #0a1224 100%);
}
body.theme-avalon h1 { display: none; }
body.theme-avalon .chat-fab {
  background: linear-gradient(160deg, #25335c, #141c38);
  border: 1.5px solid #e8c873;
}
#game-avalon {
  --av-gold: #e8c873;
  --av-gold-soft: rgba(232,200,115,0.35);
  --av-gold-dim: rgba(232,200,115,0.12);
  --av-ink: #f2e8d3;
  --av-muted: #8f9bc4;
  /* body 是 display:flex; flex-direction:column; align-items:center，每個 .game-root
     預設會用 fit-content 依自己內容的天然寬度「縮到剛好」再置中，而不是填滿版面——
     這就是為什麼不同畫面（內容多寡不同）外框寬度會兜不起來（Derek 回報：選擇出征隊伍
     跟隊伍表決兩個畫面外框寬度不一致）。這裡讓阿瓦隆的畫面統一改成跟 .container 一樣
     「填滿可用寬度、上限 480px」，畫面之間才會有一致、可預期的外框寬度。 */
  width: 100%;
  max-width: 480px;
}
#game-avalon .card {
  background: radial-gradient(120% 70% at 50% -10%, #1c2b52 0%, #101a33 45%, #0a1224 100%);
  border: 1px solid var(--av-gold-soft);
  position: relative;
  overflow: hidden;
}
/* 跟原本設計稿的 .noise 疊層同一招：一層極淡的雜訊紋理，讓深色底盤不會看起來太平/太乾淨 */
#game-avalon .card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
}
#game-avalon .av-title {
  font-family:"Cinzel",serif; text-align:center; letter-spacing:2px; color:var(--av-ink); font-weight:700;
}

/* ---- 通用按鈕：整個平台共用的粉橘漸層按鈕，在阿瓦隆裡改成深藍＋金邊，呼應設計稿
   （開始遊戲／確認組隊／我準備好了／再玩一局…這些共用元件的按鈕都套用這組配色）。
   表決／任務執行用的是各自的卡牌圖案按鈕（.av-vote-btn / .av-mission-btn），不受這裡影響。 ---- */
#game-avalon button:not(.av-vote-btn):not(.av-mission-btn):not(.dock-btn) {
  background: linear-gradient(160deg, #25335c, #141c38);
  border: 1.5px solid var(--av-gold);
  color: #f6ddA0;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 1.5px;
}
#game-avalon button.secondary:not(.av-vote-btn):not(.av-mission-btn):not(.dock-btn) {
  background: rgba(143,155,196,0.08);
  border: 1px solid rgba(143,155,196,0.35);
  color: var(--av-muted);
}
#game-avalon button:disabled { opacity: 0.35; }
/* .dock-btn（底部「你的狀態」面板裡的確認按鈕）刻意跟設計稿一樣是實心金色漸層，
   不是上面那組深藍＋金邊——所以要排除在通用按鈕樣式之外，見 .av-status-dock .dock-btn。 */

/* ---- 任務軌道（頭部小圓圈：本輪進度＋每輪任務成功/失敗結果）----
   Derek 的回饋：戰況版圖裡本來就有一份任務進度了，所以「查看戰況版圖」那個畫面不需要
   再顯示這個縮小版；但選擇出征隊伍／隊伍表決／任務執行這幾個畫面最上面還是要留著，
   讓玩家不用特地點進戰況版圖也能隨時看到目前進度。 ---- */
.av-track { display:flex; justify-content:space-between; align-items:center; gap:4px; margin:10px 0 4px; }
.av-track-item { display:flex; flex-direction:column; align-items:center; gap:3px; }
.av-track-dot {
  width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:"Cinzel",serif; font-size:11px; color:var(--av-muted); border:1.5px solid rgba(143,155,196,0.5); flex:none;
}
.av-track-dot.current { border-color:var(--av-gold); color:var(--av-gold); box-shadow:0 0 0 4px var(--av-gold-dim); font-weight:700; }
.av-track-dot img { width:28px; height:28px; border-radius:50%; display:block; }
.av-track-size { text-align:center; font-size:10.5px; color:var(--av-muted); margin-bottom:10px; }

/* ---- 陣營資訊卡（洞察）：梅林看到的壞人名單、派西維爾看到的候選人 ---- */
.av-role-card { text-align:center; padding:20px 16px; }
.av-role-card img {
  width:150px; border-radius:12px; margin-bottom:12px;
  /* 呼應設計稿身分卡背後的金色光暈：陰影＋一圈金邊光 */
  box-shadow: 0 14px 34px rgba(0,0,0,0.6), 0 0 0 1px rgba(232,200,115,0.5), 0 0 30px rgba(232,200,115,0.3);
}
.av-role-name { font-family:"Cinzel",serif; font-size:20px; color:var(--av-gold); font-weight:700; margin-bottom:6px; }
.av-role-team { font-size:12.5px; margin-bottom:10px; }
.av-role-team.good { color:#8fd3a0; }
.av-role-team.evil { color:#e08a8a; }
.av-role-desc { font-size:13.5px; line-height:1.7; color:var(--av-ink); opacity:0.9; }
.av-insight-box { margin-top:16px; padding-top:16px; border-top:1px dashed var(--av-gold-soft); }
.av-insight-title { font-size:12.5px; color:var(--av-gold); text-align:center; margin-bottom:10px; }
.av-insight-list { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.av-insight-chip {
  display:inline-flex; align-items:center; gap:5px; padding:6px 12px; border-radius:999px;
  font-size:13px; background:rgba(224,138,138,0.15); border:1px solid rgba(224,138,138,0.4); color:var(--av-ink);
}

/* ---- 畫面標頭：ROUND N（Cinzel 小字）＋ 大標題，跟設計稿每個畫面最上面的抬頭一致，
   左右兩顆圓形按鈕：左邊「返回」只在戰況版圖畫面上有作用，右邊「查看戰況」在組隊／表決／
   任務執行都能點開戰況版圖（設計稿裡原本就有的④號畫面，之前完全沒做進遊戲，是本輪要補的）。 ---- */
.av-screen-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:2px; }
.av-screen-head .icon-btn {
  width:40px; height:40px; border-radius:50%; border:1px solid var(--av-gold-soft); flex:none;
  display:flex; align-items:center; justify-content:center; background:transparent; cursor:pointer; padding:0;
}
.av-screen-head .icon-btn svg { display:block; }
.av-screen-head .icon-btn.invisible { visibility:hidden; }
.av-screen-head .titles { text-align:center; flex:1; }
.av-screen-head .round-eyebrow { font-family:"Cinzel",serif; font-size:11px; letter-spacing:3px; color:var(--av-muted); }
.av-screen-head .big-title { font-size:19px; font-weight:900; color:var(--av-ink); letter-spacing:1px; margin-top:2px; }
.av-team-pill {
  display:inline-block; margin:10px auto 0; text-align:center; font-size:10.5px; color:var(--av-muted);
  background:rgba(232,200,115,0.08); border:1px solid rgba(232,200,115,0.3); border-radius:20px; padding:5px 14px;
}
.av-team-pill b, .av-team-pill strong { color:var(--av-gold); font-weight:700; }
.av-pill-row { text-align:center; }

/* ---- 出征名單／表決／任務執行的座位圖：Derek 用互動 MOCKUP 確定下來的「圓桌」佈局——
   上／左／右三邊排開其他玩家（自己固定在畫面最下面的「你的狀態」面板，不在這裡重複畫），
   頭像跟卡牌是各自獨立定位的元素（頭像永遠在外緣，卡牌永遠在內側），卡牌整組依欄位旋轉
   讓牌面「面向桌子中央」；同一邊人數不同時，彼此間距也會跟著動態縮放（見 sideSeatY()），
   不會像之前五、六人局那樣硬撐出一大段空白。 ---- */
.av-table-area { position:relative; width:100%; margin:12px 0; transition: height 0.15s ease; }
.av-seat-avatar {
  position:absolute; transform:translate(-50%,-50%); display:flex; flex-direction:column; align-items:center;
}
.av-seat-avatar .avatar {
  width:34px; height:34px; border-radius:50%; background:#2a3968; opacity:0.75;
  display:flex; align-items:center; justify-content:center; color:var(--av-ink); font-weight:700; font-size:12px;
  border:2px solid rgba(143,155,196,0.4);
}
.av-seat-avatar.me .avatar {
  opacity:1; border-color: var(--av-gold); box-shadow: 0 0 0 4px rgba(232,200,115,0.12); background:#3a3320; color:var(--av-gold);
}
.av-seat-avatar.highlight .avatar {
  opacity:1; background:linear-gradient(160deg,#e8c873,#a9803a); border:2px solid #f6ddA0; color:#241a05; font-weight:900;
  box-shadow:0 0 8px rgba(232,200,115,0.5);
}
.av-seat-avatar .name { font-size:8.5px; margin-top:2px; color:var(--av-muted); white-space:nowrap; opacity:0.85; }
.av-seat-avatar.me .name { color:var(--av-gold); opacity:1; font-weight:700; }
.av-seat-avatar.highlight .name { color:var(--av-ink); opacity:1; }
/* 刺客現身畫面：刺客暫定要刺殺的目標，頭像外圈紅光脈動，讓所有人都看得到誰正被盯上
   （跟組隊/表決通過的金色 highlight 是不同語言：紅＝危險，不代表這個人已經確定怎樣）。*/
.av-seat-avatar.danger-target .avatar {
  background: linear-gradient(160deg, #4a1013, #180608);
  border:2px solid #8a1620; color:#e8c9c9;
  box-shadow:0 0 0 0 rgba(138,10,20,0.85), 0 0 0 0 rgba(224,40,50,0.45);
  animation: avDangerPulse 1.4s ease-out infinite;
}
.av-seat-avatar.danger-target .name { color:#bf3f3a; opacity:1; font-weight:700; }
/* Derek 的回饋：紅光脈動的效果不夠明顯——把脈衝半徑加大（原本只有 7px，現在放大到
   22px／36px 兩層疊加，做出比較有份量的「聲納波」擴散感），並改用 ease-out 讓擴散的
   前段比較快、後段漸緩，視覺上更有「一下子炸開」的張力。 */
@keyframes avDangerPulse {
  0% { box-shadow:0 0 0 0 rgba(138,10,20,0.85), 0 0 0 0 rgba(224,40,50,0.45); }
  70% { box-shadow:0 0 0 22px rgba(138,10,20,0), 0 0 0 36px rgba(224,40,50,0); }
  100% { box-shadow:0 0 0 22px rgba(138,10,20,0), 0 0 0 36px rgba(224,40,50,0); }
}
/* 刺客送出刺殺後的結果動畫：全螢幕蓋在最上層，播完才會顯示結算畫面（見
   avalon.client.js 的 playAssassinResultVideo）。 */
.av-video-overlay {
  position:fixed; inset:0; z-index:200; background:#000;
  display:flex; align-items:center; justify-content:center;
}
.av-video-overlay-el { width:100%; height:100%; object-fit:contain; background:#000; }
.av-seat-crown { position:absolute; top:-13px; left:50%; transform:translateX(-50%); filter:drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.av-seat-cards { position:absolute; display:flex; gap:4px; transition: transform 0.15s ease; }
.av-seat-cards .slot {
  width:34px; height:51px; border-radius:5px; flex:none; display:flex; align-items:center; justify-content:center;
  border:1.4px dashed rgba(143,155,196,0.4); font-size:8.5px; color:var(--av-muted); overflow:hidden;
}
.av-seat-cards.me .slot { border-color: var(--av-gold); }
.av-seat-cards .slot.back { border:1px solid rgba(232,200,115,0.5); }
.av-seat-cards .slot.back img { width:100%; height:100%; object-fit:cover; display:block; }
.av-seat-cards .slot.empty { border:1.4px dashed rgba(143,155,196,0.45); cursor:pointer; }
.av-seat-cards .slot.picked { background:linear-gradient(160deg, rgba(232,200,115,0.28), rgba(232,200,115,0.08)); border:1.4px solid var(--av-gold); box-shadow:0 0 8px rgba(232,200,115,0.4); cursor:pointer; }
.av-seat-cards .slot.pending { border:1.4px dashed rgba(143,155,196,0.45); }
.av-seat-cards .slot.idle { border:1.4px dashed rgba(143,155,196,0.25); color:#5c6790; font-size:13px; }
/* 你自己的身分卡卡背——可以點開看角色說明／視野，用一圈脈動光暈提示「這裡可以點」。 */
.av-seat-cards .slot.identity { cursor:pointer; }
.av-seat-cards .slot.identity.pulse { animation: avIdPulse 1.6s ease-in-out infinite; }
@keyframes avIdPulse { 0%,100% { box-shadow:0 0 0 0 rgba(232,200,115,0.55);} 50% { box-shadow:0 0 0 5px rgba(232,200,115,0);} }
/* 你自己的第二格插槽——只有「待行動」（表決/任務還沒送出）狀態可以點來重新叫出選卡彈窗。 */
.av-seat-cards .slot.action-slot.pending { cursor:pointer; }
.av-team-size-hint { text-align:center; color:var(--av-muted); font-size:13px; margin-bottom:6px; }
.av-progress-note { text-align:center; font-size:11px; color:var(--av-ink); font-weight:700; margin-top:8px; }
.av-progress-dots { display:flex; justify-content:center; gap:6px; margin-top:6px; }
.av-progress-dots span { width:6px; height:6px; border-radius:50%; background:rgba(143,155,196,0.3); display:block; }
.av-progress-dots span.done { background:var(--av-gold); }

/* ---- 底部常駐「你的狀態」面板：設計稿裡組隊／表決／任務執行三個畫面共用的同一塊，
   顯示自己的頭像、身分卡縮圖跟目前的行動狀態，之前完全沒做，只靠上面獨立按鈕交代狀態。 ---- */
.av-status-dock { margin-top:14px; background:linear-gradient(180deg, rgba(232,200,115,0.14), rgba(20,28,52,0.75)); border:1.5px solid var(--av-gold); border-radius:16px; padding:12px 16px; }
.av-status-dock .dock-label { font-size:9.5px; letter-spacing:2px; color:#c9a961; margin-bottom:9px; }
.av-status-dock .dock-row { display:flex; align-items:flex-end; justify-content:space-between; }
.av-status-dock .me { text-align:center; position:relative; width:58px; flex:none; }
.av-status-dock .me .crown { position:absolute; left:50%; top:-16px; transform:translateX(-50%); }
.av-status-dock .me .avatar {
  width:52px; height:52px; border-radius:50%; background:linear-gradient(160deg,#e8c873,#a9803a); border:2.5px solid #f6ddA0;
  display:flex; align-items:center; justify-content:center; font-weight:900; color:#241a05; font-size:17px; margin:0 auto;
}
.av-status-dock .me.idle .avatar { background:linear-gradient(160deg,#3d4a72,#25304f); border-color:rgba(232,200,115,0.5); color:var(--av-ink); }
.av-status-dock .me .me-label { font-size:9.5px; margin-top:6px; color:var(--av-ink); font-weight:700; }
.av-status-dock .role { text-align:center; width:60px; flex:none; }
.av-status-dock .role img { width:50px; height:75px; border-radius:7px; border:1.5px solid rgba(232,200,115,0.6); box-shadow:0 4px 12px rgba(0,0,0,0.5); display:block; margin:0 auto; object-fit:cover; }
.av-status-dock .role .role-label { font-size:9px; margin-top:6px; color:var(--av-muted); }
.av-status-dock .action { text-align:center; flex:1 1 auto; min-width:0; }
.av-status-dock .action .note { font-size:11.5px; color:var(--av-muted); line-height:1.6; }
.av-status-dock .action .av-badge {
  width:52px; height:52px; margin:0 auto; border-radius:10px; background:linear-gradient(160deg, rgba(232,200,115,0.28), rgba(232,200,115,0.08));
  border:1.5px solid var(--av-gold); box-shadow:0 0 8px rgba(232,200,115,0.4); display:flex; align-items:center; justify-content:center;
}
.av-status-dock .action .vote-result { width:64px; height:94px; margin:0 auto; border-radius:8px; overflow:hidden; box-shadow:0 6px 16px rgba(0,0,0,0.5), 0 0 0 2px rgba(232,200,115,0.6); }
.av-status-dock .action .vote-result img { width:100%; height:100%; object-fit:cover; display:block; }
.av-status-dock .divider { height:1px; background:rgba(232,200,115,0.25); margin:10px 0 8px; }
.av-status-dock .dock-btn {
  width:100%; text-align:center; border-radius:11px; padding:12px 0; font-weight:900; font-size:14px; letter-spacing:2px; cursor:pointer;
  background:linear-gradient(160deg,#f3d98a,#c9a125); color:#241a05; border:none;
}
.av-status-dock .dock-btn.idle { background:linear-gradient(160deg,#3a4670,#1c2340); border:1px solid rgba(232,200,115,0.4); color:#7f8ab0; cursor:default; }
.av-status-dock .dock-btn:disabled { opacity:0.5; cursor:default; }

/* ---- 「你的狀態」面板簡化版：只留放大、可點開的身分卡，拿掉頭像跟重複的身分說明
   （Derek 的回饋：頭像跟「已選擇隊員」勾勾格不重要，身分卡放大一點；隊長就在標題
   旁邊放皇冠＋（隊長）字樣即可，不用另外畫一顆頭像）。---- */
.dock-row.single { display:flex; justify-content:center; }
.dock-crown { vertical-align:-1.5px; margin-left:2px; }
.dock-leader-tag { font-size:9.5px; color:var(--av-gold); font-weight:700; margin-left:2px; }
.dock-role { cursor:pointer; }
.dock-role img {
  width:92px; height:138px; border-radius:10px; border:1.5px solid rgba(232,200,115,0.6);
  box-shadow:0 6px 16px rgba(0,0,0,0.5); display:block; margin:0 auto; object-fit:cover;
}
.av-role-detail { margin-top:12px; padding-top:12px; border-top:1px dashed var(--av-gold-soft); text-align:left; }
.av-role-detail .role-detail-name { font-family:"Cinzel",serif; font-size:15px; color:var(--av-gold); font-weight:700; text-align:center; margin-bottom:4px; }
.av-role-detail .av-role-team { text-align:center; }
.av-role-detail .av-role-desc { font-size:12.5px; }
.av-dock-hint { text-align:center; font-size:10.5px; color:var(--av-muted); margin-top:8px; }

/* ---- 表決／任務結算「亮牌」畫面：停留幾秒讓大家看清楚結果再往下走 ---- */
.av-reveal-banner {
  margin-top:18px; padding:14px 16px; border-radius:14px; text-align:center;
  font-family:"Cinzel",serif; font-size:15px; font-weight:700; letter-spacing:0.5px;
}
.av-reveal-banner.approved { background:rgba(143,211,160,0.12); border:1.5px solid #8fd3a0; color:#bfe8c8; }
.av-reveal-banner.rejected { background:rgba(224,138,138,0.12); border:1.5px solid #e08a8a; color:#f0bcbc; }
.av-mission-reveal-card { display:flex; justify-content:center; margin:18px 0; }
.av-mission-reveal-card img { width:150px; height:auto; border-radius:12px; box-shadow:0 10px 26px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,200,115,0.4); }

/* ---- 戰況版圖：點某一輪看詳細記錄 ---- */
.av-board-missions .m.selected .dot { box-shadow:0 0 0 3px var(--av-gold); }
.av-board-round-detail { margin:2px 0 14px; padding:12px 14px; border-radius:12px; background:rgba(232,200,115,0.06); border:1px solid var(--av-gold-soft); text-align:left; }
.av-board-round-detail .detail-title { font-size:12px; color:var(--av-gold); font-weight:700; margin-bottom:8px; text-align:center; }
.av-board-round-detail .detail-attempt { margin-bottom:10px; }
.av-board-round-detail .detail-attempt-head { font-size:11.5px; color:var(--av-ink); margin-bottom:5px; }
.av-board-round-detail .detail-attempt-head .yes { color:#8fd3a0; font-weight:700; }
.av-board-round-detail .detail-attempt-head .no { color:#e08a8a; font-weight:700; }
.av-board-round-detail .detail-votes { display:flex; flex-wrap:wrap; gap:6px; }
.av-board-round-detail .detail-vote { font-size:10px; padding:3px 8px; border-radius:20px; background:rgba(255,255,255,0.06); }
.av-board-round-detail .detail-vote.yes { color:#8fd3a0; }
.av-board-round-detail .detail-vote.no { color:#e08a8a; }
.av-board-round-detail .detail-mission { margin-top:8px; padding-top:8px; border-top:1px dashed var(--av-gold-soft); font-size:11.5px; text-align:center; }
.av-board-round-detail .detail-mission.yes { color:#8fd3a0; }
.av-board-round-detail .detail-mission.no { color:#e08a8a; }

/* ---- 點自己座位上的身分卡卡背展開的角色說明／視野彈窗：純資訊，不含任何按鈕——
   跟你看得到的人（洞見名單）長在一起，行為跟正式版的身分卡展開一致。用真實卡片尺寸
   （140px寬）而不是桌上那種縮小版卡背，這樣點開來看才有「這是我設計的那張精美卡牌」
   的感覺，不是又一個小圖示。Derek 用互動 MOCKUP 定案的版本。 ---- */
.av-role-popup {
  position:absolute; z-index:30; left:50%; top:56%; transform:translate(-50%,-50%);
  width:270px; max-width:88%; text-align:center;
  background:linear-gradient(180deg, rgba(232,200,115,0.16), rgba(20,28,52,0.97));
  border:1.5px solid var(--av-gold); border-radius:14px; padding:16px 16px 14px;
  box-shadow:0 10px 28px rgba(0,0,0,0.5);
  animation: avPopIn 0.14s ease;
}
.av-role-popup.no-anim { animation: none; }
@keyframes avPopIn { from { opacity:0; transform: translate(-50%,-50%) scale(0.92); } to { opacity:1; transform: translate(-50%,-50%) scale(1); } }
.av-role-popup-close { position:absolute; top:7px; right:9px; font-size:13px; color:var(--av-muted); cursor:pointer; line-height:1; }
.av-role-popup-card { width:140px; margin:0 auto 10px; }
.av-role-popup-card img { width:100%; display:block; border-radius:10px; box-shadow:0 10px 26px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,200,115,0.5), 0 0 22px rgba(232,200,115,0.28); }
.av-role-popup-name { font-family:"Cinzel",serif; font-size:16px; font-weight:700; color:var(--av-gold); margin-bottom:4px; }
.av-role-popup-team { font-size:11px; color:#8fd3a0; margin-bottom:10px; }
.av-role-popup-team.evil { color:#e0a3a3; }
.av-role-popup-desc { font-size:11px; color:var(--av-muted); line-height:1.6; margin-bottom:10px; text-align:left; }

/* ---- 表決／任務執行輪到你行動時，自動在桌面上跳出的選卡彈窗：不是常駐的按鈕，是
   「輪到你了」這件事發生時自己彈出來，選完就收起來；也可以先按 ✕ 收起，之後點自己
   卡牌上那個「行動中」插槽再叫出來一次。同意／反對、成功／失敗都用真實卡片圖，尺寸
   接近真實比例（120px寬），不是實心色塊按鈕。 ---- */
.av-action-modal-backdrop {
  position:absolute; inset:0; z-index:40; display:flex; align-items:center; justify-content:center;
  background:rgba(8,12,24,0.62); border-radius:12px; animation: avFadeIn 0.15s ease;
}
.av-action-modal-backdrop.no-anim { animation: none; }
@keyframes avFadeIn { from { opacity:0; } to { opacity:1; } }
.av-action-modal {
  position:relative; width:300px; max-width:90%; text-align:center;
  background:linear-gradient(180deg, rgba(232,200,115,0.14), rgba(18,25,48,0.97));
  border:1.5px solid var(--av-gold); border-radius:16px; padding:18px 16px 16px;
  box-shadow:0 14px 36px rgba(0,0,0,0.55);
}
.av-action-modal-close { position:absolute; top:7px; right:9px; font-size:13px; color:var(--av-muted); cursor:pointer; }
.av-action-modal-board { position:absolute; top:7px; left:9px; cursor:pointer; display:flex; align-items:center; justify-content:center; width:20px; height:20px; opacity:0.85; }
.av-action-modal-board:active { opacity:1; }
.av-action-modal-title { font-size:12.5px; font-weight:700; color:var(--av-ink); margin-bottom:14px; line-height:1.5; }
.av-action-modal-cards { display:flex; gap:16px; justify-content:center; }
.av-action-modal-card {
  width:120px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:7px;
  transition: transform 0.1s ease;
}
.av-action-modal-card:active { transform: scale(0.94); }
.av-action-modal-card img { width:100%; display:block; border-radius:10px; }
.av-action-modal-card-label { font-size:13px; font-weight:900; }
.av-action-modal-card.approve img { box-shadow:0 10px 24px rgba(0,0,0,0.5), 0 0 0 2px #7fd39a, 0 0 18px rgba(127,211,154,0.35); }
.av-action-modal-card.reject img { box-shadow:0 10px 24px rgba(0,0,0,0.5), 0 0 0 2px #e08a8a, 0 0 18px rgba(224,138,138,0.35); }
.av-action-modal-card.approve .av-action-modal-card-label { color:#bfe8c8; }
.av-action-modal-card.reject .av-action-modal-card-label { color:#f0bcbc; }
.av-action-modal-card.disabled { cursor:default; opacity:0.35; pointer-events:none; }
.av-action-modal-card.disabled img { filter:grayscale(1); }
.av-action-modal-note { font-size:10.5px; color:var(--av-muted); margin:10px 0 0; }

/* ---- 刺客指認：跟設計稿一樣是一個獨立的深紅/紫色邊框卡框，裡面 3 欄一列的候選人頭像網格
   （不是單欄清單），選中的人金色發光；卡框四角有裝飾性紋章圖案。 ---- */
#game-avalon .av-assassin-bg {
  background: radial-gradient(120% 60% at 50% -10%, #3a1420 0%, #1c1030 45%, #0a0a18 100%) !important;
}
.av-assassin-intro { text-align:center; margin-bottom:14px; }
.av-assassin-intro .pill {
  display:inline-block; font-size:10.5px; color:#f0b3b5; background:rgba(138,47,51,0.18);
  border:1px solid rgba(217,138,140,0.4); border-radius:20px; padding:6px 16px;
}
.av-assassin-box {
  position:relative; padding:18px; background:linear-gradient(180deg, rgba(58,18,24,0.55), rgba(20,12,26,0.5));
  border:1.5px solid rgba(217,138,140,0.55); border-radius:14px; box-shadow: inset 0 0 30px rgba(0,0,0,0.35);
}
.av-assassin-box .box-title { text-align:center; font-size:14px; font-weight:700; color:var(--av-ink); margin-bottom:6px; }
.av-assassin-box .box-desc { text-align:center; font-size:11.5px; color:#c9b3b8; line-height:1.8; padding:0 6px; margin-bottom:12px; }
.av-assassin-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px 10px; }
.av-assassin-candidate { text-align:center; cursor:pointer; }
.av-assassin-candidate .avatar {
  width:52px; height:52px; margin:0 auto; border-radius:50%; background:#3d4a72; border:1.5px solid rgba(217,138,140,0.4);
  display:flex; align-items:center; justify-content:center; font-weight:700; color:#c7cfea; font-size:16px;
}
.av-assassin-candidate .name { font-size:9.5px; margin-top:5px; color:#c7cfea; }
.av-assassin-candidate.picked .avatar {
  background:linear-gradient(160deg,#e8c873,#a9803a); border:2.5px solid #f6ddA0; color:#241a05;
  box-shadow:0 0 12px rgba(232,200,115,0.55);
}
.av-assassin-candidate.picked .name { color:var(--av-gold); font-weight:700; }
.av-assassin-picked-note { text-align:center; font-size:11px; color:#c9b3b8; margin-top:14px; }
.av-assassin-picked-note b { color:var(--av-gold); font-weight:700; }
#av-assassinConfirmBtn { background:linear-gradient(160deg,#8a2f33,#5c1c1f) !important; border:1.5px solid #d98a8c !important; color:#fce9e9 !important; }

/* ---- 戰況版圖：設計稿裡原本就規劃的第④個畫面（任務進度／否決計數／隊長順位／
   陣營比分），先前完全沒做進遊戲——從組隊／表決／任務執行畫面右上角的圖示點進來看。 ---- */
.av-board-frame {
  position:relative; padding:20px 16px 16px; margin:6px 0 14px;
  background:linear-gradient(180deg, rgba(28,43,82,0.55), rgba(14,22,44,0.5));
  border:1.5px solid rgba(232,200,115,0.55); border-radius:14px; box-shadow: inset 0 0 30px rgba(0,0,0,0.35);
}
.av-board-frame .section-label { text-align:center; font-size:10.5px; letter-spacing:2px; color:var(--av-muted); margin-bottom:12px; }
.av-board-divider { display:flex; align-items:center; gap:8px; margin:14px 0; }
.av-board-divider .line { flex:1; height:1px; background:linear-gradient(90deg, transparent, rgba(232,200,115,0.5), transparent); }
.av-board-missions { display:flex; justify-content:space-between; padding:0 4px; }
.av-board-missions .m { display:flex; flex-direction:column; align-items:center; gap:6px; }
.av-board-missions .dot {
  width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:"Cinzel",serif; font-size:15px; border:1.5px solid rgba(143,155,196,0.5); color:#9aa5cf;
}
.av-board-missions .dot.current { width:50px; height:50px; border:2px solid var(--av-gold); box-shadow:0 0 0 5px var(--av-gold-dim); color:var(--av-gold); font-weight:700; }
.av-board-missions .dot img { width:100%; height:100%; border-radius:50%; display:block; }
.av-board-missions .size { font-size:9.5px; color:var(--av-muted); }
.av-board-missions .m.current .size { color:var(--av-gold); font-weight:700; }
.av-board-note { text-align:center; font-size:9px; color:var(--av-muted); margin-top:8px; }
.av-board-rejects { display:flex; justify-content:center; gap:10px; }
.av-board-rejects .x, .av-board-rejects .empty { width:30px; height:30px; border-radius:6px; }
.av-board-rejects .x { background:linear-gradient(160deg,#8a2f33,#5c1c1f); border:1.5px solid #d98a8c; display:flex; align-items:center; justify-content:center; font-weight:900; color:#fce9e9; font-size:12px; }
.av-board-rejects .empty { border:1.5px dashed rgba(143,155,196,0.4); }
.av-board-reject-note { text-align:center; font-size:9.5px; color:#c98a8c; margin-top:9px; }
.av-board-leaders { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.av-board-leaders .p { text-align:center; position:relative; }
.av-board-leaders .p .avatar { width:34px; height:34px; border-radius:50%; background:#3d4a72; opacity:0.6; display:flex; align-items:center; justify-content:center; font-weight:700; color:#c7cfea; font-size:12px; margin:0 auto; }
.av-board-leaders .p.current .avatar { opacity:1; background:linear-gradient(160deg,#e8c873,#a9803a); border:2px solid #f6ddA0; color:#241a05; }
.av-board-leaders .p.next .avatar { opacity:1; border:1.5px solid rgba(232,200,115,0.5); }
.av-board-leaders .p .tag { font-size:8.5px; margin-top:4px; color:var(--av-muted); }
.av-board-leaders .p.current .tag { color:var(--av-gold); }
.av-board-vs { display:flex; justify-content:center; align-items:center; gap:26px; margin-top:20px; }
.av-board-vs .side { text-align:center; }
.av-board-vs .side .label { font-size:10px; color:var(--av-muted); margin-top:4px; }
.av-board-vs .side .pips { display:flex; gap:4px; justify-content:center; margin-top:4px; }
.av-board-vs .side .pips span { width:7px; height:7px; border-radius:50%; background:rgba(143,155,196,0.3); display:block; }
.av-board-vs .side .pips span.on { background:var(--av-gold); }
.av-board-vs .side.evil .pips span.on { background:#d98a8c; }
.av-board-vs .vs-label { font-family:"Cinzel",serif; font-size:13px; color:#5c6790; }

/* ---- 遊戲結束：勝負橫幅＋完整身分揭曉 ---- */
.av-winner-banner { text-align:center; padding:20px 0 10px; }
.av-winner-banner .headline { font-family:"Cinzel",serif; font-size:22px; font-weight:700; color:var(--av-gold); }
.av-winner-banner .sub { font-size:13px; color:var(--av-muted); margin-top:6px; }
.av-reveal-grid { display:grid; grid-template-columns:repeat(2, 1fr); gap:10px; margin-top:14px; }
.av-reveal-card { text-align:center; padding:10px 6px; border-radius:10px; background:rgba(143,155,196,0.06); border:1px solid rgba(143,155,196,0.2); }
.av-reveal-card.evil { background:rgba(224,138,138,0.08); border-color:rgba(224,138,138,0.3); }
.av-reveal-card img { width:64px; border-radius:6px; margin-bottom:6px; }
.av-reveal-card .name { font-size:12.5px; color:var(--av-ink); }
.av-reveal-card .role { font-size:11px; color:var(--av-gold); margin-top:2px; }

/* ================== 政變（Coup）================== */
/* 跟阿瓦隆同一招：坐在政變這一桌時整頁沉浸主題，不露出大廳共用的粉紫色背景跟通用標題。
   顏色/字體照 Derek 已核准的 mockup（coup-mobile-ui-mockup）直接沿用，沒有另外設計。 */
#game-coup { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif; }

body.theme-coup {
  background: linear-gradient(160deg, #1e1b3a 0%, #2d1b4e 100%);
}
body.theme-coup h1 { display: none; }
body.theme-coup .chat-fab {
  background: linear-gradient(160deg, #e8c873, #c9a961);
}

#game-coup {
  --coup-gold: #e8c873;
  --coup-gold-soft: rgba(232,200,115,0.4);
  --coup-gold-dim: rgba(232,200,115,0.08);
  --coup-ink: #f2e8d3;
  --coup-muted: #8f9bc4;
  --coup-danger: #bf3f3a;
  --coup-danger-soft: rgba(191,63,58,0.4);
  --coup-danger-dim: rgba(191,63,58,0.08);
  color: var(--coup-ink);
  width: 100%;
  max-width: 480px;
}
#game-coup .card {
  background: linear-gradient(160deg, #1e1b3a 0%, #2d1b4e 100%);
  border: 1px solid var(--coup-gold-soft);
}
#game-coup .rules-box { color: var(--coup-ink); }
#game-coup .rules-title { color: var(--coup-gold); }

.coup-eyebrow { font-family:"Cinzel",serif; font-size:10.5px; letter-spacing:3px; color:var(--coup-muted); text-align:center; }
.coup-big-title { font-family:"Noto Serif TC",serif; font-size:18px; font-weight:900; color:var(--coup-ink); text-align:center; margin-top:2px; letter-spacing:1px; }

/* ---- 頂排玩家：置中排列，包含自己，每人面前兩張卡背，淘汰時翻正面 ---- */
.coup-prow { display:flex; gap:11px; justify-content:center; flex-wrap:wrap; padding:2px 0; }
.coup-pu { display:flex; flex-direction:column; align-items:center; gap:3px; width:56px; }
.coup-pu .coup-av { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13.5px; color:#1e1b3a; border:2px solid rgba(143,155,196,0.35); flex:none; background-size:cover; background-position:center; }
.coup-pu.me .coup-av { border-color:var(--coup-gold); box-shadow:0 0 0 3px rgba(232,200,115,0.18); }
.coup-pu.turn .coup-av { border-color:var(--coup-gold); box-shadow:0 0 0 3px rgba(232,200,115,0.3), 0 0 12px rgba(232,200,115,0.5); }
.coup-pu.out .coup-av { opacity:0.35; }
.coup-pu.targetable { cursor:pointer; }
.coup-pu.target-selected .coup-av { border-color:var(--coup-danger); box-shadow:0 0 0 3px rgba(191,63,58,0.3), 0 0 12px rgba(191,63,58,0.55); }
.coup-pu .coup-nm { font-size:8.5px; color:var(--coup-muted); white-space:nowrap; max-width:56px; overflow:hidden; text-overflow:ellipsis; }
.coup-pu.me .coup-nm { color:var(--coup-gold); font-weight:700; }
.coup-pu .coup-cards { display:flex; gap:2px; }
.coup-pcard { width:16px; height:23px; border-radius:3px; overflow:hidden; border:1px solid rgba(232,200,115,0.4); background-size:cover; background-position:center; background-color:#100e20; }
.coup-pcard.revealed { border-color:var(--coup-danger); box-shadow:0 0 4px rgba(191,63,58,0.5); cursor:pointer; }
.coup-pu .coup-coinrow { display:flex; align-items:center; gap:2px; }
.coup-pu .coup-coinrow img { width:10px; height:10px; }
.coup-pu .coup-coinrow span { font-size:8.5px; color:#c9a961; font-weight:700; }

.coup-divider { height:1px; background:linear-gradient(90deg, transparent, rgba(232,200,115,0.35), transparent); margin:6px 0; }

/* ---- 手牌區 ---- */
.coup-hand-head { display:flex; align-items:center; justify-content:space-between; padding:0 2px; }
.coup-section-lbl { font-size:11px; color:var(--coup-muted); letter-spacing:1px; }
.coup-my-coin { display:flex; align-items:center; gap:5px; border:1px solid rgba(232,200,115,0.35); border-radius:20px; padding:4px 11px 4px 6px; background:var(--coup-gold-dim); }
.coup-my-coin img { width:18px; height:18px; }
.coup-my-coin span { font-family:"Cinzel",serif; font-size:14px; font-weight:700; color:var(--coup-gold); }

.coup-hand-row { display:flex; gap:10px; justify-content:center; margin-top:7px; }
.coup-hand-card { width:110px; border-radius:12px; overflow:hidden; border:1.5px solid rgba(232,200,115,0.45); box-shadow:0 6px 18px rgba(0,0,0,0.35); position:relative; }
.coup-hand-card img { display:block; width:100%; height:auto; }
.coup-hand-card.revealed { opacity:0.45; }
.coup-hand-card.selectable { cursor:pointer; }
.coup-hand-card.picked { border-color:var(--coup-danger); box-shadow:0 0 0 3px rgba(191,63,58,0.35); }
.coup-hand-card .coup-hand-card-name { position:absolute; left:0; right:0; bottom:0; padding:5px 4px; text-align:center; font-size:11px; font-weight:700; background:linear-gradient(0deg, rgba(10,8,20,0.85), transparent); color:var(--coup-ink); }

/* ---- 行動選單 ---- */
.coup-action-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:8px; margin-top:8px; }
/* 按鈕內距/圖示跟文字間距故意比原本窄一點（圖示本身 34x34 大小不變），純粹是為了
   讓「稅收（公爵）」之類的行動名稱、跟下面的說明文字，在手機窄螢幕上都能各自擠在同一行
   內不換行——原本 12.5px/10px 字級 + 10px 圖示間距在 iPhone 窄螢幕上會被 CJK 全形字撐
   到換行，所以文字縮小一點、間距收窄一點，圖示大小完全沒有變動。 */
.coup-abtn { display:flex; align-items:center; gap:8px; padding:8px 9px; border-radius:12px; border:1.5px solid rgba(143,155,196,0.25); background:rgba(255,255,255,0.03); min-height:44px; cursor:pointer; text-align:left; }
.coup-abtn:disabled { opacity:0.35; cursor:not-allowed; }
.coup-abtn .coup-ic { width:34px; height:34px; flex:none; display:flex; align-items:center; justify-content:center; }
.coup-abtn .coup-ic img { width:100%; height:100%; object-fit:contain; }
.coup-abtn .coup-tx { flex:1; min-width:0; }
.coup-abtn .coup-tx .coup-nm { font-size:11px; font-weight:700; color:var(--coup-ink); white-space:nowrap; overflow:hidden; text-overflow:clip; letter-spacing:-0.3px; }
.coup-abtn .coup-tx .coup-cost { font-size:9px; color:var(--coup-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; letter-spacing:-0.2px; }
.coup-abtn.selected { border-color:var(--coup-gold); background:linear-gradient(160deg, rgba(232,200,115,0.22), rgba(232,200,115,0.05)); box-shadow:0 0 10px rgba(232,200,115,0.25); }
.coup-abtn.selected .coup-tx .coup-nm { color:var(--coup-gold); }

.coup-coup-btn { display:flex; align-items:center; justify-content:center; gap:10px; padding:9px 11px; border-radius:12px; border:1.5px solid var(--coup-danger-soft); background:var(--coup-danger-dim); min-height:44px; margin-top:8px; width:100%; cursor:pointer; }
.coup-coup-btn:disabled { opacity:0.35; cursor:not-allowed; }
.coup-coup-btn.selected { box-shadow:0 0 10px rgba(191,63,58,0.35); }
.coup-coup-btn .coup-ic { width:34px; height:34px; flex:none; display:flex; align-items:center; justify-content:center; }
.coup-coup-btn .coup-ic img { width:100%; height:100%; object-fit:contain; }
.coup-coup-btn .coup-tx { flex:1; min-width:0; text-align:left; }
.coup-coup-btn .coup-nm { font-size:12.5px; font-weight:800; color:#e8a0a0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.coup-coup-btn .coup-cost { font-size:10px; color:var(--coup-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.coup-submit-hint { text-align:center; font-size:10.5px; color:var(--coup-muted); margin-top:8px; }
.coup-submit-btn { width:100%; background:linear-gradient(160deg,var(--coup-gold),#c9a961); color:#1e1b3a; border:none; border-radius:14px; padding:14px; font-size:14.5px; font-weight:800; text-align:center; letter-spacing:1px; margin-top:6px; }
.coup-submit-btn:disabled { opacity:0.4; }
.coup-waiting-note { text-align:center; font-size:13px; color:var(--coup-muted); padding:14px 0; }

/* ---- 挑戰／阻擋（Declare）畫面 ---- */
.coup-timer-wrap { display:flex; align-items:center; gap:8px; margin-top:6px; }
.coup-timer-track { flex:1; height:6px; border-radius:3px; background:rgba(143,155,196,0.18); overflow:hidden; }
.coup-timer-fill { height:100%; background:linear-gradient(90deg,var(--coup-gold),var(--coup-danger)); border-radius:3px; transition:width 0.3s linear; }
.coup-timer-num { font-family:"Cinzel",serif; font-size:13px; color:#e8a0a0; font-weight:700; width:34px; text-align:right; }

.coup-declare-card { border:1.5px solid rgba(232,200,115,0.4); border-radius:16px; background:var(--coup-gold-dim); padding:16px; display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:10px; }
.coup-who-row { display:flex; align-items:center; gap:14px; }
.coup-who { display:flex; flex-direction:column; align-items:center; gap:5px; }
.coup-who .coup-av { width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:18px; color:#1e1b3a; border:2px solid rgba(232,200,115,0.5); background-size:cover; background-position:center; }
.coup-who.me .coup-av { border-color:var(--coup-danger); box-shadow:0 0 0 4px rgba(191,63,58,0.2); }
.coup-who .coup-nm { font-size:11.5px; color:#c9c9dc; }
.coup-arrow-ic { display:flex; flex-direction:column; align-items:center; gap:2px; }
.coup-arrow-ic img { width:30px; height:30px; }
.coup-declare-text { text-align:center; font-size:14.5px; line-height:1.6; }
.coup-declare-text b { color:var(--coup-gold); }
.coup-declare-text .danger { color:#e8a0a0; font-weight:700; }

.coup-decision-row { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:8px; margin-top:10px; }
.coup-dbtn { border-radius:12px; padding:11px 6px; text-align:center; border:1.5px solid; background:none; cursor:pointer; }
.coup-dbtn:disabled { opacity:0.35; cursor:not-allowed; }
.coup-dbtn .coup-nm { font-size:13px; font-weight:800; }
.coup-dbtn .coup-sub { font-size:9.5px; margin-top:2px; opacity:0.85; }
.coup-dbtn.challenge { border-color:rgba(191,63,58,0.5); background:rgba(191,63,58,0.1); color:#e8a0a0; }
.coup-dbtn.block { border-color:rgba(232,200,115,0.5); background:var(--coup-gold-dim); color:var(--coup-gold); }
.coup-dbtn.pass { border-color:rgba(143,155,196,0.3); background:rgba(255,255,255,0.03); color:var(--coup-muted); }
.coup-dbtn.selected { box-shadow:0 0 0 2px currentColor inset; }

.coup-blockrole-row { display:flex; gap:8px; margin-top:8px; }
.coup-blockrole-row .coup-dbtn { flex:1; }

.coup-passed-note { text-align:center; font-size:11px; color:var(--coup-muted); margin-top:6px; }

/* ---- 公開時間軸＋分桌聊天室合併面板（政變的重點設計：遠端參與看不到彼此表情，
   靠這個面板承載唬爛/談判） ---- */
.coup-feed-lbl { font-size:11px; color:var(--coup-muted); letter-spacing:1px; display:flex; align-items:center; justify-content:space-between; margin-top:12px; }
.coup-feed { height:180px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid rgba(143,155,196,0.18); border-radius:14px; background:rgba(10,14,28,0.35); margin-top:6px; }
.coup-sys-chip { align-self:center; font-size:10.5px; color:var(--coup-muted); background:rgba(143,155,196,0.08); border-radius:20px; padding:4px 12px; text-align:center; }
.coup-sys-chip.warn { color:#e8a0a0; background:rgba(191,63,58,0.1); }
.coup-msg-row { display:flex; gap:7px; max-width:82%; }
.coup-msg-row.me { align-self:flex-end; flex-direction:row-reverse; }
.coup-msg-av { width:24px; height:24px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:#1e1b3a; background-size:cover; background-position:center; }
.coup-msg-bubble { background:rgba(143,155,196,0.12); border-radius:12px; padding:7px 11px; font-size:12.5px; line-height:1.5; word-break:break-word; }
.coup-msg-row.me .coup-msg-bubble { background:var(--coup-gold-dim); }
.coup-msg-name { font-size:9.5px; color:var(--coup-muted); margin-bottom:2px; }

.coup-input-row { display:flex; gap:8px; align-items:center; margin-top:8px; }
.coup-input-row input { flex:1; border:1px solid rgba(143,155,196,0.3); border-radius:20px; padding:10px 14px; font-size:12.5px; color:var(--coup-ink); background:rgba(255,255,255,0.03); }
/* 全域 button{} 有一個 padding:15px，圓形小按鈕如果沒有蓋掉它，內距會把 42x42 的按鈕
   吃掉大半空間，逼裡面的 SVG（flex 子項目，預設 flex-shrink:1）被硬擠扁——這才是 Derek
   反映「SVG 太小」的真正原因，不只是把 SVG 的 width/height 調大而已，padding 也要歸零。 */
.coup-send-btn { width:42px; height:42px; padding:0; margin:0; border-radius:50%; background:linear-gradient(160deg,var(--coup-gold),#c9a961); display:flex; align-items:center; justify-content:center; flex:none; border:none; cursor:pointer; }
.coup-send-btn svg { width:20px; height:20px; flex:none; }

/* ---- Declare 畫面標頭：標題 + 偷看自己身分的眼睛鈕 ---- */
.coup-declare-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.coup-declare-head > div:first-child { flex:1; min-width:0; }
.coup-peek-btn { flex:none; width:34px; height:34px; padding:0; margin:0; margin-top:2px; border-radius:50%; border:1.5px solid rgba(232,200,115,0.4); background:rgba(232,200,115,0.08); color:var(--coup-gold); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.coup-peek-btn svg { width:17px; height:17px; flex:none; }
.coup-peek-btn:active { background:rgba(232,200,115,0.2); }

/* ---- 卡片放大檢視（已公開的頭像小卡 / 偷看自己的身分） ---- */
.coup-lightbox { position:fixed; inset:0; z-index:500; display:flex; align-items:center; justify-content:center; padding:24px; }
.coup-lightbox-backdrop { position:absolute; inset:0; background:rgba(10,8,20,0.78); }
.coup-lightbox-panel { position:relative; max-width:340px; width:100%; background:linear-gradient(160deg, #1e1b3a 0%, #2d1b4e 100%); border:1px solid var(--coup-gold-soft); border-radius:18px; padding:18px; text-align:center; box-shadow:0 12px 40px rgba(0,0,0,0.5); }
.coup-lightbox-title { font-family:"Cinzel",serif; font-size:12px; letter-spacing:2px; color:var(--coup-muted); margin-bottom:12px; }
.coup-lightbox-cards { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.coup-lightbox-card img { width:130px; border-radius:12px; display:block; border:1.5px solid rgba(232,200,115,0.45); box-shadow:0 6px 18px rgba(0,0,0,0.35); }
.coup-lightbox-card.revealed img { opacity:0.55; }
.coup-lightbox-cardname { font-size:12.5px; color:var(--coup-ink); margin-top:6px; }
.coup-lightbox-close { margin-top:16px; width:100%; background:linear-gradient(160deg,var(--coup-gold),#c9a961); color:#1e1b3a; border:none; border-radius:12px; padding:11px; font-size:13.5px; font-weight:800; letter-spacing:1px; cursor:pointer; }

/* ---- 挑戰／阻擋挑戰的結果公布過場 ---- */
.coup-cr-icon { width:64px; height:64px; margin:6px auto 4px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.coup-cr-icon svg { width:32px; height:32px; }
.coup-cr-icon.success { background:var(--coup-gold-dim); border:2px solid var(--coup-gold); color:var(--coup-gold); box-shadow:0 0 20px rgba(232,200,115,0.35); }
.coup-cr-icon.fail { background:var(--coup-danger-dim); border:2px solid var(--coup-danger); color:#e8a0a0; box-shadow:0 0 20px rgba(191,63,58,0.3); }
.coup-cr-title { font-family:"Noto Serif TC",serif; font-size:19px; font-weight:900; text-align:center; margin-top:6px; color:var(--coup-ink); }
.coup-cr-body { font-size:13px; color:#c9c9dc; text-align:center; margin-top:8px; line-height:1.65; padding:0 4px; }

/* ---- 出局公告：兩張身分牌都翻開了，灰階顯示（跟挑戰結果公布共用 .coup-cr-* 那套風格） ---- */
.coup-elim-cards { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin:12px 0 4px; }
.coup-elim-card { text-align:center; }
.coup-elim-card img { width:96px; border-radius:10px; display:block; border:1.5px solid rgba(143,155,196,0.3); filter:grayscale(1) brightness(0.65); box-shadow:0 4px 14px rgba(0,0,0,0.4); }
.coup-elim-card-name { font-size:11.5px; color:#8f9bc4; margin-top:5px; }

/* ---- 開牌 / 換牌選擇畫面 ---- */
.coup-choice-title { text-align:center; font-size:15px; color:var(--coup-ink); margin-top:10px; }
.coup-choice-grid { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:14px; }

/* ---- 遊戲結束 ---- */
.coup-win-banner { text-align:center; padding:10px 0; }
.coup-win-banner .coup-crown { margin-bottom:4px; color:var(--coup-gold); }
.coup-win-banner .coup-banner-text { font-family:"Noto Serif TC",serif; font-size:22px; font-weight:900; color:var(--coup-gold); text-shadow:0 0 26px rgba(232,200,115,0.5); letter-spacing:1px; }
.coup-standings { display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.coup-srow { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:12px; background:rgba(255,255,255,0.03); border:1px solid rgba(143,155,196,0.15); }
.coup-srow.first { border-color:rgba(232,200,115,0.5); background:var(--coup-gold-dim); }
.coup-srow .coup-rank { font-family:"Cinzel",serif; font-size:13px; color:var(--coup-muted); width:18px; text-align:center; flex:none; }
.coup-srow.first .coup-rank { color:var(--coup-gold); font-weight:700; }
.coup-srow .coup-av { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; color:#1e1b3a; flex:none; background-size:cover; background-position:center; }
.coup-srow .coup-snm { flex:1; font-size:13.5px; font-weight:600; }
.coup-srow .coup-shand { display:flex; gap:3px; }
.coup-srow .coup-shand img { width:20px; height:29px; border-radius:3px; object-fit:cover; }
.coup-srow .coup-sstat { font-size:11px; color:var(--coup-muted); text-align:right; }

/* =====================================================================
   畫圖電話（Gartic Phone）：寫句子／畫圖／猜猜看用「筆記本塗鴉」風格跟大廳的
   深紫色殼子拉開差異——不是整頁沉浸主題（不像阿瓦隆/政變那樣連 setup 畫面都換皮），
   只有真正在玩（round/reveal 階段）的畫面套用 .gt-paper 這個「紙感卡片」，
   設定畫面（選人數、準備、開始）還是用平台共用的 .card／深紫殼子，跟其他非沉浸式
   遊戲（一眼秒殺、問答大挑戰…）一致。
   ===================================================================== */
#game-gartic {
  --gt-paper: #faf3e2;
  --gt-ink: #2b2440;
  --gt-muted: rgba(43,36,64,0.5);
  --gt-coral: #ff6b6b;
  --gt-sun: #ffb703;
  --gt-sky: #4cc9f0;
  --gt-leaf: #6bcb77;
  --gt-grape: #9d6fd6;
  width: 100%;
  max-width: 480px;
}
.gt-paper {
  background: var(--gt-paper);
  color: var(--gt-ink);
  border-radius: 18px;
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
}
.gt-eyebrow {
  text-align: center; font-size: 11.5px; letter-spacing: 2px; font-weight: 700;
  color: #a8895e; text-transform: uppercase; margin-bottom: 14px;
}

/* ---- 寫句子：精簡版，插圖置中＋一個輸入框＋送出 ---- */
/* 原本 Derek 給的插圖檔上傳後動畫沒了（聊天上傳一律轉成靜態 PNG，拿不回原始逐格動畫），
   改用 CSS 讓插圖自己輕輕浮動＋微微擺動，看起來還是「活的」，不會死板板釘在畫面中間。 */
.gt-write-illustration {
  display:block; width: 170px; height: 170px; object-fit: contain; margin: 4px auto 18px;
  animation: gt-illustration-bob 3.2s ease-in-out infinite;
}
@keyframes gt-illustration-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-9px) rotate(1.5deg); }
}
.gt-write-heading { text-align:center; font-size:20px; font-weight:800; margin:0 0 20px; line-height:1.45; }

/* ---- 訊息輸入列（寫句子／猜猜看共用）：像聊天室的傳送列 ---- */
.gt-compose {
  display:flex; align-items:center; gap:8px; background:#fff; border-radius:999px;
  padding:6px 6px 6px 20px; box-shadow:0 10px 22px rgba(43,36,64,0.12), 0 0 0 1px rgba(43,36,64,0.06);
}
.gt-compose input {
  flex-grow:1; border:none; outline:none; background:transparent; font-size:15.5px; font-weight:600;
  color: var(--gt-ink); padding:10px 0; margin:0; width:auto;
}
.gt-compose input::placeholder { color: rgba(43,36,64,0.35); }
.gt-send-btn {
  width:44px; height:44px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--gt-coral), var(--gt-sun)); box-shadow:0 6px 14px rgba(255,107,107,0.35);
  border:none; color:#fff; padding:0; margin:0; cursor:pointer;
}
.gt-send-btn:disabled { opacity:0.4; }

/* ---- 收到的訊息（畫圖／猜猜看畫面上方，出題/畫作的人傳來的那則） ---- */
.gt-incoming-row { display:flex; align-items:flex-end; gap:8px; margin: 0 0 12px; }
.gt-incoming-avatar {
  width:28px; height:28px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; color:#fff; background: var(--gt-coral);
}
.gt-incoming-name { display:block; font-size:10.5px; font-weight:700; color: var(--gt-muted); margin:0 0 3px 2px; }
.gt-incoming-bubble {
  display:inline-block; background:#fff; border-radius:4px 16px 16px 16px; padding:9px 13px;
  font-size:14px; font-weight:700; line-height:1.35; box-shadow:0 4px 10px rgba(43,36,64,0.1), 0 0 0 1px rgba(43,36,64,0.06);
}
.gt-incoming-bubble.gt-bubble-image { padding:6px; width:100%; box-sizing:border-box; }
.gt-incoming-bubble.gt-bubble-image img { display:block; width:100%; border-radius:10px; background:#fff; }

/* ---- 畫布 ---- */
/* 畫圖回合把畫布盡量放大（玩家反映畫布太小不好畫）：
   gartic.client.js 會在「輪到自己畫圖」的時候幫 body 加上 gt-drawing-mode，這時候
   - 收掉最上面的「派對遊戲」大標題，省下來的高度留給畫布跟工具列
   - 頁面左右留白、紙卡片的內距都縮到最小，畫布幾乎貼齊螢幕兩側
   - 平板／電腦這種寬螢幕，容器放寬到 600px
   寫句子、猜猜看、等待、最終播放這些畫面不受影響，維持原本的版面。 */
body.gt-drawing-mode { padding: 6px; }
body.gt-drawing-mode h1 { display: none; }
body.gt-drawing-mode .container { max-width: 600px; margin-top: 0; }
body.gt-drawing-mode #game-gartic { max-width: 600px; }
/* 靜音按鈕平常自己佔一整列；畫圖時改成疊在紙卡片的右上角（跟「第 N 輪」同一列），
   省下來的那一列高度留給畫布 */
body.gt-drawing-mode #game-gartic { position: relative; }
body.gt-drawing-mode #game-gartic .tl-audio-bar { position: absolute; top: 8px; right: 10px; margin: 0; z-index: 5; }
body.gt-drawing-mode #game-gartic .tl-mute-btn { width: 36px; height: 36px; font-size: 16px; background: rgba(43,36,64,0.08); color: #2b2440; border: none; box-shadow: none; }
body.gt-drawing-mode .gt-paper { padding: 8px 8px 14px; margin-bottom: 8px; }
body.gt-drawing-mode .gt-eyebrow { margin-bottom: 6px; height: 36px; line-height: 36px; }
body.gt-drawing-mode .gt-incoming-row { margin-bottom: 8px; padding: 0 4px; }
body.gt-drawing-mode .gt-toolbar-row,
body.gt-drawing-mode .gt-picker { margin-left: 4px; margin-right: 4px; }
body.gt-drawing-mode .gt-submit-btn { width: calc(100% - 8px); margin-left: 4px; margin-right: 4px; margin-top: 10px; padding: 14px; }
/* 聊天室的浮動按鈕平常固定在螢幕右下角，畫圖的時候那個位置剛好是送出按鈕跟顏色面板，
   會被它蓋住——畫圖時把它縮小、移到左上角（靜音按鈕的對面），而且跟著頁面一起捲動。 */
body.gt-drawing-mode .chat-fab {
  position: absolute; top: 14px; left: 16px; right: auto; bottom: auto;
  width: 36px; height: 36px; font-size: 16px; box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

/* 螢幕比較矮的手機（高度 720px 以下）：畫圖時連「第 N 輪・共 M 輪」那一列也收掉，
   聊天室按鈕改成跟靜音按鈕一起靠右、疊在題目那一列的右邊。多出來的高度剛好夠放
   粗細滑桿那一排，送出按鈕才不會被擠到要往下捲才按得到。 */
@media (max-height: 720px) {
  body.gt-drawing-mode .gt-eyebrow { display: none; }
  body.gt-drawing-mode .gt-paper { padding-top: 10px; }
  body.gt-drawing-mode .chat-fab { left: auto; right: 62px; top: 14px; }
  body.gt-drawing-mode #game-gartic .tl-audio-bar { top: 8px; right: 12px; }
  body.gt-drawing-mode .gt-incoming-row { padding-right: 92px; min-height: 40px; }
}

.gt-canvas-wrap {
  position:relative; width:100%; aspect-ratio:1; border-radius:14px; overflow:hidden; background:#e9e4d6;
  box-shadow:0 10px 22px rgba(43,36,64,0.12), 0 0 0 1px rgba(43,36,64,0.06);
  touch-action: none;
  /* 這裡的 aspect-ratio:1（正方形）只是還沒量尺寸之前的預設值；實際高度由
     gartic.client.js 的 setupCanvasSize() 依照螢幕高度決定（正方形～4:5 直式之間）。
     寬螢幕（平板／電腦）上畫布太寬會高到超出畫面、工具列被擠到要往下捲才看得到，
     所以寬度另外用「螢幕高度扣掉工具列大概需要的空間」限制住，置中顯示 */
  max-width: max(260px, calc(100vh - 330px));
  max-width: max(260px, calc(100dvh - 330px));
  margin: 0 auto;
}
/* 點點底紋畫在 canvas 自己身上（而不是外框）：放大／移動畫布的時候底紋會跟著一起動，
   看起來才像「同一張紙被放大了」。canvas 本身是透明的，底下這層白底＋點點只是顯示用，
   不會被存進送出的圖裡（送出時另外鋪一層純白，見 gartic.client.js 的 exportDrawing）。 */
.gt-canvas-wrap canvas {
  position:absolute; left:0; top:0; display:block; touch-action:none;
  background-color:#fff;
  background-image: radial-gradient(rgba(43,36,64,0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  transform-origin: 0 0;
  will-change: transform;
}

/* ---- 放大／縮小控制（疊在畫布右下角） ---- */
.gt-zoom-bar {
  position:absolute; right:8px; bottom:8px; display:flex; align-items:center; gap:2px;
  background: rgba(43,36,64,0.78); border-radius:999px; padding:3px;
  box-shadow:0 4px 10px rgba(43,36,64,0.25);
}
.gt-zoom-bar button {
  width:auto; min-width:32px; height:32px; margin:0; padding:0 6px; border:none; border-radius:999px;
  background:transparent; color:#fff; font-size:19px; font-weight:700; line-height:1; cursor:pointer;
  box-shadow:none;
}
.gt-zoom-bar button:disabled { opacity:0.35; cursor:default; }
.gt-zoom-bar #gt-zoomLabel { font-size:12px; min-width:46px; font-variant-numeric: tabular-nums; }
.gt-zoom-bar #gt-zoomLabel.is-zoomed { background: rgba(255,255,255,0.18); }

/* ---- 工具列 ---- */
.gt-toolbar-row { display:flex; align-items:center; gap:7px; margin-top:10px; }
/* 工具按鈕預設 34px 寬；螢幕很窄（320px 那種小手機）一排放不下時允許稍微縮窄，不會被擠出畫面 */
.gt-tool-btn {
  width:34px; height:34px; border-radius:10px; background:#fff; box-shadow:0 0 0 1px rgba(43,36,64,0.14);
  display:flex; align-items:center; justify-content:center; flex:0 1 34px; min-width:26px; border:none; padding:0; margin:0;
  color: var(--gt-ink); cursor:pointer;
}
.gt-tool-btn.active { background: var(--gt-ink); color:#fff; box-shadow:none; }
/* 第一排：復原／重做推到最右邊 */
.gt-row-tools .gt-tool-actions { margin-left:auto; }

/* ---- 筆刷粗細滑桿 ----
   以前是 5 顆固定大小的圓點，窄一點的手機上最後一顆會被擠出畫面；改成一條滑桿，
   寬度會自己配合螢幕，不會再被切掉。滑桿底下那個「左邊尖、右邊粗」的楔形是提示
   「往右越粗」，真正可以拖的是上面那顆圓鈕。 */
.gt-row-size { gap:10px; }
.gt-size-slider { position:relative; flex:1 1 auto; min-width:0; height:34px; display:flex; align-items:center; }
.gt-size-wedge {
  position:absolute; left:6px; right:6px; top:50%; height:16px; transform:translateY(-50%);
  background: rgba(43,36,64,0.22);
  clip-path: polygon(0 44%, 100% 0, 100% 100%, 0 56%);
  border-radius: 0 8px 8px 0; pointer-events:none;
}
.gt-size-slider input[type=range] {
  -webkit-appearance:none; appearance:none; position:relative; width:100%; height:34px; margin:0; padding:0;
  background:transparent; border:none; outline:none; touch-action:none; cursor:pointer;
}
.gt-size-slider input[type=range]::-webkit-slider-runnable-track { height:34px; background:transparent; border:none; }
.gt-size-slider input[type=range]::-moz-range-track { height:34px; background:transparent; border:none; }
.gt-size-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance:none; appearance:none; width:26px; height:26px; margin-top:4px; border-radius:50%;
  background:#fff; border:3px solid var(--gt-ink); box-shadow:0 2px 6px rgba(43,36,64,0.25);
}
.gt-size-slider input[type=range]::-moz-range-thumb {
  width:20px; height:20px; border-radius:50%;
  background:#fff; border:3px solid var(--gt-ink); box-shadow:0 2px 6px rgba(43,36,64,0.25);
}
/* 預覽：實際畫出來的粗細跟顏色（畫布 100% 大小時） */
.gt-size-preview {
  width:36px; height:36px; flex:none; border-radius:10px; background:#fff; box-shadow:0 0 0 1px rgba(43,36,64,0.14);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.gt-size-preview span { display:block; border-radius:50%; flex:none; }

/* ---- 顏色：12 個常用色＋最後一顆「自選顏色」，每列 7 顆、共兩列，平均撐滿整排 ---- */
.gt-row-colors { display:block; }
.gt-color-row { display:grid; grid-template-columns: repeat(7, 1fr); gap:8px 0; justify-items:center; }
.gt-color-swatch {
  width:30px; height:30px; border-radius:50%; border:none; padding:0; margin:0; cursor:pointer; flex:none;
  box-shadow: 0 0 0 1px rgba(43,36,64,0.18) inset; /* 白色那顆在紙感底色上也要看得出邊界 */
}
.gt-color-swatch.active { box-shadow:0 0 0 2px var(--gt-paper), 0 0 0 4px var(--gt-ink); }
/* 自選顏色那一顆：外圈彩虹，中間顯示目前自選的顏色（還沒選過就顯示一個加號） */
.gt-color-swatch.gt-color-custom {
  position:relative; box-shadow:none; color: var(--gt-ink); font-size:15px; font-weight:800; line-height:1;
  background: conic-gradient(#ff3b30, #ffcc00, #34c759, #32ade6, #5856d6, #ff2d92, #ff3b30);
}
.gt-color-swatch.gt-color-custom::after {
  content: attr(data-mark); position:absolute; inset:5px; border-radius:50%; background: var(--gt-custom, #fff);
  display:flex; align-items:center; justify-content:center;
}
.gt-color-swatch.gt-color-custom.active { box-shadow:0 0 0 2px var(--gt-paper), 0 0 0 4px var(--gt-ink); }

/* ---- 自選顏色面板 ---- */
.gt-picker {
  margin-top:10px; padding:10px; border-radius:14px; background:#fff;
  box-shadow:0 6px 16px rgba(43,36,64,0.12), 0 0 0 1px rgba(43,36,64,0.08);
}
/* 上面那一塊：左右是「淡→鮮豔」，上下是「亮→暗」；顏色的種類（紅橙黃綠…）用下面那條選 */
.gt-picker-sv {
  position:relative; width:100%; height:118px; border-radius:10px; touch-action:none; cursor:crosshair;
  background-color: hsl(200, 100%, 50%);
  background-image: linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, rgba(255,255,255,0));
}
.gt-picker-handle {
  position:absolute; width:20px; height:20px; margin:-10px 0 0 -10px; border-radius:50%; pointer-events:none;
  border:3px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,0.45), 0 2px 5px rgba(0,0,0,0.35);
}
.gt-picker-hue {
  -webkit-appearance:none; appearance:none; display:block; width:100%; height:22px; margin:12px 0 10px; padding:0;
  border:none; border-radius:11px; outline:none; touch-action:none;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.gt-picker-hue::-webkit-slider-thumb {
  -webkit-appearance:none; appearance:none; width:26px; height:26px; border-radius:50%; background:#fff;
  border:3px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,0.45), 0 2px 5px rgba(0,0,0,0.35); cursor:pointer;
}
.gt-picker-hue::-moz-range-thumb {
  width:20px; height:20px; border-radius:50%; background:#fff;
  border:3px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,0.45), 0 2px 5px rgba(0,0,0,0.35); cursor:pointer;
}
.gt-picker-hue::-moz-range-track { background:transparent; }
.gt-picker-footer { display:flex; align-items:center; gap:10px; }
.gt-picker-preview { width:34px; height:34px; border-radius:10px; flex:none; box-shadow:0 0 0 1px rgba(43,36,64,0.2) inset; }
.gt-picker-recent { display:flex; gap:7px; flex-grow:1; min-width:0; overflow:hidden; }
.gt-picker-recent button {
  width:26px; height:26px; border-radius:50%; border:none; padding:0; margin:0; flex:none; cursor:pointer;
  box-shadow:0 0 0 1px rgba(43,36,64,0.18) inset;
}
.gt-picker-done {
  width:auto; margin:0; padding:9px 16px; font-size:14px; font-weight:700; border:none; border-radius:10px; flex:none;
  background: var(--gt-ink); color:#fff; box-shadow:none; cursor:pointer;
}
.gt-tool-actions { display:flex; gap:12px; flex:none; align-items:center; }
.gt-tool-actions button {
  background:none; border:none; padding:0; margin:0; width:24px; height:24px; cursor:pointer; color: var(--gt-ink);
  box-shadow:none; border-radius:0;
}
.gt-tool-actions button:disabled { color: rgba(43,36,64,0.3); cursor:default; }
.gt-submit-btn {
  width:100%; padding:16px; font-size:17px; font-weight:700; border:none; border-radius:14px; margin-top:14px;
  background:linear-gradient(135deg, var(--gt-coral), var(--gt-sun)); color:#fff;
  box-shadow:0 8px 18px rgba(255,107,107,0.35); cursor:pointer;
}
.gt-submit-btn:disabled { opacity:0.5; }

/* ---- 等待其他人 ---- */
.gt-waiting-icon {
  width:64px; height:64px; border-radius:50%; background:#fff; margin:6px auto 16px;
  display:flex; align-items:center; justify-content:center; color: var(--gt-coral);
  box-shadow:0 8px 18px rgba(43,36,64,0.1);
}
.gt-waiting-heading { text-align:center; font-size:19px; font-weight:800; margin:0 0 4px; }
.gt-waiting-sub { text-align:center; font-size:13px; color: var(--gt-muted); margin:0 0 14px; }
#game-gartic .gt-paper .ready-chip-row { justify-content:center; }
#game-gartic .gt-paper .ready-chip { background: rgba(43,36,64,0.06); border-color: rgba(43,36,64,0.12); color: var(--gt-ink); }

/* ---- 最終播放：聊天室風格逐則播放 ---- */
.gt-reveal-header {
  display:flex; align-items:center; gap:10px; padding-bottom:14px; margin-bottom:14px;
  border-bottom:1.5px solid rgba(43,36,64,0.08);
}
.gt-reveal-avatar {
  width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:15px; font-weight:700; color:#fff; background: var(--gt-coral);
}
.gt-reveal-title { font-size:15.5px; font-weight:800; }
.gt-reveal-sub { display:flex; align-items:center; gap:5px; margin-top:1px; font-size:11.5px; font-weight:700; color: var(--gt-leaf); }
.gt-live-dot { width:7px; height:7px; border-radius:50%; background: var(--gt-leaf); flex:none; animation: gt-pulse 1.4s infinite; }
@keyframes gt-pulse { 0%,100%{opacity:1} 50%{opacity:0.25} }
.gt-reveal-dots { display:flex; gap:4px; flex:none; }
.gt-reveal-dot { width:6px; height:6px; border-radius:50%; background: rgba(43,36,64,0.18); }
.gt-reveal-dot.active { background: var(--gt-ink); }
.gt-thread { display:flex; flex-direction:column; gap:14px; min-height:120px; }
.gt-msg-row { display:flex; align-items:flex-end; gap:8px; opacity:0; transform:translateY(6px); animation: gt-msg-in 0.35s ease forwards; }
@keyframes gt-msg-in { to { opacity:1; transform:translateY(0); } }
.gt-msg-row.gt-me { flex-direction:row-reverse; }
.gt-msg-avatar {
  width:26px; height:26px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; color:#fff; background: var(--gt-coral);
}
.gt-msg-col { min-width:0; display:flex; flex-direction:column; }
.gt-msg-row.gt-me .gt-msg-col { align-items:flex-end; }
.gt-msg-name { font-size:10px; font-weight:700; color: var(--gt-muted); margin:0 0 3px 2px; display:flex; align-items:center; gap:5px; }
.gt-msg-row.gt-me .gt-msg-name { margin:0 2px 3px 0; }
.gt-msg-tag {
  font-size:9px; font-weight:800; color:#e6533f; background:rgba(255,107,107,0.14); padding:1px 6px; border-radius:999px;
}
.gt-msg-bubble {
  display:inline-block; background:#fff; border-radius:4px 16px 16px 16px; padding:9px 13px;
  font-size:13.5px; font-weight:700; line-height:1.35; box-shadow:0 3px 8px rgba(43,36,64,0.08), 0 0 0 1px rgba(43,36,64,0.06);
  max-width: 200px;
}
.gt-msg-row.gt-me .gt-msg-bubble {
  border-radius:16px 4px 16px 16px; background:linear-gradient(135deg, var(--gt-coral), var(--gt-sun)); color:#fff;
  box-shadow:0 4px 10px rgba(255,107,107,0.25);
}
.gt-msg-bubble.gt-bubble-image { padding:6px; width:158px; box-sizing:border-box; }
.gt-msg-bubble.gt-bubble-image img { display:block; width:100%; border-radius:8px; background:#fff; }
.gt-msg-bubble.gt-highlight { box-shadow:0 0 0 2.5px var(--gt-coral), 0 6px 14px rgba(255,107,107,0.25); }
.gt-typing-bubble { display:inline-flex; align-items:center; gap:4px; background:#fff; border-radius:4px 16px 16px 16px; padding:11px 14px; box-shadow:0 3px 8px rgba(43,36,64,0.08), 0 0 0 1px rgba(43,36,64,0.06); }
.gt-typing-bubble span { width:6px; height:6px; border-radius:50%; background:rgba(43,36,64,0.35); }

/* ---- 自動播放全部播完後：讓玩家自己點頭像回顧任何一本相簿（不用重播打字動畫，
   整本直接秒開） ---- */
.gt-review-section { margin-top:16px; padding-top:14px; border-top:1.5px solid rgba(43,36,64,0.08); }
.gt-review-label { text-align:center; font-size:11.5px; font-weight:700; color: var(--gt-muted); margin-bottom:10px; }
.gt-review-strip { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.gt-review-avatar {
  width:34px; height:34px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; color:#fff; border:none; padding:0; cursor:pointer;
  box-shadow: 0 0 0 2px var(--gt-paper), 0 0 0 3px transparent; opacity:0.55;
}
.gt-review-avatar.active { box-shadow: 0 0 0 2px var(--gt-paper), 0 0 0 3px var(--gt-ink); opacity:1; }

/* ---- 紙感卡片裡的次要按鈕（強制跳下一輪、離開這一桌…）：預設的 .secondary 是給深紫
   底盤配的白字半透明底，疊在淺色紙張背景上幾乎看不見，這裡疊一份跟紙張配色一致的版本 ---- */
.gt-paper button.secondary {
  background: rgba(43,36,64,0.08);
  color: var(--gt-ink);
  box-shadow: 0 0 0 1px rgba(43,36,64,0.15) inset;
}

/* =====================================================================
   電畫傳情「你畫我猜」模式（畫面結構見 index.html 的 #gt-liveHead／#gt-liveView／#gt-liveFoot）
   沿用同一張紙感卡片，上面多一列題目＋倒數條，下面多猜題紀錄跟計分板。
   ===================================================================== */
.gt-rules-mode { font-weight: 700; margin: 10px 0 2px; font-size: 14px; }

/* 你畫我猜的畫布固定 4:3 橫式（實際高度由 gartic.client.js 設定，這裡是還沒量之前的預設值） */
.gt-canvas-wrap.gt-live-ratio, .gt-view-wrap { aspect-ratio: 4 / 3; }
.gt-canvas-wrap.gt-live-ratio {
  max-width: max(260px, calc((100vh - 250px) * 1.3333));
  max-width: max(260px, calc((100dvh - 250px) * 1.3333));
}
/* 猜的人的畫布：平常跟卡片一樣寬。鍵盤彈出來、螢幕剩下的高度放不下整張畫時，
   gartic.client.js 的 fitViewCanvas() 會把外框縮小（維持 4:3），畫布跟著等比例縮小、置中。 */
.gt-view-wrap { max-width: none; touch-action: auto; }
.gt-view-wrap canvas { touch-action: auto; width: 100%; height: 100%; } /* 只是看的，手指在上面滑要能捲動頁面 */

/* 你畫我猜時，傳話接龍才用得到的東西收起來：上面那則「誰出的題」、最下面的送出按鈕 */
.gt-live #gt-drawIncoming, .gt-live #gt-drawSubmitBtn { display: none; }

/* ---- 題目／提示那一列 ---- */
.gt-live-word {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  min-height: 34px; margin: 0 4px 6px; text-align: center;
}
.gt-live-label { font-size: 13px; font-weight: 700; color: var(--gt-muted); }
.gt-live-label.is-ok { color: #2e9e4f; }
.gt-live-answer { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.gt-live-count { font-size: 12px; font-weight: 700; color: var(--gt-muted); }
.gt-hint { display: inline-flex; gap: 6px; }
.gt-hint-cell {
  display: inline-flex; align-items: flex-end; justify-content: center; width: 24px; height: 28px;
  font-size: 20px; font-weight: 800; line-height: 1; border-bottom: 3px solid var(--gt-ink); padding-bottom: 2px;
}
.gt-hint-cell.is-shown { border-bottom-color: var(--gt-coral); color: var(--gt-coral); }

/* ---- 倒數條 ---- */
.gt-timer { height: 8px; border-radius: 4px; background: rgba(43,36,64,0.12); overflow: hidden; margin: 0 4px 8px; }
.gt-timer-fill { height: 100%; width: 100%; border-radius: 4px; background: #1e4fd8; }
.gt-timer-fill.is-low { background: var(--gt-coral); }
.gt-timer-fill.is-idle { background: rgba(43,36,64,0.3); }

/* ---- 蓋在畫布上的說明（準備中／公布答案） ---- */
.gt-live-overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 12px; text-align: center; background: rgba(250,243,226,0.93); color: var(--gt-ink);
}
/* 公布答案時留一點透明，看得到後面那張畫 */
.gt-live-overlay.is-result { background: rgba(250,243,226,0.84); }
.gt-ov-title { font-size: 14px; font-weight: 700; color: var(--gt-muted); }
.gt-ov-word { font-size: 30px; font-weight: 800; letter-spacing: 3px; margin: 2px 0 4px; }
.gt-ov-sub { font-size: 14px; font-weight: 700; color: var(--gt-muted); }
.gt-ov-sub #gt-ovCount { font-size: 20px; color: var(--gt-coral); margin-left: 4px; }
.gt-ov-rows { width: 100%; max-width: 240px; max-height: 46%; overflow: auto; }
.gt-ov-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; padding: 2px 0; }
.gt-ov-row b { color: #2e9e4f; }
.gt-ov-next { font-size: 12px; font-weight: 700; color: var(--gt-muted); margin-top: 6px; }

/* ---- 答題框（在畫布上面，原因見 index.html #gt-liveView 的說明） ---- */
.gt-live-compose { margin: 0 4px 8px; padding: 3px 4px 3px 16px; }
.gt-live-compose input { padding: 8px 0; }
.gt-live-compose .gt-send-btn { width: 40px; height: 40px; }
.gt-live-compose input:disabled { opacity: 0.5; }
/* 一句話的提示：浮在畫布上緣的小膠囊 */
.gt-live-note {
  position: absolute; z-index: 2; top: 8px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px);
  padding: 5px 12px; border-radius: 999px; background: rgba(43,36,64,0.86); color: #fff;
  font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.gt-live-note:empty { display: none; }
.gt-live-note.is-ok { background: rgba(46,158,79,0.94); }
.gt-live-note.is-close { background: rgba(217,130,0,0.94); }
.gt-live-note.is-warn { background: rgba(229,75,75,0.94); }

/* ---- 猜題紀錄 ---- */
.gt-feed {
  margin: 8px 4px 0; padding: 8px 10px; max-height: 118px; overflow-y: auto; background: #fff; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(43,36,64,0.08); font-size: 13.5px; line-height: 1.5;
}
.gt-feed-item { color: var(--gt-ink); word-break: break-all; }
.gt-feed-item b { font-weight: 700; margin-right: 4px; }
.gt-feed-item.is-ok { color: #2e9e4f; font-weight: 700; }
.gt-feed-empty { color: var(--gt-muted); font-size: 12.5px; text-align: center; }
/* 畫的人：畫布正下方的一行最新動態 */
.gt-live-ticker {
  margin: 8px 4px 0; padding: 6px 10px; background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px rgba(43,36,64,0.08);
  font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gt-live-ticker .gt-feed-item { overflow: hidden; text-overflow: ellipsis; }

/* ---- 計分板 ---- */
.gt-scores { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 4px 0; }
.gt-score-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 1px rgba(43,36,64,0.1); font-size: 13px; font-weight: 600; max-width: 100%;
}
.gt-score-chip b { font-weight: 800; }
.gt-score-mark { display: inline-flex; font-size: 13px; }
.gt-score-mark:empty { display: none; }
.gt-score-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7em; }
.gt-score-chip.is-drawer { background: #e8f0ff; box-shadow: 0 0 0 1.5px #1e4fd8; color: #1e4fd8; }
.gt-score-chip.is-guessed { background: #e9f7ee; box-shadow: 0 0 0 1.5px #2e9e4f; color: #1f7a3a; }
.gt-score-chip.is-me .gt-score-name { text-decoration: underline; text-underline-offset: 3px; }
.gt-paper button.secondary.gt-skip-btn { margin: 12px 4px 0; width: calc(100% - 8px); padding: 10px; font-size: 13px; }

/* ---- 最終排名 ---- */
.gt-final-title { text-align: center; font-size: 22px; font-weight: 800; margin: 4px 0 16px; line-height: 1.4; }
.gt-final-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 8px; background: #fff; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(43,36,64,0.08); font-size: 16px;
}
.gt-final-row.is-first { box-shadow: 0 0 0 2px var(--gt-sun); background: #fff8e1; }
.gt-final-row.is-me .gt-final-name { text-decoration: underline; text-underline-offset: 3px; }
.gt-final-rank {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: rgba(43,36,64,0.1); font-size: 13px; font-weight: 800;
}
.gt-final-row.is-first .gt-final-rank { background: var(--gt-sun); color: #fff; }
.gt-final-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }

/* 螢幕比較矮的手機：你畫我猜時「第 N 回合」那一列已經被收掉（見上面 max-height:720px 的規則），
   題目那一列的右邊要讓出位置給靜音跟聊天室按鈕 */
@media (max-height: 720px) {
  body.gt-drawing-mode .gt-live .gt-live-word { padding-right: 92px; justify-content: flex-start; min-height: 40px; }
}

/* ===================== 絲路商人 ===================== */
/* 跟阿瓦隆／政變同一招：坐在這一桌時整頁沉浸主題（深藍黑底），不露出大廳共用的背景跟標題。
   畫面照定案的 mockup 做：場上三排發展卡、貴族、貨物庫、自己的資產，全部塞在一個手機畫面裡，
   點東西會從下面滑出面板。class 一律用 sr- 開頭，不會影響其他遊戲。 */
body.theme-silkroad { background: #141821; padding: 0; }
body.theme-silkroad h1 { display: none; }
body.theme-silkroad .container { margin-top: 0; }
/* 聊天室的浮動按鈕搬到右上角、縮小，才不會蓋住右下角「保留的卡」 */
body.theme-silkroad .chat-fab { right: 8px; top: 8px; bottom: auto; width: 36px; height: 36px; font-size: 16px; background: #262d3c; box-shadow: none; }

#game-silkroad {
  --sr-bg: #141821; --sr-panel: #1d2330; --sr-panel2: #222938; --sr-line: #2c3445; --sr-line2: #3a4356;
  --sr-ink: #eef1f6; --sr-muted: #aab3c2; --sr-gold: #f0c24a; --sr-good: #6fd3a0; --sr-bad: #ff8a80;
  --sr-serif: "Noto Serif TC", Georgia, "Times New Roman", serif;
  --sr-card-w: 80px; /* 場上一張卡的寬度，silkroad.client.js 會依照螢幕大小重算 */
  color: var(--sr-ink);
  width: 100%;
  max-width: 480px;
}
#game-silkroad { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif; }
#game-silkroad #sr-setupScreen, #game-silkroad #sr-gameoverScreen { margin: 16px; }

/* 大廳共用的 button 樣式（滿版、粉橘漸層、下方留白）在這款遊戲裡幾乎都不適用，
   所以這裡的按鈕一律先加 sr-btn 把那些歸零，再各自加樣式 */
.sr-btn {
  width: auto; padding: 0; margin: 0; border: none; border-radius: 0; background: none; color: inherit;
  font: inherit; font-weight: inherit; text-align: inherit; cursor: pointer; transition: none; -webkit-appearance: none; appearance: none;
}
.sr-btn:active { transform: none; }
.sr-btn:disabled { opacity: 1; }
.sr-num { font-family: var(--sr-serif); font-weight: 900; }
.sr-outline { text-shadow: 0.5px 0 0 #1c1c1c, -0.5px 0 0 #1c1c1c, 0 0.5px 0 #1c1c1c, 0 -0.5px 0 #1c1c1c; }
.sr-outline-lg { text-shadow: 0.75px 0 0 #1c1c1c, -0.75px 0 0 #1c1c1c, 0 0.75px 0 #1c1c1c, 0 -0.75px 0 #1c1c1c, 0 2px 3px rgba(0,0,0,0.7); }

/* ---- 主畫面 ---- */
.sr-main { box-sizing: border-box; min-height: 100vh; min-height: 100dvh; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--sr-bg); }
.sr-head { display: flex; align-items: center; gap: 6px; height: 36px; padding-right: 42px; /* 右邊讓給聊天室按鈕 */ }
/* 「第幾輪」疊在遊戲名稱下面（不排在右邊），頂列才放得下「輪到誰」＋喇叭＋選單三樣東西 */
.sr-title { display: flex; flex-direction: column; justify-content: center; font-size: 17px; font-weight: 900; letter-spacing: 2px; line-height: 1.15; white-space: nowrap; }
.sr-title small { font-size: 11px; font-weight: 400; letter-spacing: 0; line-height: 1.2; color: var(--sr-muted); }
.sr-head-space { flex: 1; }
.sr-turn { padding: 5px 12px; border-radius: 999px; background: var(--sr-panel2); color: var(--sr-ink); font-size: 13px; font-weight: 700; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.sr-turn.is-mine { background: var(--sr-gold); color: #231a00; }
.sr-menu-btn.sr-btn { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--sr-panel); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.sr-mute-btn.sr-btn.is-muted { color: var(--sr-muted); }
.sr-final { padding: 6px 10px; border-radius: 10px; background: rgba(240,194,74,0.14); color: var(--sr-gold); font-size: 12.5px; font-weight: 700; text-align: center; }

/* 其他玩家 */
.sr-opps { display: flex; gap: 6px; }
.sr-opp.sr-btn { flex: 1; min-width: 0; min-height: 54px; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--sr-line); border-radius: 10px; background: var(--sr-panel); display: flex; flex-direction: column; gap: 3px; text-align: left; }
.sr-opp.is-acting { border-color: var(--sr-gold); box-shadow: 0 0 0 1px var(--sr-gold); }
.sr-opp-top { display: flex; align-items: center; gap: 6px; width: 100%; }
.sr-opp-top .avatar-img, .sr-opp-top .avatar-fallback { flex: none; border-radius: 50%; font-size: 11px; }
.sr-opp-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-opp-pts { font-size: 21px; font-weight: 800; line-height: 1; }
.sr-opp-sub { font-size: 11px; color: var(--sr-muted); white-space: nowrap; }

/* 左邊的窄條（貴族的標題、牌庫） */
.sr-strip { width: 16px; flex: none; align-self: stretch; border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--sr-ink); }
.sr-strip.sr-btn { border-radius: 5px; }
.sr-strip.is-picked { box-shadow: 0 0 0 2.5px var(--sr-gold); }
.sr-strip-noble { background: #54457a; font-size: 10px; font-weight: 700; line-height: 1; gap: 4px; }
.sr-strip .sr-roman { font-family: var(--sr-serif); font-size: 11px; font-weight: 900; line-height: 1; }
.sr-strip .sr-left { font-size: 13px; font-weight: 800; line-height: 1; }

/* 貴族 */
/* 貴族這一排跟下面三排發展卡一樣寬、一樣置中，左邊才會對齊
   （螢幕比較矮的手機，卡片會縮小，三排卡片就不會佔滿整個寬度）。
   寬度＝左邊的窄條 16px＋4 個間距＋4 張卡。 */
.sr-nobles { display: flex; align-items: flex-start; gap: 6px; align-self: center; box-sizing: border-box; width: calc(16px + 6px * 4 + var(--sr-card-w) * 4); max-width: 100%; }
/* container-type：讓板塊裡的分數、需求長方形可以用「板塊寬度的百分之幾」（cqw）當單位——
   4 人局有 5 位貴族，螢幕小的時候板塊會縮小，裡面的東西要跟著一起縮才放得下。 */
.sr-noble.sr-btn, .sr-noble { flex: 0 1 64px; min-width: 0; aspect-ratio: 1 / 1; border-radius: 7px; background: var(--sr-panel2); position: relative; overflow: hidden; display: block; container-type: inline-size; }
.sr-noble img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.sr-noble.is-taken img { filter: grayscale(1) brightness(0.45); }
.sr-noble.is-taken .sr-noble-strip { opacity: 0.45; }
.sr-noble.is-picked { box-shadow: 0 0 0 2.5px var(--sr-gold); }
.sr-noble-strip { position: absolute; left: 0; top: 0; bottom: 0; width: 28%; box-sizing: border-box; padding: 3% 0; background: rgba(12,14,20,0.55); display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
/* 每個數字寫兩次：前面的 px 是板塊 64px 寬時的大小（給不認得 cqw 的舊手機用），後面的 cqw 會跟著板塊縮放 */
.sr-noble-pts { font-size: 14px; font-size: 21.9cqw; line-height: 1; color: #fff; }
.sr-noble-reqs { display: flex; flex-direction: column; gap: 1.5px; gap: 2.3cqw; }
/* 貴族的需求是「買了幾張卡」，所以畫成直立的小長方形（卡片的形狀），跟價格的圓形分開 */
.sr-req { width: 12px; width: 18.75cqw; height: 14px; height: 21.9cqw; box-sizing: border-box; border-radius: 2.5px; border: 0.75px solid #fff; color: #fff; font-size: 10px; font-size: 15.6cqw; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* 場上的發展卡 */
.sr-market { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.sr-row { display: flex; align-items: flex-start; justify-content: center; gap: 6px; }
.sr-card.sr-btn, .sr-card { width: var(--sr-card-w); flex: none; aspect-ratio: 754 / 1125; border-radius: 7px; background: var(--sr-panel2); position: relative; overflow: hidden; display: block; }
.sr-card.is-picked { box-shadow: 0 0 0 2.5px var(--sr-gold); }
.sr-card.is-empty { background: none; border: 1.5px dashed var(--sr-line2); box-sizing: border-box; }
.sr-card > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.sr-card-pts { position: absolute; left: 7%; top: 0; font-size: calc(var(--sr-card-w) * 0.29); line-height: 1.15; color: #fff; }
/* 價格：靠下緣排成一排，大小跟著卡片的寬度縮放（卡寬 81px 的時候代幣 17px） */
.sr-cost { position: absolute; left: 0; right: 0; bottom: 6%; display: flex; justify-content: center; gap: 2px; }
.sr-pip { width: calc(var(--sr-card-w) * 0.208); height: calc(var(--sr-card-w) * 0.208); box-sizing: border-box; border-radius: 50%; border: 0.75px solid #fff; color: #fff; font-size: calc(var(--sr-card-w) * 0.135); line-height: 1; display: flex; align-items: center; justify-content: center; }

/* 代幣圖＋右下角的數量 */
.sr-tok { position: relative; display: block; flex: none; }
.sr-tok img { width: 100%; height: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); }
.sr-tok-n { position: absolute; right: -5px; bottom: -3px; min-width: 16px; height: 16px; box-sizing: border-box; padding: 0 3px; border-radius: 8px; background: var(--sr-bg); border: 1px solid rgba(255,255,255,0.8); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* 貨物庫 */
.sr-bank { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: var(--sr-panel); }
/* 「貨物庫」三個字直排（一個字一行），跟左邊「貴族」那一條同樣的寫法，才不會被擠成兩行 */
.sr-bank-label { width: 14px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; line-height: 1; color: var(--sr-muted); }
.sr-bank-list { flex: 1; display: flex; justify-content: space-between; }
.sr-bank-item.sr-btn { width: 46px; min-height: 52px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sr-bank-item .sr-tok { width: 34px; height: 34px; }
.sr-bank-item .sr-tok-n { right: -6px; min-width: 17px; height: 17px; font-size: 13px; }
.sr-bank-item span.sr-name, .sr-mine-gem span.sr-name { font-size: 11px; color: #c3cad6; line-height: 1; white-space: nowrap; }
.sr-dim { opacity: 0.4; }

/* 我的資產 */
.sr-mine { padding: 8px 10px 9px; border: 1.5px solid var(--sr-gold); border-radius: 14px; background: #1a2030; display: flex; flex-direction: column; gap: 7px; }
.sr-mine.is-waiting { border-color: var(--sr-line2); }
.sr-mine-head { display: flex; align-items: center; gap: 8px; }
.sr-mine-head .avatar-img, .sr-mine-head .avatar-fallback { flex: none; border-radius: 50%; font-size: 12px; }
.sr-mine-pts b { font-size: 27px; font-weight: 800; line-height: 1; color: var(--sr-gold); }
.sr-mine-pts, .sr-mine-stat { font-size: 12px; color: var(--sr-muted); white-space: nowrap; }
.sr-mine-stat b { color: var(--sr-ink); }
.sr-disc-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.sr-disc.sr-btn { min-height: 36px; padding: 0 2px; border: 1px solid #323b4d; border-radius: 8px; background: var(--sr-panel2); font-size: 12px; line-height: 1; white-space: nowrap; display: flex; align-items: center; justify-content: center; }
.sr-disc.is-on { border: 1.5px solid var(--sr-gold); background: #2a3042; }
.sr-disc i { font-style: normal; color: var(--sr-muted); }
.sr-disc b { font-size: 17px; font-weight: 800; }
.sr-disc span { font-weight: 700; }
.sr-mine-bottom { display: flex; gap: 10px; }
.sr-mine-gems { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sr-label { font-size: 11px; color: var(--sr-muted); }
.sr-mine-gem-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.sr-mine-gem { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sr-mine-gem .sr-tok { width: 30px; height: 30px; }
.sr-mine-gem span.sr-name { font-size: 10px; color: var(--sr-muted); }
.sr-mine-res { width: 108px; flex: none; display: flex; flex-direction: column; gap: 5px; }
.sr-res-list { display: flex; align-items: flex-start; gap: 6px; }
.sr-res.sr-btn, .sr-res { flex: 1 1 0; min-width: 0; aspect-ratio: 754 / 1125; border-radius: 5px; background: var(--sr-panel2); position: relative; overflow: hidden; display: block; }
.sr-res.is-empty { background: none; border: 1.5px dashed var(--sr-line2); box-sizing: border-box; }
.sr-res.is-picked { box-shadow: 0 0 0 2px var(--sr-gold); }
.sr-res img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.sr-res-pts { position: absolute; left: 3px; top: 0; font-size: 13px; line-height: 1.2; color: #fff; }
.sr-res-tag { position: absolute; left: 2px; right: 2px; bottom: 3px; height: 14px; border-radius: 7px; background: rgba(10,12,16,0.85); color: var(--sr-ink); font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap; display: flex; align-items: center; justify-content: center; }
.sr-res-tag.is-ok { background: var(--sr-gold); color: #231a00; }
.sr-back { box-sizing: border-box; border: 1px solid #a8873a; color: #f3e3b0; font-family: var(--sr-serif); font-weight: 900; display: flex; align-items: center; justify-content: center; }
.sr-pass.sr-btn { height: 46px; border-radius: 12px; background: var(--sr-gold); color: #231a00; font-size: 15px; font-weight: 800; text-align: center; }

/* 上方跳出來的通知（別人做了什麼） */
.sr-toast { position: fixed; left: 50%; top: 50px; transform: translate(-50%, -8px); max-width: min(92vw, 440px); box-sizing: border-box; padding: 9px 14px; border-radius: 12px; background: rgba(38,45,60,0.96); border: 1px solid var(--sr-line2); color: var(--sr-ink); font-size: 13.5px; line-height: 1.4; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 450; }
.sr-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.sr-toast.is-gold { border-color: var(--sr-gold); color: var(--sr-gold); }

/* ---- 從下面滑上來的面板 ---- */
.sr-scrim { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(8,10,14,0.66); z-index: 400; }
.sr-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; max-height: 92vh; max-height: 92dvh; overflow-y: auto; box-sizing: border-box; padding: 10px 16px 18px; border-radius: 20px 20px 0 0; background: var(--sr-panel); border-top: 1px solid var(--sr-line2); display: flex; flex-direction: column; gap: 14px; z-index: 410; color: var(--sr-ink); }
.sr-grip { width: 40px; height: 4px; flex: none; border-radius: 2px; background: #4a5468; align-self: center; }
.sr-sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.sr-sheet-title { font-size: 19px; font-weight: 900; }
.sr-sheet-title small { font-size: 12px; font-weight: 400; color: var(--sr-muted); margin-left: 8px; }
.sr-close.sr-btn { width: 44px; height: 44px; margin: -6px -12px -6px 0; color: #c3cad6; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.sr-note { font-size: 13px; line-height: 1.6; color: #c3cad6; }
.sr-box { padding: 10px 12px; border-radius: 12px; background: var(--sr-bg); font-size: 13px; line-height: 1.6; color: #c3cad6; }
.sr-box b { color: var(--sr-ink); }
.sr-box .is-gold, .sr-note .is-gold { color: var(--sr-gold); font-weight: 700; }
.sr-box .is-bad, .sr-note .is-bad { color: var(--sr-bad); font-weight: 700; }
.sr-actions { display: flex; flex-direction: column; gap: 10px; }
.sr-actions.is-row { flex-direction: row; }
.sr-primary.sr-btn { min-height: 52px; padding: 0 12px; border-radius: 14px; background: var(--sr-gold); color: #231a00; font-size: 17px; font-weight: 900; text-align: center; flex: 2; }
.sr-primary.sr-btn:disabled { background: #343c4d; color: var(--sr-muted); font-size: 15px; font-weight: 700; }
.sr-secondary.sr-btn { min-height: 48px; padding: 0 12px; border: 1.5px solid #4a5468; border-radius: 14px; color: var(--sr-ink); font-size: 15px; font-weight: 700; text-align: center; flex: 1; }
.sr-secondary.sr-btn:disabled { opacity: 0.45; }

/* 拿貨物／還貨物：一排大代幣 */
.sr-pick-row { display: flex; justify-content: space-between; }
.sr-pick.sr-btn { width: 54px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sr-pick .sr-tok { width: 50px; height: 50px; margin-bottom: 2px; border-radius: 50%; }
.sr-pick .sr-tok-n { right: -6px; bottom: -4px; min-width: 21px; height: 21px; border-radius: 11px; font-size: 16px; }
.sr-pick.is-on .sr-tok { outline: 3px solid var(--sr-gold); outline-offset: 2px; }
.sr-pick span.sr-name { font-size: 12px; line-height: 1; color: #c3cad6; white-space: nowrap; }
.sr-pick span.sr-state { font-size: 10.5px; line-height: 1; color: #c3cad6; white-space: nowrap; min-height: 11px; }
.sr-pick.is-on span.sr-name, .sr-pick.is-on span.sr-state { color: var(--sr-gold); font-weight: 700; }
.sr-sum { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--sr-bg); font-size: 13px; color: #c3cad6; }
.sr-sum b { font-size: 24px; font-weight: 800; line-height: 1; color: var(--sr-gold); margin: 0 3px; }
.sr-sum.is-over b { color: var(--sr-bad); }
.sr-warn { padding: 8px 12px; border-radius: 10px; background: rgba(240,194,74,0.14); color: var(--sr-gold); font-size: 13px; font-weight: 700; line-height: 1.5; text-align: center; }

/* 放大的卡／貴族＋右邊的說明 */
.sr-detail { display: flex; gap: 14px; }
.sr-big { width: 168px; flex: none; align-self: flex-start; --sr-card-w: 168px; box-shadow: 0 0 0 2.5px var(--sr-gold); border-radius: 11px; }
.sr-big.sr-card .sr-card-pts { left: 12px; top: 3px; }
.sr-detail-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.sr-gain { display: flex; flex-direction: column; gap: 5px; }
.sr-gain-main { font-size: 16px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.sr-table { padding: 9px 10px; border-radius: 12px; background: var(--sr-bg); display: flex; flex-direction: column; gap: 7px; }
.sr-tr { display: grid; grid-template-columns: 44px repeat(4, minmax(0, 1fr)); gap: 3px; align-items: center; }
.sr-tr.is-3 { grid-template-columns: 46px repeat(3, minmax(0, 1fr)); }
.sr-tr > span { text-align: center; font-size: 18px; font-weight: 800; }
.sr-tr > span:first-child { text-align: left; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sr-tr > span:last-child { text-align: right; }
.sr-tr.is-head > span { font-size: 10.5px; font-weight: 400; color: var(--sr-muted); }
.sr-hr { height: 1px; background: var(--sr-line); }
.sr-noble-big { width: 168px; flex: none; align-self: flex-start; aspect-ratio: 1 / 1; border-radius: 11px; box-shadow: 0 0 0 2.5px var(--sr-gold); position: relative; overflow: hidden; }
.sr-noble-big img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.sr-noble-big .sr-noble-strip { width: 40px; padding: 6px 0; }
.sr-noble-big .sr-noble-pts { font-size: 34px; }
.sr-noble-big .sr-noble-reqs { gap: 5px; }
.sr-noble-big .sr-req { width: 24px; height: 32px; border-radius: 5px; border-width: 1px; font-size: 19px; }
.sr-noble-pick-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sr-noble-pick.sr-btn { width: 132px; }
.sr-noble-pick .sr-noble-big { width: 132px; box-shadow: 0 0 0 1.5px var(--sr-line2); }
.sr-noble-pick.is-on .sr-noble-big { box-shadow: 0 0 0 3px var(--sr-gold); }

/* 已買的卡／玩家資產 */
.sr-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.sr-tabs .sr-disc.sr-btn { min-height: 44px; border-radius: 10px; }
.sr-ptabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.sr-ptab.sr-btn { min-height: 48px; padding: 0 6px; border: 1px solid #323b4d; border-radius: 10px; background: var(--sr-panel2); display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; }
.sr-ptab.is-on { border: 1.5px solid var(--sr-gold); background: #2a3042; }
.sr-ptab .avatar-img, .sr-ptab .avatar-fallback { flex: none; border-radius: 50%; font-size: 11px; }
.sr-ptab span { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sr-ptab b { font-size: 19px; font-weight: 800; line-height: 1; color: var(--sr-gold); }
.sr-owned-list { display: flex; flex-wrap: wrap; gap: 12px; }
.sr-owned-item { width: 104px; display: flex; flex-direction: column; gap: 6px; --sr-card-w: 104px; }
.sr-owned-item .sr-card { box-shadow: 0 0 0 1.5px #4a5468; border-radius: 8px; }
.sr-owned-item span { font-size: 11px; color: var(--sr-muted); text-align: center; }
.sr-psum { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: var(--sr-muted); white-space: nowrap; }
.sr-psum b { color: var(--sr-ink); }
.sr-psum .sr-big-pts { font-size: 25px; font-weight: 800; line-height: 1; color: var(--sr-gold); }
.sr-prows { display: flex; flex-direction: column; gap: 6px; }
.sr-prow { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.sr-prow.has-cards { min-height: 60px; }
.sr-prow.is-none { opacity: 0.6; }
.sr-prow-label { width: 72px; flex: none; font-size: 12px; line-height: 1; white-space: nowrap; display: flex; align-items: center; }
.sr-prow-label i { font-style: normal; color: var(--sr-muted); }
.sr-prow-label b { font-size: 17px; font-weight: 800; }
.sr-prow-label span { font-weight: 700; }
.sr-prow-cards { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sr-mini { width: 40px; --sr-card-w: 40px; border-radius: 5px; }
.sr-mini .sr-card-pts { left: 3px; font-size: 14px; }
.sr-mini-noble { width: 40px; height: 40px; flex: none; border-radius: 5px; overflow: hidden; }
.sr-mini-noble img { width: 100%; height: 100%; display: block; }
.sr-pbottom { display: flex; gap: 12px; }
.sr-pbottom .sr-mine-gem .sr-tok { width: 28px; height: 28px; }
.sr-pbottom .sr-mine-res { width: 96px; }
.sr-pbottom .sr-res { flex: 0 0 28px; border-radius: 4px; }

/* 盲抽保留：牌背 */
.sr-deck-back { width: 120px; flex: none; align-self: flex-start; aspect-ratio: 754 / 1125; border-radius: 9px; border-width: 2px; flex-direction: column; gap: 8px; }
.sr-deck-back b { font-size: 44px; line-height: 1; }
.sr-deck-back span { font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 20px; font-weight: 800; line-height: 1; color: #e0cf9c; }
.sr-kv { display: flex; justify-content: space-between; gap: 8px; }
.sr-kv b { white-space: nowrap; }

/* 選單（規則、最近的動作、桌長跳過） */
.sr-rules { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.65; color: #c3cad6; }
.sr-log { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.5; color: #c3cad6; }

/* ---- 結算 ---- */
.sr-over { padding: 4px 0 12px; }
.sr-over-title { text-align: center; font-size: 22px; font-weight: 900; line-height: 1.4; margin: 4px 0 16px; color: var(--sr-gold); }
.sr-rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 8px; border-radius: 12px; background: var(--sr-panel); border: 1px solid var(--sr-line); }
.sr-rank-row.is-first { border-color: var(--sr-gold); background: rgba(240,194,74,0.1); }
.sr-rank-no { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--sr-panel2); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.sr-rank-row.is-first .sr-rank-no { background: var(--sr-gold); color: #231a00; }
.sr-rank-row .avatar-img, .sr-rank-row .avatar-fallback { flex: none; border-radius: 50%; }
.sr-rank-mid { flex: 1; min-width: 0; }
.sr-rank-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-rank-sub { font-size: 12px; color: var(--sr-muted); margin-top: 2px; }
.sr-rank-pts { font-size: 26px; font-weight: 800; color: var(--sr-gold); }

/* ===================== 激爆骰子樂（玩家端） ===================== */
/* 跟阿瓦隆／政變／絲路商人同一招：坐在這一桌時整頁沉浸主題（寶藍色的底），不露出大廳共用的
   背景跟標題。畫面照定案的 mockup 做：綠色絨布桌（黑色桌邊）、阿瓦隆式的座位、引信、米白色
   的操作區。class 一律用 dg- 開頭，不會影響其他遊戲。 */

/* 數字用的字型（Anton，SIL Open Font License）：只留 0～9 跟幾個符號，直接內嵌在這裡，
   沒有網路（手機開熱點玩）也看得到。 */
@font-face {
  font-family: "DG Anton";
  src: url(data:font/woff2;base64,d09GMgABAAAAABSMABAAAAAALgAAABQvAAIdsgAAAAAAAAAAAAAAAAAAAAAAAAAAGyAcgWgGYAB4CIE+CZwMEQgKsBSrLQE2AiQDgRILTAAEIAWDSgcgDIFhGzUqRQZqGhMbRvB/eUCP2WuoU8vQlD09Bh1T25awFEJMyX1xKKVi2HnvLB+l8R1smr38+LtbNi2hZQktpdJsdMMfTtZgafLLV9NBeGeEJLMQ9f9T+55DV7oiA8uWFROHHZYxZAfNDxyFuLzxAiq7HD9gShYBvoifBuhm3eaa3Hw1szyqgdKjF1AAAfA82mpeVOBBfviIZRA7GSxrJ44laMIOW9RX1Omql8EVWrflfGx4iKbKMv4vEFiynAffMvUKBMmD9nYZa25rGIqxuC2kJiJGQdFQpAuWyT0Y/+d1put735LPsVOi+cqwBmgtwUawS+/bqv+X4hoOpGOWQ2Sd5TCvZcKtGw9TeUyXoVObucu89UPSKkvutqIiOv4vc2bWsQLoG59qrQBXlPCrffU1I4BPOQmkt39giAAGIPsfAHDFDWxATRjdnz5ykCg6oR8kz3D7wUMHKNg5ld5G2cHpA1NUAbItVoA8ksaynTDL2c4UbskJoGGnPITO16IQfDSOIBFyKKKUCpJUI4qdgstmT47BY98+Si7FlJFgFjWwRgFKNYI4Cqu/2jAxCimhnEqqMPof8j0s2LnmfuAX86uj7menPp/JqJrndHDHKUe4iSRXBvd85QqhpeoP6UyJfc49AJKKqFDLgrT5fAvDdpFDTI1+4GZaWcQKzubK7P+FYMejZ7/Ivsjeg+y1bNZ/J8JkU5/fxFXEqKScAJYSClGEWVlz1mn3ThplME/JZILFN+JKwDVk3+XTVkdZstVRBBMooAxoBxlwsjTOrnOf7BtW//8veZHADba+K4s1j2Sn+Y/i1ely7yFPSCc8UmNxjvONhRaB4TCKItv/iIZt3MPHwLxtGt7STMrwK8rz/0AKYNtUvxtrYRx6dNgj6EneISBZZg4FtWodGtL91Cun5vyAfEpKvqqVga+1TaL49lgIW3k6g9xhbo971WgweWYNL9hFdx9dnT+4IJJLfZ8vy557UtgQfsS+SBqWwbh0UMhQtCgUxQRfqpFOuMkCkz/2DTLL0XSEOwoW7fHoU5hymzKmbLh9JVJbmk5OV+dblAr1uaMhx7iaj3XIDgW4qY/MpByrEvgiGTKJkT6HLYAFdopx5mFQTphT2BRg7VZYPW4yS2QnLvK/nDRFPsY/m7bG2OWIRIyJQHwHKaL66LCQkWA8d4LHg4BnnoB5Y21EisPRrhWIjur1vAhR3JaJg2Y2riz12K4densoJfn/P4naMeqYfBjSgclHMWi0UUg9BCRMfmI+3ZvDA0He6VHlhkDfoHkV2PeTUb0Z0p8Mr+sIQoJ2Rzn9Z9LWUf2oSJUImTRcP5CPPjiXekb+tm0gCHkbygobe2wJhR6MJxmV6iod6WnihekluU2KOBvtTmtoa34ielLUhJG8I0Qpsif/MzKTtDoI1qiNt60jhqoaR2z31ztysGSJEOOWJl3oMB/J4eImzKl35GLj5Dyo/DNpW6mu5DJJ2aK7Ngj6oHnYfhuqGQzjVSJDPTYgv+kwbL/Zp4xdAvm7LkAlb/AunscmQ6onN2JsHcp9jR0wZyJkTQXtu6w0ZmPcl2Nqvz6na3Xe4FkGB0qn/NQWiXHStaSb/RTNTykfsUK+DhHC8l5Ejm9bIeYqSr0N5JmXEVHzRAxXvKS/JRvzKXfuxJz3PhNQ8KSRWgsmgpnYvhIdRagU3nEUcyZQwhSUMg1lzECcWShnDiqYBwkWgEoWrGmG1uFucWX7bVBpkK+7ZnVHi1BRkfI7aGtRnfJ3rSUxRyzSbULq7z2BJ02chUmsQsVqVKxBxVpUrEPFelRsQMVGVGxCbWyDtI0L7e5ESZGBytQbIvM0bb3b1gHa437rdB2zITKRqjZoXtEHvH+kNFmAOdFdQ42OHXXePTG7W62sjsL9mKw1lyb/2MZ5kCcJVM/HHMzjyLWDxH/ysfywFP0CoPeFrtR5sprytbIA0sokDRt68CfkWIjmTOvolKlHOJ37RBehqlR0TRqZQLVH+WY5dmITzRK+GxsR832nyOrJ247FgCKKzWMc4+IPXsOpmxDv/ChtJtKWzscQlmSk2dqCMwylCmHLs+WZp+7CT6PLan6avLwVvVfBp5RqRVvHCddGVBL01Iu+ne7CMHWKZe7WyQyzwTLt+lV1skrokbOO84pRfI5Rjk9ny0wySgWhDpH41cZ6xhqvwGRvmAvNYk/UHJct0bE0J0LMUpvB1nZlpGhZBh8XHwNZp2omlmN4VNGMa8a+hkIjrVpzzr5WsCVxcK7OsfkNEy1m3q6PVU1a6ydWXKkKxknb15osM2aU2k5B/ZTNJzOmmOHAHMUgbWxqh6zccQ3edegjczDvbhO+FS91D1gclvv2giVRkhv12nKWThkXjg0dQejLUNSnVq6AnQmvUQroPK5KK42uuHH3o/oj7mdnemv/JybdTKnR8+zCra4Y2zelNoYLK2tYfCc7YpWqbaVWGSXloQJXW4W3f7rnTo+fsEMLusOypm0tKiKmWFjqB8CiZxi8P4pGKo2MS3XNWnodGjuFsankcuhBN/QshDBhxMoYi4YlBJCGCTPWneMnQFQsAqGMEFaBssYzsoaRtYysY5S9a1RsQMVGVGxCJWcsWragxZUvwBaguYeHkh2cA2eE8Ao0byDAJxDeCOEX2PvD4wQkFNIM56bGcV2JQLyMJJ8PSGiOkpkAsBCtAoEYFYDYcggbxziFMV5hK+E3JEAiAojDpJggJKsApJRDxCymKoJpimC6IpgRA8hUAchSAZENRYo5imKuopinKObHAApUAApVoLFIZhL2hdtnnAZ+gopCefwxUAQu4uBAkB6n8/kfJWJD/Ev7bmQhgmSzPJNwLY+yBlgAJgh2O6t7CkDoRxBC0CwgTOXODZhT4Sy4nqWm8rgAaHjaUV8NwvS4g6kJJe4lHAqZcIXJicX4Y3Y0SyOEhJgOT+qMwutr7rnuH9sttmTyk6GZO3z3Aas77aSrcPfpY7e0HMXoE9dFjmLayDw29Hhyk/nU6TNARrjOyJymxJhWM+misPjaayQHrLp7i/THvgkDujqOfYTue7B0eSQ6QvrjN4dmIPp1/JY6GYW9XBVmyIx8fKvduEciNK4Vq2lpI99GWMNN99K4gPvGP/eAjuozmAMh5auTYV5EwjLJaEJA8YXZfdysrwExPArzlRNixb/MX8gcfeFtj8p88vSYjJx5wgj9bOsRGvWiFeWbmEbIvgcLJS1f9fWd5CdHI6fBvL9pVy5XYi4sMDm2UUbU1wCMhwjQB4oT5QwKJ8Fej1G2lqN//KlgCu+pyUfJt58dHQ3r3A7oeOrOWOjJ38MSO47HbgxNygNpC105I7O8Tj2G+i/MV07MkD3nmSAlPlYCNJiuCk0PtkPNyEyXxAjZh2leCRo53i4FWopRX8Hwk0hg5tuum/FxoxZw3JxQ78vMCZGdBPQkVpWjKPPYPhGSy54cJVhvpb/I3UDNJYbuqYjy0shbnWsyxM6O1HVXWxhxo/Bt7+hrjdF7E5oMtRbtrVhFk7l25aOkIEmMqbKzUTRY3pEgzP9wyW419UfDyXduKOYXYHHoIPHh8aGeeDOLQB4Cb8/DkgS7y4w2nwEm09OC8JPtx5W4mb4Q20OSthAmNkbJvXrnsZfeePWZ99O0h+yRrgrqrbkxVI/CY+dnuPRriHmpqYl5afRTX0FuaeqwkHJQVRd3sOhoakTR/yC5twFnjnTnfVw/QYQXFiRn5+WklRmJ+ugex0+z52tI6q1oV/MScRQWDhTxUrvSuZMIMg80CAWr4n2JqD0jG8MQfvIcsX/uQn8qDx09RVoTNEE5SkM3j0p5VxD79Y1+/mizV0DF1zpZdAmSz/yt8D/3mUV3UxT9qT+JTWwkjzex6IqLmIDHdbHeWm3SqvDbWxuPPVpb7ebuItLqkYyci/HaWXqvyl/lVzik2M8vuHpVTY+rmCu3Gur8lDm6A8qdWzd0T2uMaAyYkBIp5/ReW/h3Z8mfF+aF4MfMYTeaxDRErlojZOhGV0tpy+LQHiVemgYVLdHaz//zPxLNXRX/mj85c+jXyp0rE9weKxvpoH7V5axb545huP2tSsuTtOjTP/HxCd8vrGdaVQvWIM6f/X1Thk1jQ1Pscl1ndHcfTxm4c+r2aAM1o3RTZeTdjiFSnNae7GGUg9sbaMxniB1YnKKiwaufoOLvDMfDIe5lyZ/xGxgKifQ8258q6INK/vTa5f42XDYtlxL8LnP+0FvTf0hazt793VmTvJHWagNleGEPlHQsdKitMvTfIZtHJ+47Z+TLxEg48+tN/x2022naKWVQDvEf7RkqCMc2eLx5Ty9+fW8fufNoEm+lHAubUCTjUwk7CG0yQYg1qH+/3k7rXqVYHCv09wIR1xDTC7EwX3l65tDv5XzKP1RgYH1UZJH0Pkq9NAwqm0uuIpItLYl/+WeY0P8+pqeXpxyxfer2NM8aH5/wvaI6xlV1YA/i7JnfN6dn8s5illtXkcezN5Pk1dfz1STOZE92I92Yx/lvP/rRj/mABT1RdzRGxD9OxgmV5wBjw1InNwu3GlsNMVuiajBMct5/+PLbtzx2bl+/q4gRqB/G2RNL95zARTL0lySXVwZfPdBogBT2NeVVA81UOBZVSzVclAULlEBy7Q+ycgroeQYkvKLwQsIx/s0ZfbMye+zvH1MYmyyL83NO6JF0rJPHzU6PLkfYa9m3kKdcY3zVnO6ewqtuv//1yS/XvzjvBjNXdYJ/kbj5g4E2lHq0bxfaGG3o2RWBsBZVcUq7lfpryHRXemlZjpNikWl4Dy1qOI1va9OSC4UXveEz5vuffr4u+/RZ4PWb1wM/yl6/9/N+T6OsoZwPhs8ZhaJPAuMjJ2coq0l/Xmll4ZUfXNhUVPSwK68cU3+FMld5BuH//RsIfkP+3x6U1twTLZWCTL6+x513L06dh5tCK19EBwXRA2hBj6MQlOxBa9JG0GwUCvOZI54lLnHrFzVP0EB6r+CgVVbJwNpxBosxnDCtKKxRVv5nL2lE+gbpxBjSTqCXdXHjcUb8kHoK1PkejDvg4GJIfjhASxNSQUxBRAiO4EcwRyiTsqBf1IzD+TgDglai9zCvPv+6VKxHh95rDDu8W4Fl2tC7bMQ3r6I9GcBo0UYyiNKizsZDG0/vwTk7ibXLBlGKrYHTeEKivLTkf4xPnhsKWkOd1GlNXV5SiHL035V2PKedpzNo4/RhjDgjZyNKyWEszrNul3ZvBebskF9BczZbvtRsWeliynOkEnUWC+VlsbTn5cb8AB52lVS1taA9gxeawogXzJWrgKDYSVKL56W8RGSr6vniaZNhWD+UNulF4evoN1/zdOf1duvGo9/wU+0RUaIFpQasKC0YxW5Elg06MWa5WQfhED5+bm5erueXKQKLyQXyhYI+uhbMhQ7nIcP7EAcRRgGZVCLIekCjc7Vf3Hx5TLS9wR+pDtFKyVRALFpsB+/JpDGmJ+E1jayXOC9aVIY98/FUaW2N0NRQ01bbFi/Nzw37zlIt1b0CEWaxYHSNDzNgcNa4PRb6OQVrfePpFKpMTFNTlWiobCgurNbaK6QC1OpcfaZXeyMtHWriqRrnvsX9Hx45VWdFITIAogSV6Y7daFFquQKucagw3/glEqOoyRPg4xcQNi2T5r1DIX3w8KlGlFg1qkWMYIVb3bGTzhLWTx7K3Int+fFr+z6UpBVVcFuMzQC+aIfdhYhOo3XPIM55k0HxvOXeuooKqEiS7SsTlGcVVRfU5frmzPKQ+qOiOEYst9BVhoBac4SKo0RzC7Yv16LOvdDQnJwvdHlpZ9raVtqg0Vvet1HI2tw1l1gBk2HGEG5uPERFvKggJxYKmoU+GBAF4+1kWOjPg2Ctb7zRYeHa6oOVFuflRMJBz2tfrc7Vp/c57AuN2tpw7le8kMNWjTVGZKu21a2bukXvX4vRe7DWS+N5rz8jeqtNjaDgIz14yR+7oqzksPKGynZpHwatVZuMB8qEHtZ5do8VTyjRrM2tOQKfsnQKthQsZ44fJphVWR4vKXpdrL1JmmBIjYZJ4xVkUJOw3g+pyaeivgabC1Tyf0inmhsVePwMoNIotWwQrc2kfVtNSjXVpXV5za5F70IrLqvBrhSIIletJp4q15xXzBlPRbbTSpAorc5rDJYJ7a/VZltIVKZEXHMeVJ7DYqmmO317K0op5uFjUaGoIBqPxQOOiEQcCYmGu7RAGVE/qvc51C2VX+EzRABVceLnvz+QOBlb+lGAOQDAs9nLawDPecP/+qrmK5/Qv0OLAYcCQOCfquJPukJfRtLZO3m0Gv1/1un3mKM/pE2dtuc8nA5MV+epbeCcxVK9c4G6mLmwxz9TKicouauX2KieokG/S4e3ql9dCFzNOgn0LNCr6tWpg651LFbTLAUd7AZ1BD4TGhCgljE8tmBRdLCFbwM/jYYxCOAxgUZMEPgPwE6Cz392UkS5aidNB3fsZCjj450s/ZLzyhxlMkIPhzjMaUyxh13s5ghJ5tABTpIhA3c4XRx0iEOsPckGphSx1xbbLMLgtNgNzhQn6bLBmI7isOospp1U7mIP0j3NVtrYls0Di+IQOLvYj+ZOF+JIcPZ2l6P7F602Q4vTiHE2sQPE9EcmTTPFHNqYTZwFLAFnB6fk2ZcozaV1m4sYUlKMqJSOtQfldWAm0+vcSZrpk9gNZI5SFyd7nTY66frOpTGAjGZyov8/sZN7X3sVd20Kx0W+Mz4uf+l9uMPH8bqv/AakfwHVjibuY6aim721Zkmg3dWbuHP+H+9xwq5XPW6+aVazzOqpRLpvLJRPjDA+HjhCFfIXJ/WD4GGvRkPv8ZoXb7T/Xyp/jA/bWUPVVQFYFr3j8eP12z7XBDKI8ZdtsxGgyYtIRYftoFrmZptGVWFctOkqyV4wbr59XA1mX2q3O3p7AQAAAA==) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

body.theme-dice { background: #163C96; padding: 0; }
body.theme-dice h1 { display: none; }
body.theme-dice .container { margin-top: 0; }
/* 聊天室的浮動按鈕搬到頂列的最右邊、縮小 */
body.theme-dice .chat-fab { right: 6px; top: 8px; bottom: auto; width: 36px; height: 36px; font-size: 17px; background: transparent; box-shadow: none; }

#game-dice {
  --dg-navy: #0F2A66; --dg-navy2: #0A1B45; --dg-blue: #2A63D4; --dg-yellow: #FFC629; --dg-red: #FF5A36;
  --dg-cream: #FFF8E7; --dg-ink2: #33467A;
  --dg-num: "DG Anton", "Anton", Impact, "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --dg-serif: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --dg-head-h: 52px;
  width: 100%; max-width: 480px; color: #fff;
}
#game-dice #dice-setupScreen { margin: 16px; }

/* 大廳共用的 button 樣式（滿版、粉橘漸層、下方留白）在這款遊戲裡都不適用，
   所以這裡的按鈕一律先加 dg-btn 把那些歸零，再各自加樣式 */
.dg-btn {
  width: auto; padding: 0; margin: 0; border: none; border-radius: 0; background: none; color: inherit;
  font: inherit; font-weight: inherit; text-align: inherit; cursor: pointer; transition: none; -webkit-appearance: none; appearance: none;
}
.dg-btn:active { transform: none; }
.dg-btn:disabled { opacity: 1; }
.dg-num { font-family: var(--dg-num); font-weight: 400; }
.dg-serif { font-family: var(--dg-serif); }

/* ---- 整個畫面 ---- */
.dg-main {
  position: relative; box-sizing: border-box; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: #1E4FBF url(images/dice/bg.jpg) center top / cover no-repeat;
  padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
}
/* 動作送出去、伺服器還沒回覆之前：按鈕先鎖住 */
.dg-main.is-busy .dg-panel, .dg-main.is-busy .dg-result-btns, .dg-main.is-busy .dg-text-btn { pointer-events: none; opacity: 0.6; }

/* ---- 頂列 ---- */
.dg-head { flex: none; box-sizing: border-box; height: var(--dg-head-h); padding: 0 46px 0 14px; /* 右邊讓給聊天室按鈕 */ background: var(--dg-navy); border-bottom: 3px solid var(--dg-navy2); display: flex; align-items: center; gap: 6px; }
.dg-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dg-title b { font-size: 18px; font-weight: 900; letter-spacing: 1px; line-height: 1.1; white-space: nowrap; }
.dg-title small { font-size: 11px; line-height: 1.1; color: #C7D6FF; white-space: nowrap; }
.dg-space { flex: 1; }
.dg-dir { flex: none; height: 28px; box-sizing: border-box; padding: 0 10px; border-radius: 14px; border: 1.5px solid var(--dg-yellow); display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--dg-yellow); white-space: nowrap; }
.dg-icon-btn.dg-btn { flex: none; width: 40px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; }

/* ---- 牌桌：左右兩排座位＋中間（正上方的人、桌面、自己） ---- */
.dg-table {
  --dg-av: 52px; --dg-name-h: 24px; --dg-call-h: 24px; --dg-bust-h: 17px; --dg-seat-gap: 14px;
  /* 一個座位的高度是固定的（頭像上方的標籤、喊的數字、爆幾次都先留好位置），有人喊了數字畫面才不會跳 */
  --dg-seat-h: calc(var(--dg-av) + var(--dg-name-h) + var(--dg-call-h) + var(--dg-bust-h) + 28px);
  --dg-mid-seat-h: var(--dg-seat-h); /* 中間那一欄（正上方的人、自己）一個座位的高度 */
  flex: 1 1 auto; box-sizing: border-box; display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 4px;
  padding: 8px 2px 6px;
  /* 最少要多高：左右兩排放得下、中間那一欄也放得下，取比較高的 */
  min-height: max(
    calc(var(--dg-side-n) * (var(--dg-seat-h) + var(--dg-seat-gap)) + 14px),
    calc(var(--dg-top-n) * (var(--dg-mid-seat-h) + 6px) + var(--dg-felt-min) + var(--dg-mid-seat-h) + 32px)
  );
}
/* 人多的時候座位縮小一點 */
.dg-table.dg-d2 { --dg-av: 44px; --dg-seat-gap: 10px; }
.dg-table.dg-d3 { --dg-av: 38px; --dg-name-h: 22px; --dg-call-h: 22px; --dg-bust-h: 15px; --dg-seat-gap: 8px; }
.dg-col { grid-row: 1 / 4; display: flex; flex-direction: column; align-items: center; gap: var(--dg-seat-gap); padding-top: 4px; }
.dg-col-l { grid-column: 1; }
.dg-col-r { grid-column: 3; }
.dg-top { grid-column: 2; grid-row: 1; display: flex; justify-content: center; padding-bottom: 6px; }
.dg-felt-wrap { grid-column: 2; grid-row: 2; box-sizing: border-box; min-height: calc(var(--dg-felt-min) + 18px); padding: 4px 0 14px; display: flex; align-items: center; }
.dg-me { grid-column: 2; grid-row: 3; display: flex; justify-content: center; }

/* 中間的綠色絨布桌面、黑色桌邊 */
.dg-felt {
  flex: 1; min-width: 0; height: 100%; max-height: 400px; /* 人很多、兩排很長的時候，桌面不要拉成一條很長的長條 */ box-sizing: border-box; padding: 8px 6px; border-radius: 30px; border: 6px solid #111111;
  background: radial-gradient(ellipse at 50% 38%, #2BC06F 0%, #1FA35C 55%, #14803F 100%);
  box-shadow: 0 10px 0 rgba(10,27,69,0.55), inset 0 0 26px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  container-type: size; /* 裡面的大數字依照桌面的大小縮放 */
}
.dg-felt-label { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: #fff; white-space: nowrap; }
.dg-counter { font-size: 84px; font-size: min(104px, 46cqh, 62cqw); line-height: 1; color: #fff; text-shadow: 0 5px 0 rgba(0,0,0,0.28); }
.dg-counter.is-small { font-size: 56px; font-size: min(64px, 24cqh); }
.dg-felt-foot { margin-top: 2px; font-size: 12px; color: #fff; text-align: center; }

/* 骰子：白底，1 點跟 4 點是紅色的 */
.dg-dice { max-width: 100%; margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; }
.dg-die {
  flex: none; box-sizing: border-box; width: var(--dg-die); height: var(--dg-die); padding: calc(var(--dg-die) * 0.125); border-radius: calc(var(--dg-die) * 0.2);
  background: #fff; box-shadow: 0 3px 0 #C9D2E4, 0 5px 8px rgba(0,0,0,0.3);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); place-items: center;
}
.dg-die i { width: calc(var(--dg-die) * 0.19); height: calc(var(--dg-die) * 0.19); border-radius: 50%; background: #111; }
.dg-die.is-red i { background: #D9381A; }
.dg-die i.is-off { background: transparent; }
.dg-secret { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; }
.dg-secret span { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.dg-secret b { font-size: 28px; line-height: 1; color: #FFE27A; }
.dg-secret.is-big b { font-size: 44px; }

/* 座位：頭像、名字（莊家的「莊」標在名字前面）、最後喊的數字、爆幾次 */
.dg-seat { position: relative; flex: none; box-sizing: border-box; width: 92px; height: var(--dg-seat-h); padding-top: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dg-seat-info, .dg-seat-sub { display: contents; }
.dg-avatar { position: relative; flex: none; width: var(--dg-av); height: var(--dg-av); margin-bottom: 3px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 5px 8px rgba(10,27,69,0.5); }
.dg-avatar > .avatar-img, .dg-avatar > .avatar-fallback { width: 100% !important; height: 100% !important; font-size: calc(var(--dg-av) * 0.4); font-weight: 900; }
/* 輪到的人：頭像外面多一圈亮橘紅色的光；莊家選到「先喊」的人是黃色的圈 */
.dg-seat.is-turn .dg-avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--dg-red), 0 0 16px 9px rgba(255,90,54,0.6); }
.dg-seat.is-starter .dg-avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--dg-yellow); }
/* 這回合用過 Pass／迴轉的人，頭像上方掛的標籤：剛用的時候是藍底白字，
   等再輪到他的時候變成深灰底灰字（已經用過、不能再用的感覺） */
.dg-used { position: absolute; left: 50%; top: -13px; transform: translateX(-50%); z-index: 2; box-sizing: border-box; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--dg-blue); border: 2px solid #fff; box-shadow: 0 2px 4px rgba(10,27,69,0.45); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.dg-used.is-stale { background: #3A3F4B; border-color: #7C8494; box-shadow: none; color: #A9B0BD; }
.dg-name { flex: none; box-sizing: border-box; height: var(--dg-name-h); max-width: 100%; padding: 0 8px; border-radius: 12px; background: var(--dg-navy); display: flex; align-items: center; gap: 4px; }
.dg-name b { min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.2; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-seat.is-turn .dg-name b, .dg-seat.is-starter .dg-name b { color: var(--dg-yellow); }
.dg-zhuang { flex: none; width: 18px; height: 18px; margin-left: -5px; border-radius: 50%; background: var(--dg-yellow); color: var(--dg-navy); font-family: var(--dg-serif); font-size: 11px; font-weight: 900; line-height: 18px; text-align: center; }
.dg-you { flex: none; padding: 2px 4px; border-radius: 4px; background: var(--dg-blue); color: #fff; font-size: 10px; line-height: 1; }
.dg-call { flex: none; box-sizing: border-box; max-width: 100%; height: var(--dg-call-h); padding: 0 10px; border-radius: 12px; background: #fff; border: 1.5px solid var(--dg-navy); color: var(--dg-navy); font-family: var(--dg-num); font-size: 15px; line-height: calc(var(--dg-call-h) - 3px); white-space: nowrap; }
.dg-call.is-latest { background: var(--dg-yellow); }
.dg-call.is-text { font-family: inherit; font-size: 12.5px; font-weight: 700; }
.dg-bust { flex: none; box-sizing: border-box; height: var(--dg-bust-h); padding: 3px 6px; border-radius: 8px; background: var(--dg-navy2); color: #DCE6FF; font-size: 10.5px; line-height: 1; white-space: nowrap; }
.dg-d3 .dg-bust { padding: 2px 6px; }

/* ---- 引信：已經喊過的數字燒掉了，炸彈藏在還沒燒到的地方 ---- */
.dg-fuse { flex: none; box-sizing: border-box; margin: 2px 12px 0; padding: 7px 12px; border-radius: 14px; background: var(--dg-navy); display: flex; flex-direction: column; gap: 6px; }
.dg-fuse-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #fff; }
.dg-fuse-title { display: flex; align-items: center; gap: 5px; font-weight: 700; color: #FF9B80; }
.dg-fuse-bar { display: flex; align-items: center; gap: 6px; font-size: 10.5px; line-height: 1; color: #C7D6FF; }
.dg-fuse-bar > div { flex: 1; display: flex; gap: 2px; }
.dg-fuse.is-dense .dg-fuse-bar > div { gap: 1px; }
.dg-fuse-bar i { flex: 1; height: 10px; border-radius: 2px; background: var(--dg-red); }
.dg-fuse-bar i.is-burnt { background: var(--dg-navy2); }
.dg-fuse-bar i.is-mine { background: var(--dg-yellow); }

/* ---- 下面的操作區：米白色的卡片 ---- */
.dg-panel { flex: none; box-sizing: border-box; min-height: 256px; margin: 10px 12px 7px; padding: 14px; border-radius: 22px; background: var(--dg-cream); border: 3px solid var(--dg-navy); box-shadow: 0 5px 0 var(--dg-navy2); color: var(--dg-navy); display: flex; flex-direction: column; justify-content: center; gap: 11px; }
.dg-panel.is-start { gap: 10px; }
.dg-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dg-panel-head b { font-size: 22px; font-weight: 900; line-height: 1.1; color: #D9381A; white-space: nowrap; }
.dg-panel-head span { font-size: 12px; color: var(--dg-ink2); text-align: right; }

/* 喊數字的三顆按鈕 */
.dg-calls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dg-call-btn.dg-btn { position: relative; height: 100px; padding: 8px 4px; border: 2px solid var(--dg-navy); border-radius: 16px; background: var(--dg-yellow); color: var(--dg-navy); box-shadow: 0 4px 0 var(--dg-navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; }
.dg-call-btn span { font-size: 12px; font-weight: 700; line-height: 1; }
.dg-call-btn b { font-size: 42px; line-height: 1; }
.dg-call-btn small { font-size: 11.5px; font-weight: 700; line-height: 1; white-space: nowrap; }
/* 莊家才看得到：會喊到秘密總和的那一顆做成「不建議按」的樣子 */
.dg-call-btn.is-warn.dg-btn { background: #fff; border: 2px dashed #B3261E; color: #B3261E; box-shadow: 0 4px 0 #E7B4AC; }
.dg-call-btn em { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); padding: 3px 8px; border-radius: 9px; background: #B3261E; color: #fff; font-size: 11px; font-weight: 700; font-style: normal; line-height: 1; white-space: nowrap; }
.dg-call-btn.dg-btn:active, .dg-primary.dg-btn:active, .dg-secondary.dg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--dg-navy); }
.dg-special-btn.dg-btn:active, .dg-pick.dg-btn:active, .dg-dir-btn.dg-btn:active { transform: translateY(2px); }

/* Pass／迴轉 */
.dg-special { display: flex; flex-direction: column; gap: 6px; }
.dg-special > span { font-size: 11.5px; color: var(--dg-ink2); text-align: center; }
.dg-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dg-special-btn.dg-btn { height: 44px; border-radius: 14px; border: 2px solid var(--dg-navy); background: var(--dg-blue); color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 3px 0 var(--dg-navy); display: flex; align-items: center; justify-content: center; gap: 6px; }
.dg-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--dg-ink2); text-align: center; }
.dg-note svg { flex: none; }
.dg-note.is-strong { font-weight: 700; color: var(--dg-navy); }

/* 莊家選怎麼開始 */
.dg-field { display: flex; flex-direction: column; gap: 6px; }
.dg-field-label { font-size: 12px; font-weight: 700; line-height: 16px; }
.dg-picks { display: grid; gap: 6px; }
.dg-pick.dg-btn { min-width: 0; height: 56px; border: 2px solid #C9BFA6; border-radius: 14px; background: #fff; color: var(--dg-navy); box-shadow: 0 3px 0 #D9CDB0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.dg-pick > span:last-child { box-sizing: border-box; max-width: 100%; padding: 0 3px; font-size: 12px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-dir-btn.dg-btn { height: 44px; border: 2px solid #C9BFA6; border-radius: 14px; background: #fff; color: var(--dg-navy); font-size: 14px; font-weight: 700; box-shadow: 0 3px 0 #D9CDB0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dg-pick.is-on.dg-btn, .dg-dir-btn.is-on.dg-btn { background: var(--dg-navy); border-color: var(--dg-navy); color: #fff; box-shadow: 0 3px 0 var(--dg-navy2); }
.dg-mini { display: block; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.dg-mini > .avatar-img, .dg-mini > .avatar-fallback { font-size: 12px; font-weight: 900; }
.dg-order { box-sizing: border-box; min-height: 32px; padding: 7px 12px; border-radius: 10px; background: #F3E7C9; display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.4; }
.dg-order span { flex: none; color: var(--dg-ink2); }
.dg-order b { font-weight: 700; }
.dg-primary.dg-btn { height: 48px; margin-bottom: 4px; border-radius: 16px; border: 2px solid var(--dg-navy); background: var(--dg-yellow); color: var(--dg-navy); font-size: 17px; font-weight: 900; box-shadow: 0 4px 0 var(--dg-navy); text-align: center; }

/* 等別人（等莊家決定、等別人喊） */
.dg-wait-head { display: flex; align-items: center; gap: 14px; }
.dg-wait-avatar { flex: none; margin-left: 6px; border-radius: 50%; box-shadow: 0 0 0 3px var(--dg-cream), 0 0 0 6px var(--dg-red); }
.dg-wait-avatar > .avatar-img, .dg-wait-avatar > .avatar-fallback { font-size: 20px; font-weight: 900; }
.dg-wait-head > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dg-wait-head b { font-size: 20px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.dg-wait-head div span { font-size: 12.5px; color: var(--dg-ink2); }
.dg-box { padding: 12px; border-radius: 12px; background: #F3E7C9; display: flex; flex-direction: column; gap: 8px; }
.dg-box b { font-size: 13px; font-weight: 700; }
.dg-box p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dg-ink2); }
.dg-tag { flex: none; width: 46px; height: 22px; border-radius: 11px; background: var(--dg-blue); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.dg-mine { box-sizing: border-box; min-height: 42px; padding: 10px 12px; border-radius: 12px; background: #F3E7C9; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dg-mine span { font-size: 12.5px; color: var(--dg-ink2); }
.dg-mine b { font-size: 22px; line-height: 1; }
.dg-upnext { display: flex; flex-direction: column; gap: 8px; }
.dg-upnext > span { font-size: 11.5px; color: var(--dg-ink2); }
.dg-upnext > div { display: flex; align-items: center; gap: 4px; overflow: hidden; color: var(--dg-ink2); }
.dg-upnext > div > svg { flex: none; }
.dg-next { flex: 0 1 auto; box-sizing: border-box; min-width: 0; height: 32px; padding: 0 9px 0 3px; border-radius: 16px; background: #fff; border: 1.5px solid #C9BFA6; display: inline-flex; align-items: center; gap: 5px; }
.dg-next.is-now { background: var(--dg-yellow); border-color: var(--dg-navy); }
.dg-next b { min-width: 0; max-width: 4.2em; font-size: 12.5px; font-weight: 700; color: var(--dg-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-next .dg-mini { box-shadow: none; }

/* ---- 畫面上方跳出來的通知 ---- */
.dg-toast { position: fixed; left: 12px; right: 12px; top: 62px; z-index: 400; transform: translateY(-8px); box-sizing: border-box; width: -webkit-fit-content; width: fit-content; max-width: 440px; margin: 0 auto; padding: 9px 16px; border-radius: 999px; background: var(--dg-navy2); border: 1.5px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,0.35); color: #fff; font-size: 13.5px; font-weight: 700; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; }
.dg-toast.is-on { opacity: 1; transform: translateY(0); }
.dg-toast.is-strong { background: var(--dg-yellow); border-color: var(--dg-navy); color: var(--dg-navy); }

/* ---- 規則說明：從下面滑上來的面板 ---- */
.dg-scrim { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 600; background: rgba(5,14,40,0.6); }
.dg-sheet { position: fixed; left: 50%; bottom: 0; z-index: 601; transform: translateX(-50%); box-sizing: border-box; width: 100%; max-width: 480px; max-height: 86vh; overflow: auto; padding: 14px 18px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: var(--dg-cream); border: 3px solid var(--dg-navy); border-bottom: none; color: var(--dg-navy); }
.dg-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.dg-sheet-head b { font-size: 20px; font-weight: 900; }
.dg-x.dg-btn { width: 44px; height: 44px; margin-right: -10px; display: flex; align-items: center; justify-content: center; color: var(--dg-navy); }
.dg-sheet ol { margin: 6px 0 0; padding-left: 22px; }
.dg-sheet li { margin-bottom: 8px; font-size: 14px; line-height: 1.65; }

/* ---- 有人爆了（回合結算） ---- */
.dg-result { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 5px; }
.dg-hero { padding: 10px 14px 14px; border-radius: 22px; background: var(--dg-navy); box-shadow: 0 5px 0 var(--dg-navy2); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dg-boom { position: relative; flex: none; width: 240px; height: 190px; }
.dg-boom img { position: absolute; left: 0; top: -24px; width: 240px; height: 240px; display: block; animation: dg-boom-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.dg-boom-avatar { position: absolute; left: 82px; top: 58px; width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 6px 12px rgba(10,27,69,0.45); }
.dg-boom-avatar > .avatar-img, .dg-boom-avatar > .avatar-fallback { font-size: 30px; font-weight: 900; }
.dg-hero > b { max-width: 100%; font-size: 36px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.dg-hero > span { font-size: 13.5px; line-height: 1.4; color: #DCE6FF; }
@keyframes dg-boom-in {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}
/* 攤牌：綠色桌面上攤開每一顆骰子跟總和，下面是燒到炸彈的引信 */
.dg-reveal { padding: 11px 14px; border-radius: 20px; border: 6px solid #111111; background: radial-gradient(ellipse at 50% 38%, #2BC06F 0%, #1FA35C 55%, #14803F 100%); box-shadow: 0 5px 0 rgba(10,27,69,0.55), inset 0 0 22px rgba(0,0,0,0.28); display: flex; flex-direction: column; gap: 9px; }
.dg-reveal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dg-reveal .dg-dice { margin-top: 0; justify-content: flex-start; gap: 7px; }
.dg-secret.is-reveal { flex: none; margin: 0; }
.dg-secret.is-reveal b { font-size: 36px; }
.dg-reveal-fuse > div { display: flex; align-items: center; gap: 2px; }
.dg-reveal-fuse.is-dense > div { gap: 1px; }
.dg-reveal-fuse i { flex: 1; height: 8px; border-radius: 2px; background: rgba(255,255,255,0.5); }
.dg-reveal-fuse i.is-burnt { background: rgba(0,0,0,0.45); }
.dg-reveal-fuse i.is-bomb { height: 18px; background: var(--dg-yellow); }
.dg-reveal-fuse p { margin: 4px 0 0; display: flex; justify-content: space-between; font-size: 10.5px; color: #fff; }
/* 爆最多次排行 */
.dg-board { flex: 1 0 auto; padding: 12px; border-radius: 22px; background: var(--dg-cream); border: 3px solid var(--dg-navy); box-shadow: 0 5px 0 var(--dg-navy2); color: var(--dg-navy); display: flex; flex-direction: column; gap: 8px; }
.dg-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dg-board-head b { font-size: 14px; font-weight: 900; white-space: nowrap; }
.dg-board-head span { font-size: 12px; color: var(--dg-ink2); text-align: right; }
.dg-ranks { display: flex; flex-direction: column; gap: 5px; }
.dg-rank { box-sizing: border-box; height: 38px; padding: 0 10px 0 8px; border-radius: 12px; background: #fff; border: 1.5px solid #D9CDB0; display: flex; align-items: center; gap: 8px; }
.dg-rank.is-hit { background: #FFE9A8; border-color: var(--dg-navy); }
.dg-rank-no { flex: none; width: 18px; font-size: 15px; line-height: 1; text-align: center; color: var(--dg-ink2); }
.dg-rank .dg-mini { box-shadow: none; }
.dg-rank .dg-mini > .avatar-img, .dg-rank .dg-mini > .avatar-fallback { font-size: 11px; }
.dg-rank b { flex: none; width: 5em; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-rank-bar { flex: 1; height: 8px; border-radius: 4px; background: #E7DBBE; overflow: hidden; }
.dg-rank-bar i { display: block; height: 8px; border-radius: 4px; background: var(--dg-blue); }
.dg-rank.is-hit .dg-rank-bar i { background: #D9381A; }
.dg-rank-count { flex: none; width: 40px; font-size: 12.5px; font-weight: 700; text-align: right; white-space: nowrap; }
.dg-rank.is-hit .dg-rank-count { color: #B3261E; }
/* 桌長才有「下一回合」；其他人這裡是一行「等桌長按下一回合」 */
.dg-result-btns { margin-top: 2px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.dg-secondary.dg-btn { height: 52px; border-radius: 16px; border: 2px solid var(--dg-navy); background: #fff; color: var(--dg-navy); font-size: 14px; font-weight: 700; box-shadow: 0 4px 0 var(--dg-navy); text-align: center; }
.dg-result .dg-primary.dg-btn { height: 52px; }
.dg-wait-next { box-sizing: border-box; height: 52px; padding: 0 10px; border-radius: 16px; border: 2px dashed #C7D6FF; display: flex; align-items: center; justify-content: center; font-size: 13.5px; color: #fff; text-align: center; }
.dg-text-btn.dg-btn { align-self: center; min-height: 44px; padding: 10px 14px; font-size: 13px; color: #DCE6FF; text-decoration: underline; }

/* 螢幕比較矮的手機：頭像、按鈕都縮一點，盡量一個畫面放得下 */
@media (max-height: 740px) {
  #game-dice { --dg-head-h: 46px; }
  .dg-table { --dg-av: 44px; --dg-seat-gap: 8px; }
  .dg-table.dg-d2 { --dg-av: 40px; }
  .dg-table.dg-d3 { --dg-av: 36px; }
  .dg-panel { min-height: 226px; padding: 12px; gap: 9px; }
  .dg-call-btn.dg-btn { height: 80px; }
  .dg-call-btn b { font-size: 34px; }
  .dg-toast { top: 56px; }
  /* 人數是雙數（正上方有人）的時候，中間那一欄要放「正上方的人＋桌面＋自己」，直的放不下：
     正上方的人跟自己改成橫的——頭像在左，名字、喊的數字、爆幾次在右 */
  .dg-table.dg-has-top { --dg-mid-seat-h: 66px; }
  .dg-has-top .dg-top .dg-seat, .dg-has-top .dg-me .dg-seat { width: auto; max-width: 100%; height: auto; min-height: var(--dg-mid-seat-h); flex-direction: row; align-items: center; gap: 8px; }
  .dg-has-top .dg-top .dg-avatar, .dg-has-top .dg-me .dg-avatar { margin-bottom: 0; }
  .dg-has-top .dg-top .dg-seat-info, .dg-has-top .dg-me .dg-seat-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
  .dg-has-top .dg-top .dg-seat-sub, .dg-has-top .dg-me .dg-seat-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; }
}
/* 螢幕比較窄：「接下來的順序」只列三個人 */
@media (max-width: 380px) {
  .dg-upnext > div > :nth-child(n+6) { display: none; }
}

/* ===================== 魚市場拍賣（玩家端） ===================== */
/* 跟骰子、阿瓦隆等同一招：坐在這一桌時整頁沉浸主題（海藍色魚市場），不露出大廳共用的背景跟標題。
   class 一律用 fm- 開頭，不會影響其他遊戲。畫面照定案的 mockup 做。 */
body.theme-fishmarket { background: #0a4d7e; padding: 0; }
body.theme-fishmarket h1 { display: none; }
body.theme-fishmarket .container { margin-top: 0; }
body.theme-fishmarket .chat-fab { right: 6px; top: 8px; bottom: auto; width: 36px; height: 36px; font-size: 17px; background: transparent; box-shadow: none; }

#game-fishmarket {
  --fm-ink: #1d1a14; --fm-cream: #f3e6c8; --fm-wood: #4e2f18; --fm-orange: #ff8a1f; --fm-green: #7fd69a; --fm-red: #e4533f;
  --fm-num: "Alfa Slab One", "Anton", Impact, "Arial Narrow", serif;
  width: 100%; max-width: 480px; color: #f3ecd9;
}
#game-fishmarket #fishmarket-setupScreen { margin: 16px; }
.fm-btn { width: auto; padding: 0; margin: 0; border: none; border-radius: 0; background: none; color: inherit; font: inherit; font-weight: inherit; text-align: inherit; cursor: pointer; transition: none; -webkit-appearance: none; appearance: none; }
.fm-btn:active { transform: none; }
.fm-btn:disabled { opacity: 1; }
.fm-num { font-family: var(--fm-num); font-weight: 400; }

.fm-main {
  position: relative; box-sizing: border-box; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px), repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px), linear-gradient(#1a97c9, #0f6ea3 45%, #0a4d7e);
}
.fm-main.is-busy .fm-go, .fm-main.is-busy .fm-bell, .fm-main.is-busy .fm-sellbtn { pointer-events: none; opacity: .6; }
.fm-top { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 -12px; padding: 0 46px 0 12px; box-sizing: border-box; background: linear-gradient(#9a6a3c, #7a4d28); border-bottom: 4px solid #4e2f18; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.fm-pill { background: #4e2f18; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; color: #f3ecd9; border: 0; white-space: nowrap; }
.fm-pill.is-hot { background: var(--fm-orange); color: var(--fm-ink); }
.fm-panel { background: #0a4a74; border-radius: 16px; padding: 12px; box-sizing: border-box; }
.fm-h { font-size: 16px; font-weight: 900; }
.fm-sub { font-size: 12px; opacity: .85; margin-top: 3px; line-height: 1.5; }
.fm-warn { font-size: 11px; color: #ffb3a6; line-height: 1.4; }

/* 卡片：數字在左上角，插圖滿版，細邊框 */
.fm-card { position: relative; width: 80px; height: 52px; background: var(--fm-cream); border-radius: 8px; overflow: hidden; color: var(--fm-ink); border: 1px solid var(--fm-ink); box-sizing: border-box; flex: none; }
.fm-card b { position: absolute; left: 3px; top: 1px; z-index: 1; font-family: var(--fm-num); font-weight: 400; font-size: 15px; line-height: 1.1; color: var(--fm-ink); text-shadow: 0 0 2px #f3e6c8, 0 0 3px #f3e6c8, 0 0 4px #f3e6c8; }
.fm-card u { position: absolute; left: 3px; top: 3px; right: 3px; bottom: 3px; background-repeat: no-repeat; background-position: center; background-size: contain; text-decoration: none; }
.fm-card { transition: transform .16s, box-shadow .16s, filter .16s; }
.fm-card.is-sel { z-index: 30 !important; transform: translateY(-4px) scale(1.06); border-color: #ffe3a1; box-shadow: 0 0 0 1px rgba(255,226,150,.9), 0 0 10px 3px rgba(255,176,64,.85), 0 0 24px 8px rgba(255,150,40,.42); animation: fm-glow 1.1s ease-in-out infinite alternate; }
@keyframes fm-glow { from { box-shadow: 0 0 0 1px rgba(255,226,150,.8), 0 0 8px 2px rgba(255,176,64,.7), 0 0 18px 5px rgba(255,150,40,.3); } to { box-shadow: 0 0 0 1px rgba(255,236,180,1), 0 0 13px 4px rgba(255,190,80,.95), 0 0 30px 10px rgba(255,150,40,.5); } }
.fm-card.is-src { opacity: .35; }
.fm-ghost { position: fixed !important; z-index: 999; pointer-events: none; transform: translate(-50%, -60%) scale(1.12) rotate(-3deg); box-shadow: 0 0 0 1px rgba(255,226,150,.9), 0 0 12px 4px rgba(255,176,64,.85), 0 10px 18px rgba(0,0,0,.4); }
.fm-card.is-pick { border-color: #ffe3a1; box-shadow: 0 0 0 1px rgba(255,226,150,.7), 0 0 9px 2px rgba(255,200,90,.7); animation: fm-glow 1.3s ease-in-out infinite alternate; }
.fm-card.is-dead { filter: grayscale(.6) brightness(.85); }
.fm-card em { position: absolute; right: -1px; top: -1px; z-index: 2; background: var(--fm-orange); color: var(--fm-ink); font-size: 9px; font-weight: 900; font-style: normal; padding: 0 4px; border-radius: 0 6px 0 6px; }
.fm-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-pool-empty { font-size: 13px; opacity: .8; padding: 14px 0; }

/* 玩家墊：用你畫的圖，卡片疊在對應的格子上，薄薄的紙板感 */
.fm-mat { --fw: min(366px, calc(100vw - 24px)); position: relative; width: var(--fw); height: calc(var(--fw) * 204 / 366); flex: none; margin: 0 auto 10px; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 8px 16px rgba(0,0,0,.3); }
.fm-mat[data-sortmat] { touch-action: none; -webkit-user-select: none; user-select: none; }
.fm-mat > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.fm-reg { position: absolute; top: 22%; height: 58%; width: 21.5%; }
.fm-reg .fm-card { position: absolute; left: 0; right: 0; width: auto; height: calc(var(--fw) * 40 / 366); }
.fm-reg { pointer-events: none; }
.fm-reg .fm-card { pointer-events: auto; }
.fm-card[data-act="selCard"] { cursor: grab; touch-action: none; }
.fm-slot { position: absolute; top: 19%; height: 62%; width: 23.5%; border-radius: 12px; z-index: 1; cursor: pointer; transition: background .18s; }
.fm-slot.is-hint { background: radial-gradient(ellipse 80% 70% at 50% 100%, rgba(255,244,214,.42), rgba(255,244,214,.08) 70%, transparent); }
.fm-slot.is-over { background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(255,214,120,.7), rgba(255,214,120,.15) 70%, transparent); }
.fm-tag { position: absolute; top: 83%; width: 21.5%; text-align: center; font-size: 11px; font-weight: 900; }
.fm-tag span { background: var(--fm-cream); color: var(--fm-ink); border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.fm-tag.is-tap { z-index: 5; cursor: pointer; }
.fm-tag span.is-dup { background: #f0b429; color: var(--fm-ink); }
.fm-tag span.is-bad { background: var(--fm-red); color: #fff; }
.fm-tag span.is-mute { background: #2e6e96; color: #f3ecd9; }
.fm-tag span.is-hot { background: var(--fm-orange); }
.fm-dead { filter: grayscale(.6) brightness(.8); }
.fm-mat-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; font-size: 14px; font-weight: 900; }

/* 玩家列：點一下看他的漁獲 */
.fm-seats { flex: none; display: flex; gap: 6px; margin-top: 10px; }
.fm-seat { flex: 1; min-width: 0; position: relative; background: #0a4a74; border-radius: 14px; padding: 8px; box-sizing: border-box; text-align: left; }
.fm-seat.is-auct { border: 2px solid var(--fm-orange); padding: 6px; }
.fm-seat.is-buyer { border: 2px solid #ffd45c; padding: 6px; }
.fm-seat .tg { position: absolute; top: -9px; left: 8px; background: var(--fm-orange); color: var(--fm-ink); font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.fm-seat .who { display: flex; align-items: center; gap: 6px; }
.fm-seat .who .avatar-img, .fm-seat .who .avatar-fallback { flex: none; }
.fm-seat .nm { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-seat .cash { font-family: var(--fm-num); color: var(--fm-green); font-size: 14px; }
.fm-seat .meta { font-size: 10px; opacity: .8; margin-top: 4px; white-space: nowrap; }
.fm-hint { flex: none; font-size: 11px; opacity: .9; text-align: right; margin-top: 4px; }

.fm-bell, .fm-go, .fm-sellbtn { border: 0; border-radius: 20px; font-weight: 900; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; flex: none; }
.fm-bell { height: 68px; background: var(--fm-orange); color: var(--fm-ink); font-size: 22px; box-shadow: 0 5px 0 #b95a00; margin-top: 12px; }
.fm-bell.is-off { background: #2e6e96; color: #a9c2cc; box-shadow: 0 5px 0 #245a7c; font-size: 16px; }
.fm-flip { height: 68px; background: var(--fm-cream); color: var(--fm-ink); font-size: 22px; box-shadow: 0 5px 0 #b9a77f; margin-top: 12px; }
.fm-flip.is-wait { opacity: .6; }
.fm-go { height: 56px; border-radius: 16px; background: var(--fm-orange); color: var(--fm-ink); font-size: 18px; box-shadow: 0 4px 0 #b95a00; margin-top: 10px; }
.fm-go.is-off { background: #2e6e96; color: #a9c2cc; box-shadow: 0 4px 0 #245a7c; }
.fm-go.is-light { background: var(--fm-cream); box-shadow: 0 4px 0 #b9a77f; }
.fm-sellbtn { width: auto; height: 36px; padding: 0 18px; border-radius: 12px; background: var(--fm-orange); color: var(--fm-ink); font-size: 14px; box-shadow: 0 3px 0 #b95a00; }
.fm-sellbtn.is-off { background: #2e6e96; color: #a9c2cc; box-shadow: 0 3px 0 #245a7c; }
.fm-line { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #2b7aa8; font-size: 13px; gap: 8px; }
.fm-line:last-child { border-bottom: 0; }
.fm-row { padding: 10px 0; border-bottom: 1px solid #2b7aa8; display: flex; flex-direction: column; gap: 8px; }
.fm-row:last-child { border-bottom: 0; padding-bottom: 0; }
.fm-tabs { display: flex; gap: 6px; margin-top: 12px; flex: none; }
.fm-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 12px; background: #0a4a74; font-size: 12px; font-weight: 700; }
.fm-tab.is-on { outline: 3px solid var(--fm-orange); outline-offset: -3px; background: #0b5f93; }
.fm-prices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.fm-prices div { background: #0b5f93; border-radius: 8px; padding: 4px 2px; text-align: center; font-size: 10px; line-height: 1.4; }
.fm-prices b { font-size: 13px; color: var(--fm-green); }
.fm-step { display: flex; gap: 6px; margin-top: 12px; flex: none; }
.fm-step div { flex: 1; text-align: center; padding: 8px 0; border-radius: 10px; background: #4e2f18; font-weight: 700; font-size: 14px; opacity: .8; }
.fm-step div.is-on { background: var(--fm-orange); color: var(--fm-ink); font-weight: 900; opacity: 1; }
.fm-note { margin-top: 12px; font-size: 12px; line-height: 1.5; opacity: .9; flex: none; }
.fm-back { height: 52px; border-radius: 16px; background: var(--fm-cream); color: var(--fm-ink); font-weight: 900; font-size: 17px; box-shadow: 0 4px 0 #b9a77f; margin-top: auto; }
.fm-spacer { flex: 1; min-height: 10px; }

/* 結算 */
.fm-rank { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #2b7aa8; }
.fm-rank:last-child { border-bottom: 0; }
.fm-rank .no { width: 22px; text-align: center; font-family: var(--fm-num); font-size: 18px; }
.fm-rank .nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-rank .sub { font-size: 11px; opacity: .85; font-weight: 400; display: block; }
.fm-rank .tot { font-family: var(--fm-num); font-size: 22px; color: var(--fm-green); }
.fm-rank.is-win .tot { color: #ffd45c; }
.fm-crown { font-size: 11px; background: #ffd45c; color: var(--fm-ink); border-radius: 6px; padding: 1px 6px; margin-left: 6px; font-weight: 900; }

/* 彈出卡：最後階段／市場關閉。卡片彈出放大再縮回，說明文字等彈完才出現 */
.fm-pop { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 500; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 16px; background: rgba(4,30,52,.78); padding: 16px; box-sizing: border-box; }
.fm-pop.is-on { display: flex; }
.fm-pop img { width: min(250px, 62vw); display: block; border-radius: 14px; }
.fm-pop-cap { width: min(250px, 62vw); text-align: center; font-size: 14px; font-weight: 700; line-height: 1.6; color: #f3ecd9; opacity: 0; }
.fm-pop-hint { font-size: 11px; opacity: 0; color: #f3ecd9; }
@keyframes fm-pop { 0% { transform: scale(.2); opacity: 0; } 35% { transform: scale(1.18); opacity: 1; } 55% { transform: scale(.96); } 70%, 100% { transform: scale(1); opacity: 1; } }
@keyframes fm-capin { from { opacity: 0; } to { opacity: 1; } }
.fm-pop.is-on img { animation: fm-pop 1.3s cubic-bezier(.2,.8,.3,1) both; }
.fm-pop.is-on .fm-pop-cap { animation: fm-capin .35s ease-out .95s both; }
.fm-pop.is-on .fm-pop-hint { animation: fm-capin .35s ease-out 1.3s both; opacity: .75; }
@media (prefers-reduced-motion: reduce) { .fm-pop.is-on img { animation: none; } .fm-pop.is-on .fm-pop-cap, .fm-pop.is-on .fm-pop-hint { animation: none; opacity: 1; } }

/* 腐壞／被偷通知 */
.fm-notice { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 450; display: none; align-items: center; justify-content: center; background: rgba(4,30,52,.7); padding: 16px; box-sizing: border-box; }
.fm-notice.is-on { display: flex; }
.fm-notice-box { width: 100%; max-width: 340px; background: #0a4a74; border: 2px solid var(--fm-red); border-radius: 16px; padding: 16px; box-sizing: border-box; }
.fm-sheet-scrim { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 420; background: rgba(0,0,0,.5); }
.fm-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 430; max-height: 80vh; overflow-y: auto; max-width: 480px; margin: 0 auto; background: #0a4a74; border-radius: 18px 18px 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.fm-sheet ol { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.fm-toast { position: fixed; left: 12px; right: 12px; top: 62px; z-index: 400; transform: translateY(-8px); box-sizing: border-box; width: -webkit-fit-content; width: fit-content; max-width: 440px; margin: 0 auto; padding: 9px 16px; border-radius: 999px; background: #4e2f18; border: 1.5px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.35); color: #fff; font-size: 13.5px; font-weight: 700; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.fm-toast.is-on { opacity: 1; transform: translateY(0); }
.fm-toast.is-strong { background: var(--fm-orange); border-color: var(--fm-ink); color: var(--fm-ink); }

.fm-ok { font-size: 12.5px; line-height: 1.55; margin-top: 6px; color: var(--fm-green); font-weight: 700; }
.fm-stats { display: flex; justify-content: space-between; gap: 8px; margin: 0 2px; font-size: 12.5px; font-weight: 800; flex: none; }
.fm-card.is-new { box-shadow: 0 0 0 1px rgba(255,226,150,.8), 0 0 10px 3px rgba(255,190,80,.7); }
.fm-eye { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: #0a4a74; color: #f3ecd9; font-size: 12.5px; font-weight: 800; }
.fm-eye.is-on { background: var(--fm-orange); color: var(--fm-ink); }

/* =====================================================================
   密碼黑白猜（codeguess）：深紫底、黑白數字牌、圓點拼成的「<」牌背
   ===================================================================== */
body.theme-codeguess { background: #1a1433; padding: 0; }
body.theme-codeguess h1 { display: none; }
body.theme-codeguess .container { margin-top: 0; }
#game-codeguess {
  --cg-kb: #1a1822; --cg-kw: #f3f0e8; --cg-pink: #ff5f9e; --cg-ok: #3ddc97; --cg-bad: #ff6b6b;
  --cg-fg: #f1eefc; --cg-muted: #a8a3c4; --cg-line: #3a3360; --cg-soft: rgba(255,255,255,.06);
  width: 100%; max-width: 480px; color: var(--cg-fg);
}
#game-codeguess .card { background: #241e3d; border: 1px solid var(--cg-line); color: var(--cg-fg); }
#game-codeguess .muted { color: var(--cg-muted); }
.cg-phone { display: flex; flex-direction: column; gap: 12px; padding: 12px 12px 92px; background: linear-gradient(165deg, #2b2257, #1a1433); min-height: 100vh; box-sizing: border-box; }
.cg-phone.center { align-items: center; text-align: center; justify-content: center; }
.cg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cg-head b { font-size: 16px; }
.cg-round { color: var(--cg-muted); font-size: 12px; }
.cg-chips { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.cg-chip { padding: 3px 9px; border-radius: 999px; background: var(--cg-soft); border: 1px solid var(--cg-line); font-size: 12px; font-variant-numeric: tabular-nums; }
.cg-chip.me { border-color: var(--cg-pink); }
.cg-opp, .cg-mine { background: var(--cg-soft); border: 1px solid var(--cg-line); border-radius: 14px; padding: 10px 12px; }
.cg-opp.turn { border-color: var(--cg-pink); box-shadow: 0 0 0 1px var(--cg-pink), 0 0 16px rgba(255,95,158,.35); }
.cg-opp.out { opacity: .55; }
.cg-mine { background: rgba(255,95,158,.07); }
.cg-oh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.cg-oh .cg-av { width: 24px; height: 24px; display: inline-block; }
.cg-oh .cg-av img, .cg-oh .cg-av .avatar-fallback { width: 24px !important; height: 24px !important; border-radius: 50%; font-size: 12px; }
.cg-oh .cg-st { margin-left: auto; color: var(--cg-muted); font-size: 12px; }
.cg-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: linear-gradient(90deg, #ff5f9e, #ff8a5b); color: #fff; }
.cg-badge.out { background: #555; }
.cg-sc { font-size: 12px; color: var(--cg-muted); }
.cg-hint { font-size: 11.5px; color: var(--cg-muted); margin: -4px 0 6px; }
.cg-row { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; align-items: flex-end; padding: 14px 10px 12px; margin: -6px -10px -8px; scrollbar-width: thin; }
.cg-row.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }

.cg-card { position: relative; flex: none; width: 42px; height: 60px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; border: 1px solid rgba(255,255,255,.2); transition: transform .15s, box-shadow .15s; box-sizing: border-box; }
.cg-card::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 6px; height: 2px; border-radius: 2px; background: currentColor; opacity: .85; }
.cg-card.b { background: var(--cg-kb); color: #fff; }
.cg-card.w { background: var(--cg-kw); color: #1a1a22; border-color: rgba(0,0,0,.25); }
.cg-card.hid { color: transparent; }
.cg-card.hid::after { left: 4px; right: 4px; top: 4px; bottom: 4px; height: auto; border-radius: 4px; background: none; border: 1px dashed rgba(139,139,153,.55); opacity: 1; }
.cg-chev { width: 52%; height: auto; display: block; position: relative; z-index: 1; }
.cg-chev path { fill: none; stroke: #8b8b99; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0.1 24.9; }
.cg-card.rev.b { background: #4b4b57; color: #b4b4c0; border-color: rgba(255,255,255,.08); }
.cg-card.rev.w { background: #a4a4b0; color: #5a5a66; border-color: rgba(0,0,0,.1); }
.cg-card.rev::after { opacity: .5; }
.cg-card.pick { cursor: pointer; }
.cg-card.pick:active { transform: translateY(-3px); }
.cg-card.sel { box-shadow: 0 0 0 3px var(--cg-pink); transform: translateY(-3px); }
.cg-card.fresh { box-shadow: 0 0 0 3px var(--cg-ok), 0 0 12px rgba(61,220,151,.6); }
.cg-tag { position: absolute; top: -9px; right: -6px; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 999px; background: var(--cg-ok); color: #06301f; z-index: 2; }
.cg-gap { flex: none; width: 26px; height: 60px; border-radius: 7px; border: 1px dashed var(--cg-ok); background: rgba(61,220,151,.12); color: var(--cg-ok); font-size: 18px; font-weight: 800; padding: 0; cursor: pointer; }

.cg-deckwrap { display: flex; justify-content: center; }
.cg-deck { position: relative; width: 52px; height: 74px; border-radius: 9px; border: 2px solid #8a7fd0; background: repeating-linear-gradient(135deg, #3b3170, #3b3170 6px, #2e2658 6px, #2e2658 12px); color: #fff; font-weight: 800; font-size: 16px; padding: 0; box-shadow: 3px 3px 0 #2e2658; }
.cg-deck:disabled { opacity: .85; cursor: default; }
.cg-deck.can { border-color: var(--cg-pink); box-shadow: 0 0 0 2px rgba(255,95,158,.4), 0 0 18px rgba(255,95,158,.6); animation: cgbob 1s ease-in-out infinite; cursor: pointer; }
@keyframes cgbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.cg-prompt { background: var(--cg-soft); border: 1px solid var(--cg-line); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--cg-muted); }
.cg-prompt.mine { color: var(--cg-fg); border-color: var(--cg-pink); }
.cg-btns { display: flex; gap: 10px; }
.cg-btns button { flex: 1; }

.cg-scrim { position: fixed; inset: 0; background: rgba(8,5,20,.6); z-index: 9000; }
.cg-sheet { position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px; z-index: 9001; background: #2a2350; border: 1px solid var(--cg-line); border-radius: 18px 18px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.cg-shtitle { font-weight: 800; font-size: 16px; }
.cg-shsub { color: var(--cg-muted); font-size: 12.5px; margin: 2px 0 10px; }
.cg-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.cg-num { position: relative; height: 46px; border-radius: 10px; border: 1px solid var(--cg-line); font-size: 18px; font-weight: 800; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.cg-num.b { background: var(--cg-kb); color: #fff; }
.cg-num.w { background: var(--cg-kw); color: #1a1a22; }
.cg-num.on { box-shadow: 0 0 0 3px var(--cg-pink); }
.cg-num.x { opacity: .22; text-decoration: line-through; cursor: default; }
.cg-num.tr { opacity: .4; cursor: default; }
.cg-num.tr::after { content: "猜過"; position: absolute; left: 0; right: 0; bottom: 2px; font-size: 9px; font-weight: 700; line-height: 1; color: var(--cg-pink); }
.cg-hinttog { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--cg-muted); }
.cg-hinttog input { width: auto; margin: 0; }
.cg-legend { font-size: 12px; color: var(--cg-muted); margin: 8px 0 12px; }
.cg-shbtns { display: flex; gap: 10px; }
.cg-shbtns button { flex: 1; }

.cg-rank { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.cg-rankrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--cg-soft); border: 1px solid var(--cg-line); }
.cg-rankrow.win { border-color: #e8c873; }
.cg-rankrow .pl { width: 28px; text-align: center; font-size: 18px; }
.cg-rankrow .nm { flex: 1; text-align: left; font-weight: 700; }
.cg-rankrow .nt { color: var(--cg-muted); font-size: 13px; }
.cg-sub, .cg-wait { color: var(--cg-muted); }
.cg-toast { position: fixed; left: 50%; top: 56px; transform: translate(-50%, -80px); max-width: 90vw; z-index: 9100; padding: 10px 16px; border-radius: 12px; background: #3a2f73; border: 1px solid var(--cg-pink); color: #fff; font-size: 14px; opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; text-align: center; }
.cg-toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ===== 煉金術士 ===== */
#game-alchemist{--bg:#12201d;--bg2:#183029;--panel:#1c3530;--panel2:#234139;--line:#2f554a;--fg:#efe6cf;--mut:#9fb3a6;--gold:#e3b650;--silver:#c9d2d6;--ok:#5ee0a0;--bad:#ff7a6b;
--y:#f2cf4a;--r:#d9453b;--g:#2fb374;--b:#8b5a3c;color:var(--fg);font:15px/1.45 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist *{box-sizing:border-box}
#game-alchemist .al-wrap{max-width:430px;margin:0 auto;padding:12px 16px 120px}
#game-alchemist h1,#game-alchemist h2,#game-alchemist h3{margin:0;font-weight:700}
#game-alchemist .al-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
#game-alchemist .al-top h1{font-size:20px;letter-spacing:.06em;font-family:"Noto Serif TC",serif}
#game-alchemist .al-pill{padding:5px 12px;border-radius:999px;border:1.5px solid var(--gold);color:var(--gold);font-size:13px;font-weight:700;white-space:nowrap}
#game-alchemist .al-pill.al-wait{border-color:var(--line);color:var(--mut)}
#game-alchemist .al-topr{display:flex;align-items:center;gap:6px}
#game-alchemist .al-mute{width:32px;height:32px;border-radius:999px;border:1.5px solid var(--line);background:transparent;color:var(--fg);font-size:15px;line-height:1;padding:0;margin:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
#game-alchemist .al-mute .al-snd{width:18px;height:18px;display:block}
#game-alchemist .al-mute.is-muted{color:var(--mut)}
#game-alchemist .al-banner{font-size:12.5px;color:var(--mut);margin:0 0 10px}
#game-alchemist .al-banner b{color:var(--gold)}
#game-alchemist .al-lab{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin:14px 0 6px;font-size:13px;color:var(--mut)}
#game-alchemist .al-lab h2{font-size:15px;color:var(--fg);font-family:"Noto Serif TC",serif;letter-spacing:.04em}
#game-alchemist .al-row{display:flex;gap:8px;overflow-x:auto;padding:12px 8px 12px;margin:-6px -8px;scrollbar-width:thin;align-items:stretch}
#game-alchemist .al-row>*{flex:none}
#game-alchemist /* cubes */
.al-cube{display:inline-block;width:16px;height:16px;border-radius:4px;vertical-align:middle;box-shadow:inset 0 -3px 0 rgba(0,0,0,.28),inset 0 2px 0 rgba(255,255,255,.35),0 1px 2px rgba(0,0,0,.5);margin:0 1px}
#game-alchemist .al-c0{background:linear-gradient(160deg,#ffe780,var(--y))}
#game-alchemist .al-c1{background:linear-gradient(160deg,#ff7a6b,var(--r))}
#game-alchemist .al-c2{background:linear-gradient(160deg,#5fe0a0,var(--g))}
#game-alchemist .al-c3{background:linear-gradient(160deg,#b98563,var(--b))}
#game-alchemist .al-cube.al-big{width:26px;height:26px;border-radius:6px}
#game-alchemist .al-cubes{display:inline-flex;flex-wrap:wrap;gap:1px;align-items:center}
#game-alchemist .al-cab10{gap:6px;margin:0}
#game-alchemist .al-cab10 .al-sl{border-radius:9px}
#game-alchemist .al-cab10 .al-sl .al-cube{width:100%;height:100%;border-radius:8px}
#game-alchemist button.al-sl{font:inherit;padding:0;color:inherit;border:1px dashed var(--line);background:var(--bg2)}
#game-alchemist .al-sl.al-on{border:2px solid var(--gold)!important;box-shadow:0 0 0 2px rgba(227,182,80,.35);transform:translateY(-3px)}
#game-alchemist .al-sl.al-ov{border-color:var(--bad)}
#game-alchemist .al-cab .al-cab10{grid-template-columns:repeat(5,44px);justify-content:center;gap:6px}
#game-alchemist .al-cab .al-cab10 .al-sl .al-cube{width:100%;height:100%;border-radius:6px}
#game-alchemist .al-legend{display:flex;gap:4px 12px;flex-wrap:wrap;margin-top:8px;font-size:12px;color:var(--mut)}
#game-alchemist .al-legend .al-cube{width:12px;height:12px;margin:0 3px 0 0}
#game-alchemist .al-ups{display:flex;flex-direction:column;line-height:.95;color:var(--gold);font-size:20px;align-items:center}
#game-alchemist .al-ups b{display:block;font-weight:400}
#game-alchemist .al-putbar{margin:auto -8px -8px;align-self:stretch;min-height:30px;border-top:1px dashed var(--line);background:rgba(0,0,0,.5);border-radius:0 0 10px 10px;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;padding:3px 4px}
#game-alchemist .al-ic{width:15px;height:15px;vertical-align:-3px;margin-right:2px}
#game-alchemist .al-rc.al-k-g,#game-alchemist .al-rc.al-k-u,#game-alchemist .al-rc.al-k-t{background-size:cover;background-position:center}
#game-alchemist .al-rc.al-k-g{background-image:linear-gradient(rgba(8,18,15,.5),rgba(8,18,15,.35)),url(games/alchemist-art/recipe-g.jpg)}
#game-alchemist .al-rc.al-k-u{background-image:linear-gradient(rgba(8,18,15,.5),rgba(8,18,15,.35)),url(games/alchemist-art/recipe-u.jpg)}
#game-alchemist .al-rc.al-k-t{background-image:linear-gradient(rgba(8,18,15,.5),rgba(8,18,15,.35)),url(games/alchemist-art/recipe-t.jpg)}
#game-alchemist .al-rc .al-kind{text-shadow:0 1px 3px #000}
#game-alchemist .al-rc .al-cube{box-shadow:inset 0 -3px 0 rgba(0,0,0,.28),inset 0 2px 0 rgba(255,255,255,.35),0 1px 3px rgba(0,0,0,.8)}
#game-alchemist .al-arrow{color:#ffe08a;font-size:24px;line-height:1;margin:2px 2px;text-shadow:0 1px 3px #000,0 0 6px rgba(0,0,0,.9)}
#game-alchemist /* opponents */
.al-slots10{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;margin:8px 0 6px}
#game-alchemist .al-sl{min-width:0;aspect-ratio:1;border-radius:6px;background:var(--bg2);border:1px dashed var(--line);display:flex;align-items:center;justify-content:center}
#game-alchemist .al-sl .al-cube{margin:0;width:100%;height:100%;border-radius:5px}
#game-alchemist .al-opp{width:176px;background:var(--panel);border:1.5px solid var(--line);border-radius:12px;padding:8px 10px;text-align:left;color:inherit;font:inherit}
#game-alchemist .al-opp.al-turn{border-color:var(--gold);box-shadow:0 0 0 2px rgba(227,182,80,.25)}
#game-alchemist .al-opp .al-n{display:flex;align-items:center;gap:6px;font-weight:700;font-size:14px}
#game-alchemist .al-av{width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:12px;color:#fff;background:#6a4e9a}
#game-alchemist .al-opp .al-m{display:flex;gap:6px;margin:6px 0 4px;font-size:12px;font-variant-numeric:tabular-nums}
#game-alchemist .al-opp .al-m span{display:inline-flex;align-items:center;gap:2px}
#game-alchemist .al-start{width:16px;height:16px;flex:none;margin-left:2px;vertical-align:-2px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))}
#game-alchemist .al-opp .al-n .al-start{margin-left:auto;width:18px;height:18px}
#game-alchemist .al-startnote{display:flex;align-items:center;gap:6px;color:var(--gold);font-size:13px}
#game-alchemist .al-startnote .al-start{margin:0}
#game-alchemist .al-opp .al-s{font-size:12px;color:var(--mut);display:flex;justify-content:space-between;gap:6px}
#game-alchemist .al-opp .al-s b{color:var(--gold)}
#game-alchemist /* potion cards */
.al-potion .al-cost{flex-wrap:nowrap!important;gap:1px!important}
#game-alchemist .al-potion .al-cube{width:15px;height:15px;margin:0}
#game-alchemist .al-potion{width:122px;background:linear-gradient(180deg,#2a4a3f,#1f3a32);border:1.5px solid var(--line);border-radius:12px;padding:8px;position:relative;text-align:center;color:inherit;font:inherit;display:flex;flex-direction:column;gap:6px;align-items:center}
#game-alchemist .al-potion .al-pn{font-size:13px;font-weight:700;font-family:"Noto Serif TC",serif;line-height:1.2;min-height:32px;display:flex;align-items:center}
#game-alchemist .al-potion .al-pt{font-size:22px;font-weight:800;color:var(--gold);line-height:1}
#game-alchemist .al-potion .al-cost{display:flex;flex-wrap:wrap;gap:2px;justify-content:center;min-height:38px;align-content:center}
#game-alchemist .al-potion.al-can{border-color:var(--ok);box-shadow:0 0 0 2px rgba(94,224,160,.25)}
#game-alchemist .al-potion.al-can::after{content:"可調製";position:absolute;left:50%;bottom:-9px;transform:translateX(-50%);background:var(--ok);color:#0b2a1c;font-size:11px;font-weight:800;padding:1px 8px;border-radius:999px}
#game-alchemist button.al-potion{width:124px;height:172px;padding:0;gap:0;justify-content:flex-end;background:#1c3530;position:relative}
#game-alchemist .al-pimg{position:absolute;inset:0;border-radius:11px;background-size:cover;background-position:center top}
#game-alchemist .al-potion .al-pt{position:absolute;top:4px;left:9px;font-size:28px;line-height:1.1;font-weight:800;color:#fff;font-family:"Noto Serif TC",serif;text-shadow:0 1px 3px #000,0 0 8px rgba(0,0,0,.9)}
#game-alchemist .al-pbar{position:relative;width:100%;padding:16px 4px 6px;border-radius:0 0 11px 11px;background:linear-gradient(180deg,rgba(8,20,17,0),rgba(8,20,17,.88) 38%);display:flex;flex-direction:column;align-items:center;gap:3px}
#game-alchemist .al-potion .al-pn{min-height:0;font-size:12.5px;text-shadow:0 1px 3px #000;color:#fff}
#game-alchemist .al-potion .al-cost{min-height:0}
#game-alchemist .al-coin{z-index:3;position:absolute;top:-8px;right:-6px;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:#2a1c00;border:2px solid rgba(0,0,0,.25);box-shadow:0 2px 3px rgba(0,0,0,.4)}
#game-alchemist .al-coin.al-gold{background:radial-gradient(circle at 35% 30%,#ffe9a0,var(--gold))}
#game-alchemist .al-coin.al-silver{background:radial-gradient(circle at 35% 30%,#fff,var(--silver))}
#game-alchemist /* recipe cards */
.al-rc{width:104px;background:var(--panel);border:1.5px solid var(--line);border-radius:12px;padding:6px 8px 8px;color:inherit;font:inherit;text-align:center;display:flex;flex-direction:column;gap:5px;align-items:center;position:relative}
#game-alchemist .al-rc .al-pos{font-size:11px;font-weight:800;color:#0b2a1c;background:var(--ok);padding:1px 8px;border-radius:999px}
#game-alchemist .al-rc .al-pos.al-pay{background:var(--panel2);color:var(--fg);border:1px solid var(--line)}
#game-alchemist .al-rc .al-put{min-height:20px;display:flex;gap:1px;flex-wrap:wrap;justify-content:center;align-items:center;font-size:11px;color:var(--mut)}
#game-alchemist .al-rc .al-kind{font-size:12px;font-weight:800;color:var(--gold)}
#game-alchemist .al-rc .al-eff{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:62px;justify-content:center}
#game-alchemist .al-rc.al-mine{width:96px;border-color:#3f6b5d}
#game-alchemist .al-rc.al-used{opacity:.45}
#game-alchemist .al-rc.al-sel{border-color:var(--gold)}
#game-alchemist .al-app{position:absolute;top:-7px;left:-5px;background:#3b2f73;color:#fff;border-radius:999px;font-size:10px;padding:0 6px}
#game-alchemist /* cabinet */
.al-cab{background:var(--panel);border:1.5px solid var(--line);border-radius:14px;padding:10px 12px}
#game-alchemist .al-cab .al-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
#game-alchemist .al-cell{text-align:center;background:var(--bg2);border-radius:10px;padding:8px 4px}
#game-alchemist .al-cell .al-nm{font-size:11px;color:var(--mut);margin-top:2px}
#game-alchemist .al-cell .al-ct{font-size:22px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
#game-alchemist .al-cab .al-foot{display:flex;justify-content:flex-end;margin-top:8px;font-size:12.5px;color:var(--mut)}
#game-alchemist .al-cab .al-foot b{color:var(--fg)}
#game-alchemist .al-over{color:var(--bad)!important}
#game-alchemist .al-bar{display:flex;gap:8px;margin-top:10px}
#game-alchemist .al-btn{font:inherit;font-weight:800;border-radius:12px;padding:11px 14px;border:1.5px solid var(--gold);background:var(--gold);color:#2a1c00;flex:1}
#game-alchemist .al-btn.al-sec{background:transparent;color:var(--gold)}
#game-alchemist .al-btn:disabled{opacity:.4}
#game-alchemist .al-hint{margin:12px 0 0;padding:10px 12px;border:1.5px solid var(--gold);border-radius:12px;font-size:14px;background:rgba(227,182,80,.08)}
#game-alchemist .al-log{margin-top:14px;font-size:12.5px;color:var(--mut);display:flex;flex-direction:column;gap:3px}
#game-alchemist .al-log div{padding:3px 0;border-bottom:1px dashed var(--line)}
#game-alchemist .al-log b{color:var(--fg)}
#game-alchemist .al-mypot{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
#game-alchemist .al-mypot .al-chip{font:inherit;color:var(--fg);background:var(--bg2);border:1px solid var(--line);border-radius:999px;padding:2px 10px;font-size:12px}
#game-alchemist /* sheet */
.al-sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:9000;display:flex;align-items:flex-end;justify-content:center}
#game-alchemist .al-sheet{width:100%;max-width:430px;background:#1a2f29;border-top:2px solid var(--gold);border-radius:18px 18px 0 0;padding:16px 16px calc(18px + env(safe-area-inset-bottom,0px));max-height:86vh;overflow:auto}
#game-alchemist .al-sheet h3{font-size:17px;font-family:"Noto Serif TC",serif;margin-bottom:4px}
#game-alchemist .al-sheet p{margin:4px 0 10px;color:var(--mut);font-size:13.5px}
#game-alchemist .al-sheet .al-box{background:var(--bg2);border-radius:12px;padding:10px 12px;margin:8px 0;display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap}
#game-alchemist .al-sheet .al-box .al-l{font-size:13px;color:var(--mut)}
#game-alchemist .al-opts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0}
#game-alchemist .al-opt{font:inherit;color:var(--fg);background:var(--panel2);border:1.5px solid var(--line);border-radius:12px;padding:10px 4px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px}
#game-alchemist .al-opt:disabled{opacity:.35}
#game-alchemist .al-cardbox{display:flex;justify-content:center;align-items:center;gap:12px;margin:10px 0}
#game-alchemist .al-cardbox .al-l{font-size:13px;color:var(--mut)}
#game-alchemist .al-step{display:flex;align-items:center;gap:12px;justify-content:center;margin:8px 0}
#game-alchemist .al-step button{width:44px;height:44px;flex:none;padding:0;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1.5px solid var(--gold);background:transparent;color:var(--gold)}
#game-alchemist .al-step button:disabled{opacity:.3}
#game-alchemist .al-step .al-v{font-size:28px;font-weight:800;line-height:44px;min-width:64px;text-align:center;font-variant-numeric:tabular-nums}
#game-alchemist .al-slot{font:inherit;display:flex;flex-direction:column;align-items:center;gap:4px;background:var(--panel2);border:1.5px dashed var(--gold);border-radius:12px;padding:8px 12px;color:var(--fg);font-size:11px}
#game-alchemist .al-slots{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
#game-alchemist .al-res{display:flex;gap:6px;flex-wrap:wrap;font-size:12px;color:var(--mut);margin:6px 0 2px;align-items:center}
#game-alchemist /* 聚光燈：別人出牌時，那張牌放大跳到畫面中間 */
.al-spot{position:fixed;inset:0;z-index:9050;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:24px 20px calc(48px + env(safe-area-inset-bottom,0px));background:radial-gradient(ellipse at 50% 45%,rgba(30,58,50,.78),rgba(4,10,8,.93) 70%);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:al-fade .25s ease;cursor:pointer;-webkit-tap-highlight-color:transparent}
#game-alchemist .al-spot.al-out{animation:al-fadeout .25s ease forwards}
#game-alchemist .al-who{display:flex;align-items:center;gap:10px;animation:al-rise .35s ease both}
#game-alchemist .al-sav{width:34px;height:34px;border-radius:50%;overflow:hidden;display:inline-flex;flex:none}
#game-alchemist .al-sav>*{border-radius:50%}
#game-alchemist .al-wn{font:900 19px/1.2 "Noto Serif TC",serif;letter-spacing:.04em}
#game-alchemist .al-verb{padding:2px 10px;border-radius:999px;font-size:13px;font-weight:800;background:var(--gold);color:#2a1c00;white-space:nowrap}
#game-alchemist .al-verb.al-v-learn{background:#7fb6ff;color:#06203f}
#game-alchemist .al-verb.al-v-claim{background:var(--ok);color:#0b2a1c}
#game-alchemist .al-verb.al-v-rest{background:var(--panel2);color:var(--fg);border:1px solid var(--line)}
#game-alchemist .al-stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:250px}
#game-alchemist .al-glow{position:absolute;left:50%;top:50%;width:260px;height:260px;margin:-130px 0 0 -130px;border-radius:50%;background:radial-gradient(circle,rgba(227,182,80,.35),rgba(227,182,80,0) 65%);animation:al-pulse 1.6s ease-in-out infinite}
#game-alchemist .al-glow.al-g-claim{background:radial-gradient(circle,rgba(94,224,160,.35),rgba(94,224,160,0) 65%)}
#game-alchemist .al-spot .al-rc.al-big{zoom:1.75;animation:al-flyin .55s cubic-bezier(.2,.9,.3,1.15) both}
#game-alchemist .al-spot .al-rc.al-big.al-from-mk{animation-name:al-flyup}
#game-alchemist .al-spot .al-potion{width:124px;height:172px;padding:0;gap:0;justify-content:flex-end;background:#1c3530;position:relative;cursor:pointer}
#game-alchemist .al-spot .al-potion.al-big{zoom:1.5;animation:al-flyin .55s cubic-bezier(.2,.9,.3,1.15) both}
#game-alchemist .al-stamp{position:absolute;right:-16px;top:-12px;z-index:4;font:900 18px/1 "Noto Serif TC",serif;color:var(--gold);background:#2a1c00;border:2px solid var(--gold);border-radius:9px;padding:3px 6px;transform:rotate(-10deg);box-shadow:0 4px 12px rgba(0,0,0,.6);animation:al-stamp .4s cubic-bezier(.3,1.6,.5,1) .5s both}
#game-alchemist .al-coin.al-fall{width:34px;height:34px;top:-14px;right:-16px;font:900 12px/1 "Noto Serif TC",serif;animation:al-cdrop .6s cubic-bezier(.3,1.5,.5,1) .55s both}
#game-alchemist .al-fan{position:relative;height:200px;width:280px}
#game-alchemist .al-fan .al-rc{position:absolute;top:30px;left:50%;margin-left:-48px;zoom:1.15;transform:translateX(var(--x)) rotate(var(--r));animation:al-fanin .5s cubic-bezier(.2,.9,.3,1.2) both}
#game-alchemist .al-sres{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;font-size:14px;color:var(--mut);max-width:300px;animation:al-rise .35s ease .45s both}
#game-alchemist .al-sres .al-line{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:center;color:var(--fg);font-weight:700}
#game-alchemist .al-sres .al-cube{width:22px;height:22px;border-radius:5px;animation:al-pop .3s cubic-bezier(.3,1.6,.5,1) both}
#game-alchemist .al-plus{color:var(--ok);font-weight:900;font-size:18px}
#game-alchemist .al-minus{color:var(--bad);font-weight:900;font-size:18px}
#game-alchemist .al-note{font-weight:400;color:var(--mut);font-size:13px}
#game-alchemist .al-skip{position:absolute;left:0;right:0;bottom:calc(14px + env(safe-area-inset-bottom,0px));text-align:center;font-size:12px;color:var(--mut)}
#game-alchemist .al-timer{position:absolute;left:0;bottom:0;height:3px;background:var(--gold);animation:al-timer linear forwards}
#game-alchemist .al-qn{position:absolute;top:calc(14px + env(safe-area-inset-top,0px));right:14px;font-size:12px;color:var(--mut);background:rgba(0,0,0,.4);border:1px solid var(--line);padding:2px 10px;border-radius:999px}
@keyframes al-fade{from{opacity:0}}
@keyframes al-fadeout{to{opacity:0}}
@keyframes al-rise{from{opacity:0;transform:translateY(10px)}}
@keyframes al-pulse{50%{transform:scale(1.12);opacity:.7}}
@keyframes al-flyin{0%{opacity:0;transform:translateY(-120px) scale(.4) rotateY(85deg)}60%{opacity:1}100%{transform:none}}
@keyframes al-flyup{0%{opacity:0;transform:translateY(140px) scale(.4) rotate(-8deg)}60%{opacity:1}100%{transform:none}}
@keyframes al-stamp{from{opacity:0;transform:rotate(-10deg) scale(2.6)}}
@keyframes al-cdrop{from{opacity:0;transform:translateY(-140px) rotate(-200deg)}}
@keyframes al-fanin{from{opacity:0;transform:translateY(-100px)}}
@keyframes al-pop{from{transform:scale(0)}}
@keyframes al-timer{from{width:100%}to{width:0}}
@media (prefers-reduced-motion:reduce){#game-alchemist .al-spot,#game-alchemist .al-spot *{animation-duration:.01ms!important;animation-delay:0s!important}#game-alchemist .al-spot .al-timer{animation-duration:4s!important}}
#game-alchemist .al-go{display:flex;gap:8px;margin-top:12px}
#game-alchemist /* gameover */
.al-rank{display:flex;flex-direction:column;gap:8px;margin:10px 0}
#game-alchemist .al-rk{display:grid;grid-template-columns:30px 1fr auto;gap:8px;align-items:center;background:var(--panel);border:1.5px solid var(--line);border-radius:12px;padding:10px 12px}
#game-alchemist .al-rk.al-win{border-color:var(--gold);box-shadow:0 0 0 2px rgba(227,182,80,.25)}
#game-alchemist .al-rk .al-t{font-size:22px;font-weight:800;color:var(--gold)}
#game-alchemist .al-rk small{color:var(--mut);display:block;font-size:12px}

body.theme-alchemist { background: #12201d; padding: 0; }
body.theme-alchemist h1 { display: none; }
body.theme-alchemist .container { margin-top: 0; }
#game-alchemist .al-phone { max-width: 430px; margin: 0 auto; padding: 12px 16px 120px; color: #efe6cf; }
#game-alchemist .al-sub { color: var(--mut); font-size: 13px; text-align: center; margin: 4px 0 10px; }
#game-alchemist .al-card-wide { margin-top: 0; }
.al-toast { position: fixed; left: 50%; top: 56px; transform: translate(-50%, -80px); max-width: 90vw; z-index: 9100; padding: 10px 16px; border-radius: 12px; background: #1c3530; border: 1px solid #e3b650; color: #efe6cf; font-size: 14px; opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; text-align: center; }
.al-toast.on { transform: translate(-50%, 0); opacity: 1; }
#game-alchemist .al-sheet-bg { z-index: 9000; }
#game-alchemist .al-logrow .al-cube { width: 11px; height: 11px; margin: 0 1px; }
#game-alchemist .al-ranktable { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
#game-alchemist .al-rk .al-nm2 { font-weight: 700; }
/* ---- 煉金術士：市場新牌提醒（貼「新」字；在畫面外時右邊出現「新配方：採集 ›」） ---- */
#game-alchemist .al-rowwrap { position: relative; }
#game-alchemist .al-rc.al-new, #game-alchemist .al-potion.al-new { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227,182,80,.35), 0 0 16px rgba(227,182,80,.3); }
#game-alchemist .al-new.al-fresh { animation: al-nw-in .7s cubic-bezier(.3,1.6,.5,1) both; }
#game-alchemist .al-new.al-fresh::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 11px; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,240,190,.55) 48%, transparent 66%) no-repeat; background-size: 250% 100%; animation: al-nw-sheen 2.4s ease-in-out .5s 3 both; }
#game-alchemist .al-newtag { position: absolute; top: -9px; right: -6px; z-index: 4; background: var(--gold); color: #2a1c00; font-size: 11px; font-weight: 800; line-height: 1.5; padding: 0 7px; border-radius: 999px; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
#game-alchemist .al-potion .al-newtag { right: auto; left: -6px; }
@keyframes al-nw-in { 0% { transform: translateY(-26px) scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes al-nw-sheen { 0% { background-position: 120% 0; } 100% { background-position: -60% 0; } }
#game-alchemist .al-edge { position: absolute; width: auto; min-width: 0; height: auto; min-height: 0; margin: 0; letter-spacing: 0; white-space: nowrap; right: -10px; top: 50%; transform: translateY(-50%); z-index: 5; font: 800 12px/1 "Noto Sans TC", system-ui, sans-serif; color: #2a1c00; background: var(--gold); border: 0; border-radius: 999px 0 0 999px; padding: 10px 8px 10px 12px; animation: al-nw-ping 1.6s ease-out infinite; }
#game-alchemist .al-edge:active { transform: translateY(-50%); }
#game-alchemist .al-edge.al-left { right: auto; left: -10px; border-radius: 0 999px 999px 0; padding: 10px 12px 10px 8px; }
#game-alchemist .al-edge[hidden] { display: none; }
@keyframes al-nw-ping { 0% { box-shadow: 0 0 0 0 rgba(227,182,80,.6); } 100% { box-shadow: 0 0 0 12px rgba(227,182,80,0); } }

/* ---- 煉金術士：提煉抽屜（直接點材料櫃裡的材料升級） ---- */
#game-alchemist .al-uorder { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--fg); margin: -4px 0 10px; }
#game-alchemist .al-uorder .al-cube { margin: 0; }
#game-alchemist .al-uorder span { color: var(--mut); font-size: 12px; }
#game-alchemist .al-upips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
#game-alchemist .al-upips.al-shake { animation: al-u-shake .4s; }
#game-alchemist .al-upip { width: 40px; height: 40px; padding: 0; margin: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1.5px dashed var(--line); background: transparent; }
#game-alchemist .al-upip span { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; border: 1.5px solid var(--line); color: var(--mut); }
#game-alchemist .al-upip.al-lit { border: 1.5px solid var(--gold); background: rgba(227,182,80,.12); cursor: pointer; }
#game-alchemist .al-upip.al-lit span { background: var(--gold); border-color: var(--gold); color: #2a1c00; box-shadow: 0 0 10px rgba(227,182,80,.6); }
#game-alchemist .al-upip.al-pop { animation: al-u-lit .45s cubic-bezier(.3,1.7,.5,1); }
#game-alchemist .al-utip { font-size: 12px; color: var(--mut); margin: 0 0 10px; min-height: 18px; }
#game-alchemist .al-ucab { display: grid; grid-template-columns: repeat(5, minmax(0, 56px)); justify-content: center; gap: 9px; padding: 12px 8px; background: var(--bg2); border-radius: 14px; }
#game-alchemist .al-usl { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px dashed var(--line); background: var(--bg); display: flex; }
#game-alchemist .al-usl .al-cube { width: 100%; height: 100%; margin: 0; border: 0; padding: 0; border-radius: 9px; cursor: pointer; }
#game-alchemist .al-usl.al-dim .al-cube { filter: saturate(.45) brightness(.6); }
#game-alchemist .al-usl.al-upd { border: 2px solid var(--gold); box-shadow: 0 0 12px rgba(227,182,80,.55); }
#game-alchemist .al-usl.al-upd .al-cube { animation: al-u-bob 1.5s ease-in-out infinite; }
#game-alchemist .al-usl.al-pop .al-cube { animation: al-u-pop .55s cubic-bezier(.3,1.8,.5,1), al-u-bob 1.5s ease-in-out .55s infinite; }
#game-alchemist .al-usl.al-no .al-cube { animation: al-u-no .35s; }
#game-alchemist .al-spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; left: 50%; top: 50%; pointer-events: none; z-index: 3; animation: al-u-spark .6s ease-out forwards; }
#game-alchemist .al-umsg { min-height: 20px; font-size: 12.5px; color: var(--mut); text-align: center; margin-top: 8px; }
#game-alchemist .al-umsg.al-warn { color: var(--bad); }
@keyframes al-u-pop { 0% { transform: scale(1); } 30% { transform: translateY(-14px) scale(1.12); } 60% { transform: translateY(0) scale(.92,1.06); } 100% { transform: none; } }
@keyframes al-u-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes al-u-no { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes al-u-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes al-u-lit { 0% { transform: scale(.8); } 100% { transform: none; } }
@keyframes al-u-spark { 0% { transform: translate(-50%,-50%); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3); opacity: 0; } }

/* ---- 煉金術士：輪到誰，誰的材料櫃就發光（魔法光環：金綠紫的光沿著邊框繞圈） ---- */
@property --al-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
#game-alchemist .al-cab, #game-alchemist .al-opp { position: relative; }
#game-alchemist .al-cab.al-myturn, #game-alchemist .al-opp.al-turn { border-color: transparent; animation: al-fx-soft 3s ease-in-out infinite; }
#game-alchemist .al-opp.al-turn { animation-name: al-fx-soft-s; }
#game-alchemist .al-cab.al-myturn::before, #game-alchemist .al-opp.al-turn::before { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 2.5px; pointer-events: none;
  background: conic-gradient(from var(--al-ang), #e3b650, #fff3c4 8%, #5ee0a0 22%, #9b7bff 40%, #e3b650 55%, #fff3c4 62%, #5ee0a0 78%, #9b7bff 90%, #e3b650);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: al-fx-spin 3.2s linear infinite; }
@keyframes al-fx-spin { to { --al-ang: 360deg; } }
@keyframes al-fx-soft { 0%, 100% { box-shadow: 0 0 14px 1px rgba(155,123,255,.25), 0 0 22px 2px rgba(94,224,160,.15); } 50% { box-shadow: 0 0 22px 4px rgba(227,182,80,.38), 0 0 34px 6px rgba(94,224,160,.2); } }
/* 其他玩家那一排會被捲動區域切到，光暈小一點 */
@keyframes al-fx-soft-s { 0%, 100% { box-shadow: 0 0 6px 0 rgba(155,123,255,.3); } 50% { box-shadow: 0 0 10px 1px rgba(227,182,80,.45); } }
/* 剛輪到你：整個畫面邊框閃一次金光 */
#game-alchemist .al-flash { position: fixed; inset: 0; z-index: 8990; pointer-events: none; animation: al-fx-flash 1.3s ease-out forwards; }
@keyframes al-fx-flash { 0% { box-shadow: inset 0 0 0 0 rgba(227,182,80,0); } 20% { box-shadow: inset 0 0 0 4px rgba(227,182,80,.95), inset 0 0 50px 10px rgba(227,182,80,.45); } 100% { box-shadow: inset 0 0 0 0 rgba(227,182,80,0); } }
@media (prefers-reduced-motion: reduce) {
  #game-alchemist .al-new, #game-alchemist .al-new::before, #game-alchemist .al-edge, #game-alchemist .al-usl .al-cube, #game-alchemist .al-cab.al-myturn, #game-alchemist .al-opp.al-turn, #game-alchemist .al-cab.al-myturn::before, #game-alchemist .al-opp.al-turn::before { animation: none !important; }
}

/* ===================== 煉金術士：新手教學（games/alchemist.tutorial.js） ===================== */
#game-alchemist .al-tutbtn{display:block;width:100%;margin:0 0 4px;padding:13px 14px;border-radius:12px;border:1.5px solid #e3b650;background:linear-gradient(135deg,#e3b650,#c9963a);color:#2a1c00;font:800 16px/1.3 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .al-tutbtn.tu-nudge{animation:tu-nudge 1.8s ease-in-out infinite}
@keyframes tu-nudge{0%,100%{box-shadow:0 0 0 0 rgba(227,182,80,.6)}50%{box-shadow:0 0 0 7px rgba(227,182,80,0)}}
#game-alchemist .tu-wrap{position:fixed;inset:0;z-index:9200;background:rgba(4,10,8,.82);display:flex;align-items:flex-start;justify-content:center;padding:max(10px,4vh) 10px 10px;animation:tu-fadein .2s ease}
#game-alchemist .tu-box{position:relative;width:100%;max-width:430px;max-height:100%;overflow:auto;background:#152824;border:1.5px solid var(--gold);border-radius:18px;padding:12px 16px calc(14px + env(safe-area-inset-bottom,0px));box-shadow:0 10px 40px rgba(0,0,0,.6)}
#game-alchemist .tu-head{display:flex;align-items:center;justify-content:space-between}
#game-alchemist .tu-count{font-size:12.5px;color:var(--mut);font-weight:700;letter-spacing:.04em}
#game-alchemist .tu-x{width:36px;height:36px;min-height:0;margin:0;padding:0;border-radius:50%;border:1.5px solid var(--line);background:transparent;color:var(--fg);display:inline-flex;align-items:center;justify-content:center}
#game-alchemist .tu-dots{display:flex;gap:5px;margin:6px 0 10px;flex-wrap:wrap}
#game-alchemist .tu-dot{flex:1;min-width:10px;width:auto;height:6px;min-height:0;margin:0;padding:0;border:0;border-radius:3px;background:var(--line)}
#game-alchemist .tu-dot.tu-done{background:#8a7440}
#game-alchemist .tu-dot.tu-on{background:var(--gold)}
#game-alchemist .tu-title{font:700 19px/1.3 "Noto Serif TC",serif;margin:0 0 4px;color:var(--fg)}
#game-alchemist .tu-text{font-size:14.5px;line-height:1.6;color:#d9d2bc;margin:0 0 10px}
#game-alchemist .tu-text b{color:var(--gold)}
#game-alchemist .tu-stage{position:relative;min-height:330px;background:radial-gradient(ellipse at 50% 30%,#1f3a32,#12201d 75%);border:1px solid var(--line);border-radius:14px;padding:12px 10px;display:flex;flex-direction:column;justify-content:center;overflow:hidden}
#game-alchemist .tu-scene{display:flex;flex-direction:column;gap:2px}
#game-alchemist .tu-fly{position:absolute;inset:0;pointer-events:none}
#game-alchemist .tu-cap{min-height:24px;margin:8px 0 2px;text-align:center;font-size:14px;font-weight:700;color:var(--gold)}
#game-alchemist .tu-cap.tu-capin{animation:tu-fadein .35s ease}
#game-alchemist .tu-replay{display:block;width:auto;min-height:0;margin:2px auto 0;padding:5px 14px;border-radius:999px;border:1px solid var(--line);background:transparent;color:var(--mut);font:700 13px/1.4 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .tu-replay[hidden]{display:none}
#game-alchemist .tu-nav{display:flex;gap:8px;margin-top:10px}
#game-alchemist .tu-nb{flex:1;width:auto;margin:0;padding:12px 10px;border-radius:12px;border:1.5px solid var(--gold);background:var(--gold);color:#2a1c00;font:800 16px/1.2 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .tu-nb.tu-sec{background:transparent;color:var(--gold);flex:.6}
#game-alchemist .tu-nb:disabled{opacity:.3}
/* 舞台上的東西 */
#game-alchemist .tu-lab{font:700 13px/1.3 "Noto Serif TC",serif;color:var(--mut);margin:6px 2px 4px}
#game-alchemist .tu-row{display:flex;gap:8px;justify-content:center;align-items:stretch;padding:8px 0 6px;min-height:40px}
#game-alchemist .tu-row>*{flex:none}
#game-alchemist .tu-two{display:grid;grid-template-columns:auto auto;justify-content:center;gap:4px 16px}
#game-alchemist .tu-two .tu-row{justify-content:flex-start;min-height:120px}
#game-alchemist .tu-two>div+div{border-left:1px dashed var(--line);padding-left:12px}
#game-alchemist .tu-row.tu-mk{gap:5px}
#game-alchemist .tu-row.tu-mk .al-rc{width:76px;padding:10px 4px 8px}
#game-alchemist .tu-row.tu-mk .al-putbar{margin:auto -4px -8px}
#game-alchemist .tu-row .al-rc.al-mine{width:88px}
#game-alchemist .tu-potion{width:104px;height:146px;padding:0;gap:0;justify-content:flex-end}
#game-alchemist .tu-potion .al-pt{font-size:24px}
#game-alchemist .tu-cabbox{padding:8px 10px}
#game-alchemist .tu-cab{grid-template-columns:repeat(5,38px)!important;justify-content:center}
#game-alchemist .tu-cab .al-sl{position:relative}
#game-alchemist .tu-cab .al-sl .al-cube{width:100%;height:100%;border-radius:6px}
#game-alchemist .tu-cab .al-sl.tu-taken .al-cube{visibility:hidden}
#game-alchemist .tu-tag{position:absolute;top:-9px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:10.5px;font-weight:800;padding:0 7px;line-height:1.6;border-radius:999px;background:var(--panel2);color:var(--fg);border:1px solid var(--line);z-index:2}
#game-alchemist .tu-mk .al-rc:first-child .tu-tag{background:var(--ok);color:#0b2a1c;border-color:var(--ok)}
#game-alchemist .tu-empty{color:var(--mut);font-size:13px;align-self:center}
#game-alchemist .tu-fakebtn{margin:8px 0 0;padding:10px;border-radius:12px;border:1.5px solid var(--gold);color:var(--gold);text-align:center;font-weight:800;font-size:14px;position:relative}
#game-alchemist .tu-fakebtn.tu-dim{opacity:.35}
#game-alchemist .tu-ladder{display:flex;align-items:center;justify-content:center;gap:4px;margin:4px 0 10px;min-height:66px}
#game-alchemist .tu-mat{display:flex;flex-direction:column;align-items:center;gap:4px;width:62px;font-size:12px;font-weight:700;text-align:center;line-height:1.2}
#game-alchemist .tu-mat .al-cube.al-big{width:34px;height:34px;border-radius:8px}
#game-alchemist .tu-arr{color:var(--gold);font-weight:800}
#game-alchemist .tu-four{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#game-alchemist .tu-opt{background:var(--panel2);border:1.5px solid var(--line);border-radius:14px;padding:10px 8px;min-height:104px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-align:center}
#game-alchemist .tu-opt b{width:26px;height:26px;border-radius:50%;background:var(--gold);color:#2a1c00;display:flex;align-items:center;justify-content:center;font-size:14px}
#game-alchemist .tu-opt span{font:700 16px/1.3 "Noto Serif TC",serif}
#game-alchemist .tu-opt small{font-size:12px;color:var(--mut);line-height:1.35}
#game-alchemist .tu-opt.tu-ghost{border-style:dashed;background:transparent}
#game-alchemist .tu-ups{display:flex;justify-content:center;gap:12px;margin-top:8px;font-size:24px;color:var(--line)}
#game-alchemist .tu-ups b{font-weight:400}
#game-alchemist .tu-ups b.tu-on{color:var(--gold);text-shadow:0 0 10px rgba(227,182,80,.8)}
#game-alchemist .tu-got{margin-top:10px;text-align:center;font-weight:800;color:var(--gold);background:rgba(227,182,80,.1);border:1px solid var(--gold);border-radius:10px;padding:6px}
#game-alchemist .tu-score{display:flex;flex-direction:column;gap:8px}
#game-alchemist .tu-srow{display:grid;grid-template-columns:104px 1fr 48px;align-items:center;gap:8px;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:8px 10px;min-height:44px}
#game-alchemist .tu-srow .tu-sl{font-size:13px;color:var(--mut);font-weight:700}
#game-alchemist .tu-srow .tu-sm{display:flex;gap:4px;align-items:center;flex-wrap:wrap}
#game-alchemist .tu-srow .tu-sm small{font-size:11px;color:var(--mut)}
#game-alchemist .tu-srow b{text-align:right;font-size:20px;color:var(--gold)}
#game-alchemist .tu-srow.tu-total{border-color:var(--gold);background:rgba(227,182,80,.1)}
#game-alchemist .tu-srow.tu-total .tu-sl{color:var(--fg);font-size:15px}
#game-alchemist .tu-srow.tu-total b{font-size:26px}
#game-alchemist .tu-mini{display:inline-flex;align-items:center;justify-content:center;width:30px;height:38px;border-radius:6px;background:linear-gradient(180deg,#2a4a3f,#1f3a32);border:1px solid var(--line);font:800 15px/1 "Noto Serif TC",serif}
#game-alchemist .al-coin.tu-coin{position:static;width:24px;height:24px}
#game-alchemist .tu-tips{margin:0;padding:0 0 0 2px;list-style:none;display:flex;flex-direction:column;gap:10px}
#game-alchemist .tu-tips li{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:10px 12px;font-size:14px;line-height:1.55}
#game-alchemist .tu-tips b{color:var(--gold)}
/* 動畫 */
#game-alchemist .tu-pop{animation:tu-pop .45s cubic-bezier(.3,1.5,.5,1) both}
#game-alchemist .al-used.tu-pop{animation-name:tu-popdim}
@keyframes tu-popdim{0%{opacity:0;transform:scale(.4)}100%{opacity:.45;transform:scale(1)}}
#game-alchemist .tu-fade{animation:tu-fadein .5s ease both}
#game-alchemist .tu-d1{animation-delay:.18s}
#game-alchemist .tu-d2{animation-delay:.36s}
#game-alchemist .tu-d3{animation-delay:.54s}
#game-alchemist .tu-glow{box-shadow:0 0 0 2px var(--gold),0 0 24px rgba(227,182,80,.6)}
#game-alchemist .tu-hi{border-color:var(--gold)!important;box-shadow:0 0 0 2px var(--gold),0 0 18px rgba(227,182,80,.55);transform:translateY(-4px);transition:transform .2s}
#game-alchemist .tu-out .al-cube{animation:tu-out .6s ease .15s forwards}
#game-alchemist .tu-out{border-color:var(--bad)}
#game-alchemist .tu-slide{animation:tu-slide .5s ease both}
#game-alchemist .tu-new{animation-name:tu-slidein}
#game-alchemist .tu-back{animation:tu-back .55s cubic-bezier(.2,.9,.3,1.1) both}
#game-alchemist .tu-flycube{position:absolute;width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:5px;z-index:5;transition:transform .55s cubic-bezier(.45,.05,.3,1);box-shadow:0 4px 10px rgba(0,0,0,.6)}
#game-alchemist .tu-tap{position:absolute;z-index:6;width:0;height:0}
#game-alchemist .tu-tap::before{content:"";position:absolute;left:-22px;top:-22px;width:44px;height:44px;border-radius:50%;border:3px solid #fff;animation:tu-ring .9s ease-out .35s both}
#game-alchemist .tu-tap svg{position:absolute;left:-8px;top:-4px;filter:drop-shadow(0 3px 4px rgba(0,0,0,.6));animation:tu-press .9s ease both}
@keyframes tu-fadein{from{opacity:0}to{opacity:1}}
@keyframes tu-pop{0%{opacity:0;transform:scale(.4)}100%{opacity:1;transform:scale(1)}}
@keyframes tu-out{to{opacity:0;transform:scale(.2)}}
@keyframes tu-slide{from{transform:translateX(40px)}to{transform:none}}
@keyframes tu-slidein{from{opacity:0;transform:translateX(80px)}to{opacity:1;transform:none}}
@keyframes tu-back{from{opacity:0;transform:translateY(90px)}to{opacity:1;transform:none}}
@keyframes tu-ring{0%{opacity:0;transform:scale(.4)}30%{opacity:1}100%{opacity:0;transform:scale(1.5)}}
@keyframes tu-press{0%{opacity:0;transform:translate(26px,30px)}40%{opacity:1;transform:none}55%{transform:scale(.88)}70%,100%{transform:none}}
@media (prefers-reduced-motion:reduce){#game-alchemist .tu-wrap *,#game-alchemist .al-tutbtn{animation-duration:.01ms!important;animation-delay:0s!important;transition-duration:.01ms!important}}

/* 煉成抽屜的「完成後材料櫃」（兩列五格，放不下的另外放在紅框） */
#game-alchemist .al-aftlab{display:flex;justify-content:space-between;align-items:baseline;font-size:13px;margin:10px 0 6px}
#game-alchemist .al-aftlab span{color:var(--mut);font-weight:800}
#game-alchemist .al-aftcab{padding:10px 12px}
#game-alchemist .al-aftcab .al-cab10{grid-template-columns:repeat(5,40px);justify-content:center;gap:6px}
#game-alchemist .al-aftov{display:flex;align-items:center;gap:10px;margin-top:8px;padding:8px 12px;border:1.5px dashed var(--bad);border-radius:12px;background:rgba(255,122,107,.08)}
#game-alchemist .al-aftov>div{flex:1;display:flex;flex-direction:column;gap:2px}
#game-alchemist .al-aftov b{font-size:13px;color:var(--bad)}
#game-alchemist .al-aftov small{font-size:11.5px;color:#c9b8a8}
#game-alchemist .al-aftov>span{display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end;max-width:60%}
#game-alchemist .al-osl{width:30px;height:30px;border-radius:6px;border:1.5px solid var(--bad);display:flex;align-items:center;justify-content:center}
#game-alchemist .al-osl .al-cube{width:100%;height:100%;border-radius:5px;margin:0}

/* ===================== 煉金術士：互動新手教學（games/alchemist.lesson.js） ===================== */
#game-alchemist .al-lessonbtn{display:block;width:100%;margin:0 0 6px;padding:14px;border-radius:12px;border:1.5px solid #e3b650;background:linear-gradient(135deg,#e3b650,#c9963a);color:#2a1c00;font:800 16.5px/1.3 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .al-lessonbtn small{display:block;font-size:12px;font-weight:700;opacity:.75;margin-top:2px}
#game-alchemist .al-lessonbtn.ls-nudge{animation:tu-nudge 1.8s ease-in-out infinite}
#game-alchemist .al-tutlink{display:block;width:auto;margin:0 auto 4px;padding:6px 12px;min-height:0;border:0;background:transparent;color:#e3b650;font:700 13.5px/1.4 "Noto Sans TC",system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px}
/* 教學中：畫面下面留空間給師傅的對話框；抽屜矮一點，上面放對話框 */
#game-alchemist.ls-on .al-wrap,#game-alchemist.ls-on #al-main>.al-phone{padding-bottom:220px}
#game-alchemist.ls-on .al-sheet{max-height:calc(100vh - 190px)}
#game-alchemist .ls-dim{opacity:.32;transition:opacity .25s}
#game-alchemist .ls-tgt{position:relative;z-index:3;animation:ls-glow 1.3s ease-in-out infinite}
#game-alchemist .ls-focus{box-shadow:0 0 0 2.5px #e3b650,0 0 18px rgba(227,182,80,.55)!important}
@keyframes ls-glow{0%,100%{box-shadow:0 0 0 2.5px #e3b650,0 0 10px rgba(227,182,80,.45)}50%{box-shadow:0 0 0 3.5px #ffe08a,0 0 26px rgba(255,224,138,.9)}}
/* 師傅對話框 */
#game-alchemist .ls-box{position:fixed;z-index:9150;left:50%;transform:translateX(-50%);bottom:calc(10px + env(safe-area-inset-bottom,0px));width:min(410px,calc(100% - 20px));box-sizing:border-box;background:rgba(12,22,19,.97);border:1.5px solid #e3b650;border-radius:16px;padding:10px 12px;display:flex;gap:10px;align-items:flex-start;box-shadow:0 -6px 30px rgba(0,0,0,.6);color:#efe6cf}
#game-alchemist .ls-box.ls-top{bottom:auto;top:calc(8px + env(safe-area-inset-top,0px))}
#game-alchemist .ls-box.ls-shake{animation:ls-shake .4s ease}
@keyframes ls-shake{0%,100%{transform:translateX(-50%)}25%{transform:translateX(calc(-50% - 7px))}75%{transform:translateX(calc(-50% + 7px))}}
#game-alchemist .ls-av{flex:none;width:62px;height:62px;border-radius:50%;background:#2a3f38;border:2px solid #e3b650;overflow:hidden}
#game-alchemist .ls-av img{width:100%;height:100%;object-fit:cover;object-position:50% 12%;display:block}
#game-alchemist .ls-say{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
#game-alchemist .ls-say>span{font-size:14.5px;line-height:1.55}
#game-alchemist .ls-name{display:flex;align-items:center;justify-content:space-between}
#game-alchemist .ls-name b{font:900 13px/1 "Noto Serif TC",serif;color:#e3b650}
#game-alchemist .ls-skip{width:auto;min-height:0;margin:0;padding:4px 2px;border:0;background:transparent;color:#9fb3a6;font:700 12px/1 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .ls-go{align-self:flex-end;width:auto;min-height:0;margin:0;padding:8px 20px;border-radius:12px;border:1.5px solid #e3b650;background:#e3b650;color:#2a1c00;font:800 14px/1.2 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .ls-go.ls-ping{animation:ls-ping .5s ease}
@keyframes ls-ping{50%{transform:scale(1.12);box-shadow:0 0 0 6px rgba(227,182,80,.35)}}
#game-alchemist .ls-hint{align-self:flex-end;font-size:11.5px;color:#9fb3a6}
/* 故事、結尾 */
#game-alchemist .ls-cover{position:fixed;inset:0;z-index:9300;background:#070d0c}
#game-alchemist .ls-story{position:absolute;inset:0;max-width:520px;margin:0 auto;background-size:cover;background-position:center top;display:flex;flex-direction:column;padding:12px 18px calc(24px + env(safe-area-inset-bottom,0px));box-sizing:border-box;color:#efe6cf}
#game-alchemist .ls-story .ls-skip{align-self:flex-end;color:#e6ddc6;text-shadow:0 1px 3px #000;font-size:13px;padding:8px 4px}
#game-alchemist .ls-sp{flex:1}
#game-alchemist .ls-big{width:min(250px,62vw);align-self:center;margin-bottom:-18px;position:relative;z-index:1;filter:drop-shadow(0 8px 18px rgba(0,0,0,.7))}
#game-alchemist .ls-sbox{position:relative;z-index:2;background:rgba(10,18,16,.88);border:1.5px solid #e3b650;border-radius:16px;padding:16px 18px;min-height:110px;box-sizing:border-box}
#game-alchemist .ls-sbox b{display:block;font:900 14px/1 "Noto Serif TC",serif;color:#e3b650;margin-bottom:8px}
#game-alchemist .ls-sbox span{font:700 17.5px/1.65 "Noto Serif TC",serif}
#game-alchemist .ls-dots{display:flex;gap:6px;justify-content:center;margin:14px 0 12px}
#game-alchemist .ls-dots i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.3)}
#game-alchemist .ls-dots i.on{background:#e3b650}
#game-alchemist .ls-btn{width:100%;margin:0 0 8px;padding:13px;border-radius:12px;border:1.5px solid #e3b650;background:#e3b650;color:#2a1c00;font:800 16px/1.2 "Noto Sans TC",system-ui,sans-serif}
#game-alchemist .ls-btn.ls-sec{background:transparent;color:#e3b650;margin-bottom:0}
#game-alchemist .ls-end{background-size:cover;background-position:center;overflow-y:auto;gap:9px}
#game-alchemist .ls-endimg{width:118px;align-self:center;filter:drop-shadow(0 6px 14px rgba(0,0,0,.7))}
#game-alchemist .ls-end h3{margin:-6px 0 0;text-align:center;font:900 25px/1.3 "Noto Serif TC",serif;color:#e3b650}
#game-alchemist .ls-end p{margin:0 0 4px;text-align:center;font-size:14px;line-height:1.6;color:#c9d6cc}
#game-alchemist .ls-rule{background:rgba(28,53,48,.92);border:1px solid #2f554a;border-radius:12px;padding:10px 13px;font-size:13.5px;line-height:1.55}
#game-alchemist .ls-rule b{color:#e3b650}
#game-alchemist .ls-rule.ls-tip{background:rgba(227,182,80,.12);border-color:#e3b650}
#game-alchemist .ls-rise{animation:ls-rise .4s ease both}
@keyframes ls-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){#game-alchemist .ls-tgt,#game-alchemist .ls-rise,#game-alchemist .ls-box.ls-shake,#game-alchemist .al-lessonbtn.ls-nudge{animation:none!important}#game-alchemist .ls-tgt{box-shadow:0 0 0 3px #e3b650}}

/* ===== 絲路商人：互動新手教學（public/games/silkroad.lesson.js），做法跟煉金術士的 ls- 那一段一樣，配色換成絲路商人 ===== */
#game-silkroad .sr-lessonbtn{display:block;width:100%;margin:0 0 10px;padding:14px;border-radius:12px;border:1.5px solid #f0c24a;background:linear-gradient(135deg,#f0c24a,#c9963a);color:#2a1c00;font:800 16.5px/1.3 "Noto Sans TC",system-ui,sans-serif}
#game-silkroad .sr-lessonbtn small{display:block;font-size:12px;font-weight:700;opacity:.75;margin-top:2px}
#game-silkroad .sr-lessonbtn.ls-nudge{animation:tu-nudge 1.8s ease-in-out infinite}
#game-silkroad.ls-on .sr-main{padding-bottom:230px}
#game-silkroad.ls-on .sr-sheet{max-height:calc(100vh - 175px);max-height:calc(100dvh - 175px)}
#game-silkroad .ls-dim{opacity:.32;transition:opacity .25s}
#game-silkroad .ls-tgt{position:relative;z-index:3;animation:sl-glow 1.3s ease-in-out infinite}
#game-silkroad .ls-focus{box-shadow:0 0 0 2.5px #f0c24a,0 0 18px rgba(240,194,74,.55)!important}
@keyframes sl-glow{0%,100%{box-shadow:0 0 0 2.5px #f0c24a,0 0 10px rgba(240,194,74,.45)}50%{box-shadow:0 0 0 3.5px #ffe08a,0 0 26px rgba(255,224,138,.9)}}
#game-silkroad .ls-box{position:fixed;z-index:9150;left:50%;transform:translateX(-50%);bottom:calc(10px + env(safe-area-inset-bottom,0px));width:min(410px,calc(100% - 20px));box-sizing:border-box;background:rgba(22,27,38,.97);border:1.5px solid #f0c24a;border-radius:16px;padding:10px 12px;display:flex;gap:10px;align-items:flex-start;box-shadow:0 -6px 30px rgba(0,0,0,.6);color:#efe6cf}
#game-silkroad .ls-box.ls-top{bottom:auto;top:calc(8px + env(safe-area-inset-top,0px))}
#game-silkroad .ls-box.ls-shake{animation:sl-shake .4s ease}
@keyframes sl-shake{0%,100%{transform:translateX(-50%)}25%{transform:translateX(calc(-50% - 7px))}75%{transform:translateX(calc(-50% + 7px))}}
#game-silkroad .ls-av{flex:none;width:62px;height:62px;border-radius:50%;background:#2a3142;border:2px solid #f0c24a;overflow:hidden}
#game-silkroad .ls-av img{width:100%;height:100%;object-fit:cover;object-position:50% 12%;display:block}
#game-silkroad .ls-say{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
#game-silkroad .ls-say>span{font-size:14.5px;line-height:1.55}
#game-silkroad .ls-name{display:flex;align-items:center;justify-content:space-between}
#game-silkroad .ls-name b{font:900 13px/1 "Noto Serif TC",serif;color:#f0c24a}
#game-silkroad .ls-skip{width:auto;min-height:0;margin:0;padding:4px 2px;border:0;background:transparent;color:#aab3c2;font:700 12px/1 "Noto Sans TC",system-ui,sans-serif}
#game-silkroad .ls-go{align-self:flex-end;width:auto;min-height:0;margin:0;padding:8px 20px;border-radius:12px;border:1.5px solid #f0c24a;background:#f0c24a;color:#2a1c00;font:800 14px/1.2 "Noto Sans TC",system-ui,sans-serif}
#game-silkroad .ls-go.ls-ping{animation:sl-ping .5s ease}
@keyframes sl-ping{50%{transform:scale(1.12);box-shadow:0 0 0 6px rgba(240,194,74,.35)}}
#game-silkroad .ls-hint{align-self:flex-end;font-size:11.5px;color:#aab3c2}
#game-silkroad .ls-cover{position:fixed;inset:0;z-index:9300;background:#0b0d13}
#game-silkroad .ls-story{position:absolute;inset:0;max-width:520px;margin:0 auto;background-size:cover;background-position:center top;display:flex;flex-direction:column;padding:12px 18px calc(24px + env(safe-area-inset-bottom,0px));box-sizing:border-box;color:#efe6cf}
#game-silkroad .ls-story .ls-skip{align-self:flex-end;color:#e6ddc6;text-shadow:0 1px 3px #000;font-size:13px;padding:8px 4px}
#game-silkroad .ls-sp{flex:1}
#game-silkroad .ls-big{width:min(250px,62vw);align-self:center;margin-bottom:-18px;position:relative;z-index:1;filter:drop-shadow(0 8px 18px rgba(0,0,0,.7))}
#game-silkroad .ls-sbox{position:relative;z-index:2;background:rgba(16,20,28,.9);border:1.5px solid #f0c24a;border-radius:16px;padding:16px 18px;min-height:110px;box-sizing:border-box}
#game-silkroad .ls-sbox b{display:block;font:900 14px/1 "Noto Serif TC",serif;color:#f0c24a;margin-bottom:8px}
#game-silkroad .ls-sbox span{font:700 17.5px/1.65 "Noto Serif TC",serif}
#game-silkroad .ls-dots{display:flex;gap:6px;justify-content:center;margin:14px 0 12px}
#game-silkroad .ls-dots i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.3)}
#game-silkroad .ls-dots i.on{background:#f0c24a}
#game-silkroad .ls-btn{width:100%;margin:0 0 8px;padding:13px;border-radius:12px;border:1.5px solid #f0c24a;background:#f0c24a;color:#2a1c00;font:800 16px/1.2 "Noto Sans TC",system-ui,sans-serif}
#game-silkroad .ls-btn.ls-sec{background:transparent;color:#f0c24a;margin-bottom:0}
#game-silkroad .ls-end{background-size:cover;background-position:center;overflow-y:auto;gap:9px}
#game-silkroad .ls-endimg{width:118px;align-self:center;filter:drop-shadow(0 6px 14px rgba(0,0,0,.7))}
#game-silkroad .ls-end h3{margin:-6px 0 0;text-align:center;font:900 25px/1.3 "Noto Serif TC",serif;color:#f0c24a}
#game-silkroad .ls-end p{margin:0 0 4px;text-align:center;font-size:14px;line-height:1.6;color:#c9cfdb}
#game-silkroad .ls-rule{background:rgba(34,41,56,.95);border:1px solid #3a4356;border-radius:12px;padding:10px 13px;font-size:13.5px;line-height:1.55}
#game-silkroad .ls-rule b{color:#f0c24a}
#game-silkroad .ls-rule.ls-tip{background:rgba(240,194,74,.12);border-color:#f0c24a}
#game-silkroad .ls-rise{animation:sl-rise .4s ease both}
@keyframes sl-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){#game-silkroad .ls-tgt,#game-silkroad .ls-rise,#game-silkroad .ls-box.ls-shake{animation:none!important}#game-silkroad .ls-tgt{box-shadow:0 0 0 3px #f0c24a}}
#game-silkroad .ls-tgt,#game-silkroad .ls-focus{border-radius:8px}
/* 教學：同一顆貨物還要再點一下（還在發光）的時候，先不畫「已選」的圓框，免得跟發光的方框疊在一起 */
#game-silkroad .sr-pick.is-on.ls-tgt .sr-tok{outline:none}
/* 故事頁：對話框不准被擠扁（字才不會跑出框外），螢幕不夠高時改縮小阿依莎的圖 */
#game-silkroad .ls-story .ls-sbox{flex-shrink:0}
#game-silkroad .ls-story .ls-big{flex:0 1 auto;min-height:0;object-fit:contain;object-position:center bottom}
#game-silkroad .ls-story .ls-btn,#game-silkroad .ls-story .ls-dots{flex-shrink:0}
#game-silkroad .ls-end .ls-grp{margin:6px 0 -3px;font:900 14px/1.3 "Noto Serif TC",serif;color:#f0c24a;letter-spacing:1px}
#game-silkroad .ls-ff{position:fixed;inset:0;z-index:9200;background-size:cover;background-position:center;display:flex;align-items:center;justify-content:center;font:900 24px/1.6 "Noto Serif TC",serif;color:#f6e3b0;text-shadow:0 2px 8px #000;animation:ls-ff 2.4s ease forwards;pointer-events:none}
@keyframes ls-ff{0%{opacity:0}15%,75%{opacity:1}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){#game-silkroad .sr-lessonbtn.ls-nudge,#game-silkroad .ls-ff{animation:none!important}}

/* ===================== 魚市場：規則動畫（games/fishmarket.tutorial.js） ===================== */
#game-fishmarket .tu-wrap{position:fixed;inset:0;z-index:9200;background:rgba(4,30,52,.72);display:flex;align-items:flex-start;justify-content:center;padding:max(10px,3vh) 10px 10px}
#game-fishmarket .tu-box{position:relative;width:100%;max-width:430px;max-height:100%;overflow:auto;background:#0a4a74;border:2px solid var(--fm-orange);border-radius:18px;padding:0 14px 14px;box-shadow:0 10px 40px rgba(0,0,0,.55)}
#game-fishmarket .tu-head{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;margin:0 -14px;padding:8px 10px 8px 14px;background:linear-gradient(#9a6a3c,#7a4d28);border-bottom:3px solid #4e2f18;border-radius:15px 15px 0 0}
#game-fishmarket .tu-count{font-size:13px;font-weight:800;letter-spacing:.04em}
#game-fishmarket .tu-x{width:34px;height:34px;border-radius:50%;border:0;background:#4e2f18;color:#f3ecd9;display:inline-flex;align-items:center;justify-content:center}
#game-fishmarket .tu-dots{display:flex;gap:4px;margin:10px 0 10px}
#game-fishmarket .tu-dot{flex:1;height:6px;border:0;padding:0;border-radius:3px;background:#2e6e96}
#game-fishmarket .tu-dot.tu-done{background:#b76a2a}
#game-fishmarket .tu-dot.tu-on{background:var(--fm-orange)}
#game-fishmarket .tu-title{font-size:19px;font-weight:900;margin:0 0 4px}
#game-fishmarket .tu-text{font-size:14.5px;line-height:1.6;color:#dcebf2;margin:0 0 10px}
#game-fishmarket .tu-text b{color:#ffc27a}
#game-fishmarket .tu-stage{position:relative;min-height:300px;background:repeating-linear-gradient(45deg,rgba(255,255,255,.05) 0 2px,transparent 2px 22px),linear-gradient(#1a97c9,#0f6ea3 50%,#0a4d7e);border-radius:14px;padding:12px 8px;display:flex;flex-direction:column;justify-content:center;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
#game-fishmarket .tu-scene{display:flex;flex-direction:column;gap:8px}
#game-fishmarket .tu-fly{position:absolute;inset:0;pointer-events:none}
#game-fishmarket .tu-cap{min-height:24px;margin:8px 0 2px;text-align:center;font-size:14px;font-weight:800;color:#ffc27a}
#game-fishmarket .tu-capin{animation:fmtu-fadein .35s ease}
#game-fishmarket .tu-replay{display:block;margin:2px auto 0;padding:5px 14px;border-radius:999px;border:1px solid #2e6e96;background:transparent;color:#a9c2cc;font:700 13px/1.4 "Noto Sans TC",system-ui,sans-serif}
#game-fishmarket .tu-replay[hidden]{display:none}
#game-fishmarket .tu-nav{display:flex;gap:8px;margin-top:10px}
#game-fishmarket .tu-nb{flex:1;padding:13px 10px;border:0;border-radius:14px;background:var(--fm-orange);color:var(--fm-ink);font:900 16px/1.2 "Noto Sans TC",system-ui,sans-serif;box-shadow:0 4px 0 #b95a00}
#game-fishmarket .tu-nb.tu-sec{flex:.6;background:var(--fm-cream);box-shadow:0 4px 0 #b9a77f}
#game-fishmarket .tu-nb:disabled{opacity:.35}

/* ---------------- 舞台上的東西 ---------------- */
#game-fishmarket .tu-lab{font-size:12.5px;font-weight:800;opacity:.9;margin:0 2px -2px;display:flex;justify-content:space-between;align-items:center}
#game-fishmarket .tu-pool{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;min-height:48px;align-items:center;background:#0a4a74;border-radius:12px;padding:8px}
#game-fishmarket .tu-pool .tu-empty{font-size:13px;opacity:.75}
#game-fishmarket .tu-bigcard{width:96px;height:62px}
#game-fishmarket .tu-bigcard b{font-size:18px}
#game-fishmarket .tu-bell,#game-fishmarket .tu-flipb{height:48px;border-radius:16px;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:900;font-size:17px;color:var(--fm-ink)}
#game-fishmarket .tu-bell{background:var(--fm-orange);box-shadow:0 4px 0 #b95a00}
#game-fishmarket .tu-flipb{background:var(--fm-cream);box-shadow:0 4px 0 #b9a77f}
#game-fishmarket .tu-bell.tu-ring svg{animation:fmtu-ringbell .5s ease 2}
#game-fishmarket .tu-bell.is-off{background:#2e6e96;color:#a9c2cc;box-shadow:0 4px 0 #245a7c;font-size:14px}
#game-fishmarket .tu-flipb.is-wait{opacity:.55}
#game-fishmarket .tu-play .tu-bell:not(.is-off),#game-fishmarket .tu-play .tu-flipb{cursor:pointer;-webkit-tap-highlight-color:transparent}
#game-fishmarket .tu-play .tu-bell:not(.is-off):active,#game-fishmarket .tu-play .tu-flipb:active{transform:translateY(3px);box-shadow:0 1px 0 #b95a00}
#game-fishmarket .tu-msg{min-height:44px;text-align:center;font-size:14px;font-weight:800;line-height:1.45;display:flex;align-items:center;justify-content:center;padding:4px 6px}
#game-fishmarket .tu-msg.good{color:var(--fm-green)}
#game-fishmarket .tu-msg.bad{color:#ffb3a6}
#game-fishmarket .tu-trybadge{display:inline-block;background:#ffd45c;color:var(--fm-ink);font-size:12px;font-weight:900;border-radius:6px;padding:1px 7px;margin-right:6px;vertical-align:3px}
/* 攤位介紹的說明泡泡（箭頭指向那一格） */
#game-fishmarket .tu-call{position:relative;margin:0 auto 12px;width:min(340px,calc(100vw - 64px));max-width:100%;background:var(--fm-cream);color:var(--fm-ink);border-radius:14px;padding:10px 12px;box-shadow:0 6px 14px rgba(0,0,0,.35)}
#game-fishmarket .tu-call b{display:block;font-size:19px;font-weight:900;margin-bottom:2px}
#game-fishmarket .tu-call span{font-size:15px;font-weight:700;line-height:1.45}
#game-fishmarket .tu-call em{font-style:normal;color:#c0392b;font-weight:900}
#game-fishmarket .tu-call::after{content:"";position:absolute;bottom:-10px;left:var(--ax);margin-left:-10px;border:10px solid transparent;border-bottom:0;border-top-color:var(--fm-cream)}
#game-fishmarket .tu-seats{display:flex;gap:6px}
#game-fishmarket .tu-seat{flex:1;min-width:0;position:relative;background:#0a4a74;border-radius:12px;padding:8px 6px 6px;text-align:center}
#game-fishmarket .tu-seat.is-auct{box-shadow:inset 0 0 0 2px var(--fm-orange)}
#game-fishmarket .tu-seat.is-me{box-shadow:inset 0 0 0 2px #ffd45c}
#game-fishmarket .tu-seat .tg{position:absolute;top:-8px;left:50%;transform:translateX(-50%);background:var(--fm-orange);color:var(--fm-ink);font-size:10px;font-weight:900;padding:0 6px;border-radius:6px;white-space:nowrap}
#game-fishmarket .tu-seat.is-me .tg{background:#ffd45c}
#game-fishmarket .tu-seat .nm{font-size:12px;font-weight:700}
#game-fishmarket .tu-seat .cash{font-family:var(--fm-num);color:var(--fm-green);font-size:18px}
#game-fishmarket .tu-delta{display:inline-block;font-size:12px;font-weight:900;border-radius:6px;padding:0 5px;margin-left:2px}
#game-fishmarket .tu-delta.up{background:var(--fm-green);color:var(--fm-ink)}
#game-fishmarket .tu-delta.down{background:var(--fm-red);color:#fff}
#game-fishmarket .tu-prices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
#game-fishmarket .tu-prices div{background:#0b5f93;border-radius:8px;padding:4px 2px;text-align:center;font-size:10.5px;line-height:1.35}
#game-fishmarket .tu-prices b{font-size:14px;color:var(--fm-green)}
#game-fishmarket .tu-prices div.on{background:var(--fm-orange);color:var(--fm-ink)}
#game-fishmarket .tu-prices div.on b{color:var(--fm-ink)}
#game-fishmarket .tu-steps{display:flex;flex-direction:column;gap:8px}
#game-fishmarket .tu-stp{display:flex;align-items:center;gap:10px;background:#0a4a74;border-radius:14px;padding:10px 12px;min-height:62px}
#game-fishmarket .tu-stp i{flex:none;width:30px;height:30px;border-radius:50%;background:var(--fm-orange);color:var(--fm-ink);font-style:normal;font-weight:900;display:flex;align-items:center;justify-content:center}
#game-fishmarket .tu-stp span{font-size:16px;font-weight:900}
#game-fishmarket .tu-stp small{display:block;font-size:12px;opacity:.8;font-weight:500;margin-top:2px}
#game-fishmarket .tu-stp.tu-ghost{background:transparent;border:1.5px dashed #2e6e96}
#game-fishmarket .tu-got{text-align:center;font-weight:900;background:rgba(255,138,31,.15);border:1.5px solid var(--fm-orange);border-radius:12px;padding:7px;color:#ffc27a}
#game-fishmarket .tu-special{display:flex;gap:12px;align-items:center;justify-content:center}
#game-fishmarket .tu-special img{width:118px;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.4)}
#game-fishmarket .tu-special p{margin:0;font-size:13.5px;line-height:1.55;max-width:170px}
#game-fishmarket .tu-special p b{color:#ffc27a}
#game-fishmarket .tu-rank{display:flex;flex-direction:column;gap:6px}
#game-fishmarket .tu-rk{display:grid;grid-template-columns:1fr auto auto auto;gap:8px;align-items:center;background:#0a4a74;border-radius:12px;padding:8px 12px;font-size:13px}
#game-fishmarket .tu-rk b{font-family:var(--fm-num);font-weight:400;font-size:18px;color:var(--fm-green);min-width:44px;text-align:right}
#game-fishmarket .tu-rk.win{box-shadow:inset 0 0 0 2px #ffd45c}
#game-fishmarket .tu-rk small{opacity:.8}
#game-fishmarket .tu-tips{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:9px}
#game-fishmarket .tu-tips li{background:#0a4a74;border-radius:12px;padding:10px 12px;font-size:14px;line-height:1.55}
#game-fishmarket .tu-tips b{color:#ffc27a}
#game-fishmarket .tu-vs{display:grid;grid-template-columns:1fr;gap:6px}
#game-fishmarket .tu-who{font-size:12px;font-weight:800;margin:0 0 3px 4px}

/* 動畫 */
#game-fishmarket .tu-pop{animation:fmtu-pop .45s cubic-bezier(.3,1.5,.5,1) both}
#game-fishmarket .tu-d1{animation-delay:.18s}#game-fishmarket .tu-d2{animation-delay:.36s}#game-fishmarket .tu-d3{animation-delay:.54s}
#game-fishmarket .tu-flipin{animation:fmtu-flipin .5s ease both}
#game-fishmarket .tu-hi{box-shadow:0 0 0 2px #ffe3a1,0 0 14px 4px rgba(255,176,64,.85)!important;z-index:30!important}
#game-fishmarket .tu-rot{animation:fmtu-rot .9s ease both}
#game-fishmarket .tu-gone{animation:fmtu-out .5s ease .1s forwards}
#game-fishmarket .tu-glowreg{box-shadow:0 0 0 2px #ffe3a1,0 0 16px rgba(255,200,90,.8);border-radius:10px}
#game-fishmarket .tu-flycard{position:absolute;z-index:5;margin:-20px 0 0 -31px;transition:transform .6s cubic-bezier(.45,.05,.3,1);box-shadow:0 6px 14px rgba(0,0,0,.5)}
#game-fishmarket .tu-tap{position:absolute;z-index:6;width:0;height:0}
#game-fishmarket .tu-tap::before{content:"";position:absolute;left:-20px;top:-20px;width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.35);border:2px solid rgba(255,255,255,.9);animation:fmtu-ring .7s ease-out .45s both}
#game-fishmarket .tu-tap svg{position:absolute;left:-22px;top:-3px;overflow:visible;filter:drop-shadow(0 3px 4px rgba(0,0,0,.45));transform-origin:22px 3px;animation:fmtu-press 1s ease both}
@keyframes fmtu-fadein{from{opacity:0}to{opacity:1}}
@keyframes fmtu-pop{0%{opacity:0;transform:scale(.4)}100%{opacity:1;transform:scale(1)}}
@keyframes fmtu-out{to{opacity:0;transform:scale(.3)}}
@keyframes fmtu-flipin{0%{opacity:0;transform:perspective(300px) rotateY(90deg) translateY(-20px)}100%{opacity:1;transform:none}}
@keyframes fmtu-rot{0%{filter:none}100%{filter:grayscale(.8) brightness(.7) sepia(.4)}}
@keyframes fmtu-ringbell{0%,100%{transform:rotate(0)}25%{transform:rotate(-18deg)}75%{transform:rotate(18deg)}}
@keyframes fmtu-ring{0%{opacity:0;transform:scale(.4)}30%{opacity:1}100%{opacity:0;transform:scale(1.5)}}
@keyframes fmtu-press{0%{opacity:0;transform:translate(22px,26px)}40%{opacity:1;transform:none}52%{transform:scale(.86)}66%,100%{transform:none}}
@media (prefers-reduced-motion:reduce){#game-fishmarket .tu-wrap *{animation-duration:.01ms!important;animation-delay:0s!important;transition-duration:.01ms!important}}

/* 教學裡的卡片、玩家墊比遊戲裡小一點，才放得進舞台 */
#game-fishmarket .tu-wrap .fm-card{width:62px;height:40px;border-radius:7px}
#game-fishmarket .tu-wrap .fm-card b{font-size:13px}
#game-fishmarket .tu-wrap .tu-bigcard{width:96px;height:62px}
#game-fishmarket .tu-wrap .tu-bigcard b{font-size:18px}
#game-fishmarket .tu-wrap .fm-mat{--fw:min(340px,calc(100vw - 64px));margin:0 auto}
#game-fishmarket .tu-wrap .fm-mat.sm{--fw:min(250px,calc(100vw - 120px))}
#game-fishmarket .tu-wrap .fm-reg .fm-card{width:auto;border-radius:6px}
#game-fishmarket .tu-wrap .fm-reg .fm-card b{font-size:calc(var(--fw)*13/340)}
#game-fishmarket .tu-wrap .fm-tag{font-size:10.5px}
#game-fishmarket .tu-wrap .fm-mat.sm .fm-tag{font-size:9px}
#game-fishmarket .tu-wrap .fm-tag span{padding:1px 5px}
#game-fishmarket .tu-wrap .fm-tag span.is-ok{background:var(--fm-green)}
#game-fishmarket .tu-wrap .fm-pill{font-size:12px;padding:5px 11px}
/* 開桌畫面的「看規則動畫」按鈕（還沒看過的手機會一閃一閃） */
#game-fishmarket .fm-tutbtn{display:block;width:100%;margin:0 0 6px;padding:13px 14px;border:0;border-radius:14px;background:var(--fm-orange);color:var(--fm-ink);font:900 16px/1.3 "Noto Sans TC",system-ui,sans-serif;box-shadow:0 4px 0 #b95a00;cursor:pointer}
#game-fishmarket .fm-tutbtn small{display:block;font-size:12px;font-weight:700;opacity:.8;margin-top:2px}
#game-fishmarket .fm-tutbtn.tu-nudge{animation:fmtu-nudge 1.8s ease-in-out infinite}
@keyframes fmtu-nudge{0%,100%{box-shadow:0 4px 0 #b95a00,0 0 0 0 rgba(255,138,31,.6)}50%{box-shadow:0 4px 0 #b95a00,0 0 0 8px rgba(255,138,31,0)}}
/* 遊戲中「規則」說明裡的入口 */
#game-fishmarket .fm-tutlink{display:block;width:100%;margin:12px 0 0;padding:10px;border:0;border-radius:12px;background:var(--fm-orange);color:var(--fm-ink);font:900 15px/1.3 "Noto Sans TC",system-ui,sans-serif;box-shadow:0 3px 0 #b95a00;cursor:pointer}
/* 蓋掉共用的 button 樣式（全寬、粉紅漸層、底下留白） */
#game-fishmarket .tu-wrap{font-family:"Noto Sans TC",system-ui,sans-serif;color:#f3ecd9;text-align:left}
#game-fishmarket .tu-wrap *{box-sizing:border-box}
#game-fishmarket .tu-wrap button{width:auto;min-height:0;margin:0;font-weight:900;transition:none}
#game-fishmarket .tu-wrap button:active{transform:none}
#game-fishmarket .tu-wrap .tu-x{width:34px;padding:0}
#game-fishmarket .tu-wrap .tu-dot{width:auto;padding:0}
#game-fishmarket .tu-wrap .tu-replay{margin:2px auto 0;padding:5px 14px;font-weight:700}
#game-fishmarket .tu-wrap .tu-nb{padding:13px 10px;font-size:16px}
#game-fishmarket .tu-wrap .tu-nb:disabled{opacity:.35}
#game-fishmarket .tu-wrap .tu-title{margin:0 0 4px}
#game-fishmarket .tu-wrap .tu-text{margin:0 0 10px}

/* ===================== 陪酒小姐 ===================== */
.pj-card-row { display:flex; gap:14px; align-items:center; margin:8px 0 14px; }
.pj-card {
  position:relative; flex:0 0 auto; width:92px; height:130px; border-radius:10px;
  background:#fff; color:#1e1b3a; box-shadow:0 6px 18px rgba(0,0,0,0.35);
  display:flex; align-items:center; justify-content:center; animation:pj-flip .35s ease-out;
}
.pj-card.pj-red { color:#d62f4b; }
.pj-card-back { background:repeating-linear-gradient(45deg,#ff5f9e 0 8px,#c2407a 8px 16px); font-size:34px; animation:none; }
.pj-card-back span { background:#2d1b4e; border-radius:50%; width:52px; height:52px; display:flex; align-items:center; justify-content:center; }
.pj-pip { font-size:46px; }
.pj-corner { position:absolute; top:6px; left:8px; font-size:15px; font-weight:700; line-height:1.05; text-align:center; }
.pj-corner-br { top:auto; left:auto; bottom:6px; right:8px; transform:rotate(180deg); }
@keyframes pj-flip { from { transform:rotateY(90deg); } to { transform:rotateY(0); } }
.pj-card-text { flex:1; min-width:0; }
.pj-title { font-size:20px; font-weight:700; margin:2px 0 6px; }
.pj-desc { font-size:13.5px; line-height:1.55; color:#d8d3ee; }
.pj-extra { margin-top:8px; padding:6px 10px; border-radius:8px; background:rgba(255,138,91,0.25); font-weight:600; font-size:14px; }
.pj-big { font-size:18px; font-weight:700; }
.pj-pick-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 8px; }
.pj-pick-grid .vote-btn { text-align:center; }
button.pj-hot { background:linear-gradient(135deg,#ff5f9e,#ff8a5b); font-size:18px; }
button.pj-camera { background:linear-gradient(135deg,#3a86ff,#8338ec); }
.pj-captain { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:10px; border-top:1px dashed rgba(255,255,255,0.15); }
.pj-captain button { flex:1 1 30%; font-size:13px; padding:10px 6px; }
.pj-pname { display:flex; align-items:center; gap:6px; flex-wrap:wrap; min-width:0; }
.pj-tag { font-size:11.5px; padding:2px 7px; border-radius:999px; background:rgba(255,255,255,0.15); }
.pj-tag-hostess { background:rgba(255,95,158,0.45); }
.pj-tag-crazy { background:rgba(46,204,113,0.4); }
.pj-rule { font-size:15px; margin-top:6px; }
.speak-entry.pj-me { background:rgba(255,95,158,0.25); }
.pj-flash {
  position:fixed; inset:0; z-index:900; display:flex; align-items:center; justify-content:center;
  padding:24px; text-align:center; font-size:34px; font-weight:800;
  background:rgba(214,47,75,0.88); animation:pj-pop .3s ease-out; pointer-events:none;
}
.pj-flash.pj-flash-camera { background:rgba(255,255,255,0.92); color:#1e1b3a; }
@keyframes pj-pop { from { transform:scale(1.25); opacity:0; } to { transform:scale(1); opacity:1; } }
.pj-seat-box { margin-top:14px; padding-top:14px; border-top:1px dashed rgba(255,255,255,0.15); }
.pj-seat { display:flex; align-items:center; gap:8px; padding:6px 10px; margin-bottom:6px; border-radius:10px; background:rgba(255,255,255,0.06); }
.pj-seat-me { background:rgba(255,95,158,0.22); border:1px solid rgba(255,138,91,0.6); }
.pj-seat-no { width:24px; height:24px; flex:0 0 24px; border-radius:50%; background:rgba(255,255,255,0.18); display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; }
.pj-seat-name { flex:1; min-width:0; font-size:15px; }
button.pj-seat-btn { width:40px; flex:0 0 40px; padding:6px 0; margin:0; font-size:14px; background:rgba(255,255,255,0.12); }
button.pj-seat-btn:disabled { opacity:0.25; }
.pj-seat-loop { margin:4px 0 0; font-size:12.5px; }
.pj-mine { font-size:14px; font-weight:600; color:#ffc7a8; margin:4px 0 0; }
.pj-seat-details summary { cursor:pointer; font-size:14px; opacity:0.85; }
