/* ══ 大製作手感層 ══
   載入在 game.css 之後，只放覆寫與新元件：字級規範、直式延伸舞台、教學、攤牌演出、3D 翻牌、預選行動。 */
:root {
  /* 字級規範：設計座標（1600×900 / 900×N），只用這七級。 */
  --fs-xs: 13px; --fs-s: 15px; --fs-m: 18px; --fs-l: 24px; --fs-xl: 32px; --fs-2xl: 48px; --fs-3xl: 72px;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-back: cubic-bezier(.3, 1.5, .5, 1);
}
/* 舞台外（非 16:9 的邊）延續房間的暗色，而不是純黑 */
html, body { background: radial-gradient(ellipse at 50% 40%, #1a1410, #070605 75%); }

/* 數字一律用等高數字：Cormorant 的舊式數字 0 像 o、1 像 I，改用 Cinzel（中文自動退回 Noto Serif TC） */
.tv-stack.tv-stack, .tv-bet span, .tv-pot-label b, .tv-slider output, .act-btn b, .tv-hud-left, .sd-amount, .pre-act b {
  font-family: var(--caps); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .04em;
}

/* ── 直式：舞台高度隨手機比例延伸（--dy = 多出高度的一半），牌桌整組下移置中 ── */
body.portrait #table .tv-table, body.portrait #table .tv-lamp, body.portrait #table .tv-pot,
body.portrait #table .tv-rank, body.portrait #table .tv-banner, body.portrait #table .tv-showdown { translate: 0 var(--dy, 0px); }

/* ── 直式字級下限：手機上舞台約縮成 0.43 倍，牌桌文字至少 22 設計像素（實際約 10px） ── */
body.portrait .tv-name.tv-name { --h: 46px; font-size: 22px; max-width: 176px; }
body.portrait .tv-seat.hero .tv-name.tv-name { --h: 54px; font-size: 26px; max-width: 280px; }
body.portrait .tv-stack.tv-stack { font-size: 23px; line-height: 32px; padding: 3px 16px 3px; border-radius: 19px; }
body.portrait .tv-seat.hero .tv-stack.tv-stack { font-size: 26px; line-height: 36px; padding: 3px 18px; }
body.portrait .tv-badge.tv-badge { --h: 42px; font-size: 20px; }
body.portrait .tv-bet span { font-size: 22px; padding: 4px 14px 5px; }
body.portrait .tv-pot-label { font-size: 22px; padding: 6px 26px; }
body.portrait .tv-pot-label b { font-size: 28px; }
body.portrait .tv-hud-left { font-size: 20px; }
body.portrait .tv-rank { font-size: 24px; }
body.portrait .tv-status { font-size: 22px; }
body.portrait .tv-sizes > button { font-size: 19px; }
body.portrait .tv-slider output { font-size: 24px; }
body.portrait .tv-ai { transform: scale(1.35); transform-origin: right bottom; }

/* ── 教學：頁碼放進對話框的紅色名籤、每頁同高、牌型附牌例 ── */
.tutorial .tut { display: grid; grid-template-rows: auto 296px auto auto auto; }
.tut-stage { display: grid; place-items: center; height: 296px; overflow: hidden; }
.tut-stage .tut-visual { min-height: 0; margin: 0; }
.tut p[data-tab] { position: relative; height: 150px; min-height: 0; box-sizing: border-box; margin-top: 14px; padding: 46px 70px 28px; }
.tut p[data-tab]::before { content: attr(data-tab); position: absolute; left: 4.2%; top: 3.5%; width: 30.5%; height: 20%;
  display: grid; place-items: center; font: 600 var(--fs-xs)/1 var(--tc); letter-spacing: .18em; color: #f1d9a8; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.tut-pips { display: flex; justify-content: center; gap: 10px; margin: 16px 0 2px; }
.tut-pips i { width: 9px; height: 9px; transform: rotate(45deg); background: #3a2d1f; box-shadow: 0 0 0 1px #7a613b; transition: background .3s, box-shadow .3s; }
.tut-pips i.done { background: #8a6a3a; }
.tut-pips i.on { background: #e8c27a; box-shadow: 0 0 0 1px #ffe6ae, 0 0 10px #e0b56b; }
.tutorial .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 520px; margin-inline: auto; }
.tutorial .modal-actions > :only-child { grid-column: 1 / -1; justify-self: center; }
.tut-spacer { display: block; }
.tutorial .modal-actions .tut-spacer + .btn-primary { grid-column: 2; }
.tut-ranks { list-style: none; display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 6px 30px; max-width: 660px; margin: 0 auto; padding: 0; columns: auto; }
.tut-ranks li { display: grid; justify-items: center; gap: 4px; font-size: var(--fs-s); color: var(--gold2); }
.tut-ranks li b { font: 600 var(--fs-xs)/1.2 var(--tc); letter-spacing: .08em; }
/* 牌例像手上攤開的牌：44px 寬、互相疊壓，只露出左上角標 */
.tut-mini { display: flex; }
.tut-mini .card { width: 52px; height: 74px; border-radius: 4px; box-shadow: -2px 2px 5px #000a; }
.tut-mini .card + .card { margin-left: -30px; }
.tut-ranks li:first-child .tut-mini .card { box-shadow: 0 0 0 1px #ffe3a0, 0 0 10px #e0b56b88; }
body.portrait .tutorial .tut { grid-template-rows: auto 340px auto auto auto; }
body.portrait .tut-stage { height: 340px; }
body.portrait .tut p[data-tab] { height: 190px; font-size: 22px; padding: 58px 72px 30px; }
body.portrait .tut p[data-tab]::before { font-size: 17px; }
body.portrait .tut-mini .card { width: 56px; height: 80px; } body.portrait .tut-mini .card + .card { margin-left: -30px; }
body.portrait .tut-ranks li b { font-size: 17px; }

/* ── 牌桌燈光：吊燈照在桌心，往外衰減；牌與桌面有接觸陰影 ── */
.tv-table::after { content: ''; position: absolute; inset: 9% 7%; border-radius: 50%; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(ellipse 55% 60% at 50% 45%, #ffe2b060, #ffd9a018 45%, transparent 70%), radial-gradient(ellipse at 50% 50%, transparent 58%, #00000070 100%); }
body.portrait .tv-table::after { inset: 6% 9%; }
.tv-slot .card { box-shadow: 0 1px 1px #000d, 0 5px 9px #0009, inset 0 0 0 1px #fff8; }
.tv-cards .card { transition: filter .35s, transform .35s var(--ease-out), box-shadow .35s; }
.fly.airborne .card { box-shadow: 0 20px 26px #0007, 0 6px 10px #0006; }
.fly.airborne .chip { filter: drop-shadow(0 14px 10px #0008); }
.deck-stack { position: relative; width: 82px; height: 116px; }
.deck-stack .card { position: absolute; inset: 0; }
.deck-stack .card:nth-child(2) { translate: 1.5px -2px; } .deck-stack .card:nth-child(3) { translate: 3px -4px; }
.card.flipping { backface-visibility: hidden; }

/* ── 籌碼一顆顆疊上 ── */
.tv-bet.dropping .chip { animation: chip-drop .26s var(--ease-back) backwards; animation-delay: calc(var(--i) * 34ms); }
@keyframes chip-drop { from { translate: 0 -10px; opacity: 0; } 60% { opacity: 1; } }   /* 落下距離 10px：頂端座位的籌碼數字與下注之間只有 17px，落下時也要留 6px */

/* ── 下注預覽 ── */
.tv-bet-preview { z-index: 3; pointer-events: none; }
.tv-bet-preview.on { opacity: .72; filter: saturate(.7) drop-shadow(0 0 8px #e0b56b66); animation: preview-breathe 1.2s ease-in-out infinite alternate; }
.tv-bet-preview span { color: #fff1cf !important; box-shadow: 0 0 0 1px #000, 0 0 0 2px #e0b56b, 0 0 12px #e0b56b88 !important; }
.tv-bet.under-preview { opacity: 0 !important; }
@keyframes preview-breathe { to { opacity: .9; } }

/* ── 攤牌：贏牌浮起、其他變暗 ── */
.card.win-card { transform: translateY(-14px) scale(1.06) !important; box-shadow: 0 0 0 2px #ffe3a0, 0 0 22px #f0c77aaa, 0 16px 22px #000a !important; z-index: 2; }
.tv-cards .card.win-card:first-child { transform: rotate(-7deg) translateY(-12px) scale(1.08) !important; }
.tv-cards .card.win-card:nth-child(2) { transform: rotate(7deg) translateY(-12px) scale(1.08) !important; }
.tv-cards.hero-hand .card.win-card:first-child { transform: rotate(-6deg) translateY(-13px) scale(1.05) !important; }
.tv-cards.hero-hand .card.win-card:nth-child(2) { transform: rotate(6deg) translateY(-13px) scale(1.05) !important; }
.card.dim-card { filter: brightness(.42) saturate(.5); }
.tv-slot .card { transition: transform .45s var(--ease-back), filter .4s, box-shadow .4s; }
#table.sd-on .tv-felt-mark { opacity: .2; }

/* ── 攤牌牌匾：牌型大字 + 贏家 + 滾動金額 ── */
/* 內距由 tableview.js 的 fitPlate 依底圖實際深色內框（PLATE_INNER，勝利版與一般版各一組）設定；這裡的數值只是載入前的預設。 */
.tv-showdown { position: absolute; left: 800px; top: 200px; z-index: 14; width: 600px; height: 150px; transform: translate(-50%, 0) scale(var(--s, 1)); transform-origin: 50% 0;
  display: grid; align-content: center; justify-items: center; gap: 2px; padding: 63px 72px 38px; pointer-events: none; opacity: 0;
  background: url('../assets/ui/plate-defeat.webp') center / 100% 100% no-repeat; filter: drop-shadow(0 18px 30px #000e); }
.tv-showdown.mine { background-image: url('../assets/ui/plate-victory.webp'); }
.tv-showdown.on { animation: sd-in .6s .15s var(--ease-back) both; }   /* 等底池先淡出（見間距規則） */
@keyframes sd-in { 0% { opacity: 0; transform: translate(-50%, 0) scale(calc(var(--s, 1) * .6)); filter: blur(6px) drop-shadow(0 18px 30px #000e); } 60% { opacity: 1; filter: none; } 100% { opacity: 1; transform: translate(-50%, 0) scale(var(--s, 1)); filter: drop-shadow(0 18px 30px #000e); } }
/* 無人跟注：小一號、字也收斂，留給真正的攤牌做高潮 */
.tv-showdown.quiet { --s: .72; }
.tv-showdown.quiet .sd-rank { font-size: var(--fs-l); letter-spacing: .24em; }
.sd-rank { font: 700 var(--fs-xl)/1.1 var(--caps); letter-spacing: .16em; color: #f6e2b6; white-space: nowrap;
  background: linear-gradient(180deg, #fff6dc, #e8c27a 55%, #a87b3a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 14px #e0b56b66); }
.tv-showdown.mine .sd-rank { font-size: 34px; }
#table.sd-on .tv-pot { opacity: 0; }
.sd-who { display: flex; justify-content: center; column-gap: 22px; max-width: 100%; min-width: 0; font: 600 var(--fs-m) var(--caps); color: #d9c49a; letter-spacing: .08em; text-shadow: 0 2px 3px #000; }
/* 每位贏家一組：名字、（牌型與標題不同時）自己的牌型、各自的金額 */
.sd-entry { display: inline-flex; gap: 8px; align-items: baseline; justify-content: center; white-space: nowrap; min-width: 0; }
.sd-name { min-width: 0; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.sd-hand { flex: none; font: 600 var(--fs-xs) var(--tc); font-style: normal; letter-spacing: .1em; color: #e6c98f; }
/* 三人以上平分：一行摘要 */
.sd-split { gap: 12px; }
.sd-split .sd-name { max-width: none; }
.sd-each { display: inline-flex; gap: 6px; align-items: baseline; }
/* 多位贏家：兩到三人每人一列（list），四到六人兩欄（grid）；名字改用較窄的襯線字。列數越多，標題與字越小，總高度不超出牌匾內框 */
.tv-showdown[data-layout='list'] .sd-who, .tv-showdown[data-layout='grid'] .sd-who { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 0; width: 100%; }
.tv-showdown[data-layout='grid'] .sd-who { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 18px; }
.tv-showdown[data-cols='2'] .sd-who { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 四人以上各拿不同金額（極少見）：兩欄空間有限，不再逐人標牌型（標題與亮起的牌已經顯示），把寬度留給名字 */
.tv-showdown[data-layout='grid']:not([data-rows='1']) .sd-hand { display: none; }
.tv-showdown[data-layout='grid'] .sd-rank { font-size: var(--fs-l); }
.tv-showdown[data-layout='list'] .sd-entry, .tv-showdown[data-layout='grid'] .sd-entry { gap: 8px; }
.tv-showdown[data-layout='list'] .sd-name, .tv-showdown[data-layout='grid'] .sd-name { max-width: none; font: 600 17px/1.25 var(--serif); letter-spacing: .03em; color: #eadbb8; }
.tv-showdown[data-layout='list'] .sd-amount, .tv-showdown[data-layout='grid'] .sd-amount { font-size: var(--fs-m); line-height: 1.25; }
.sd-amount { font-size: var(--fs-l); color: #ffd98f; text-shadow: 0 0 12px #e0b56b88, 0 2px 3px #000; }
.sd-amount::before { content: '+'; margin-right: 2px; opacity: .8; }
.tv-showdown.big.on .sd-rank { animation: sd-glint 1.4s .5s ease-in-out 2; }
@keyframes sd-glint { 50% { filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 26px #ffd98fcc); } }
/* 直式：放在頂端座位與上方兩側座位的底牌之間的空帶（上緣錨定），不蓋到任何人的牌 */
body.portrait .tv-showdown { left: 450px; top: 246px; width: 340px; height: 200px; padding: 77px 72px 46px; }
/* 直式多列：往下長（上緣錨定），字才不會縮到看不清 */
body.portrait .tv-showdown[data-rows='2'] { height: 236px; } body.portrait .tv-showdown[data-rows='3'] { height: 270px; }
body.portrait .tv-showdown.tv-showdown[data-layout='list'] .sd-rank, body.portrait .tv-showdown.tv-showdown[data-layout='grid'] .sd-rank { font-size: 40px; line-height: 1.12; }
body.portrait .tv-showdown[data-layout='list'] .sd-name, body.portrait .tv-showdown[data-layout='list'] .sd-amount, body.portrait .tv-showdown[data-layout='grid'] .sd-name, body.portrait .tv-showdown[data-layout='grid'] .sd-amount { line-height: 1.15; }
body.portrait .sd-rank { font-size: 42px; } body.portrait .tv-showdown.mine .sd-rank { font-size: 44px; }
body.portrait .sd-who { font-size: 24px; } body.portrait .sd-amount { font-size: 30px; } body.portrait .sd-hand { font-size: 18px; }
body.portrait .tv-showdown[data-layout='grid'] .sd-who { column-gap: 14px; }
body.portrait .tv-showdown[data-layout='list'] .sd-name, body.portrait .tv-showdown[data-layout='grid'] .sd-name { font-size: 22px; }
body.portrait .tv-showdown[data-layout='list'] .sd-amount, body.portrait .tv-showdown[data-layout='grid'] .sd-amount { font-size: 24px; }

/* ── 你的牌型提示：金框膠囊，牌型變強時一閃 ── */
.tv-rank { font: 600 var(--fs-m) var(--caps); letter-spacing: .22em; padding: 6px 22px 7px; border-radius: 20px; opacity: 0; transition: opacity .3s;
  background: linear-gradient(#1e1711e8, #0b0908e8); box-shadow: 0 0 0 1px #000, 0 0 0 2px #9a7a45aa, 0 6px 12px #000a; }
.tv-rank.on { opacity: 1; }
.tv-rank.up { animation: rank-up .9s var(--ease-out); }
/* 用獨立的 scale 屬性，不覆蓋定位用的 transform（橫式以左緣定位、直式置中） */
@keyframes rank-up { 0% { scale: 1.35; box-shadow: 0 0 0 1px #000, 0 0 0 2px #ffe3a0, 0 0 30px #f0c77a; color: #fff5dc; } 100% { scale: 1; } }
#table.sd-on .tv-rank { opacity: 0; }

/* ── 預選行動 ── */
.tv-pre { position: absolute; right: 26px; bottom: 40px; width: 640px; z-index: 24; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; animation: rise .3s ease-out; }
.pre-act { --h: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; height: var(--h); border: 0 solid transparent; border-width: 0 30px;
  border-image: var(--btn-dark) 0 16% fill / 0 30px stretch; background: none; color: #d8c49c; font: 600 var(--fs-m) var(--tc); letter-spacing: .1em; text-shadow: 0 2px 3px #000; opacity: .82; }
.pre-act i { width: 20px; height: 20px; flex: none; border-radius: 4px; background: #0b0908; box-shadow: 0 0 0 1px #000, 0 0 0 2px #9a7a45, inset 0 2px 4px #000; position: relative; }
.pre-act[aria-pressed='true'] { opacity: 1; color: #ffe9bd; filter: drop-shadow(0 0 12px #e0b56b77); }
.pre-act[aria-pressed='true'] i::after { content: ''; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px; border: solid #ffd98f; border-width: 0 3px 3px 0; transform: rotate(45deg); filter: drop-shadow(0 0 4px #ffd98f); }
.pre-act:hover { opacity: 1; background: none; }
body.portrait .tv-pre { left: 20px; right: 20px; width: auto; bottom: 36px; }
body.portrait .pre-act { --h: 84px; font-size: 26px; }
body.portrait .pre-act i { width: 28px; height: 28px; }
body.portrait .pre-act[aria-pressed='true'] i::after { left: 9px; top: 2px; width: 8px; height: 17px; }

/* ── 快捷鍵提示（有滑鼠的裝置）與全下確認 ── */
@media (hover: hover) and (pointer: fine) {
  .tv-buttons .act-btn[data-key]::after { content: attr(data-key); position: absolute; right: 18%; top: 14%; width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center;
    font: 600 11px/1 var(--caps); letter-spacing: 0; color: #cdb88f; background: #0b0908cc; box-shadow: 0 0 0 1px #6e5634; opacity: .75; }
  .tv-buttons .act-btn.confirm[data-key]::after { content: '↵'; }
}
.act-btn.raise.confirm { animation: confirm-pulse .6s ease-in-out infinite alternate !important; filter: brightness(1.25) drop-shadow(0 0 20px #ff5a3aaa) drop-shadow(0 8px 14px #000c); }
@keyframes confirm-pulse { to { filter: brightness(1.45) drop-shadow(0 0 30px #ff5a3acc) drop-shadow(0 8px 14px #000c); } }

body[data-motion='off'] .tv-showdown.on { animation: none; opacity: 1; transform: translate(-50%, 0) scale(var(--s, 1)); }
/* 橫式：牌型膠囊移到手牌右側，不壓在自己的下注籌碼上 */
.tv-rank { left: 1000px; top: 628px; }
body.portrait .tv-rank { left: 450px; }
/* Cinzel 的字身較高：籌碼膠囊上下多留 2px，數字不貼金框 */
.tv-stack.tv-stack { padding-top: 5px; padding-bottom: 5px; }
/* 座位名牌：長名字以省略號收尾（原本是 flex 置中，文字會從兩側被切掉、也不會出現省略號） */
/* 置中方式維持原樣：上方 3px 光學偏移、其餘高度當作行高（主角名牌原本另有較矮的行高，這裡一併蓋過）。 */
.tv-seat .tv-name.tv-name, .tv-seat.hero .tv-name.tv-name { display: block; text-align: center; padding-top: 3px; line-height: calc(var(--h) - 3px); }

/* ── 間距規則：任兩個獨立的牌桌元件之間至少 6px（舞台座標），由 tests/ui-spacing.mjs 檢查 ──
   名牌與籌碼數字、動作標籤與頭像框（框比頭像大 12px）、底池與公共牌、狀態文字與你的籌碼。 */
.tv-seat:not(.hero) .tv-stack.tv-stack { margin-top: 7px; }
.tv-seat:not(.hero):not(.top) .tv-badge { top: -50px; }
.tv-seat.hero .tv-badge { right: 174px; }
.tv-seat.top .tv-badge { right: 170px; }
body.portrait .tv-showdown { top: 306px; }
body.portrait .tv-seat:not(.hero):not(.top) .tv-badge { top: -62px; }
body.portrait .tv-status { bottom: 204px; }
.tv-pot { top: 372px; transform: translate(-50%, -100%); }
#table .tv-pot-chips .chip-col { height: 56px; }   /* 底池籌碼矮一點，讓頂端座位的下注與底池之間留得出 6px */
body.portrait .tv-pot { top: 628px; transform: translate(-50%, -100%); }
/* 底池以下緣定位：籌碼只往上長，標籤不會在收池時往下移進公共牌；攤牌時先淡出，牌匾稍後進場 */
#table.sd-on .tv-pot { transition: none; }
/* 動作標籤只淡入淡出、不位移：滑動途中會靠近頭像框或 HUD */
.tv-badge, .tv-badge.on { transform: none; }
.tv-rank { left: 922px; transform: none; transform-origin: 0 50%; }
body.portrait .tv-rank { left: 450px; top: 786px; transform: translateX(-50%); }
/* 直式牌匾名字過長：金額換行到名字下方，牌匾往下長（上緣錨定，不碰側邊座位的底牌與公共牌） */
.tv-showdown.stack .sd-entry { flex-direction: column; align-items: center; gap: 0; max-width: 100%; justify-self: center; }
.tv-showdown.stack .sd-name { max-width: 100%; }
body.portrait .tv-showdown.stack { height: 236px; } body.portrait .tv-showdown.stack[data-rows='2'] { height: 280px; } body.portrait .tv-showdown.stack[data-rows='3'] { height: 320px; }

/* ── 牌手人生（第 4 階段）：大廳名牌的資金與身份、今天的生活、級別、工作、登入摘要 ── */
.tag.status, .lobby-me .tag.status { margin-left: 0; padding: 3px 10px; border-radius: 3px; font: 600 12px var(--tc); letter-spacing: .12em; text-transform: none; background: #0b0908cc; white-space: nowrap; }
.tag.status.civilian { color: #b8a98c; border-color: #6e5c44; }
.tag.status.parttime { color: #dcc38c; border-color: #8f7445; }
.tag.status.player { color: #ffe3a0; border-color: #c9a45f; box-shadow: 0 0 10px #e0b56b44; }
.tag.status.fulltime { color: #fff0cf; border-color: #e0b56b; background: linear-gradient(#5a1a12cc, #2a0c08cc); }
.tag.status.pro { color: #fff6e0; border-color: #ffd98a; background: linear-gradient(#8f2620, #4d110f); box-shadow: 0 0 14px #ff9a6a66; }
.me-life { display: flex; align-items: center; gap: 18px; margin-left: 4px; padding-left: 18px; border-left: 1px solid #6e563488; }
.me-life:empty { display: none; }
.me-bank small, .me-status small { display: block; font: 12px var(--tc); letter-spacing: .12em; color: var(--muted); text-transform: none; }
.lobby-me .me-bank b { font: 700 26px/1.15 var(--serif); letter-spacing: .02em; color: transparent; -webkit-background-clip: text; background-clip: text; background-image: var(--text-gold); }
.me-status { display: grid; justify-items: start; gap: 8px; }
.me-bank small { margin-bottom: 5px; }
.lobby-nav { gap: 6px; }   /* 選單按鈕之間也要 6px（原本 4px） */
/* 今天的生活（沿用 .today 皮革面板） */
.life-plan { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.life-plan b { font: 700 24px var(--serif); color: var(--gold2); }
.life-plan span { font: 14px var(--tc); color: #cbbd9f; white-space: nowrap; }
.life-line { margin: 0 0 4px; font-size: 14px; line-height: 1.5; color: #a4916f; }
.life-warn { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: #f2a18c; }
.life-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.life-actions .ghost-btn, .life-actions .btn-primary { --h: 46px; width: 100%; min-width: 0; font-size: 14px; }
/* 大廳右欄：今日檔案顯示最新一則，留位置給今天的生活 */
.lobby-side .today:not(.life-card) { max-height: 262px; }
body.portrait .lobby-center > p { margin: 17px 0 23px; }   /* 標題與副標之間 6px 以上（總高度不變） */
body.portrait .lobby-side { top: 900px; grid-template-columns: 1fr 1fr; }   /* 選單最後一列到 892：右欄往下，留 8px */
body.portrait .lobby-side .season-card { grid-column: 1 / -1; }
body.portrait .lobby-side .today { max-height: none; }
/* 彈窗：級別、生活方案、資金不足、登入摘要 */
.modal.life { width: 620px; }
.modal.life.stakes { width: 760px; }
body.portrait .modal.life.stakes { width: 820px; }
.stakes .life-row { padding: 9px 18px; }
.stakes .life-list { gap: 8px; }
body.portrait .modal.life { width: 820px; }
.life-list { display: grid; gap: 10px; margin: 0; }
.life-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; width: 100%; padding: 12px 18px; text-align: left; color: inherit; font: inherit; }
button.life-row { cursor: pointer; transition: transform .18s, box-shadow .18s, opacity .18s; }
button.life-row:not(:disabled):hover { transform: translateX(4px); }
.life-row[aria-pressed='true'] { box-shadow: inset 0 2px 8px #000d, inset 0 0 0 1px #d0584499, 0 0 18px #a0302833; }
.life-row:disabled { cursor: not-allowed; opacity: .6; }
.life-row b { font: 700 20px var(--serif); color: var(--gold2); }
.life-row > span { justify-self: end; font: 15px var(--tc); color: #e9cf98; white-space: nowrap; }
.life-row > small { grid-column: 1; font-size: 13px; color: #a4916f; }
.life-row > small.short { color: #f2a18c; }
.life-row > em { grid-column: 2; justify-self: end; font: 12px var(--tc); font-style: normal; color: #f0b0a0; }
.life-row dt { font: 15px var(--tc); color: #cbbd9f; }
.life-row dt small { display: block; margin-top: 2px; font-size: 12px; color: #a4916f; }
.life-row dd { margin: 0; justify-self: end; font: 700 22px var(--serif); color: var(--gold2); white-space: nowrap; }
.life-row.up dd { color: #9fdc8a; } .life-row.down dd { color: #f2a18c; }
.life-row dd .tag.status { vertical-align: middle; }
.life-row .arrow { margin: 0 8px; font-style: normal; color: var(--muted); }
.life-note { margin: 14px 0 0; font-size: 13px; line-height: 1.7; color: #a4916f; }
.life-bank { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font: 14px var(--tc); letter-spacing: .1em; color: #a4916f; }
.life-bank b { font: 700 26px var(--serif); color: var(--gold2); }
.life-bank .tag.status { margin-left: auto; }
.life-broke { margin: 0 0 16px; padding: 14px 18px; border-radius: 6px; background: #3a0c0a66; box-shadow: inset 0 0 0 1px #a8423288; }
.life-broke p { margin: 0 0 8px; color: #f0c9b8; line-height: 1.6; }
.life-broke ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.8; color: #cbbd9f; }
.life-broke .modal-actions { margin-top: 14px; }
.modal.life .modal-actions .btn-primary, .modal.life .modal-actions .ghost-btn { width: 100%; min-width: 0; }
/* 排隊：級別與練習桌標示；工作中畫面 */
.queue-stake { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 18px var(--tc); letter-spacing: .08em; color: #e9cf98; }
.tag.practice { margin-left: 0; color: #9fdc8a; border-color: #4f7a45; text-transform: none; }
.work-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 12px; }
.work-rows > div { display: grid; justify-items: center; gap: 6px; min-width: 210px; padding: 14px 24px; }
.work-rows dt { font: 13px var(--tc); letter-spacing: .12em; color: #a4916f; }
.work-rows dd { margin: 0; font: 700 30px var(--serif); color: var(--gold2); white-space: nowrap; }
.queue.work .btn-primary { margin-top: 20px; }
.queue .practice-note { max-width: 560px; line-height: 1.6; }
/* 結算：獎金 */
.result-rows dt small { display: block; font-size: 12px; color: var(--muted); }
.result-rows dd.up { color: #9fdc8a; }
/* 第 4 階段的間距修正 */
.me-life { padding-block: 4px; }
.life-actions .ghost-btn, .life-actions .btn-primary { font-size: 13px; letter-spacing: .04em; }
.queue-seal { margin-bottom: 18px; }
/* 資金不足時付不起的級別收成一行：名稱 · 還差多少 · 報名費 */
.stakes .life-row:disabled { grid-template-columns: auto minmax(0, 1fr) auto; }
.stakes .life-row:disabled > small { grid-column: 2; grid-row: 1; }
.stakes .life-row:disabled > span { grid-column: 3; grid-row: 1; }
/* 結算：圖、小標、名次牌匾之間留 8px；橫式高度不夠，圖縮小、列距收緊 */
.result-box > .eyebrow { display: block; margin: 8px 0; }
.result-rows dt { text-align: left; }
body:not(.portrait) .result-art { width: 150px; }
body:not(.portrait) .result-rows > div { padding-block: 9px; }

/* 牌手人生檔案：沿用金色字、深色框與身份標籤。 */
.life-profile { min-width: 0; }
.life-profile .life-story { color: var(--muted); font: 15px/1.7 var(--tc); margin: 8px 0 20px; }
.life-level { padding: 18px 20px; border: 1px solid var(--line); background: #100e0bcc; }
.life-level > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.life-level b { color: var(--gold2); font: 26px var(--serif); }
.life-level span { color: var(--gold); font: 16px var(--serif); }
.life-xp { margin: 14px 0 12px; height: 8px; background: #050403; border-radius: 8px; overflow: hidden; }
.life-xp i { display: block; height: 100%; background: linear-gradient(90deg, #71342b, #b68d50, #efcf85); border-radius: inherit; }
.life-level p { margin: 0; color: var(--muted); font: 13px/1.6 var(--tc); }
.life-records { margin: 18px 0 24px; }
.life-records > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.life-records dt { color: var(--muted); font: 14px/1.6 var(--tc); }
.life-records dd { margin: 0; color: var(--gold2); font: 16px/1.6 var(--tc); }
.life-milestones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.life-milestone { padding: 14px 10px; text-align: center; border: 1px solid var(--line); background: #0a0908a8; }
.life-milestone b, .life-milestone span { display: block; font: 14px/1.5 var(--tc); }
.life-milestone b { color: var(--muted); margin-bottom: 8px; }
.life-milestone span { color: var(--muted); font-size: 13px; }
.life-milestone.earned b, .life-milestone.earned span, .life-achievement.earned b { color: var(--gold2); }
.life-achievement { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; padding: 16px 18px; border: 1px solid var(--line); background: linear-gradient(110deg, #27170e99, #0c0909cc); }
.life-achievement b { color: var(--muted); font: 16px/1.6 var(--tc); }
.life-achievement span { color: var(--muted); font: 13px/1.6 var(--tc); align-self: center; }
.life-achievement p { grid-column: 1 / -1; margin: 0; color: var(--muted); font: 13px/1.7 var(--tc); }
.life-profile-note { margin: 16px 0 0; color: var(--muted); font: 13px/1.7 var(--tc); }
body.portrait .self-left nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 五個分頁仍能完整留在框內，讓檔案初始位置就看得到標題。 */
.self-left .framed, body.portrait .self-left .framed { width: 220px; margin: 10px auto 0; }
.self-left .self-portrait { height: 240px; }
.self-left nav { gap: 10px; margin-top: 16px; }
.life-profile h3 { margin: 18px 0 10px; }
.life-profile .life-story { margin-bottom: 14px; }
.life-level { padding: 14px 18px; }
.life-records { margin: 12px 0 16px; }
.life-records > div { padding-block: 10px; }
.life-milestones { margin-bottom: 14px; }
.life-milestone { padding-block: 12px; }
.life-achievement { padding: 12px 16px; }
.life-profile-note { margin-top: 12px; line-height: 1.6; }

/* 卡片的文字退進裝飾框內；小操作沿用面板金屬色，不再套第二層華麗牌匾。 */
.lobby-side { gap: 18px; }
.lobby-side .today { padding: 16px 12px 14px; }
.lobby-side .today h3 { position: relative; margin: 0 0 14px; padding: 0 0 12px; font: 600 15px/1.4 var(--tc); letter-spacing: .12em; }
.lobby-side .today h3::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #90734540; }
.lobby-side .today .empty { margin: 0; font: 14px/1.7 var(--tc); color: #ad9d82; }
.lobby-side .feed-item { padding: 8px 0; }
.lobby-side .feed-item:last-child { border-bottom: 0; }
.lobby-side .feed-item p { min-width: 0; overflow-wrap: anywhere; }
.lobby-side .life-plan { margin-bottom: 10px; gap: 16px; }
.lobby-side .life-plan b { font-size: 21px; line-height: 1.4; }
.life-actions { gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #90734540; }
.panel-action { display: flex; align-items: center; justify-content: center; min-height: 42px; min-width: 0; padding: 8px 12px; border: 1px solid #76603c; border-radius: 2px; background: linear-gradient(#28231b, #171410); box-shadow: inset 0 1px #e8ce8a13, inset 0 -2px #0007; color: #d7c39b; font: 600 14px/1.5 var(--tc); letter-spacing: .06em; transition: background .2s, border-color .2s; }
.panel-action.accent { background: linear-gradient(#442521, #291816); border-color: #895144; color: #eed3ad; }
.panel-action:hover { border-color: #c2a369; background: linear-gradient(#393024, #211b14); }
.panel-action.accent:hover { background: linear-gradient(#59302a, #351e1a); }
.panel-action.is-pressed, .modal-x.is-pressed { transform: translateY(1px) !important; filter: none !important; }
.modal-x.modal-x { display: grid; place-items: center; top: 14px; right: 14px; width: 42px; height: 42px; border: 1px solid #76603c; border-radius: 2px; background: linear-gradient(135deg, #2b251c, #14120f); box-shadow: inset 0 1px #e8ce8a18, inset 0 -2px #0007; color: #c8b184; }
.modal-x span { position: relative; width: 14px; height: 14px; pointer-events: none; }
.modal-x span::before, .modal-x span::after { content: ''; position: absolute; left: 6px; top: -1px; width: 1px; height: 17px; background: currentColor; transform: rotate(45deg); }
.modal-x span::after { transform: rotate(-45deg); }
.modal-x:hover { color: #f1dca9; border-color: #b39660; }
.modal > .m-head { padding-inline: 44px; }
.m-lead { text-wrap: pretty; }
.volume .stat-grid dt, .volume .stat-grid dd { text-align: center; font-variant-numeric: tabular-nums; }
/* 場景內的層級：背景 → 動態空氣 → UI。 */
#smoke { z-index: 1; opacity: 1; }
#table #smoke { z-index: 0; opacity: .65; }
#boot #smoke, #create #smoke { display: none; }
.title-glow, .lobby-chandelier { display: none; }
body[data-motion='reduced'] #smoke { opacity: .45; }
