/* ══ 介面修正（2026-09-29） ══
   最後載入，只放覆寫。牌面換圖不在這裡。 */

/* 數字一律用等高數字：Cormorant 預設的舊式數字 0 像 o、1 像 I（檔案、結算、商店、選級別都會出現）。
   各處的 font: 簡寫會把 font-variant-numeric 與 font-feature-settings 都重設回 normal，所以不能只設在 #stage 靠繼承，要直接套到每個元件。
   用 font-feature-settings 而不是 font-variant-numeric：其他樣式都沒用到它，不會蓋掉既有的 tabular-nums。 */
#stage, #stage * { font-feature-settings: "lnum" 1; }

/* Stage pixels shrink on phones: these gaps must remain at least 6 screen px. */
body:not(.portrait) .lobby-nav { gap: max(8px, var(--ui-gap, 8px)); }
.tv-sizes { column-gap: max(8px, var(--ui-gap, 8px)); }
.tv-slider { gap: max(10px, var(--ui-gap, 10px)); }
body.portrait.phone .tv-sizes { gap: max(16px, var(--ui-gap, 16px)); }
body.portrait.phone .tv-slider { gap: max(18px, var(--ui-gap, 18px)); }

/* 公共牌只發了幾張時，空位之間會露出浮水印的殘字（翻牌後剩「A D」）。桌上一有公共牌就淡出浮水印。 */
.tv-felt-mark { transition: opacity .6s var(--ease-out, ease-out); }
#table:has(.tv-slot .card) .tv-felt-mark { opacity: 0; }

/* 建立牌手：「會／不會」是選項，不能和送出的「確認」長得一樣（原本選中時同為紅色主按鈕）。
   選中＝細框＋金字＋左側菱形；主按鈕維持紅色。菱形絕對定位，不佔文字寬度，文字仍在正中央。 */
.know-row .toggle.toggle { color: #a8987c; }
.know-row .toggle.toggle[aria-pressed='true'] { --frame: var(--btn-slim); --pl: var(--slim-l); --pm: var(--slim-m); --pr: var(--slim-r); --slice: 44; --cap: .256; color: #f3dca3; text-shadow: 0 0 10px #e0b86a66; }
.know-row .toggle.toggle { position: relative; }
.know-row .toggle[aria-pressed='true']::before { content: ''; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: var(--gem) center / contain no-repeat; }
/* 橫式：確認鈕原本緊貼選項（間距 0）、離舞台下緣只剩 3px。收緊欄位標題與牌背縮圖，讓確認鈕與上下都留出空間。 */
body:not(.portrait) #create .field-label { margin: 10px 0 6px; }
body:not(.portrait) #create .back-grid .back-choice { padding: 6px; }
body:not(.portrait) #create .back-grid .back-choice .card { width: 40px; height: 58px; }
body:not(.portrait) #create .create-panel .btn-primary { margin-top: 18px; }

/* 結算：上方是雕花牌匾，下方原本是四個各自獨立的平面圓角框，風格接不起來。
   改成一張有金色細框的帳單：列與列之間用淡金分隔線，上緣中央一顆菱形飾件，和牌匾、彈窗同一套語彙。列與列之間仍留 6px，不貼齊。 */
.result-box .result-rows { position: relative; gap: 6px; padding: 6px 30px; border-radius: 3px;
  background: linear-gradient(180deg, #0e0b08f2, #17110cf2);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 5px #0e0b08, inset 0 0 0 6px #5a4529, 0 0 0 1px #8a6c3e99, 0 14px 34px #000b; }
.result-box .result-rows::before { content: ''; position: absolute; left: 50%; top: -8px; width: 16px; height: 16px; transform: translateX(-50%); background: var(--gem) center / contain no-repeat; filter: drop-shadow(0 1px 2px #000); }
.result-box .result-rows > div { background: none; box-shadow: none; border-radius: 0; padding: 11px 4px; align-items: baseline;
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, #0000, #8a6c3e80 20%, #8a6c3e80 80%, #0000) 1; }
.result-box .result-rows > div:last-child { border-bottom: 0; }
body .result-box .result-rows > div { padding-block: 8px; }
.result-box .result-rows dt { color: #b3a384; }
/* 新紀錄合成一列（原本一條一列，冠軍加兩條紀錄時整個結算比 900 高出 124px，按鈕被擠出畫面）。 */
.result-box .result-rows > .record { align-items: center; gap: 16px; }
.result-box .result-rows .record dt { flex: none; }
.result-box .result-rows .record dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; font-size: 18px; }
.result-box .record-item { display: inline-flex; align-items: center; gap: 8px; }
.result-box .record-item img { width: 30px; }
/* 橫式：名次牌匾縮小，讓最長的情況（冠軍＋新紀錄）也留在畫面內。 */
body:not(.portrait) .result-place.victory { width: 520px; margin-bottom: 14px; }
body:not(.portrait) .result-place.defeat { width: 470px; margin-bottom: 14px; }
body:not(.portrait) .result-box .quote { margin-top: 14px; }

/* 出局字卡（BUSTED）：「最終名次 #6」正好落在自己的底牌上，三層疊在一起難讀。
   播放期間自己的底牌褪暗，名次那行墊一層柔和的暗底；攤牌牌匾仍在最上層，看得到是被什麼牌淘汰。 */
.tv-hero-cards { transition: filter .6s ease-out; }
#table:has(.wfx.bust:not([hidden])) .tv-hero-cards { filter: brightness(.32) saturate(0); }
.wfx.bust .wfx-amount { padding: 10px 40px; border-radius: 50%; background: radial-gradient(closest-side, #000e 30%, #000a 70%, #0000); }

/* 空狀態（排行榜、遇見紀錄、賽季冊）：置中的圖示＋說明＋前往牌桌，上下各一條淡金飾線。 */
.empty-state { display: grid; justify-items: center; gap: 14px; margin: 18px auto 8px; padding: 26px 40px 30px; max-width: 560px; text-align: center; }
.empty-state::before, .empty-state::after { content: ''; width: 260px; max-width: 80%; height: 12px; background: var(--divider) center / 100% 100% no-repeat; opacity: .8; }
.empty-state::before { order: -1; }
.empty-state img { width: 64px; height: 64px; object-fit: contain; opacity: .85; filter: drop-shadow(0 4px 10px #000c); }
.empty-state p { margin: 0; font: 18px/1.7 var(--tc); color: #bfae8e; text-wrap: balance; }
.empty-state .btn-primary { margin-top: 6px; min-width: 220px; }
.empty-state::after { order: 9; }
body.portrait .empty-state img { width: 84px; height: 84px; }
body.portrait .empty-state p { font-size: 24px; }
/* 大廳「今日檔案」沒有消息時：蠟封＋一句說明這裡會記什麼。 */
.feed-empty { display: flex; align-items: center; gap: 14px; }
.feed-empty img { width: 46px; height: 46px; flex: none; opacity: .7; filter: saturate(.7) drop-shadow(0 3px 6px #000c); }
.lobby-side .today .feed-empty .empty small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.6; color: #8f8069; }

/* 商店肖像框：原本只是頭像外一圈 2px 色線（outline），比免費介面還樸素，不像能收藏的東西。
   改用既有的方形雕花框素材疊在頭像上：赤紅＝原色＋紅光，鎏金＝同一張調成金色。拍立得樣式的檔案頭像維持原本的色線。 */
:is(.frame-gold, .frame-crimson) > .portrait:not(.polaroid, .level-framed) { position: relative; outline: 0; overflow: visible; }
:is(.frame-gold, .frame-crimson) > .portrait:not(.polaroid, .level-framed)::after { content: ''; position: absolute; inset: -16% -18%; pointer-events: none;
  background: url('../assets/ui/frame-basic.webp') center / 100% 100% no-repeat; }
.frame-gold > .portrait:not(.polaroid, .level-framed) { box-shadow: 0 0 22px #e0b04a40; }
.frame-gold > .portrait:not(.polaroid, .level-framed)::after { filter: sepia(1) saturate(2.4) hue-rotate(-6deg) brightness(1.45) contrast(1.05) drop-shadow(0 0 6px #f0c46e55); }
.frame-crimson > .portrait:not(.polaroid, .level-framed) { box-shadow: 0 0 24px #b0203a55; }
.frame-crimson > .portrait:not(.polaroid, .level-framed)::after { filter: saturate(1.5) brightness(1.1) drop-shadow(0 0 7px #d0284866); }

/* 橫式加注滑桿原本只剩約 80px 可拖：同一列還有一個金額框，但「加注至 N」按鈕上已顯示同一個數字。
   橫式拿掉重複的金額框、預設下注鈕略窄，滑桿約寬兩倍半；± 鈕與方向鍵微調照舊。 */
body:not(.portrait) .tv-slider output { display: none; }
body:not(.portrait) .tv-sizes > button { min-width: 80px; }

/* ══ 手機直式（body.phone：舞台縮放 < 0.6，由 main.js 的 fit() 判斷；?phone 強制開啟） ══
   900 寬的舞台在 390 寬的手機上只剩 0.43 倍：設計座標要 25px 以上，實際才有 11px。
   這裡只放大字級與觸控目標，不動座位座標；phone-tall（舞台下延 ≥ 240）另外把操作列改兩排。 */

/* 牌桌：HUD */
/* 一行放不下「第 1 手 盲注 25 / 50 Lv 1 · 8 手後升盲」（原本文字超出牌匾下緣 30px）：改成置中兩行、高度隨內容。 */
body.portrait.phone .tv-hud-left { --h: 60px; height: auto; min-height: 60px; font-size: 24px; max-width: 470px; flex-wrap: wrap; justify-content: center; align-content: center; gap: 2px 16px; padding-block: 8px; line-height: 1.3; }
body.portrait.phone .tv-hud-left b { font-size: 26px; }
body.portrait.phone .tv-hud-right { gap: 14px; }
body.portrait.phone .tv-hud-right .icon-btn { width: 66px; height: 66px; }
body.portrait.phone .tv-leave.ghost-btn { --h: 66px; font-size: 24px; min-width: 130px; }
/* 牌桌：座位。名牌、籌碼數字、動作標籤、下注、底池的方塊尺寸維持直式原值（頭像位置、彼此間距、與攤牌牌匾的距離都是照原尺寸調的），
   只放大裡面的字。方塊一變大就會擠到鄰居（頭像↔動作標籤 2.5px、頭像↔底牌 2.7px、籌碼數字壓到攤牌牌匾 -1px 等都是這樣來的）。 */
body.portrait.phone .tv-name.tv-name { font-size: 26px; }
body.portrait.phone .tv-seat.hero .tv-name.tv-name { font-size: 29px; }
body.portrait.phone .tv-stack.tv-stack { font-size: 27px; }
body.portrait.phone .tv-seat.hero .tv-stack.tv-stack { font-size: 30px; }
body.portrait.phone .tv-badge.tv-badge { font-size: 24px; }
/* AI 標籤：放大 1.9 倍會壓住頭像右下的臉；改 1.3 倍、往外移到頭像框外緣（右下角），只碰到框不碰臉 */
body.portrait.phone .tv-ai { transform: scale(1.3); right: -24px; bottom: -4px; }
/* 牌桌：中央 */
body.portrait.phone .tv-bet span { font-size: 24px; line-height: 33px; padding-inline: 9px; }   /* 行高固定為原值 22px×1.5，方塊不變高；字變寬，左右內距 14→9px，整體比原版還窄一點——下注時整個框會彈大 12%，彈到頂點時原版就只留 6–7px，手機版不能更寬 */
body.portrait.phone .tv-pot-label { font-size: 25px; line-height: 33px; padding-inline: 18px; }   /* 字變寬，左右內距 26→18px，整體不比原版寬（旁邊的下注框彈大時只留 6px 左右） */
body.portrait.phone .tv-pot-label b { font-size: 31px; line-height: 1; }
body.portrait.phone .tv-rank { font-size: 28px; }
body.portrait.phone .tv-status { font-size: 26px; }
/* 操作列：一排時先放大觸控目標 */
/* 手機操作區距離舞台下緣約 40 個螢幕像素，留出拇指操作與手勢空間。
   --ui-gap 由 fit() 換算為 6 個螢幕像素，避免固定舞台座標在小手機縮水。 */
body.portrait.phone .tv-actions,
body.portrait.phone .tv-reveal { bottom: calc(24px + 5 * var(--ui-gap, 14px)); }
body.portrait.phone .tv-pre { bottom: calc(36px + 5 * var(--ui-gap, 14px)); }
body.portrait.phone .tv-sizes > button { --h: 64px; font-size: 25px; }
body.portrait.phone .tv-step { width: 60px; height: 60px; font-size: 30px; }
body.portrait.phone .tv-slider output { font-size: 28px; }
body.portrait.phone .tv-slider input { height: 60px; }
body.portrait.phone .tv-slider input::-webkit-slider-thumb { width: 52px; height: 52px; margin-top: -22px; }
body.portrait.phone .tv-buttons .act-btn { --h: 116px; font-size: 32px; }
body.portrait.phone .tv-buttons .act-btn b { font-size: 29px; }
body.portrait.phone .pre-act { --h: 100px; font-size: 30px; }
body.portrait.phone .tv-reveal .act-btn { --h: 100px; font-size: 30px; }
body.portrait.phone .tv-reveal-title { font-size: 28px; }
body.portrait.phone .tv-reveal-q { font-size: 24px; }
/* phone-tall：預設下注一排、滑桿獨立一排（滑桿從約 200 變成整列寬），狀態文字跟著上移。 */
body.portrait.phone-tall .tv-sizes { flex-wrap: wrap; row-gap: 14px; }
body.portrait.phone-tall .tv-sizes > button { flex: 1 1 0; --h: 78px; font-size: 27px; }
body.portrait.phone-tall .tv-slider { flex: 1 0 100%; }
body.portrait.phone-tall .tv-step { width: 76px; height: 76px; font-size: 36px; }
body.portrait.phone-tall .tv-slider output { min-width: 150px; font-size: 32px; }
/* 高的手機也放在你的座位左邊（原本在下注列上方，與下注列、籌碼牌都只差幾 px）。座位會隨 --extra 下移一半。 */
body.portrait.phone-tall .tv-status { left: 20px; right: auto; width: 330px; text-align: right; white-space: normal; line-height: 1.2; bottom: calc(240px + var(--extra, 0px) / 2); }
/* 手機直式但不夠高（Safari 有網址列的 iPhone 多半如此）：操作列只有一排，原本整列寬的狀態文字會壓在下注鈕上。
   狀態文字改放你的名字與籌碼左邊的空位（右對齊貼近你的座位，最多兩行）；座位已由 tableview 上移 96。
   下注列與按鈕之間至少 6 個實際像素。 */
body.portrait.phone:not(.phone-tall) .tv-status { left: 20px; right: auto; width: 330px; bottom: calc(327px + var(--extra, 0px) / 2); text-align: right; white-space: normal; line-height: 1.2; }
body.portrait.phone:not(.phone-tall) .tv-actions { gap: max(12px, var(--ui-gap, 12px)); }
/* 手機：行動鈕之間、你的名字與籌碼牌之間至少 6 個實際像素（原本約 4–4.5px） */
body.portrait.phone .tv-buttons { gap: max(10px, var(--ui-gap, 10px)); }
body.portrait.phone .tv-seat.hero .tv-stack.tv-stack { margin-top: max(-3px, calc(var(--ui-gap, 0px) - 14px)); }

/* 手機大廳：原本字級 12–16px（實際 5–7px），下方還空了約 450px。放大字級與按鈕，右欄面板往下移。 */
body.portrait.phone .lobby-mode, body.portrait.phone .lang-switch button { font-size: 22px; }
body.portrait.phone .lang-switch button { padding: 10px 18px; }
/* 英文的模式說明較長，頂列放不下時整列換行，語言鈕被擠到第二排、壓住 THE ARCHIVE 標題（-31px）。
   改成頂列不換行，模式說明在自己的區塊內換行。 */
body.portrait.phone .lobby-top { flex-wrap: nowrap; }
body.portrait.phone .lobby-mode { flex: 0 1 auto; min-width: 0; line-height: 1.3; text-wrap: balance; }
body.portrait.phone .lang-switch { flex: none; }
body.portrait.phone .find-card span { font-size: 26px; }
body.portrait.phone .lobby-nav { gap: 12px; }
body.portrait.phone .lobby-nav button { --h: 92px; grid-template-columns: 64px 1fr auto; gap: 0 14px; }
body.portrait.phone .lobby-nav button span { font-size: 28px; }
html[lang='en'] body.portrait.phone .lobby-nav button span { font-size: 23px; letter-spacing: .04em; }
body.portrait.phone .lobby-nav .nav-icon { width: 60px; height: 60px; }
body.portrait.phone .lobby-nav { top: 480px; }
body.portrait.phone .lobby-side { top: 930px; }
body.portrait.phone .season-card span { font-size: 22px; }
body.portrait.phone .season-card b { font-size: 40px; line-height: 1.15; margin-bottom: 8px; }
/* ↑ 放大後「剩 56 天」和下一行小字的行框貼在一起（0px），中間補 8px。 */
body.portrait.phone .season-card small { font-size: 21px; }
body.portrait.phone .lobby-side .today h3 { font-size: 24px; }
body.portrait.phone .lobby-side .today .empty, body.portrait.phone .life-line, body.portrait.phone .life-plan span { font-size: 22px; }
body.portrait.phone .lobby-side .today .feed-empty .empty small { font-size: 19px; }
body.portrait.phone .feed-empty img { width: 60px; height: 60px; }
body.portrait.phone .life-plan b { font-size: 28px; }
body.portrait.phone .life-actions .panel-action { font-size: 22px; min-height: 64px; }
body.portrait.phone .lobby-me { transform: scale(1.4); transform-origin: left bottom; }

/* 大廳拿掉「打牌 · 記住 · 歸屬」副標後：標題與尋找牌桌之間補回呼吸，直式選單與右欄跟著上移。 */
.lobby-center > h1 + .find-card { margin-top: 64px; }
body.portrait .lobby-center > h1 + .find-card { margin-top: 36px; }
body.portrait:not(.phone) .lobby-nav { top: 490px; }
body.portrait:not(.phone) .lobby-side { top: 810px; }

/* 手機彈窗：內容字級多為 13–18px（實際 6–8px）。用 zoom 讓內容區整體放大並在較窄的寬度重新排版，
   而不是逐個元件改字級。3D 牌背檢視器（WebGL、拖曳旋轉）不放大，避免座標換算出錯；
   教學的牌型清單與羊皮紙是固定寬高，整窗放大會超框，改在下面個別放大字級。 */
body.portrait.phone .modal:not(.c3d-modal, .tutorial) > .m-scroll-viewport, body.portrait.phone .modal:not(.c3d-modal, .tutorial) > .m-head { zoom: 1.35; }
/* 放大後內容區變窄：設定裡 8 欄固定寬的外觀格子會超出面板，改成撐滿整列、8 欄均分；彈窗可用的高度也放寬到舞台的高度。 */
body.portrait.phone .look-grid.small { width: 100%; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
body.portrait.phone .look-grid.small .look-choice { width: auto; }
body.portrait.phone .modal { max-height: calc(100% - 180px); }
/* 手機結算：帳單、引言、按鈕整組放大（寬度先縮回 1/1.3，放大後剛好填滿原本的 820）。 */
body.portrait.phone .result-box .result-rows, body.portrait.phone .result-box .quote, body.portrait.phone .result-actions, body.portrait.phone .result-box > .eyebrow { zoom: 1.3; }
body.portrait.phone .result-box .result-rows { width: 77%; }
/* 手機建立牌手：欄位標題、選項、牌背名稱、確認鈕 */
body.portrait.phone #create .field-label { font-size: 22px; }
body.portrait.phone #create .sub { font-size: 26px; }
body.portrait.phone #create .back-name { font-size: 24px; }
body.portrait.phone .know-row .toggle.toggle { --h: 78px; font-size: 25px; }
/* 英文選項「Yes — take me to the table」在 25px 下左右貼齊按鈕、也會壓到左側菱形：英文改 20px，手機上的菱形往左移，和文字至少隔 6px。 */
html[lang='en'] body.portrait.phone .know-row .toggle.toggle { font-size: 20px; }
body.portrait.phone .know-row .toggle[aria-pressed='true']::before { left: 8px; }
body.portrait.phone #create .create-panel .btn-primary { --h: 96px; align-self: stretch; font-size: 30px; }
/* 手機教學：說明字級放大，羊皮紙固定高度跟著加大（各頁同高，下一步鈕不跳動）。 */
body.portrait.phone .tut p[data-tab] { height: 250px; font-size: 27px; padding: 64px 64px 30px; }
body.portrait.phone .tut p[data-tab]::before { font-size: 21px; }
/* 英文說明比中文長，27px 會多出第四行、超出羊皮紙 8px：英文改 24px、行高 1.55，最後一行離下緣也留空間。 */
html[lang='en'] body.portrait.phone .tut p[data-tab] { font-size: 24px; line-height: 1.55; }
/* 牌型清單的名稱原本 17px（實際 7px）；清單變高，示意區跟著加高 40px。 */
body.portrait.phone .tut-ranks li b { font-size: 22px; }
body.portrait.phone .tutorial .tut { grid-template-rows: auto 380px auto auto auto; }
body.portrait.phone .tutorial .modal-actions .btn-primary, body.portrait.phone .tutorial .modal-actions .ghost-btn { --h: 80px; font-size: 26px; }
/* 手機開桌介紹：名字、關係、說明 */
body.portrait.phone .intro-card b { font-size: 32px; }
body.portrait.phone .intro-card em { font-size: 21px; }
body.portrait.phone .intro-card small { font-size: 21px; }


/* ══ 原本就不足 6px 的間距（以沒有這個檔案的版本比對確認不是這次造成的） ══
   間距規則：任兩個獨立元件至少 6px。以下各補 1–3px。 */
/* 生活方案、選擇級別：列內標題與說明的列距 4px → 6px */
.life-row { row-gap: 6px; }
/* 大廳名牌：「生涯資金」與金額 4px（金額字身超出行框約 1px）→ 7px */
.me-bank small { margin-bottom: 8px; }
/* 季節卡：「剩 56 天」與下一行 4px → 6px（手機另設 8px） */
.season-card b { margin-bottom: 2px; }
/* 今天的生活：兩行說明 5px → 6px */
.life-line { margin-bottom: 5px; }
/* 資金不足的兩條建議：行高 1.8 的行框比字身高，兩條之間只剩 5.2px → 7px */
.life-broke li + li { margin-top: 2px; }
/* Release collection: long requirements sit outside the action button. */
.gallery-unlock{margin:8px 0 12px;padding:0 8px;color:var(--muted,#b7a58b);font-size:13px;line-height:1.65;overflow-wrap:anywhere;}
.back-grid.small{gap:8px;}
body.portrait .gallery-list{grid-template-columns:repeat(5,1fr);gap:16px;}
body.portrait .gallery-list .back-choice .card{width:86px;height:125px;}
body.portrait .gallery-unlock{font-size:28px;margin:12px 0 16px;padding:0 16px;}
body.portrait .gallery-name{font-size:38px!important;}
body.portrait .gallery-main .c3d-stage{height:490px;}
body.portrait .gallery-main .c3d-buttons{gap:16px;}
body.portrait .gallery-main .c3d-buttons .ghost-btn,
body.portrait .gallery-main .c3d-buttons .btn-primary{font-size:26px;min-height:70px;}
body.portrait .back-grid.small{grid-template-columns:repeat(5,1fr);gap:16px;}
body.portrait .back-grid.small .card{width:60px;height:87px;}
body.portrait .gallery-main .c3d-modes button{font-size:24px;min-height:54px;padding:8px 18px;}

/* 頁面底色：頭像的 .portrait（#1a1411 咖啡底）也會套到手機直式的 body.portrait；舞台讓出 iPhone 安全區後，
   露出的上下條就成了咖啡色帶。底色固定為舞台邊緣的近黑色。 */
html, body, body.portrait { background: #0b0a09; }

/* 手機大廳「你的第一段故事」：外框圖的邊很厚，原本內距 30/36 讓小標貼著上框、蠟封貼著文字。加大內距與蠟封間距。 */
body.portrait.phone .season-card { padding: 46px 54px 46px 48px; gap: 28px; }
body.portrait.phone .season-card b { margin: 6px 0 12px; }

/* Same light material, positioned as a real element in table-local coordinates. */
.tv-spot, .tv-spot.mine { background: none; transition: none; }
.tv-spot::before { content: none; }
.tv-spot-light { position: absolute; left: 0; top: 0; width: 500px; height: 500px;
  margin: -250px 0 0 -250px; pointer-events: none;
  background: radial-gradient(250px circle at 50% 50%, #ffd9a030, #ffd9a00c 55%, transparent 72%); }
.tv-spot.mine .tv-spot-light { width: 640px; height: 640px; margin: -320px 0 0 -320px;
  background: radial-gradient(320px circle at 50% 50%, #ffdca040, #ffd9a010 55%, transparent 72%); }

/* 手機、平板（<html class="calm">）：牌桌三層全螢幕「螢幕混色」（燈光畫布、跟隨光、聚光燈）改一般疊色。
   這三層都是很淡的暖光，在深色桌面上兩種疊法算出來的顏色幾乎一樣（逐像素比對見 docs/local-progress.md），
   但手機每合成一格就少做三次全螢幕混色。所有動畫照常播放。 */
.calm #table #smoke, .calm #table .cursor-light, .calm .tv-spot { mix-blend-mode: normal; }
/* 手機、平板：聚光燈的移動改由 tableview.js 在同一拍上逐格寫位置（同一條曲線、0.7 秒），不交給合成器過渡（iPhone 會停在半路或舊座位） */
.calm .tv-spot::before { transition: none; }


/* 真機實測（網址加 ?perf&ab 才會出現這些 class，平常不影響畫面）：暫時拿掉某一層，量它在手機上的實際成本 */
.ab-no-ambient #smoke, .ab-no-cardfx .table-card-effect { visibility: hidden !important; }
.ab-no-loops .tv-portrait, .ab-no-loops .tv-portrait::after, .ab-no-loops .tv-lamp, .ab-no-loops .tv-clock-ember::before, .ab-no-loops .tv-seat .tv-clock,
.ab-no-loops .tv-status::after, .ab-no-loops .act-btn::before, .ab-no-loops .tv-badge::before, .ab-no-loops .tv-bet-preview { animation-play-state: paused !important; }
.ab-no-overlays .vignette, .ab-no-overlays .grain, .ab-no-overlays .cursor-light, .ab-no-overlays .tv-spot, .ab-no-overlays .tv-lamp { visibility: hidden !important; }

/* 今晚的牌桌（寬 1000 以下：手機、平板直拿）：五位牌手都看得到，不再左右滑（使用者 2026-10-07：一次只看得到一位、其他人被切掉）。
   標題與「繼續」固定在上下，名單在中間一欄（平板較寬時兩欄）；高度不夠時只有名單捲動，底部淡出提示，按鈕永遠不會蓋住任何一位。
   字級照入座介紹的規範：名字 21px、關係與戰績 15px，戰績一項一行；不縮字、不藏溢出。 */
@media (max-width: 1000px) {
  .overlay.intro.intro-native { display: flex; flex-direction: column; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .intro-native .intro-box { flex: 0 1 auto; min-height: 0; max-height: 100%; width: min(100%, 720px); display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin: auto 0; }
  .intro-native .intro-box > * { flex: none; }
  .intro-native .intro-box > .eyebrow, .intro-native .intro-box > h2 { align-self: center; }
  .overlay.intro.intro-native .intro-row { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; padding: 0; scroll-snap-type: none; }
  .overlay.intro.intro-native .intro-row.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
  .intro-native .intro-swipe { display: none; }
  .intro-native .intro-actions { display: grid; justify-items: center; padding-top: 4px; }
  .overlay.intro.intro-native .intro-card { flex: none; display: grid; grid-template-columns: 56px auto minmax(0, 1fr); grid-template-areas: 'face name tag' 'face stat stat'; column-gap: 12px; row-gap: 4px;
    align-items: center; justify-items: start; text-align: left; padding: 8px 12px; min-height: 0; border-radius: 10px;
    background: linear-gradient(100deg, #241b13, #100d0a 72%); border: 1px solid #8b6a3a; }
  .overlay.intro.intro-native .intro-card.rival { border-color: #c0503c; filter: none; }
  .intro-native .intro-card.rival::before { inset: 0; border-radius: 10px; box-shadow: 0 0 16px #c0403566; }
  .intro-native .intro-avatar { grid-area: face; align-self: start; width: 56px; height: 56px; }
  .intro-native .intro-portrait { width: 56px; height: 56px; box-shadow: 0 0 0 3px #0b0a09, 0 0 0 4px #6e5634; }
  .intro-native .intro-badge { width: 26px; height: 26px; left: auto; right: -6px; bottom: -6px; transform: none; }
  .overlay.intro.intro-native .intro-card > b { grid-area: name; font-size: 21px; line-height: 1.2; }
  .overlay.intro.intro-native .intro-card > em { grid-area: tag; font-size: 15px; line-height: 1.3; min-height: 0; display: block; }
  .overlay.intro.intro-native .intro-card > small { grid-area: stat; font-size: 15px; line-height: 1.45; min-height: 0; display: grid; gap: 2px; width: auto; }
}

/* 今晚的牌桌（寬 1001 以上但不夠高：iPad 橫拿、矮的筆電視窗）：iPad mini 橫拿時五張大卡加標題太高，連「繼續」都被擠出畫面。
   同樣標題與「繼續」固定、卡片列在中間；頭像、卡片留白與標題牌寬度收小（字級不變，卡片下緣仍留過外框裝飾），還放不下時只有卡片列捲動。 */
@media (min-width: 1001px) and (max-height: 820px) {
  .overlay.intro.intro-native { display: flex; flex-direction: column; align-items: center; padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .intro-native .intro-box { flex: 0 1 auto; min-height: 0; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; margin: auto 0; }
  .intro-native .intro-box > * { flex: none; }
  .overlay.intro.intro-native .intro-row { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; grid-auto-rows: max-content; }
  .overlay.intro.intro-native .intro-row.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
  html body .overlay.intro.intro-native .intro-box > h2.read-title { --read-title-width: 360px; }
  .overlay.intro.intro-native .intro-card { padding: 20px 20px 56px; }
  .overlay.intro.intro-native .intro-card > small { min-height: 0; }
  .intro-native .intro-avatar { width: 96px; height: 124px; }
  .intro-native .intro-portrait { width: 96px; height: 96px; }
  .intro-native .intro-badge { width: 44px; height: 44px; }
}

/* 手機橫拿（觸控、橫向、可視高度不到 500px）：整個舞台會縮到字只剩約 8px，入座名單也放不下——請玩家轉成直向。平板橫拿高度夠，不受影響。 */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  body::after { content: '請把手機轉成直向'; position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding-top: 120px;
    background: #0b0a09 url('../assets/logo.webp') center calc(50% - 40px) / min(300px, 60vw) auto no-repeat; color: #e8d3a3; font: 600 20px/1.6 'Noto Serif TC', serif; letter-spacing: 3px; text-align: center; }
  html[lang='en'] body::after { content: 'Please turn your phone to portrait'; letter-spacing: 1px; }
}

/* 手機（zoom 舞台）：Safari 會把縮放後小於 9px 的字撐到 9px（「AI」標籤 10px×0.34～0.48），再疊上原本的 1.3 倍就變成一大塊壓在頭像上。
   手機上拿掉額外放大：字就是剛好看得清楚的 9px、外框跟著收小。平板（不是 phone）維持原樣。 */
.calm body.portrait.phone .tv-ai { transform: none; }

/* Full-screen transitions must not reveal the uninitialized table. */
.overlay { background: radial-gradient(ellipse at center, #140f0c, #050404 75%); }
/* Text safe area follows the visible frame, not its transparent image bounds. */
.tv-buttons .act-btn, .tv-reveal .act-btn { line-height: 1.15; padding-block: 14px; }
.tv-buttons .act-btn b { line-height: 1.1; }
.tv-buttons .act-btn { --h: 84px; gap: 5px; }
body.portrait .tv-buttons .act-btn { --h: 120px; gap: 6px; padding-block: 20px; }
body.portrait.phone .tv-buttons .act-btn { --h: 132px; }
.tv-badge.tv-badge { --h: 40px; line-height: 1.15; padding-inline: 10px; }
body.portrait .tv-badge.tv-badge { --h: 60px; }
.tv-seat:not(.hero):not(.top) .tv-badge { top: -60px; }
body.portrait .tv-seat:not(.hero):not(.top) .tv-badge { top: -90px; }
body.portrait .tv-seat:is([data-slot="1"], [data-slot="2"]) .tv-badge { translate: 40px 0; }
body.portrait .tv-seat:is([data-slot="4"], [data-slot="5"]) .tv-badge { translate: -40px 0; }
/* Avatar portraits keep their equipped round frame, never an additional rectangular surround. */
.framed::after, .framed.achievement::after,
:is(.frame-gold, .frame-crimson) > .portrait:not(.level-framed)::after { content: none; }
.self-left .self-portrait, body.portrait .self-left .self-portrait { width: 220px; height: 220px; border: 0; }
.file-portrait.polaroid { border: 0; border-radius: 50%; padding: 0; transform: none; box-shadow: none; }
.lang-switch button, .seg button { padding-block: max(10px, var(--ui-gap, 6px)); }
.level-frame-grid button { padding-inline: max(12px, var(--ui-gap, 6px)); }
body.portrait .room-object { padding-bottom: max(12px, var(--ui-gap, 6px)); }
/* Short Safari viewport: reserve bottom space for the create confirmation. */
@media (max-height: 600px) {
  body.portrait.phone #create { grid-template-rows: 504px 1fr; }   /* 520→504：自行託管字型後文字高度多了約 3px，確認鈕在 iPhone SE 瀏覽器（375×548）底部被切 */
}
/* Intrinsic label widths: English Auto rotate needs more room than Flip/Reset. */
body.portrait.phone .gallery-main .c3d-buttons.c3d-buttons {
  grid-template-columns: minmax(0, 1fr) minmax(max-content, 1.5fr) minmax(0, 1fr);
}
body.portrait.phone .gallery-main .c3d-buttons.c3d-buttons button { padding-inline: 26px; }
/* The eyebrow belongs inside the panel, below the raised top frame. */
body .modal.modal.modal.modal > .m-head {
  padding-top: max(64px, calc(var(--ui-gap, 6px) * 3));
}

/* SHOW／MUCK 多了一行「不選就直接下一手」：字和按鈕之間至少 6 個實際像素（iPhone SE 原本只剩 5px） */
.tv-reveal-q { margin-bottom: max(16px, calc(var(--ui-gap, 6px) * 2)) !important; }

/* 新手四步練習：選項改兩欄、牌縮小，整題（牌、說明、四個選項、回饋、下一步）在同一畫面內，不必捲動。
   2026-10-09 實測：桌機各尺寸（1280×720 到 1920×1080）原本只看得到前兩個選項，第 3、4 題要的「過牌」「棄牌」在捲動區外，
   答題後「下一個情境」也看不到；iPhone SE 同樣被切。 */
.journey-drill{padding-top:0;padding-bottom:14px}
.journey-modal .journey-drill .guide-cards{height:100px;margin:4px}
.journey-modal .journey-drill .guide-cards .card{width:68px;height:100px}
.journey-modal .journey-drill p{font-size:20px;line-height:1.45}
#modal .journey-drill p:not(.guide-feedback){text-wrap:balance}   /* 要用 #modal 開頭：下方 #modal p{text-wrap:pretty} 的優先權比類別高，07u 被它蓋掉，「籌碼。」仍單獨落行 */
.journey-modal .journey-drill .journey-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}
body.portrait.phone .journey-modal .journey-drill .journey-choices{gap:12px}
.journey-modal .journey-drill .journey-choices button,body.portrait.phone .journey-modal .journey-drill .journey-choices button{--h:54px;min-height:54px;padding:10px 12px}
.journey-drill .guide-feedback{min-height:30px;margin:4px 0 8px}
body.portrait .journey-drill .guide-feedback{margin:4px 0 12px}
/* 桌機四題都要放得下：第 4 題說明較長、會換兩行（07t 實測「完成練習」被切 20–30px），選項鈕在桌機矮一點 */
body:not(.portrait) .journey-modal .journey-drill .journey-choices button{--h:46px;min-height:46px;padding:8px 12px}

/* 卡面典藏（桌機）：底部「翻面／自動旋轉／回正／使用中」原本超出捲動區 9–12px（1280×720 到 1920×1080 都會），要捲動才按得到。
   卡片展示區 310→264px，按鈕完整落在畫面內，卡片與下方切換鈕仍至少 6px。直式（手機、平板）原本就放得下，不動。 */
body:not(.portrait) .gallery-main .c3d-stage{height:264px}

/* 手機：遇見紀錄／宿敵列的戰績與時間原本 13px，縮放後實際約 7.8px 看不清。方塊不變，只放大字。 */
body.portrait.phone .person small,body.portrait.phone .person em{font-size:21px;line-height:1.5}
body.portrait.phone .person-note{font-size:22px;line-height:1.5}

/* 私人筆記卡（米色紙）：標題與說明被通用視窗樣式改成金色，在紙上幾乎看不到（對比 1.08、2.04）。改回深色墨水，對比 ≥5。
   手機上標籤鈕與說明原本約 8px，放大字（方塊不變）。 */
#modal .note-card h3{color:#6b1f1b}
#modal .note-card .note-status{color:#5a4a33}
#modal .note-card textarea::placeholder{color:#66563f}
body.portrait.phone #modal .note-card .chip-tag{font-size:21px;padding:8px 16px}
body.portrait.phone #modal .note-card .note-status{font-size:20px;line-height:1.5}

/* 視窗內的段落與按鈕不要只剩一個字掉到下一行（例：「閱讀。」的「讀。」、「第二章 · 未解鎖」的「鎖」）。 */
#modal p{text-wrap:pretty}
#modal button{text-wrap:balance}

/* 2026 雙十國慶限定牌背的贈送通知：左邊轉動的 3D 牌（勝利演出），右邊說明與「使用這款卡背」。直式改上下排。 */
.event-gift{display:grid;grid-template-columns:240px minmax(0,1fr);gap:28px;align-items:center;padding:4px 18px 10px}
.event-gift .c3d-stage{height:300px}
.event-gift-copy h3{font:600 30px var(--tc);color:var(--gold2,#e9c17a);letter-spacing:.12em;margin:0 0 12px}
.event-gift-copy p{font-size:19px;line-height:1.75;margin:0 0 10px}
.event-gift-copy .event-gift-note{color:#cbb48a}
.event-gift-copy .modal-actions{justify-content:flex-start;margin-top:20px;gap:14px}
.event-gift-copy .modal-actions button{white-space:nowrap;min-width:150px}
.event-gift-copy p{text-wrap:balance}
.event-gift-modal .event-gift{max-width:860px;margin:0 auto}
body.portrait .event-gift{grid-template-columns:1fr;gap:10px;text-align:center;padding-inline:8px}
body.portrait .event-gift .c3d-stage{height:380px}
body.portrait .event-gift-copy .modal-actions{justify-content:center}
body.portrait.phone .event-gift-copy h3{font-size:36px}
body.portrait.phone .event-gift-copy p{font-size:24px}
