/* THE READ — Neo-Noir Private Club。整個遊戲在 1600×900 的舞台上繪製並等比縮放。 */
:root {
  color-scheme: dark;
  --bg: #0b0a09; --panel: #15120f; --panel2: #1d1813; --line: #4a3b27; --line2: #6e5634;
  --ink: #eadfc8; --muted: #9d907a; --gold: #c9a45f; --gold2: #ecd29a; --red: #7d1a17; --red2: #b3302a; --green: #7fa27a;
  --serif: 'Cormorant Garamond', 'Noto Serif TC', Georgia, serif; --caps: 'Cinzel', 'Noto Serif TC', Georgia, serif; --tc: 'Noto Serif TC', 'Cormorant Garamond', serif;
  --script: 'Pinyon Script', 'Cormorant Garamond', cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { color: var(--ink); font: 16px/1.5 var(--tc); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .38; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
input, textarea { user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }

#stage { position: fixed; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; overflow: clip; background: radial-gradient(ellipse at 50% 30%, #1d1712, #0b0a09 70%); isolation: isolate; }
#smoke { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; mix-blend-mode: screen; opacity: .8; }
.vignette { position: absolute; inset: 0; z-index: 60; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, #000a 100%); }
.grain { position: absolute; inset: -50%; z-index: 61; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, 3%); } }
body[data-motion='off'] .grain, body[data-motion='off'] #smoke { display: none; }
.screen { position: absolute; inset: 0; z-index: 5; overflow: clip; }

/* 共用元件 */
.eyebrow { font: 13px var(--caps); letter-spacing: 4px; color: var(--gold); text-transform: uppercase; }
.muted { color: var(--muted); }
.btn-primary { position: relative; min-width: 220px; padding: 15px 34px; font: 600 17px var(--caps); letter-spacing: 4px; color: #f6e6c6; text-transform: uppercase;
  background: linear-gradient(#8f2620, #4d110f); border: 1px solid #c2574a; box-shadow: inset 0 1px 0 #ffffff26, inset 0 0 0 3px #00000040, 0 8px 26px #0008, 0 0 30px #a0302822; transition: .2s; }
.btn-primary:hover { filter: brightness(1.18); box-shadow: inset 0 1px 0 #ffffff26, inset 0 0 0 3px #00000040, 0 8px 26px #0008, 0 0 40px #c0403555; transform: translateY(-1px); }
.btn-primary.big { padding: 19px 56px; font-size: 20px; }
.ghost-btn { padding: 11px 24px; border: 1px solid var(--line2); color: #d9c49a; font: 14px var(--caps); letter-spacing: 2px; background: #0e0c0acc; transition: .2s; text-transform: uppercase; }
.ghost-btn:hover { border-color: var(--gold); color: var(--gold2); background: #1d1813; }
.ghost-btn.danger { border-color: #7d2a22; color: #d88b7c; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line2); border-radius: 50%; color: var(--gold2); font-size: 18px; background: #0e0c0acc; }
.tag { display: inline-block; padding: 2px 9px; margin-left: 8px; font: 11px var(--caps); letter-spacing: 2px; border: 1px solid var(--line2); color: var(--gold); vertical-align: middle; text-transform: uppercase; }
.tag.rival { color: #f0b0a0; border-color: #a83a2c; background: #5b16128a; }
.tag.ai { color: #9fb6c0; border-color: #4b6570; }
.quote { font: italic 21px var(--serif); color: #bba77f; text-align: center; margin: 22px 0 0; }
.lang-switch { display: flex; gap: 2px; border: 1px solid var(--line); padding: 3px; background: #0c0a08c0; }
.lang-switch button { padding: 5px 12px; font-size: 13px; color: var(--muted); }
.lang-switch button[aria-pressed='true'] { background: #3a2a17; color: var(--gold2); }
.toast-wrap, #toasts { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 11px 22px; background: #1a1410f2; border: 1px solid var(--line2); color: var(--gold2); font-size: 15px; letter-spacing: 1px; box-shadow: 0 10px 30px #000a; animation: toast-in .35s ease-out; transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }

/* 肖像 */
.portrait { display: block; background: #1a1411 center / cover no-repeat; }

/* 撲克牌 */
.card { position: relative; width: 82px; height: 116px; border-radius: 7px; flex-shrink: 0; }
.card.face { background: linear-gradient(150deg, #fbf6ea, #e6dcc6 70%, #d8ccb2); box-shadow: 0 6px 14px #0009, inset 0 0 0 1px #fff8, inset 0 0 0 4px #efe6d2, inset 0 0 0 5px #c9b99466; color: #16130f; overflow: hidden; }
.card.face.red { color: #a3201c; }
.c-rank { position: absolute; left: 8px; top: 4px; font: 600 30px/1 var(--serif); }
.c-suit { position: absolute; left: 10px; top: 34px; font-size: 20px; line-height: 1; }
.c-pip { position: absolute; right: 9px; bottom: 6px; font-size: 44px; line-height: 1; opacity: .92; }
.c-pip.court { font: 600 44px var(--caps); opacity: .85; }
.c-corner { display: none; }
.card.back { background: #3a0f0e center / 108% 108% no-repeat; box-shadow: 0 5px 12px #000a, inset 0 0 0 1px #d6b77a55; border: 1px solid #1a0908; }
.card.back.back-crimson { background-image: url('../assets/card-back-crimson.webp'); }
.card.back.back-ivory { background-image: url('../assets/card-back-ivory.webp'); background-color: #d9ccb0; }
.card.back.back-brass { background-image: url('../assets/card-back-brass.webp'); background-color: #15120d; }

/* 籌碼 */
.chips { display: flex; gap: 3px; align-items: flex-end; }
.chip-col { position: relative; width: 30px; height: calc(30px + 4px * 6); }
.chip { position: absolute; left: 0; bottom: calc(var(--i) * 4px); width: 30px; height: 30px; border-radius: 50%;
  background: var(--img) center / 100% 100% no-repeat; box-shadow: 0 2px 0 var(--edge), 0 3px 4px #000b; }
.d25 { --img: url('../assets/chip-white.webp'); --edge: #8d846f; }
.d100 { --img: url('../assets/chip-red.webp'); --edge: #4b0d0d; }
.d500 { --img: url('../assets/chip-green.webp'); --edge: #10301f; }
.d1k { --img: url('../assets/chip-black.webp'); --edge: #000; }
.d5k { --img: url('../assets/chip-blue.webp'); --edge: #0c1a33; }

/* ── 開機 ── */
#boot { display: grid; place-content: center; justify-items: center; gap: 22px; background: radial-gradient(ellipse at 50% 45%, #231a12, #070605 70%); }
.boot-logo { width: 620px; filter: drop-shadow(0 10px 30px #000); animation: breathe 3s ease-in-out infinite; }
.boot-track { width: 420px; height: 2px; background: #2a2118; overflow: hidden; }
.boot-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7d1a17, var(--gold2)); transition: width .4s; box-shadow: 0 0 12px var(--gold); }
#boot-text { margin: 0; font: 14px var(--caps); letter-spacing: 5px; color: var(--muted); }
.boot-motto { position: absolute; bottom: 60px; font: italic 20px var(--serif); color: #8d7b5e; }
@keyframes breathe { 50% { filter: drop-shadow(0 10px 40px #000) brightness(1.12); } }

/* ── 標題 ── */

.title-art { position: absolute; inset: -30px; background: linear-gradient(0deg, #0b0a09 4%, #0b0a0900 50%), linear-gradient(90deg, #0b0a0960, #0b0a0900 30%, #0b0a0980 70%, #0b0a09d0), url('../assets/bg-title.webp') 30% center / cover; filter: saturate(.9); animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.06) translate(-10px, -6px); } }
.title-glow { position: absolute; left: 50%; top: -120px; width: 900px; height: 700px; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 20%, #f3c67a38, transparent 65%); animation: flicker 6s infinite; pointer-events: none; }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 48% { opacity: .75; } 49% { opacity: 1; } 72% { opacity: .9; } }
.title-center { position: absolute; left: 50%; top: 170px; transform: translateX(-50%); display: grid; justify-items: center; text-align: center; width: 1000px; z-index: 5; }
.title-logo { width: 760px; filter: drop-shadow(0 18px 40px #000); animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.title-tag { font: italic 25px var(--serif); color: #cdb994; letter-spacing: 1px; margin: 8px 0 60px; animation: rise 1.4s .25s cubic-bezier(.2, .7, .2, 1) both; }
.title-center .btn-primary { animation: rise 1.4s .45s cubic-bezier(.2, .7, .2, 1) both; }
.title-mode { margin-top: 26px; font: 13px var(--caps); letter-spacing: 3px; color: var(--muted); display: flex; align-items: center; gap: 10px; animation: rise 1.4s .6s both; }
.title-mode i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.title-foot { position: absolute; left: 60px; right: 60px; bottom: 44px; display: flex; justify-content: space-between; align-items: center; z-index: 5; }
.title-foot > span { font: 14px var(--caps); letter-spacing: 4px; color: #8f7f64; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

/* ── 建立牌手 ── */
#create { display: grid; grid-template-columns: 820px 1fr; background: #0b0a09; }
.create-preview { position: relative; overflow: hidden; }
.create-portrait { position: absolute; inset: 0; background: center 20% / cover no-repeat; filter: saturate(.75) contrast(1.05); transition: background-image .3s; animation: drift 24s ease-in-out infinite alternate; }
.create-vignette { position: absolute; inset: 0; background: linear-gradient(90deg, #0000 50%, #0b0a09), linear-gradient(0deg, #0b0a09 2%, #0000 40%), radial-gradient(ellipse at 40% 35%, #0000 40%, #000b); }
.create-sign { position: absolute; left: 70px; bottom: 70px; z-index: 2; font: 92px/1 var(--script); color: #e9d3a4; text-shadow: 0 4px 20px #000; transform: rotate(-6deg); max-width: 650px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 10px; }
.create-panel { padding: 70px 90px 40px 30px; display: flex; flex-direction: column; }
.create-panel h2 { font: 38px var(--caps); letter-spacing: 6px; margin: 0; color: var(--gold2); text-transform: uppercase; }
.create-panel .sub { font: italic 20px var(--serif); color: var(--muted); margin: 4px 0 22px; }
.field-label { font: 13px var(--caps); letter-spacing: 3px; color: var(--gold); margin: 16px 0 10px; text-transform: uppercase; }
.name-row { display: flex; gap: 10px; }
.name-row input { flex: 1; padding: 12px 16px; background: #120f0c; border: 1px solid var(--line2); font: 22px var(--serif); color: var(--gold2); letter-spacing: 2px; }
.dice { width: 54px; border: 1px solid var(--line2); font-size: 28px; color: var(--gold); background: #120f0c; }
.field-error { color: #e38e7d; font-size: 13px; min-height: 20px; margin: 6px 0 0; }
.look-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.look-grid.small { grid-template-columns: repeat(8, 52px); gap: 8px; }
/* 建立角色的外觀：兩列橫向分頁（每頁 8 欄），‹ › 翻頁；捲軸隱藏，選中框的光暈留在內距裡不被裁掉。 */
.look-pager { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 8px; align-items: stretch; }
.look-grid.paged { grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: calc((100% - 70px) / 8);
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 5px 3px; margin: -5px -3px; }
.look-grid.paged::-webkit-scrollbar { display: none; }
.look-grid.paged .look-choice { scroll-snap-align: start; }
.look-page { border: 1px solid var(--line); background: #100d0a; color: var(--gold); font: 28px/1 var(--serif); transition: opacity .2s, border-color .2s; }
.look-page:hover:not(:disabled) { border-color: var(--gold); color: var(--gold2); }
.look-page:disabled { opacity: .25; cursor: default; }
#create .create-panel { padding-top: 54px; padding-bottom: 20px; }
body.portrait #create .create-panel { padding-top: 20px; padding-bottom: 50px; }
body.portrait .look-grid.paged { grid-template-rows: repeat(3, auto); }
.look-choice { aspect-ratio: 1; border: 1px solid var(--line); padding: 3px; background: #100d0a; transition: .2s; }
.look-choice .portrait { width: 100%; height: 100%; filter: saturate(.7); }
.look-choice[aria-pressed='true'] { border-color: var(--gold2); box-shadow: 0 0 0 2px #7d5a28, 0 0 18px #c9a45f55; }
.look-choice:hover .portrait { filter: none; }
.back-grid { display: flex; gap: 16px; }
.back-grid.small { gap: 10px; }
.back-choice { display: grid; justify-items: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--line); background: #100d0a; font-size: 13px; color: var(--muted); }
.back-choice .card { width: 58px; height: 84px; }
.back-grid.small .card { width: 44px; height: 64px; }
.back-choice[aria-pressed='true'] { border-color: var(--gold2); color: var(--gold2); box-shadow: 0 0 18px #c9a45f44; }
.know-row { display: flex; gap: 10px; }
.toggle { flex: 1; padding: 12px; border: 1px solid var(--line); color: var(--muted); font-size: 15px; background: #100d0a; }
.toggle[aria-pressed='true'] { border-color: var(--gold); color: var(--gold2); background: #2a1f13; }
.create-panel .btn-primary { margin-top: auto; align-self: flex-start; }

/* ── 大廳 ── */

.lobby-art { position: absolute; inset: 0; background: linear-gradient(90deg, #0b0a09f5 0 22%, #0b0a0970 45%, #0b0a0990 70%, #0b0a09f0), linear-gradient(0deg, #0b0a09, #0b0a0900 40%), url('../assets/bg-lobby.webp') center / cover; filter: saturate(.9); }
.lobby-chandelier { position: absolute; left: 50%; top: -60px; width: 520px; height: 180px; transform: translateX(-50%); border-radius: 50%; border: 3px solid #d8b0663a; box-shadow: 0 0 60px #f0c77a55, inset 0 0 40px #f0c77a33; animation: flicker 7s infinite; }
.lobby-top { position: absolute; top: 26px; left: 50px; right: 50px; display: flex; align-items: center; gap: 30px; z-index: 5; }
.lobby-logo { width: 220px; }
.lobby-mode { margin-left: auto; display: flex; align-items: center; gap: 10px; font: 13px var(--caps); letter-spacing: 2px; color: var(--muted); }
.lobby-mode i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.lobby-mode i.local { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
body[data-link='reconnecting'] .lobby-mode i { background: var(--red2); }
.lobby-nav { position: absolute; left: 50px; top: 150px; width: 290px; display: grid; gap: 4px; z-index: 5; }
.lobby-nav button { display: grid; grid-template-columns: 40px 1fr; align-items: center; text-align: left; padding: 13px 16px; font: 17px var(--caps); letter-spacing: 3px; color: #cdbd9f; border-left: 2px solid transparent; transition: .2s; text-transform: uppercase; }
.lobby-nav button i { font-style: normal; color: var(--gold); font-size: 19px; }
.lobby-nav button small { grid-column: 2; font: 11px var(--tc); letter-spacing: 1px; color: #6f6452; text-transform: none; }
.lobby-nav button:not(:disabled):hover { background: linear-gradient(90deg, #3a2412cc, transparent); color: var(--gold2); padding-left: 22px; }
.lobby-nav button[data-nav="find"] { color: var(--gold2); }
.lobby-center { position: absolute; left: 420px; top: 210px; width: 700px; z-index: 5; }
.lobby-center h1 { font: 76px/1 var(--caps); letter-spacing: 12px; margin: 0; color: #eddcb8; text-shadow: 0 6px 30px #000; }
.lobby-center > p { font: italic 24px var(--serif); color: #bfa982; margin: 14px 0 54px; letter-spacing: 3px; }
.find-card { position: relative; display: flex; align-items: center; gap: 34px; width: 620px; padding: 30px 36px; text-align: left; background: linear-gradient(110deg, #2b100ef2, #16100cea 60%); border: 1px solid #8f3a2c; box-shadow: 0 20px 60px #000c, inset 0 0 0 1px #ffffff10, inset 0 0 60px #7d1a1733; transition: .25s; overflow: hidden; }
.find-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #ffe2a61c 50%, transparent 70%); transform: translateX(-100%); animation: sheen 4.5s 1s infinite; }
@keyframes sheen { 30%, 100% { transform: translateX(100%); } }
.find-card:hover { transform: translateY(-3px); border-color: #d06a52; box-shadow: 0 26px 70px #000d, 0 0 50px #a0302844, inset 0 0 60px #7d1a1744; }
.find-card b { display: block; font: 38px var(--caps); letter-spacing: 6px; color: #f2dfb8; text-transform: uppercase; }
.find-card span { font-size: 16px; color: #bfa982; letter-spacing: 1px; }
.find-card em { margin-left: auto; font: 60px var(--serif); color: var(--gold); font-style: normal; }
.find-ace { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.find-ace .card { position: absolute; width: 74px; height: 104px; top: 6px; }
.find-ace .card:first-child { left: 4px; transform: rotate(-12deg); z-index: 2; }
.find-ace .card:last-child { left: 42px; transform: rotate(10deg); }
.find-ace .c-rank { font-size: 26px; } .find-ace .c-pip { font-size: 38px; }
.lobby-side { position: absolute; right: 50px; top: 150px; width: 380px; display: grid; gap: 20px; z-index: 5; }
.season-card { display: flex; gap: 18px; align-items: center; padding: 20px; background: linear-gradient(135deg, #1d1712f0, #0f0c0af0); border: 1px solid var(--line2); box-shadow: 0 16px 40px #000a; }
.season-card img { width: 86px; filter: drop-shadow(0 4px 10px #000); }
.season-card span { font: 14px var(--caps); letter-spacing: 3px; color: var(--gold); text-transform: uppercase; }
.season-card b { display: block; font: 30px var(--serif); color: var(--gold2); }
.season-card small { color: var(--muted); font-size: 13px; }
.season-card strong { color: var(--ink); font-weight: 400; }
.today { padding: 20px 22px; background: linear-gradient(135deg, #17130fe8, #0d0b09e8); border: 1px solid var(--line); max-height: 470px; overflow: hidden; }
.today h3 { margin: 0 0 12px; font: 16px var(--caps); letter-spacing: 3px; color: var(--gold2); text-transform: uppercase; }
.feed { display: grid; gap: 4px; }
.feed-item { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #3a2e1f; animation: rise .6s both; }
.feed-item p { margin: 0; font-size: 14px; line-height: 1.5; color: #cbbd9f; }
.feed-item b { color: var(--gold2); font-weight: 400; }
.feed-item small { display: block; color: #75695a; font-size: 12px; }
.feed-portrait { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line2); filter: grayscale(.4); }
.feed-portrait.seal { background: url('../assets/archive-seal.webp') center / 90% no-repeat; border: 0; }
.today .empty { color: var(--muted); font: italic 17px var(--serif); }
.lobby-me { position: absolute; left: 50px; bottom: 40px; display: flex; align-items: center; gap: 16px; z-index: 5; cursor: pointer; padding: 10px 26px 10px 10px; background: #0f0c0ad8; border: 1px solid var(--line); }
.lobby-me:hover { border-color: var(--line2); }
.me-portrait { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--gold); box-shadow: 0 0 0 3px #0b0a09, 0 0 0 4px #6e5634; }
.lobby-me b { display: block; font: 24px var(--serif); color: var(--gold2); letter-spacing: 2px; }
.lobby-me span { font: 13px var(--caps); color: var(--muted); letter-spacing: 2px; }

/* ── 配桌 ── */
.queue { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; background: radial-gradient(ellipse at center, #0b0a09b0, #050404f2 75%), url('../assets/bg-archive.webp') center / cover; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.queue-box { display: grid; justify-items: center; text-align: center; gap: 6px; }
.queue-seal { width: 170px; height: 170px; background: url('../assets/archive-seal.webp') center / contain no-repeat; animation: spin 14s linear infinite, breathe 3s infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.queue h2 { font: 34px var(--caps); letter-spacing: 8px; margin: 6px 0 16px; color: var(--gold2); text-transform: uppercase; }
.queue-seats { display: flex; gap: 14px; margin-bottom: 12px; }
.queue-seats i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); transition: .4s; }
.queue-seats i.on { background: radial-gradient(circle, var(--gold2), #8a6a30); box-shadow: 0 0 16px var(--gold); }
.queue-count { font: 22px var(--serif); margin: 0; color: var(--ink); }
.queue-wait, .queue-note { margin: 0; color: var(--muted); font-size: 14px; }
.queue .ghost-btn { margin-top: 26px; }
.queue-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:20px; margin-top:26px; max-width:760px; }
.queue .queue-actions .ghost-btn { margin-top:0; }
.queue-box { padding:30px; max-width:calc(100% - 60px); }
.queue-fill { max-width:700px; line-height:1.6; }
.trial-disclaimer { max-width:650px; margin:12px auto; color:var(--muted); font-size:14px; line-height:1.6; }
.phone .trial-disclaimer { font-size:24px; }
.phone .queue-box { gap:18px; }
.phone .queue-stake, .phone .queue-count, .phone .queue-note { font-size:32px; }
.phone .queue-wait { font-size:28px; }
.phone .queue-actions button { font-size:32px; }

/* ── 牌桌 ── */

.tv-room { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, #0000 30%, #0b0a09 75%), url('../assets/bg-table.webp') center / cover; filter: blur(1.5px) brightness(.6) saturate(.85); transform: scale(1.03); }
.tv-lamp { position: absolute; left: 50%; top: -260px; width: 1300px; height: 1000px; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 55%, #ffd79a26, #ffd79a0c 40%, transparent 65%); pointer-events: none; z-index: 1; animation: flicker 9s infinite; }
.tv-table { position: absolute; left: 190px; top: 150px; width: 1220px; height: 520px; z-index: 1; }
.tv-rail { position: absolute; inset: 0; border-radius: 260px; background: linear-gradient(170deg, #3b271a, #1a100b 45%, #0d0806); box-shadow: 0 40px 80px #000e, 0 0 0 2px #8b6a3d, 0 0 0 5px #1b120b, 0 0 0 6px #b48d52aa, inset 0 2px 1px #ffffff1c, inset 0 -8px 20px #000a; }
.tv-felt { position: absolute; inset: 30px; border-radius: 230px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #ffd9a022 0%, #0000 45%, #0000008c 85%, #000000c0 100%), url('../assets/felt.webp') center / 340px repeat, #5b1415;
  box-shadow: inset 0 0 0 2px #c9a45f66, inset 0 0 0 6px #230707, inset 0 0 0 7px #c9a45f33, inset 0 18px 60px #000c, inset 0 -20px 50px #000b; }
.tv-felt::before { content: ''; position: absolute; inset: 0; opacity: .25; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23f)'/%3E%3C/svg%3E"); }
.tv-felt-line { position: absolute; inset: 60px 150px; border-radius: 200px; border: 1px solid #d7b17522; }
.tv-felt-mark { position: absolute; left: 0; right: 0; top: 330px; text-align: center; font: 30px var(--caps); letter-spacing: 16px; color: #e0bc7c1e; }
.tv-hud { position: absolute; top: 18px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; z-index: 20; }
.tv-hud-left { display: flex; gap: 18px; align-items: baseline; padding: 9px 20px; background: #0c0a08cc; border: 1px solid var(--line); font: 14px var(--caps); letter-spacing: 2px; color: var(--muted); }
.tv-hud-left b { color: var(--gold2); font-weight: 400; font-size: 17px; }
.tv-hud-right { display: flex; gap: 10px; }
.tv-pot { position: absolute; left: 800px; top: 300px; transform: translate(-50%, -50%); z-index: 6; display: grid; justify-items: center; opacity: 0; transition: opacity .3s; }
.tv-pot.on { opacity: 1; }
.tv-pot-chips .chip-col { height: 62px; }
.tv-pot-label { margin-top: 4px; padding: 3px 16px; background: #0b0908c8; border: 1px solid #c9a45f55; border-radius: 20px; font: 14px var(--caps); letter-spacing: 2px; color: var(--muted); white-space: nowrap; }
.tv-pot-label b { margin-left: 8px; color: var(--gold2); font: 600 21px var(--serif); letter-spacing: 1px; }
.tv-board { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.tv-slot { position: absolute; width: 82px; height: 116px; transform: translate(-50%, -50%); border-radius: 7px; border: 1px dashed #d7b17522; }
.tv-slot .card { position: absolute; inset: 0; }
.tv-rank { position: absolute; left: 800px; top: 496px; transform: translateX(-50%); z-index: 6; font: 15px var(--caps); letter-spacing: 4px; color: var(--gold2); text-shadow: 0 2px 6px #000; white-space: nowrap; text-transform: uppercase; }
.tv-banner { position: absolute; left: 800px; top: 206px; transform: translate(-50%, -50%) scale(.9); z-index: 12; padding: 8px 28px; background: linear-gradient(90deg, transparent, #120e0bf0 15% 85%, transparent); font: 24px var(--serif); color: var(--gold2); white-space: nowrap; opacity: 0; pointer-events: none; letter-spacing: 1px; }
.tv-banner em { margin-left: 12px; font: 15px var(--caps); letter-spacing: 3px; color: #e6a88f; font-style: normal; }
.tv-banner.on { animation: banner 3.4s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } 10%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; } }
.tv-seats, .tv-bets, .tv-hero-cards, .tv-fx { position: absolute; inset: 0; pointer-events: none; }
.tv-seats { z-index: 8; } .tv-bets { z-index: 7; } .tv-hero-cards { z-index: 9; } .tv-fx { z-index: 30; }
.tv-seat { position: absolute; width: 200px; transform: translate(-50%, -50%); display: grid; justify-items: center; pointer-events: auto; transition: opacity .4s, filter .4s; }
.tv-avatar { position: relative; width: 96px; height: 96px; border-radius: 50%; }
.tv-seat.hero .tv-avatar { width: 108px; height: 108px; }
.tv-portrait { position: absolute; inset: 6px; border-radius: 50%; filter: saturate(.8); box-shadow: inset 0 0 20px #000; }
.tv-frame { position: absolute; inset: -12px; background: url('../assets/avatar-frame.webp') center / contain no-repeat; pointer-events: none; }
.tv-timer { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); z-index: 2; pointer-events: none; }
.tv-timer circle { fill: none; stroke: var(--gold2); stroke-width: 5; stroke-dasharray: 352; stroke-dashoffset: 352; filter: drop-shadow(0 0 6px var(--gold)); stroke-linecap: round; }
.tv-seat.active .tv-portrait { filter: none; box-shadow: 0 0 30px #f0c77a88; }
.tv-seat.active .tv-avatar::after { content: ''; position: absolute; inset: -18px; border-radius: 50%; box-shadow: 0 0 40px #e9b86555; animation: pulse 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes pulse { 50% { box-shadow: 0 0 60px #e9b865aa; } }
.tv-ai { position: absolute; right: -8px; bottom: 2px; z-index: 3; font: 600 10px var(--caps); letter-spacing: 1px; color: #bcd3dc; background: #152025; border: 1px solid #4b6570; padding: 1px 6px; font-style: normal; }
.tv-ai:empty { display: none; }
.tv-place { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; font: 600 28px var(--caps); color: var(--gold2); font-style: normal; text-shadow: 0 2px 8px #000; }
.tv-plate { margin-top: 8px; min-width: 150px; padding: 5px 16px 6px; text-align: center; background: linear-gradient(#1b1511f5, #0c0a08f5); border: 1px solid #5e4a2e; box-shadow: 0 6px 16px #000b, inset 0 1px 0 #ffffff12; }
.tv-name { display: block; font: 600 17px var(--serif); letter-spacing: 2px; color: #eadcbc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.tv-stack { font: 600 19px var(--serif); color: var(--gold2); }
.tv-stack::before { content: '◉ '; font-size: 12px; color: var(--gold); vertical-align: 2px; }
.tv-badge { position: absolute; top: -34px; padding: 3px 14px; border-radius: 14px; background: #0d0b09ee; border: 1px solid var(--line2); font: 14px var(--tc); color: #e8d6ae; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: .25s; pointer-events: none; z-index: 4; }
.tv-badge.on { opacity: 1; transform: none; }
.tv-badge.fold { color: #9a8f80; border-color: #4a4035; }
.tv-badge.raise, .tv-badge.bet { color: #fff0cf; border-color: #b0843f; background: #3a2610ee; }
.tv-badge.allin { color: #fff; border-color: #d24a3c; background: linear-gradient(#8f2620, #4d110f); box-shadow: 0 0 20px #c0403577; }
.tv-badge.check { color: #cfe0c8; }
.tv-seat.hero .tv-badge { top: 40px; right: 168px; }
.tv-seat.hero .tv-plate { display: flex; gap: 14px; align-items: baseline; padding: 3px 18px; margin-top: 6px; }
.tv-seat.folded .tv-avatar, .tv-seat.folded .tv-plate { opacity: .45; filter: grayscale(.8); }
.tv-seat.out { opacity: .35; filter: grayscale(1); }
.tv-seat.offline .tv-portrait { filter: grayscale(1) brightness(.6); }
.tv-seat.winner .tv-avatar::before { content: ''; position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, #f3d08f55, transparent 70%); animation: pulse 1s ease-in-out 3; }
.tv-seat.winner .tv-plate { border-color: var(--gold2); box-shadow: 0 0 24px #e0b56b66; }
.tv-cards { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 0; pointer-events: none; }
.tv-cards .card { width: 48px; height: 68px; margin: 0 -6px; box-shadow: 0 4px 8px #000b; }
.tv-cards .card:first-child { transform: rotate(-7deg); } .tv-cards .card:nth-child(2) { transform: rotate(7deg); }
.tv-cards .card.face .c-rank { font-size: 20px; left: 5px; top: 3px; } .tv-cards .card.face .c-suit { font-size: 14px; left: 6px; top: 24px; } .tv-cards .card.face .c-pip { font-size: 26px; right: 5px; bottom: 3px; }
.tv-cards .card.face .c-pip.court { font-size: 24px; }
.tv-cards.hero-hand { gap: 10px; }
.tv-cards.hero-hand .card { width: 92px; height: 130px; margin: 0; }
.tv-cards.hero-hand .card:first-child { transform: rotate(-6deg) translateY(4px); } .tv-cards.hero-hand .card:nth-child(2) { transform: rotate(6deg) translateY(4px); }
.tv-cards.hero-hand .card.face .c-rank { font-size: 34px; } .tv-cards.hero-hand .card.face .c-suit { font-size: 22px; top: 38px; } .tv-cards.hero-hand .card.face .c-pip { font-size: 50px; }
.tv-cards.mucked { opacity: .35; filter: grayscale(.7); }
.tv-bet { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; opacity: 0; transition: opacity .2s; }
.tv-bet.on { opacity: 1; }
.tv-bet span { margin-top: 2px; padding: 1px 10px; border-radius: 10px; background: #0b0908d0; font: 600 16px var(--serif); color: var(--gold2); }
.tv-dealer { position: absolute; left: 0; top: 0; width: 44px; height: 44px; z-index: 9; transition: opacity .3s; filter: drop-shadow(0 4px 5px #000); pointer-events: none; }
.fly { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.fly .card { width: 82px; height: 116px; }
.fly-card { position: absolute; }
.tv-log { position: absolute; left: 26px; bottom: 22px; width: 360px; z-index: 20; padding: 12px 16px; background: #0c0a08c0; border: 1px solid var(--line); }
.tv-log-title { font: 12px var(--caps); letter-spacing: 3px; color: var(--gold); text-transform: uppercase; }
.tv-log ol { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: #b3a589; line-height: 1.65; height: 150px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.tv-log li:last-child { color: var(--ink); }
.tv-status { position: absolute; left: 28px; bottom: 222px; z-index: 20; font: 14px var(--caps); letter-spacing: 3px; color: var(--muted); white-space: nowrap; text-transform: uppercase; }
.tv-actions { position: absolute; right: 26px; bottom: 22px; width: 560px; z-index: 25; display: grid; gap: 10px; animation: rise .3s ease-out; }
.tv-sizes { display: flex; gap: 6px; align-items: center; }
.tv-sizes > button { padding: 7px 12px; font: 13px var(--caps); letter-spacing: 1px; color: #d7c39c; border: 1px solid var(--line2); background: #0e0c0ad8; }
.tv-sizes > button:hover:not(:disabled) { border-color: var(--gold); }
.tv-slider { flex: 1; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); background: #0e0c0ad8; }
.tv-slider input { flex: 1; accent-color: var(--gold); min-width: 60px; }
.tv-step { width: 26px; height: 26px; color: var(--gold2); font-size: 18px; }
.tv-slider output { min-width: 64px; text-align: right; font: 600 18px var(--serif); color: var(--gold2); }
.tv-buttons { display: grid; grid-template-columns: 1fr 1.2fr 1.3fr; gap: 10px; }
.act-btn { display: inline-grid; place-items: center; min-height: 66px; padding: 8px 14px; font: 600 19px var(--caps); letter-spacing: 3px; text-transform: uppercase; border: 1px solid; box-shadow: inset 0 1px 0 #ffffff1c, inset 0 0 0 3px #00000045, 0 10px 24px #000b; transition: .15s; }
.act-btn b { display: block; font: 600 20px var(--serif); letter-spacing: 1px; }
.act-btn:hover:not(:disabled) { filter: brightness(1.2); transform: translateY(-2px); }
.act-btn:active:not(:disabled) { transform: translateY(1px); }
.act-btn.fold, .act-btn.muck { background: linear-gradient(#23201c, #100e0c); border-color: #5b4d3a; color: #cdbf9f; }
.act-btn.call { background: linear-gradient(#2c2418, #15110b); border-color: #9a7a45; color: #f0dcb2; }
.act-btn.raise, .act-btn.show { background: linear-gradient(#8f2620, #4d110f); border-color: #c2574a; color: #fbe7c5; }
.tv-reveal { position: absolute; right: 26px; bottom: 22px; width: 560px; z-index: 26; padding: 18px 20px 22px; background: linear-gradient(135deg, #1d1712f5, #0f0c0af5); border: 1px solid var(--line2); box-shadow: 0 20px 50px #000c; animation: rise .35s ease-out; }
.tv-reveal p { margin: 0; } .tv-reveal-title { font: 18px var(--serif); color: var(--gold2); } .tv-reveal-q { color: var(--muted); font-size: 14px; margin: 2px 0 14px !important; }
.tv-reveal div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tv-reveal-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); transform-origin: left; }
.tv-allin { position: absolute; inset: 0; z-index: 28; display: grid; place-items: center; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, #5a0c0a55, #000c 80%); }
.tv-allin span { font: 120px var(--caps); letter-spacing: 22px; color: #f4dcae; text-shadow: 0 0 40px #d0402f, 0 8px 30px #000; text-transform: uppercase; }
.tv-allin.on { animation: allin 1.5s ease-out; }
.tv-allin.on span { animation: slam 1.5s ease-out; }
@keyframes allin { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes slam { 0% { transform: scale(2.2); filter: blur(10px); } 18% { transform: scale(1); filter: none; } 100% { transform: scale(1.06); } }
body[data-motion='off'] .tv-allin, body[data-motion='reduced'] .tv-allin { display: none; }

/* ── 過場 ── */
.overlay { position: absolute; inset: 0; z-index: 75; display: grid; place-items: center; background: radial-gradient(ellipse at center, #140f0cf2, #050404fa 75%); }
.intro-box { text-align: center; display: grid; justify-items: center; }
.intro-box h2, .rival-box h2 { font: 40px var(--caps); letter-spacing: 10px; margin: 8px 0 26px; color: var(--gold2); text-transform: uppercase; }
.intro-row { display: flex; gap: 22px; margin-bottom: 40px; }
.intro-card { width: 210px; padding: 20px 14px; display: grid; justify-items: center; gap: 6px; background: linear-gradient(160deg, #1d1712, #0e0b09); border: 1px solid var(--line); animation: deal-in .6s calc(var(--n) * .12s) cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes deal-in { from { opacity: 0; transform: translateY(-60px) rotate(-8deg) scale(.8); } }
.intro-portrait { width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--gold); box-shadow: 0 0 0 4px #0b0a09, 0 0 0 5px #6e5634; margin-bottom: 8px; }
.intro-card b { font: 600 24px var(--serif); letter-spacing: 2px; }
.intro-card em { font: 12px var(--caps); letter-spacing: 3px; font-style: normal; color: var(--gold); text-transform: uppercase; }
.intro-card small { color: var(--muted); font-size: 12px; line-height: 1.5; min-height: 36px; }
.intro-card.rival { border-color: #a83a2c; box-shadow: 0 0 30px #a0302844; } .intro-card.rival em { color: #f09a86; }
.intro-card.ai em { color: #9fb6c0; }
.rival-box { width: 1000px; text-align: center; display: grid; justify-items: center; }
.rival-art { width: 360px; margin: -10px 0 -24px; filter: drop-shadow(0 10px 30px #000); animation: slam 1.2s ease-out; }
.rival-vs { display: flex; align-items: center; gap: 60px; }
.rival-side { display: grid; justify-items: center; gap: 12px; }
.rival-side b { font: 600 28px var(--serif); letter-spacing: 3px; }
.rival-portrait { width: 200px; height: 240px; border: 1px solid var(--line2); box-shadow: 0 20px 50px #000; filter: grayscale(.3) contrast(1.1); }
.rival-side:first-child .rival-portrait { animation: from-left .8s cubic-bezier(.2, .8, .3, 1) both; }
.rival-side:last-child .rival-portrait { animation: from-right .8s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes from-left { from { transform: translateX(-200px); opacity: 0; } } @keyframes from-right { from { transform: translateX(200px); opacity: 0; } }
.rival-vs > em { font: 70px var(--caps); color: var(--red2); font-style: normal; text-shadow: 0 0 30px #c0403588; }
.rival-stats { display: flex; gap: 50px; margin: 18px 0 0; }
.rival-stats strong { display: block; font: 600 38px var(--serif); color: var(--gold2); }
.rival-stats span { font: 12px var(--caps); letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.rival-box .btn-primary, .result-box .btn-primary { margin-top: 20px; }
.rival-box .quote { margin-top: 14px; }
.result-box { width: 640px; text-align: center; display: grid; justify-items: center; }
.result-art { width: 260px; filter: drop-shadow(0 20px 40px #000); animation: slam 1s ease-out; }
.result-place { font: 72px var(--caps); letter-spacing: 8px; margin: 4px 0 20px; color: var(--gold2); text-shadow: 0 6px 30px #000; text-transform: uppercase; }
.result-rows { width: 100%; margin: 0; }
.result-rows > div { display: flex; justify-content: space-between; padding: 12px 6px; border-bottom: 1px solid var(--line); font-size: 18px; }
.result-rows dt { color: var(--muted); } .result-rows dd { margin: 0; font: 600 22px var(--serif); }
.result-rows small { color: var(--muted); font-size: 15px; }
.result-rows .record dt { color: var(--red2); font: 13px var(--caps); letter-spacing: 3px; text-transform: uppercase; }
.up { color: #9fd08f; } .down { color: #e58c7c; }
.result-actions { display: flex; gap: 12px; margin-top: 26px; align-items: center; }
.result-actions .btn-primary { margin: 0; }

/* ── 視窗 ── */
.modal-wrap { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: #050404c8; backdrop-filter: blur(5px); }
.modal { position: relative; width: 640px; max-height: 800px; overflow: auto; padding: 38px 44px; background: linear-gradient(140deg, #211a14, #0f0c0a 70%); border: 1px solid var(--line2); box-shadow: 0 30px 90px #000e, inset 0 0 0 1px #ffffff08; user-select: text; }
.modal.wide { width: 1000px; }
.modal.small { width: 520px; }
.modal h2 { font: 34px var(--caps); letter-spacing: 5px; margin: 4px 0 18px; color: var(--gold2); text-transform: uppercase; }
.modal h2 small { font: 16px var(--caps); color: var(--muted); letter-spacing: 2px; }
.modal h3 { font: 16px var(--caps); letter-spacing: 3px; color: var(--gold); margin: 22px 0 10px; text-transform: uppercase; }
.modal p { color: #cbbd9f; }
.modal-x { position: absolute; right: 16px; top: 10px; font-size: 32px; color: var(--muted); z-index: 2; }
.modal-x:hover { color: var(--gold2); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 26px; }
.modal::-webkit-scrollbar { width: 8px; } .modal::-webkit-scrollbar-thumb { background: #4a3b27; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); }
.stat-grid > div { padding: 12px 16px; background: #120f0c; }
.stat-grid dt { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.stat-grid dd { margin: 2px 0 0; font: 600 24px var(--serif); color: var(--gold2); }
.file-head { display: flex; gap: 30px; align-items: center; margin-bottom: 14px; }
.file-portrait { width: 150px; height: 150px; border: 1px solid var(--line2); flex-shrink: 0; }
.file-portrait.polaroid { padding: 0; border: 8px solid #d9ceb4; border-bottom-width: 30px; transform: rotate(-4deg); box-shadow: 0 12px 30px #000c; filter: sepia(.25) grayscale(.2); }
.file-head h2 { margin: 0; }
.file-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; }
.note-card { position: relative; padding: 34px 34px 22px; transform: rotate(1deg); color: #2d241a; min-height: 440px; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 20% 90%, #a8875a33, transparent 40%), radial-gradient(ellipse at 90% 10%, #8f6b3d2a, transparent 45%), linear-gradient(170deg, #efe3c7, #dccaa3);
  box-shadow: 0 16px 40px #000c, inset 0 0 40px #8a6a3a44, inset 0 0 0 1px #fff6; clip-path: polygon(0 1%, 3% 0, 97% 1%, 100% 0, 99% 50%, 100% 99%, 60% 100%, 2% 99%, 0 60%); }
.note-card::before { content: ''; position: absolute; top: -6px; left: 50%; width: 110px; height: 26px; transform: translateX(-50%) rotate(-3deg); background: #7a1d19cc; box-shadow: 0 2px 4px #0006; }
.note-card::after { content: 'THE READ · PRIVATE NOTES'; position: absolute; right: 26px; top: 14px; font: 11px var(--caps); letter-spacing: 3px; color: #6b5a3f; }
.note-card h3 { color: #6b1f1b; margin: 10px 0 8px; }
.note-card textarea { flex: 1; min-height: 190px; width: 100%; resize: none; background: repeating-linear-gradient(transparent 0 29px, #6b5a3f33 29px 30px); border: 0; color: #2d241a; font: 20px/30px var(--serif); padding: 0; }
.note-card textarea:focus-visible { outline: none; }
.note-card textarea::placeholder { color: #7a6a52; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.chip-tag { padding: 4px 11px; border: 1px solid #6b5a3f88; border-radius: 16px; font-size: 13px; color: #4a3b27; }
.chip-tag[aria-pressed='true'] { background: #6b1f1b; color: #f7e8cc; border-color: #6b1f1b; }
.note-status { color: #6b5a3f; font-size: 12px; }
.shown-list { display: flex; flex-wrap: wrap; gap: 14px; }
.shown { display: grid; grid-template-columns: auto auto; gap: 4px; justify-items: center; }
.shown small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.shown .card, .hand-row .card { width: 42px; height: 60px; border-radius: 4px; }
.shown .card .c-rank, .hand-row .card .c-rank { font-size: 18px; left: 4px; top: 2px; }
.shown .card .c-suit, .hand-row .card .c-suit { font-size: 12px; left: 5px; top: 21px; }
.shown .card .c-pip, .hand-row .card .c-pip { font-size: 22px; right: 4px; bottom: 2px; }
.self-file { display: grid; grid-template-columns: 300px 1fr; gap: 36px; }
.self-left { display: grid; align-content: start; gap: 8px; }
.self-portrait { width: 300px; height: 360px; border: 1px solid var(--line2); filter: saturate(.75); }
.self-sign { margin: -70px 0 20px 18px; font: 58px/1.2 var(--script); color: #f0dcb2; text-shadow: 0 4px 14px #000; transform: rotate(-6deg); position: relative; }
.self-left nav { display: grid; margin-top: 16px; border-top: 1px solid var(--line); }
.self-left nav button { text-align: left; padding: 11px 14px; font: 14px var(--caps); letter-spacing: 3px; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: uppercase; }
.self-left nav button[aria-pressed='true'] { color: var(--gold2); background: linear-gradient(90deg, #3a2412, transparent); border-left: 2px solid var(--red2); }
.self-body h3:first-child { margin-top: 0; }
.people-list, .hand-list, .lb { display: grid; gap: 6px; }
.person { display: grid; grid-template-columns: 58px 1fr auto; gap: 16px; align-items: center; text-align: left; padding: 10px 14px; border: 1px solid var(--line); background: #120f0c; transition: .2s; }
.person:hover { border-color: var(--line2); background: #1c1611; }
.person-portrait { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line2); }
.person b { font: 600 20px var(--serif); letter-spacing: 1px; }
.person small { display: block; color: var(--muted); font-size: 13px; }
.person-note { display: block; font: italic 15px var(--serif); color: #bba77f; }
.person em { color: var(--muted); font-size: 13px; font-style: normal; }
.hand-row { display: grid; grid-template-columns: 96px 240px 1fr; gap: 16px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); background: #120f0c; }
.hand-cards, .hand-board { display: flex; gap: 4px; }
.hand-meta b { font: 600 20px var(--serif); } .hand-meta small { display: block; color: var(--muted); font-size: 12px; }
.volume { display: grid; grid-template-columns: 110px 1fr; gap: 24px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.volume .cover { position: relative; width: 110px; aspect-ratio: 520 / 629; background: url('../assets/archive-cover.webp') center / contain no-repeat; filter: drop-shadow(0 8px 16px #000); }
.volume .cover span { position: absolute; left: 22%; right: 12%; top: 79%; text-align: center; font: 600 10px var(--caps); letter-spacing: 1px; color: #3b2d1c; white-space: nowrap; }
.volume.current .cover { filter: drop-shadow(0 8px 16px #000) drop-shadow(0 0 12px #c9a45f55); }
.modal.archive-bg { background: linear-gradient(140deg, #1b1510f0, #0b0a09f5 70%), url('../assets/bg-archive.webp') center / cover; }
.volume h3 { margin: 0 0 10px; }
.volume .stat-grid { grid-template-columns: repeat(4, 1fr); }
.lb-row { display: grid; grid-template-columns: 44px 48px 1fr 120px 110px; gap: 14px; align-items: center; padding: 8px 14px; text-align: left; border: 1px solid var(--line); background: #120f0c; }
.lb-row em { font: 600 22px var(--serif); color: var(--gold); font-style: normal; text-align: center; }
.lb-row:nth-child(1) em { color: #f3d58f; text-shadow: 0 0 10px #e0b56b; }
.lb-row .lb-portrait { width: 44px; height: 44px; border-radius: 50%; }
.lb-row b { font: 600 19px var(--serif); } .lb-row span { color: var(--muted); font-size: 13px; } .lb-row strong { font: 600 22px var(--serif); color: var(--gold2); text-align: right; }
.lb-row.me { border-color: var(--red2); background: #2a1210; }
.settings .set-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings .set-row > span { color: #cbbd9f; }
.seg { display: flex; border: 1px solid var(--line); padding: 3px; gap: 2px; }
.seg button { padding: 6px 14px; color: var(--muted); font-size: 14px; }
.seg button[aria-pressed='true'] { background: #3a2a17; color: var(--gold2); }
.mode-line { margin-top: 16px; font-size: 13px; }
.tutorial { width: 760px; text-align: center; }
.tut p { font-size: 18px; line-height: 1.8; max-width: 620px; margin: 18px auto 0; }
.tut-visual { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 140px; margin-top: 10px; }
.tut-visual .plus { font: 40px var(--serif); color: var(--gold); margin: 0 10px; }
.tut-visual.buttons { gap: 12px; } .tut-visual.buttons .act-btn { min-width: 150px; }
.chips-demo .chips { transform: scale(1.8); }
.tut-ranks { columns: 3; text-align: left; max-width: 620px; margin: 20px auto 0; font-size: 17px; color: var(--gold2); }
.tutorial .modal-actions { justify-content: center; }

/* ── 直式舞台 900×1600：手機直拿時所有操作都留在畫面內 ── */
body.portrait #stage { width: 900px; height: 1600px; }
body.portrait .title-center { top: 430px; width: 860px; }
body.portrait .title-logo { width: 800px; }
body.portrait .title-tag { font-size: 28px; }
body.portrait .title-foot { left: 20px; right: 20px; bottom: 70px; flex-direction: column; gap: 22px; text-align: center; }
body.portrait #create { grid-template-columns: 1fr; grid-template-rows: 560px 1fr; }
body.portrait .title-art { background-position: center, center, 24% center; }
body.portrait .create-vignette { background: linear-gradient(0deg, #0b0a09 2%, #0000 45%), radial-gradient(ellipse at 50% 35%, #0000 40%, #000b); }
body.portrait .create-sign { left: 50px; bottom: 30px; font-size: 80px; }
body.portrait .create-panel { padding: 20px 50px 50px; }
body.portrait .create-panel h2 { font-size: 34px; }
body.portrait .lobby-top { top: 30px; left: 40px; right: 40px; gap: 16px; flex-wrap: wrap; }
body.portrait .lobby-logo { width: 190px; }
body.portrait .lobby-center { left: 40px; top: 150px; width: 820px; }
body.portrait .lobby-center h1 { font-size: 62px; letter-spacing: 9px; }
body.portrait .lobby-center > p { margin: 10px 0 30px; }
body.portrait .find-card { width: 820px; }
body.portrait .lobby-nav { left: 40px; top: 560px; width: 820px; grid-template-columns: 1fr 1fr; gap: 8px; }
body.portrait .lobby-side { left: 40px; right: 40px; top: 880px; width: auto; }
body.portrait .today { max-height: 430px; }
body.portrait .tv-table { left: 90px; top: 140px; width: 720px; height: 1060px; }
body.portrait .tv-rail { border-radius: 360px; }
body.portrait .tv-felt { border-radius: 330px; }
body.portrait .tv-felt-line { inset: 150px 60px; border-radius: 300px; }
body.portrait .tv-felt-mark { top: 820px; font-size: 26px; letter-spacing: 12px; }
body.portrait .tv-lamp { width: 1000px; height: 1400px; top: -200px; }
body.portrait .tv-hud { top: 20px; left: 20px; right: 20px; }
body.portrait .tv-hud-left { flex-wrap: wrap; gap: 4px 14px; font-size: 13px; padding: 8px 14px; max-width: 640px; }
body.portrait .tv-pot { left: 450px; top: 560px; }
body.portrait .tv-rank { left: 450px; top: 776px; }
body.portrait .tv-banner { left: 450px; top: 420px; font-size: 22px; }
body.portrait .tv-status { left: 450px; bottom: 206px; transform: translateX(-50%); }
body.portrait .tv-actions, body.portrait .tv-reveal { left: 20px; right: 20px; width: auto; bottom: 24px; }
body.portrait .tv-sizes > button { padding: 12px 14px; font-size: 15px; }
body.portrait .tv-slider { padding: 8px 10px; }
body.portrait .act-btn { min-height: 92px; font-size: 24px; }
body.portrait .act-btn b { font-size: 24px; }
body.portrait .tv-allin span { font-size: 86px; letter-spacing: 14px; }
body.portrait .intro-row { flex-wrap: wrap; justify-content: center; width: 860px; gap: 18px; }
body.portrait .intro-card { width: 260px; }
body.portrait .rival-box { width: 860px; }
body.portrait .rival-vs { gap: 30px; }
body.portrait .rival-stats { gap: 30px; flex-wrap: wrap; justify-content: center; }
body.portrait .result-box { width: 820px; }
body.portrait .result-actions { flex-wrap: wrap; justify-content: center; }
body.portrait .modal { width: 820px; max-height: 1400px; }
body.portrait .modal.wide { width: 860px; }
body.portrait .file-cols, body.portrait .self-file { grid-template-columns: 1fr; }
body.portrait .self-portrait { width: 100%; height: 420px; }
body.portrait .lb-row { grid-template-columns: 40px 44px 1fr 80px 90px; }
body.portrait .hand-row { grid-template-columns: 96px 1fr; }
body.portrait .hand-meta { grid-column: 1 / -1; }
body.portrait .volume .stat-grid { grid-template-columns: repeat(2, 1fr); }
body.portrait .settings .set-row { flex-wrap: wrap; }
body.portrait .tutorial { width: 820px; }

/* ══ 華麗元件層：黑漆金框，與美術素材同一語言。覆寫上方的基礎樣式。 ══ */
:root { --gem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0 L20 10 L10 20 L0 10Z' fill='%23c9a45f'/%3E%3Cpath d='M10 4 L16 10 L10 16 L4 10Z' fill='%238e1f1f'/%3E%3Cpath d='M10 5 L13 10 L10 8Z' fill='%23ff8a7a' opacity='.6'/%3E%3C/svg%3E"); --divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14'%3E%3Cdefs%3E%3ClinearGradient id='g'%3E%3Cstop offset='0' stop-color='%23c9a45f' stop-opacity='0'/%3E%3Cstop offset='.5' stop-color='%23c9a45f'/%3E%3Cstop offset='1' stop-color='%23c9a45f' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect y='6.5' width='400' height='1' fill='url(%23g)'/%3E%3Cpath d='M200 1 L206 7 L200 13 L194 7Z' fill='%23c9a45f'/%3E%3Cpath d='M200 4 L203 7 L200 10 L197 7Z' fill='%238e1f1f'/%3E%3C/svg%3E"); }
/* 主要按鈕：兩端裝飾固定、中段延展 */
.btn-primary { min-width: 240px; min-height: 62px; padding: 0 22px; border: 0 solid transparent; border-width: 0 40px; border-image: var(--btn-crimson) 0 20% fill / 0 40px stretch;
  background: none; box-shadow: none; color: #f4e2b8; text-shadow: 0 2px 4px #000, 0 0 14px #d8b06a55; filter: drop-shadow(0 10px 18px #000c); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.15) drop-shadow(0 0 16px #c0403566) drop-shadow(0 10px 18px #000c); box-shadow: none; }
.btn-primary.big { min-height: 76px; border-width: 0 48px; border-image-width: 0 48px; font-size: 21px; }
.ghost-btn { min-height: 50px; padding: 0 14px; border: 0 solid transparent; border-width: 0 30px; border-image: var(--btn-dark) 0 16% fill / 0 30px stretch; background: none; color: #e2cc9e; text-shadow: 0 2px 3px #000; }
.ghost-btn:hover { background: none; filter: brightness(1.2); color: var(--gold2); }
.ghost-btn.danger { color: #f0a592; }
/* 牌桌行動按鈕 */
.act-btn { position: relative; aspect-ratio: 3.1; min-height: 0; padding: 0 12%; border: 0; box-shadow: none; background: center / 100% 100% no-repeat; color: #f1ddb2;
  font: 600 19px var(--caps); letter-spacing: 3px; text-shadow: 0 2px 3px #000, 0 0 10px #d8b06a44; filter: drop-shadow(0 8px 14px #000c); line-height: 1.15; }
.act-btn b { font: 600 17px var(--serif); color: #ffe9bd; }
.act-btn.fold, .act-btn.muck, .act-btn.call, .act-btn.raise, .act-btn.show { background-size: 100% 100%; background-position: center; background-repeat: no-repeat; border: 0; }
.act-btn:hover:not(:disabled) { filter: brightness(1.22) drop-shadow(0 0 14px #c0403555) drop-shadow(0 8px 14px #000c); }
.act-btn:disabled { filter: grayscale(.8) brightness(.6); }
.tv-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: center; }
.tv-buttons .act-btn { min-width: 0; width: 100%; letter-spacing: 2px; }
.tv-actions { width: 640px; }
.tv-buttons .act-btn { aspect-ratio: 2.8; font-size: 21px; }
.tv-actions { gap: 12px; }
/* 下注額：預設鈕、籌碼滑桿 */
.tv-sizes { gap: 8px; }
.tv-sizes > button { min-width: 72px; height: 36px; padding: 0 10px; border: 0; background: none; color: #dcc59a; font: 600 13px var(--caps); text-shadow: 0 1px 2px #000; }
.tv-sizes > button:hover:not(:disabled) { filter: brightness(1.3); }
.tv-slider { border: 0; background: none; padding: 0 4px; gap: 8px; }
.tv-step { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a2d1d, #120e0a 70%); box-shadow: 0 0 0 1px #000, 0 0 0 2px #b48d52, 0 3px 6px #000a; color: var(--gold2); font-size: 18px; line-height: 1; }
.tv-slider input { -webkit-appearance: none; appearance: none; height: 30px; background: transparent; }
.tv-slider input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(#050404, #1f1812); box-shadow: inset 0 1px 3px #000, 0 0 0 1px #6e5634, 0 1px 0 #ffffff14; }
.tv-slider input::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(#050404, #1f1812); box-shadow: inset 0 1px 3px #000, 0 0 0 1px #6e5634; }
.tv-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border: 0; border-radius: 50%; background: url('../assets/chip-black.webp') center / 100% 100%; box-shadow: 0 3px 6px #000c, 0 0 10px #c9a45f55; cursor: grab; }
.tv-slider input::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: url('../assets/chip-black.webp') center / 100% 100%; box-shadow: 0 3px 6px #000c; }
.settings .vol-slider { flex: 0 1 380px; }
.settings .vol-slider output { min-width: 72px; font-size: 16px; }
.tv-slider output { min-width: 80px; padding: 3px 10px; text-align: center; border-radius: 16px; background: linear-gradient(#1e1711, #0b0908); box-shadow: 0 0 0 1px #000, 0 0 0 2px #9a7a45, inset 0 1px 0 #ffffff14; font-size: 19px; }
/* 座位名牌 */
.tv-name { position: absolute; left: 34px; right: 34px; top: 9px; max-width: none; font-size: 17px; line-height: 28px; color: #f3e3c2; text-shadow: 0 2px 3px #000; }
.tv-stack { position: absolute; left: 50px; right: 50px; bottom: 2px; font: 700 15px/18px var(--serif); color: #ffd98f; text-shadow: 0 1px 2px #000, 0 0 8px #e0b56b66; }
.tv-stack::before { font-size: 8px; vertical-align: 1px; }
.tv-seat.hero .tv-plate { display: block; width: 236px; height: 78px; padding: 0; margin-top: 4px; }
.tv-seat.hero .tv-name { top: 11px; line-height: 32px; font-size: 18px; left: 40px; right: 40px; }
.tv-seat.hero .tv-stack { left: 68px; right: 68px; bottom: 4px; font-size: 15px; line-height: 18px; }
.tv-seat.winner .tv-plate { box-shadow: none; filter: drop-shadow(0 0 14px #e0b56baa) drop-shadow(0 6px 10px #000c); }
/* 行動標籤、下注額、底池 */
.tv-badge { min-width: 92px; padding: 5px 22px; border: 0; border-radius: 0; background: none; color: #ecd7ad; font-size: 14px; text-align: center; text-shadow: 0 1px 2px #000; }
.tv-badge.fold { filter: grayscale(.7) brightness(.8); }
.tv-bet span, .tv-pot-label { border: 0; border-radius: 14px; background: linear-gradient(#1e1711f0, #0b0908f0); box-shadow: 0 0 0 1px #000, 0 0 0 2px #9a7a45aa, 0 4px 8px #000a; }
.tv-pot-label { padding: 4px 22px; }
/* HUD、狀態、手牌紀錄 */
.tv-hud-left { padding: 0 10px; min-height: 46px; align-items: center; border: 0 solid transparent; border-width: 0 26px; border-image: var(--btn-dark) 0 14% fill / 0 26px stretch; background: none; color: #bba98a; }
.icon-btn { width: 46px; height: 46px; border: 0; background: radial-gradient(circle at 40% 35%, #3a2d1d, #110d0a 70%); box-shadow: 0 0 0 1px #000, 0 0 0 3px #b48d52, 0 0 0 4px #000, 0 6px 12px #000b; font-size: 19px; }
.icon-btn:hover { filter: brightness(1.3); }
.icon-btn[aria-pressed='true'] { box-shadow: 0 0 0 1px #000, 0 0 0 3px #e0b56b, 0 0 14px #e0b56b88; }
.tv-status { left: auto; right: 26px; bottom: 196px; width: 640px; text-align: center; font-size: 15px; color: #bca987; text-shadow: 0 2px 4px #000; }
.tv-status.turn { color: var(--gold2); animation: turn-glow 1.6s ease-in-out infinite; }
@keyframes turn-glow { 50% { text-shadow: 0 0 16px #e0b56b, 0 2px 4px #000; } }
.tv-log { display: none; top: 80px; bottom: auto; left: 26px; width: 360px; }
.tv-log.open { display: block; animation: rise .25s ease-out; }
/* 華麗面板：金色雙框、四角寶石 */
.season-card, .today, .intro-card, .queue-box, .stat-grid { position: relative; }
.modal, .season-card, .today, .tv-log, .intro-card, .tv-reveal, .lobby-me {
  border: 1px solid #8b6a3a; background: linear-gradient(160deg, #1f1813f5, #0c0a08f8);
  box-shadow: 0 0 0 1px #000, 0 0 0 4px #17110b, 0 0 0 5px #b48d5277, inset 0 0 0 1px #000, inset 0 0 0 3px #1f1710, inset 0 0 0 4px #c9a45f2e, 0 24px 60px #000d; }
.modal::before, .season-card::before, .today::before, .tv-log::before, .intro-card::before, .tv-reveal::before, .lobby-me::before {
  content: ''; position: absolute; inset: 4px; pointer-events: none; z-index: 1;
  background: var(--gem) left top / 14px no-repeat, var(--gem) right top / 14px no-repeat, var(--gem) left bottom / 14px no-repeat, var(--gem) right bottom / 14px no-repeat; }
.modal.archive-bg { background: linear-gradient(140deg, #1b1510f0, #0b0a09f5 70%), url('../assets/bg-archive.webp') center / cover; }
.modal h2::after, .queue h2::after, .intro-box h2::after, .result-place::after { content: ''; display: block; width: 320px; max-width: 100%; height: 14px; margin: 12px 0 0; background: var(--divider) center / 100% 100% no-repeat; }
.queue h2::after, .intro-box h2::after, .result-place::after, .tutorial h2::after { margin-inline: auto; }
.modal-x { width: 38px; height: 38px; right: 14px; top: 14px; border-radius: 50%; font-size: 22px; line-height: 1; background: radial-gradient(circle at 40% 35%, #3a2d1d, #110d0a 70%); box-shadow: 0 0 0 1px #000, 0 0 0 2px #b48d52; color: var(--gold2); z-index: 2; }
.stat-grid { background: #6e563466; border-color: #6e5634; }
.stat-grid > div { background: linear-gradient(#18130f, #0e0b09); }
/* 大廳 */
.lobby-nav button { min-height: 54px; padding: 0 12px; border: 0 solid transparent; border-width: 0 26px; border-image: var(--btn-dark) 0 14% fill / 0 26px stretch; background: none; }
.lobby-nav button:not(:disabled):hover { background: none; padding-left: 12px; filter: brightness(1.3); color: var(--gold2); }
.find-card { min-height: 190px; padding: 26px 110px 26px 96px; border: 0; background: none; box-shadow: none; filter: drop-shadow(0 22px 40px #000d); overflow: visible; }
.find-card::before { display: none; }
.find-card:hover { box-shadow: none; filter: brightness(1.15) drop-shadow(0 0 30px #c0403555) drop-shadow(0 22px 40px #000d); }
.find-card em { display: none; }
.lobby-me { padding: 10px 26px 10px 12px; }
.season-card, .today { padding: 22px 24px; }
/* 其他小元件 */
.lang-switch, .seg { border: 0; padding: 3px; background: linear-gradient(#17120e, #0b0908); box-shadow: 0 0 0 1px #000, 0 0 0 2px #6e5634; border-radius: 18px; }
.lang-switch button, .seg button { border-radius: 15px; }
.lang-switch button[aria-pressed='true'], .seg button[aria-pressed='true'] { background: linear-gradient(#8f2620, #4d110f); color: #fbe7c5; box-shadow: inset 0 0 0 1px #d0746366; }
.toggle { border-radius: 0; border: 0; min-height: 50px; background: none; }
.toggle, .toggle[aria-pressed='true'] { background-size: 100% 100%; background-position: center; background-repeat: no-repeat; border: 0; }
.name-row input { border: 0; border-radius: 4px; background: linear-gradient(#070605, #15110d); box-shadow: 0 0 0 1px #000, 0 0 0 2px #9a7a45, inset 0 2px 6px #000; }
.dice { border: 0; border-radius: 50%; width: 54px; height: 54px; background: radial-gradient(circle at 40% 35%, #3a2d1d, #110d0a 70%); box-shadow: 0 0 0 1px #000, 0 0 0 3px #b48d52; }
.intro-card { border: 1px solid #8b6a3a; }
.intro-card.rival { border-color: #c0503c; box-shadow: 0 0 0 1px #000, 0 0 0 4px #17110b, 0 0 0 5px #d0584488, 0 0 36px #a0302866; }
.tv-reveal { padding: 22px 26px 26px; }
.tv-reveal div { align-items: center; }
.result-rows > div { border-bottom: 0; background: var(--divider) bottom / 100% 10px no-repeat; padding-bottom: 16px; }
/* 直式 */
body.portrait .tv-status { left: 20px; right: 20px; width: auto; bottom: 232px; transform: none; font-size: 18px; }
body.portrait .act-btn { min-height: 0; font-size: 25px; }
body.portrait .act-btn b { font-size: 23px; }
body.portrait .tv-sizes > button { min-width: 110px; height: 48px; font-size: 16px; }
body.portrait .tv-log { left: 20px; right: 20px; width: auto; top: 90px; }

/* ══ 按鈕系統：自繪 SVG 牌匾（尖角六邊形、金框、內細線、端點寶石）。端蓋固定比例，中段水平延展。 ══ */
:root { --text-gold: linear-gradient(180deg, #fff7de 0%, #f1d38e 40%, #b98b3f 54%, #f4dca4 100%); }
.act-btn, .btn-primary, .ghost-btn, .toggle, .tv-sizes > button, .lobby-nav button, .tv-badge {
  --h: 56px; --frame: var(--btn-dark); --pl: var(--dark-l); --pm: var(--dark-m); --pr: var(--dark-r);
  box-sizing: border-box; height: var(--h); min-height: 0; min-width: 0; aspect-ratio: auto; border-radius: 0; box-shadow: none;
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap));
  border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch;
  padding: 0 2px; display: inline-flex; align-items: center; justify-content: center; gap: .35em;
  background: none; color: #f0d292; text-shadow: 0 1px 0 #000, 0 2px 3px #000c, 0 0 12px #e0b56b40;
  font: 600 calc(var(--h) * .3) var(--caps); letter-spacing: .1em; text-transform: uppercase; line-height: 1.1;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 6px 10px #000c); transition: filter .15s, transform .12s; white-space: nowrap; }
.act-btn:hover:not(:disabled), .btn-primary:hover, .ghost-btn:hover, .toggle:hover, .tv-sizes > button:hover:not(:disabled), .lobby-nav button:not(:disabled):hover {
  transform: translateY(-1px); filter: brightness(1.2) drop-shadow(0 0 10px #e0b56b55) drop-shadow(0 6px 10px #000c); }
.act-btn:active:not(:disabled), .btn-primary:active, .ghost-btn:active, .tv-sizes > button:active { transform: translateY(1px) scale(.985); }
.act-btn:disabled, .tv-sizes > button:disabled { filter: grayscale(.9) brightness(.5); transform: none; }
/* 款式 */
.act-btn.fold, .act-btn.muck, .ghost-btn.ghost-btn, .tv-sizes > button, .tv-badge.tv-badge { --frame: var(--btn-dark); --pl: var(--dark-l); --pm: var(--dark-m); --pr: var(--dark-r); background: none; color: #e9cf98; border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch; }
.act-btn.call, .tv-badge.check, .tv-badge.call { --frame: var(--btn-gold); --pl: var(--dark-l); --pm: var(--dark-m); --pr: var(--dark-r); background: none; color: #ffe7b0; border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch; }
.act-btn.raise, .act-btn.show, .btn-primary.btn-primary, .toggle[aria-pressed='true'], .tv-badge.raise, .tv-badge.bet, .lobby-nav button[data-nav="find"] {
  --frame: var(--btn-crimson); --pl: var(--red-l); --pm: var(--red-m); --pr: var(--red-r); background: none; color: #fff0cf; border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch; }
.act-btn.raise.allin, .tv-badge.allin { --frame: var(--btn-allin); --pl: var(--red-l); --pm: var(--red-m); --pr: var(--red-r); background: none; color: #fffaf0; border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch; animation: ember 1.4s ease-in-out infinite; }
@keyframes ember { 50% { filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 14px #ff5a3caa) drop-shadow(0 6px 10px #000c); } }
.toggle.toggle { --frame: var(--btn-dark); --pl: var(--dark-l); --pm: var(--dark-m); --pr: var(--dark-r); background: none; color: #e9cf98; border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch; }
.toggle[aria-pressed='true'] { color: #fff0cf; }
.ghost-btn.danger { color: #f2a18c; }
/* 尺寸 */
.tv-buttons .act-btn { --h: 66px; aspect-ratio: auto; width: 100%; flex-direction: column; gap: 1px; font-size: 20px; letter-spacing: .12em; }
.act-btn b { display: block; font: 700 18px var(--serif); letter-spacing: .04em; }
.tv-reveal .act-btn { --h: 60px; width: 100%; font-size: 18px; }
.tut-visual.buttons .act-btn { --h: 58px; min-width: 190px; font-size: 17px; }
.btn-primary { --h: 60px; min-width: 250px; padding: 0 14px; font-size: 18px; }
.btn-primary.big { --h: 74px; font-size: 22px; min-width: 320px; }
.ghost-btn { --h: 50px; padding: 0 8px; font-size: 14px; min-width: 150px; }
.toggle { --h: 52px; font-size: 15px; letter-spacing: .04em; text-transform: none; }
.tv-sizes > button { --h: 38px; min-width: 88px; font-size: 13px; letter-spacing: .04em; padding: 0; }
.tv-badge { --h: 30px; min-width: 0; padding: 0 2px; font: 600 13px var(--tc); letter-spacing: .04em; text-transform: none; filter: drop-shadow(0 1px 0 #000) drop-shadow(0 4px 6px #000b); }
.tv-badge.fold { filter: grayscale(.8) brightness(.75); }
.lobby-nav button { --h: 54px; display: grid; justify-content: stretch; text-align: left; padding: 0 6px; font-size: 16px; letter-spacing: .14em; }
.lobby-nav button i { color: #e7c77f; }
.lobby-nav button small { color: #8c7d65; text-shadow: none; }
.tv-hud-left { --h: 46px; --frame: var(--btn-slim); --pl: var(--slim-l); --pm: var(--slim-m); --pr: var(--slim-r); --slice: 44; --cap: .256; border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch; min-height: 46px; height: 46px; }
/* 尋找牌桌卡：酒紅漆面雙金框 */
.find-card { padding: 30px 40px; border: 1px solid #c9a45f; background: radial-gradient(ellipse at 30% 0%, #ffffff14, transparent 60%), linear-gradient(160deg, #7c1814, #3a0806 70%);
  box-shadow: 0 0 0 1px #000, 0 0 0 4px #1c0b08, 0 0 0 5px #e0b56b, 0 0 0 6px #000, inset 0 0 0 1px #000, inset 0 0 0 4px #5a0f0c, inset 0 0 0 5px #f0cf8666, 0 26px 60px #000d; filter: none; }
.find-card::before { display: block; inset: 5px; background: var(--gem) left top / 16px no-repeat, var(--gem) right top / 16px no-repeat, var(--gem) left bottom / 16px no-repeat, var(--gem) right bottom / 16px no-repeat; transform: none; animation: none; }
.find-card:hover { filter: brightness(1.12); box-shadow: 0 0 0 1px #000, 0 0 0 4px #1c0b08, 0 0 0 5px #ffe3a0, 0 0 0 6px #000, inset 0 0 0 1px #000, inset 0 0 0 4px #5a0f0c, inset 0 0 0 5px #f0cf86aa, 0 0 40px #c0403555, 0 26px 60px #000d; }
.find-card b { color: #f6e0ac; text-shadow: 0 2px 4px #000, 0 0 18px #e0b56b55; }
/* 直式 */
body.portrait .tv-buttons .act-btn { --h: 96px; font-size: 27px; }
body.portrait .tv-buttons .act-btn b { font-size: 24px; }
body.portrait .tv-sizes > button { --h: 50px; min-width: 112px; font-size: 16px; }
body.portrait .tv-reveal .act-btn { --h: 84px; font-size: 24px; }
body.portrait .lobby-nav button { --h: 60px; }
.tv-actions { grid-template-columns: minmax(0, 1fr); }
.tv-sizes { min-width: 0; }
.tv-slider { min-width: 0; flex: 1 1 0; }
.tv-slider input { min-width: 0; width: 100%; flex: 1 1 0; }

/* ══ 間距與溢出修正：所有文字都留在元件內，並與邊框保持距離 ══ */
/* 名牌：名字用黑漆牌匾，籌碼用金框小膠囊 */
.tv-plate { position: static; width: auto; height: auto; margin-top: 6px; padding: 0; border: 0; background: none; box-shadow: none; filter: none; display: grid; justify-items: center; }
.tv-name.tv-name { --h: 34px; position: static; box-sizing: border-box; height: var(--h); max-width: 196px; padding: 0 6px;
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--h) * var(--cap)); border-image: var(--frame) 0 var(--slice) fill / 0 calc(var(--h) * var(--cap)) stretch;
  display: block; line-height: var(--h); font-size: 16px; letter-spacing: 1.5px; color: #f3e3c2; text-shadow: 0 1px 0 #000, 0 2px 3px #000c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: drop-shadow(0 4px 6px #000b); }
.tv-stack.tv-stack { position: relative; left: auto; right: auto; bottom: auto; margin-top: -3px; padding: 3px 14px 4px; border-radius: 14px; z-index: 1;
  background: linear-gradient(#1e1711, #0b0908); box-shadow: 0 0 0 1px #000, 0 0 0 2px #b48d52, 0 4px 8px #000a;
  font: 700 15px/18px var(--serif); color: #ffd98f; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.tv-seat.hero .tv-plate { display: grid; width: auto; height: auto; padding: 0; margin-top: 6px; }
.tv-seat.hero .tv-name.tv-name { --h: 40px; font-size: 18px; max-width: 230px; padding: 0 8px; }
.tv-seat.hero .tv-stack.tv-stack { font-size: 16px; padding: 3px 16px 4px; }
.tv-seat.winner .tv-plate { filter: none; }
.tv-seat.winner .tv-name { filter: drop-shadow(0 0 10px #e0b56baa) drop-shadow(0 4px 6px #000b); }
.tv-seat.winner .tv-stack.tv-stack { box-shadow: 0 0 0 1px #000, 0 0 0 2px #ffe3a0, 0 0 14px #e0b56b88; }
/* 頂端座位的行動標籤放在頭像左側 */
.tv-seat.top .tv-badge { top: 34px; right: 164px; }
/* 行動按鈕：加高，兩行字不貼金線 */
.tv-buttons .act-btn { --h: 74px; font-size: 18px; gap: 3px; }
.tv-buttons .act-btn b { font-size: 16px; }
body.portrait .tv-buttons .act-btn { --h: 104px; font-size: 25px; gap: 4px; }
body.portrait .tv-buttons .act-btn b { font-size: 22px; }
.tv-status { bottom: 198px; }   /* 牌型標籤換牌型時先放大到 1.35 倍，和狀態文字要留 6px */
body.portrait .tv-status { bottom: 214px; font-size: 17px; }
/* 大廳選單：鎖定說明與標題同一行 */
.lobby-nav button { grid-template-columns: 34px 1fr auto; align-items: center; gap: 0 6px; }
.lobby-nav button small { grid-column: 3; grid-row: 1; font-size: 11px; letter-spacing: 0; white-space: nowrap; }
body.portrait .lobby-nav button small { font-size: 12px; }
/* 開桌介紹卡片 */
.intro-card { padding: 24px 22px 22px; }
.intro-card small { line-height: 1.6; }
/* 亮牌面板 */
.tv-reveal { padding: 30px 34px 30px; }
.tv-reveal-q { margin-bottom: 16px !important; }
.tv-reveal .act-btn { font-size: 17px; letter-spacing: .08em; }
/* 手牌紀錄：橫式放左下角空白處，內距加大 */
.tv-log { padding: 22px 30px 22px; }
.tv-log.open { top: auto; bottom: 22px; }
.tv-log ol { height: auto; max-height: 190px; }
body.portrait .tv-log.open { top: 92px; bottom: auto; }
/* 小元件內距 */
.tv-ai { padding: 3px 7px; line-height: 1.2; }
.tv-bet span { padding: 3px 12px 4px; }
.tag { padding: 3px 10px; }
.settings .set-row { padding: 14px 8px; }
.card.face .c-rank { top: 6px; left: 9px; }
.card.face .c-suit { left: 11px; top: 38px; }
.card.face .c-pip { right: 10px; bottom: 9px; }
.tv-cards .card.face .c-rank { left: 6px; top: 4px; } .tv-cards .card.face .c-suit { left: 7px; top: 25px; } .tv-cards .card.face .c-pip { right: 6px; bottom: 5px; }
.tv-cards.hero-hand .card.face .c-rank { left: 10px; top: 6px; } .tv-cards.hero-hand .card.face .c-suit { left: 12px; top: 42px; } .tv-cards.hero-hand .card.face .c-pip { right: 10px; bottom: 9px; }
.shown .card .c-rank, .hand-row .card .c-rank { left: 5px; top: 3px; } .shown .card .c-pip, .hand-row .card .c-pip { right: 5px; bottom: 4px; }
.find-ace .card .c-rank { left: 8px; top: 5px; } .find-ace .card .c-pip { right: 8px; bottom: 7px; }
.tv-seat.hero .tv-stack.tv-stack { left: auto; right: auto; bottom: auto; margin-top: -3px; line-height: 20px; }
.tv-reveal.tv-reveal { background: linear-gradient(160deg, #1f1813, #0c0a08); }

/* ══ 使用者素材整合：無文字按鈕底板、空白牌面、牌桌外框、視窗框、皮革與紙張材質、徽章 ══ */
:root {
  --btn-dark: url('../assets/ui/plate-dark.webp'); --btn-slim: url('../assets/ui/plate-slim.webp');
  --btn-crimson: url('../assets/ui/plate-red.webp'); --btn-gold: url('../assets/ui/plate-dark.webp'); --btn-allin: url('../assets/ui/plate-red.webp');
  --leather: linear-gradient(160deg, #1c1510e6, #0b0908f0), url('../assets/ui/tex-leather.webp') center / 420px;
}
/* 按鈕底板：黑色高款（預設）、黑色細款（小元件）、紅色（主要）；端蓋比例依素材量測 */
.act-btn, .btn-primary, .ghost-btn, .toggle, .tv-sizes > button, .lobby-nav button, .tv-badge, .tv-name { --slice: 48; --cap: .2; }
.ghost-btn.ghost-btn, .tv-sizes > button, .tv-badge.tv-badge, .lobby-nav button, .toggle.toggle, .tv-name.tv-name { --frame: var(--btn-slim); --pl: var(--slim-l); --pm: var(--slim-m); --pr: var(--slim-r); --slice: 44; --cap: .256; }
.act-btn.raise, .act-btn.show, .btn-primary.btn-primary, .toggle.toggle[aria-pressed='true'], .lobby-nav button[data-nav="find"], .tv-badge.raise.raise, .tv-badge.bet.bet, .act-btn.raise.allin, .tv-badge.allin.allin { --frame: var(--btn-crimson); --pl: var(--red-l); --pm: var(--red-m); --pr: var(--red-r); --slice: 64; --cap: .335; }
.act-btn.call { color: #ffe3a0; text-shadow: 0 1px 0 #000, 0 2px 3px #000c, 0 0 14px #e0b56b88; }
.act-btn.raise.allin { filter: drop-shadow(0 0 12px #ff5a3c99) drop-shadow(0 6px 10px #000c); }
.act-btn, .btn-primary, .ghost-btn, .toggle, .tv-sizes > button, .lobby-nav button { padding-inline: 8px; }
/* 撲克牌：空白牌面素材 */
.card.face { background: url('../assets/ui/card-face.webp') center / 100% 100% no-repeat; box-shadow: 0 5px 12px #0009; border-radius: 7px; }
.card.face .c-rank { left: 15%; top: 8%; }
.card.face .c-suit { left: 16%; top: 33%; }
.card.face .c-pip { right: 14%; bottom: 9%; }
.tv-cards .card.face .c-rank { left: 14%; top: 6%; } .tv-cards .card.face .c-suit { left: 15%; top: 36%; } .tv-cards .card.face .c-pip { right: 13%; bottom: 7%; }
.tv-cards.hero-hand .card.face .c-rank { left: 15%; top: 7%; } .tv-cards.hero-hand .card.face .c-suit { left: 16%; top: 33%; } .tv-cards.hero-hand .card.face .c-pip { right: 14%; bottom: 8%; }
.shown .card .c-rank, .hand-row .card .c-rank { left: 15%; top: 5%; } .shown .card .c-suit, .hand-row .card .c-suit { left: 16%; top: 36%; } .shown .card .c-pip, .hand-row .card .c-pip { right: 13%; bottom: 6%; }
.find-ace .card .c-rank { left: 15%; top: 7%; } .find-ace .card .c-pip { right: 14%; bottom: 8%; }
/* 牌背：13 款 */
.card.back.back-blackred { background-image: url('../assets/backs/blackred.webp'); } .card.back.back-ruby { background-image: url('../assets/backs/ruby.webp'); }
.card.back.back-phoenix { background-image: url('../assets/backs/phoenix.webp'); } .card.back.back-serpent { background-image: url('../assets/backs/serpent.webp'); }
.card.back.back-cream { background-image: url('../assets/backs/cream.webp'); } .card.back.back-navy { background-image: url('../assets/backs/navy.webp'); }
.card.back.back-emerald { background-image: url('../assets/backs/emerald.webp'); } .card.back.back-gear { background-image: url('../assets/backs/gear.webp'); }
.card.back.back-amethyst { background-image: url('../assets/backs/amethyst.webp'); } .card.back.back-silver { background-image: url('../assets/backs/silver.webp'); }
.card.back { background-size: 100% 100%; background-color: #120e0b; border: 0; box-shadow: 0 5px 12px #000a; }
.back-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.back-grid .back-choice { padding: 8px 6px; }
.back-grid .back-choice .card { width: 44px; height: 64px; margin: 0 auto; }
.back-grid.small { grid-template-columns: repeat(7, 48px); gap: 6px; }
.back-grid.small .card { width: 34px; height: 50px; }
.back-name { margin: 8px 0 0; color: var(--gold2); font: 15px var(--tc); letter-spacing: 2px; }
body.portrait .back-grid { grid-template-columns: repeat(7, 1fr); }
/* 牌桌：完整牌桌外框素材（橫式九宮格延展，直式使用旋轉版） */
.tv-table { border: 0 solid transparent; border-width: 60px 260px; border-image: url('../assets/ui/table.webp') 90 392 fill / 60px 260px stretch; filter: drop-shadow(0 40px 60px #000e); }
.tv-rail, .tv-felt-line { display: none; }
.tv-felt { inset: -30px -200px; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.tv-felt::before { display: none; }
.tv-felt-mark { top: 270px; color: #e0bc7c24; }
body.portrait .tv-table { border-width: 0; border-image: none; background: url('../assets/ui/table-portrait.webp') center / 100% 100% no-repeat; }
body.portrait .tv-felt { inset: 0; }
body.portrait .tv-felt-mark { top: 820px; }
/* 視窗與面板：通用視窗框（九宮格）＋黑皮革 */
.modal { border: 42px solid transparent; border-image: url('../assets/ui/window.webp') 70 / 42px stretch; background: var(--leather); background-clip: padding-box; box-shadow: none; padding: 6px 12px 10px; filter: drop-shadow(0 30px 60px #000e); }
.modal::before, .today::before, .tv-log::before, .tv-reveal::before, .lobby-me::before, .find-card::before { display: none; }
.modal.archive-bg { background: linear-gradient(140deg, #1b1510ee, #0b0a09f5 70%), url('../assets/bg-archive.webp') center / cover; background-clip: padding-box; }
.modal-x { right: -22px; top: -22px; }
.today, .tv-log, .tv-reveal, .lobby-me { border: 26px solid transparent; border-image: url('../assets/ui/window.webp') 70 / 26px stretch; background: var(--leather); background-clip: padding-box; box-shadow: none; filter: drop-shadow(0 20px 40px #000d); }
.today { padding: 2px 8px 6px; } .tv-log { padding: 2px 10px 4px; } .tv-reveal { padding: 4px 10px 8px; } .lobby-me { padding: 0 14px 0 2px; }
.tv-reveal.tv-reveal { background: var(--leather); background-clip: padding-box; }
/* 大廳賽季卡：橫式資訊面板 */
.season-card { border: 0; background: url('../assets/ui/info-panel.webp') center / 100% 100% no-repeat; box-shadow: none; padding: 34px 44px; min-height: 140px; filter: drop-shadow(0 16px 30px #000c); }
.season-card::before { display: none; }
/* 開桌介紹卡片：直式物品框 */
.intro-card, .intro-card.rival { border: 0; box-shadow: none; background: url('../assets/ui/item-frame.webp') center / 100% 100% no-repeat, radial-gradient(ellipse at 50% 30%, #2a2018, #0c0a08 75%); padding: 34px 26px 30px; min-height: 330px; }
.intro-card::before { display: none; }
.intro-card.rival { filter: drop-shadow(0 0 20px #c0403566); }
.intro-badge { width: 54px; margin: -30px 0 -6px; position: relative; z-index: 2; filter: drop-shadow(0 4px 6px #000); }
body.portrait .intro-card { min-height: 360px; }
/* 宿敵畫面：宿敵徽章 */
.rival-art { width: 150px; margin: 0 0 -6px; }
/* 結算：勝利／失敗底板、徽章 */
.result-art { width: 180px; }
.result-place { display: grid; place-items: center; width: 620px; margin: 0 auto 18px; font-size: 56px; }
.result-place.victory { aspect-ratio: 900 / 398; background: url('../assets/ui/plate-victory.webp') center / 100% 100% no-repeat; }
.result-place.victory span { transform: translateY(12%); }
.result-place.defeat { width: 560px; aspect-ratio: 900 / 483; background: url('../assets/ui/plate-defeat.webp') center / 100% 100% no-repeat; }
.result-place::after { display: none; }
.result-rows .record dt { display: flex; align-items: center; gap: 8px; }
.result-rows .record img { width: 34px; }
/* 成就徽章 */
.badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.badge { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; text-align: center; background: #0e0b09aa; border-radius: 6px; box-shadow: inset 0 0 0 1px #6e563455; }
.badge img { width: 78px; filter: grayscale(1) brightness(.45); }
.badge span { font-size: 13px; color: #8c7d65; }
.badge small { font-size: 11px; color: #6f6452; min-height: 14px; }
.badge.on img { filter: drop-shadow(0 4px 10px #000) drop-shadow(0 0 12px #e0b56b44); }
.badge.on span { color: var(--gold2); }
/* 頭像框 */
.framed { position: relative; width: 300px; }
.framed::after { content: ''; position: absolute; inset: -18px; background: url('../assets/ui/frame-basic.webp') center / 100% 100% no-repeat; pointer-events: none; }
.framed.achievement::after { inset: -30px -22px -18px; background-image: url('../assets/ui/frame-achievement.webp'); }
body.portrait .framed { width: 100%; }
/* 私人筆記：舊紙張 */
.note-card { background: radial-gradient(ellipse at center, transparent 55%, #6b4a2244 100%), url('../assets/ui/tex-paper.webp') center / cover; }
/* 教學文字：劇情對話框 */
.tut p { max-width: 640px; min-height: 150px; margin: 20px auto 0; padding: 44px 48px 30px; display: grid; place-items: center; color: #2d241a; font-size: 17px; background: url('../assets/ui/dialog.webp') center / 100% 100% no-repeat; }
/* 載入與配桌：沙漏 */
.boot-hourglass { width: 92px; margin-top: -6px; animation: hourglass 3.6s ease-in-out infinite; filter: drop-shadow(0 8px 16px #000); }
@keyframes hourglass { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
.queue-seal.hourglass { width: 130px; height: 156px; background-image: url('../assets/ui/hourglass.webp'); animation: hourglass 3.6s ease-in-out infinite; }
body[data-motion='off'] .boot-hourglass, body[data-motion='off'] .queue-seal.hourglass { animation: none; }

/* ══ 生動化：光線、粒子、視差、按壓手感 ══ */
@property --sx { syntax: '<length>'; inherits: false; initial-value: 800px; }
@property --sy { syntax: '<length>'; inherits: false; initial-value: 300px; }
/* 粒子層 */
.juice-layer { position: absolute; inset: 0; z-index: 95; pointer-events: none; overflow: clip; }
.spark { position: absolute; border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, var(--c) 45%, transparent 72%); box-shadow: 0 0 6px var(--c), 0 0 14px var(--c); }
.ring { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid var(--c); box-shadow: 0 0 16px var(--c), inset 0 0 10px var(--c); }
/* 跟隨游標的暖光（偶爾像燈泡一樣閃一下） */
.cursor-light { position: absolute; inset: 0; z-index: 55; pointer-events: none; background: radial-gradient(460px circle at var(--lx, 50%) var(--ly, 30%), #ffcf8a24, #ffcf8a08 45%, transparent 70%); mix-blend-mode: screen; animation: lamp 8s infinite; }
@keyframes lamp { 0%, 41%, 45%, 100% { opacity: 1; } 42% { opacity: .55; } 43% { opacity: .9; } 44% { opacity: .6; } 72% { opacity: .85; } }
body[data-motion='off'] .cursor-light, body[data-motion='reduced'] .cursor-light { display: none; }
/* 視差：背景往反方向、前景跟著微動 */
.lobby-art { inset: -26px; }
.title-art, .lobby-art, .tv-room { translate: calc(var(--mx, 0) * -20px) calc(var(--my, 0) * -13px); }
.title-center, .lobby-center { translate: calc(var(--mx, 0) * 7px) calc(var(--my, 0) * 5px); }
.lobby-chandelier, .tv-lamp, .title-glow { translate: calc(var(--mx, 0) * -10px) calc(var(--my, 0) * -4px); }
.create-portrait { translate: calc(var(--mx, 0) * -14px) calc(var(--my, 0) * -10px); inset: -20px; }
/* 按鈕手感：按下下沉、放開回彈；滑過時一道光掃過牌面 */
.act-btn, .btn-primary, .ghost-btn, .toggle, .tv-sizes > button, .lobby-nav button, .icon-btn, .look-choice, .back-choice, .modal-x, .lang-switch button, .seg button, .person, .lb-row, .chip-tag, .dice, .tv-step, .self-left nav button {
  position: relative; transition: transform .16s cubic-bezier(.3, 1.8, .5, 1), filter .18s, box-shadow .18s; }
.act-btn:active:not(:disabled), .btn-primary:active, .ghost-btn:active, .toggle:active, .tv-sizes > button:active:not(:disabled), .lobby-nav button:active:not(:disabled), .icon-btn:active, .look-choice:active, .back-choice:active, .modal-x:active, .dice:active, .tv-step:active, .person:active, .lb-row:active,
.is-pressed.is-pressed { transform: translateY(3px) scale(.95) !important; filter: brightness(.72) saturate(1.25) drop-shadow(0 1px 2px #000) !important; transition-duration: .04s !important; }
.act-btn::after, .btn-primary::after, .ghost-btn::after, .toggle::after, .tv-sizes > button::after, .lobby-nav button::after {
  /* 掃光蓋滿按鈕的 border-box：牌匾兩端畫在左右邊框區，所以左右用負值延伸進去（邊框寬度會被取整到整數 px，這裡同樣取整）。 */
  content: ''; position: absolute; inset: 0 calc(var(--bw, 0px) * -1); inset: 0 calc(round(down, var(--bw, 0px), 1px) * -1); pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 30%, #fff1cc66 47%, #fff1cc22 53%, transparent 70%) no-repeat; background-size: 260% 100%; background-position: 140% 0; mix-blend-mode: screen;
  /* 以牌匾本身的三段切片當遮罩，位置與尺寸和背景一致：光只落在牌匾有畫的地方 */
  -webkit-mask: var(--pl) left center / auto 100% no-repeat, var(--pr) right center / auto 100% no-repeat, var(--pm) center / calc(100% - var(--bw) * 2 + 2px) 100% no-repeat;
  mask: var(--pl) left center / auto 100% no-repeat, var(--pr) right center / auto 100% no-repeat, var(--pm) center / calc(100% - var(--bw) * 2 + 2px) 100% no-repeat; }
.act-btn:hover:not(:disabled)::after, .btn-primary:hover::after, .ghost-btn:hover::after, .toggle:hover::after, .tv-sizes > button:hover:not(:disabled)::after, .lobby-nav button:not(:disabled):hover::after { animation: sheen-btn .75s ease-out; }
@keyframes sheen-btn { 0% { opacity: 1; background-position: 140% 0; } 100% { opacity: 1; background-position: -40% 0; } }
.btn-primary:hover, .act-btn:hover:not(:disabled) { filter: brightness(1.18) drop-shadow(0 0 16px #e0b56b55) drop-shadow(0 6px 10px #000c); }
/* 鍵盤焦點：造型牌匾不畫方形外框，改成沿牌匾外形的金色描邊與光暈 */
.act-btn:focus-visible, .btn-primary:focus-visible, .ghost-btn:focus-visible, .toggle:focus-visible, .tv-sizes > button:focus-visible, .lobby-nav button:focus-visible {
  outline: none; filter: drop-shadow(0 0 1px #ffe3a0) drop-shadow(0 0 1px #ffe3a0) drop-shadow(0 0 9px #e0b56bcc) drop-shadow(0 6px 10px #000c); }
/* 輪到你：行動列依序彈出，加注鈕呼吸發光 */
.tv-actions:not([hidden]) .act-btn { animation: pop-in .38s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.tv-actions:not([hidden]) .act-btn:nth-child(2) { animation-delay: .06s; } .tv-actions:not([hidden]) .act-btn:nth-child(3) { animation-delay: .12s; }
@keyframes pop-in { from { opacity: 0; transform: translateY(26px) scale(.85); } }
.tv-actions:not([hidden]) .act-btn.raise:not(.allin) { animation: pop-in .38s .12s cubic-bezier(.2, 1.6, .4, 1) backwards, ready 2.6s .6s ease-in-out infinite; }
@keyframes ready { 50% { filter: brightness(1.12) drop-shadow(0 0 18px #ff7a4a66) drop-shadow(0 6px 10px #000c); } }
/* 聚光燈：跟著正在行動的人移動 */
.tv-spot { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(250px circle at var(--sx) var(--sy), #ffd9a030, #ffd9a00c 55%, transparent 72%);
  transition: --sx .7s cubic-bezier(.4, 0, .2, 1), --sy .7s cubic-bezier(.4, 0, .2, 1); }
.tv-spot.mine { background: radial-gradient(320px circle at var(--sx) var(--sy), #ffdca040, #ffd9a010 55%, transparent 72%); }
/* 倒數最後 5 秒 */
.tv-seat.hurry .tv-timer circle { stroke: #ff5a3c; filter: drop-shadow(0 0 8px #ff3a1c); }
.tv-seat.hurry .tv-avatar { animation: hurry .45s ease-in-out infinite alternate; }
@keyframes hurry { to { transform: scale(1.05); } }
/* 頭像呼吸 */
.tv-seat:not(.folded):not(.out) .tv-portrait { animation: breathe-p 6s ease-in-out infinite; }
.tv-seat:nth-child(2n) .tv-portrait { animation-delay: -2s; } .tv-seat:nth-child(3n) .tv-portrait { animation-delay: -4s; }
@keyframes breathe-p { 50% { transform: scale(1.035); filter: saturate(.9) brightness(1.06); } }
/* 你的手牌：滑鼠移上去時抬起展開 */
.tv-cards.hero-hand { pointer-events: auto; }
.tv-cards.hero-hand .card { transition: transform .28s cubic-bezier(.2, 1.4, .4, 1), box-shadow .28s; }
.tv-cards.hero-hand:hover .card:first-child { transform: rotate(-10deg) translate(-12px, -20px); box-shadow: 0 16px 24px #000c, 0 0 20px #e0b56b44; }
.tv-cards.hero-hand:hover .card:nth-child(2) { transform: rotate(10deg) translate(12px, -20px); box-shadow: 0 16px 24px #000c, 0 0 20px #e0b56b44; }
/* 翻牌時閃過一道光 */
.card.face.shine::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, #ffffffb0 47%, #fff8e040 53%, transparent 66%) no-repeat; background-size: 260% 100%; animation: card-shine .9s ease-out forwards; }
@keyframes card-shine { from { background-position: 140% 0; } to { background-position: -50% 0; opacity: 0; } }
.card.face { overflow: hidden; }
/* 大廳進場：選單依序滑入、側欄從右滑入、標題展開 */
.lobby-nav button { animation: nav-in .6s calc(.18s + var(--i, 7) * 70ms) cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes nav-in { from { opacity: 0; transform: translateX(-46px); } }
.lobby-side > * { animation: side-in .75s .3s cubic-bezier(.2, .8, .2, 1) backwards; } .lobby-side > *:nth-child(2) { animation-delay: .42s; }
@keyframes side-in { from { opacity: 0; transform: translateX(50px); } }
.lobby-center h1.metal-title { animation: title-in 1.3s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes title-in { from { opacity: 0; letter-spacing: 28px; filter: blur(8px); } }
.lobby-center > p { animation: rise 1s .25s backwards; }
.lobby-me { animation: rise .8s .5s backwards; }
/* 尋找牌桌：紅色底板、跟著游標傾斜並反光、待機呼吸光 */
.find-card { --h: 190px; border: 0 solid transparent; border-width: 0 64px; border-image: var(--btn-crimson) 0 64 fill / 0 64px stretch; background: none; box-shadow: none;
  padding: 20px 26px; transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .3s;
  animation: rise .8s .35s backwards, find-glow 3.2s 1.2s ease-in-out infinite; }
.find-card.tilting { transition: transform .06s linear, filter .3s; }
.find-card:hover { box-shadow: none; filter: brightness(1.12) drop-shadow(0 0 30px #c0403566) drop-shadow(0 22px 40px #000d); }
@keyframes find-glow { 50% { filter: drop-shadow(0 0 26px #d0503e55) drop-shadow(0 22px 40px #000d); } }
.find-card .glare, .season-card::after, .intro-card::after { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: screen; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), #ffe6b040, transparent 48%); }
.season-card::after, .intro-card::after { content: ''; }
.find-card.tilting .glare, .season-card.tilting::after, .intro-card.tilting::after { opacity: 1; }
.season-card, .intro-card { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.season-card.tilting, .intro-card.tilting { transition: transform .06s linear; }
body.portrait .find-card { --h: 170px; }
/* 標題 Logo：一道光沿著字形掃過 */
.logo-shine { position: relative; width: 760px; }
.logo-shine::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url('../assets/logo.webp') center / 100% 100% no-repeat; mask: url('../assets/logo.webp') center / 100% 100% no-repeat;
  background: linear-gradient(110deg, transparent 38%, #fff6dcdd 50%, transparent 62%) no-repeat; background-size: 300% 100%; background-position: 150% 0;
  animation: logo-sheen 5.5s 1.8s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes logo-sheen { 0% { background-position: 150% 0; } 35%, 100% { background-position: -50% 0; } }
.logo-shine .title-logo { width: 100%; display: block; }
body.portrait .logo-shine { width: 800px; }
body[data-motion='off'] *, body[data-motion='off'] *::before, body[data-motion='off'] *::after { animation: none !important; transition: none !important; }
.season-card { padding: 30px 36px; gap: 14px; }
.season-card small { font-size: 12px; white-space: nowrap; }
.modal.settings { width: 780px; }
.settings .set-row { padding: 9px 8px; }
.settings h2 { margin-bottom: 6px; }
body.portrait .modal { max-height: 1480px; }
body.portrait .self-portrait { height: 320px; }
body.portrait .badge img { width: 64px; }
/* 牌桌外框：洞與分隔金條都放進等比縮放的端蓋，只延展兩洞之間的純皮革段，洞不再變形 */
.tv-table { border-width: 60px 338px; border-image: url('../assets/ui/table.webp') 90 510 fill / 60px 338px stretch; }
.tv-felt { inset: -30px -310px; }
body.portrait .tv-table { left: 100px; width: 700px; border: 0 solid transparent; border-width: 456px 80px; background: none;
  border-image: url('../assets/ui/table-portrait.webp') 513 90 fill / 456px 80px stretch; }
body.portrait .tv-felt { inset: -420px -50px; }
body.portrait .tv-felt-mark { top: 700px; }

/* ══ 金屬浮雕標題：與 Logo 同質感（深色描邊、銀灰漆面、錘紋、細亮倒角、掃光） ══ */
.metal-title { position: relative; isolation: isolate; font-family: var(--caps); font-weight: 700; color: #d9ccb3; text-shadow: none; }
.metal-title::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; pointer-events: none;
  color: #0a0705; -webkit-text-stroke: .055em #0a0705; text-shadow: 0 .035em 0 #0a0705, 0 .15em .26em #000d; }
.metal-title .face { color: transparent; text-shadow: none; -webkit-text-stroke: .009em #fff3d855;
  background: linear-gradient(100deg, transparent 42%, #fff8e6 50%, transparent 58%) 160% 0 / 250% 100% no-repeat,
    url('../assets/ui/tex-metal.webp') center / 190px,
    linear-gradient(180deg, #fbf7ee 0%, #ddd2bd 22%, #a89b83 40%, #554c3f 51%, #7d715d 60%, #cdbf9f 82%, #f6ecd4 100%);
  background-blend-mode: overlay, soft-light, normal; -webkit-background-clip: text; background-clip: text;
  animation: metal-sheen 7s 1.6s ease-in-out infinite; }
.metal-title .ember { color: transparent; -webkit-text-stroke: .009em #ffc0a855;
  background: url('../assets/ui/tex-metal.webp') center / 190px, linear-gradient(180deg, #ff8f78 0%, #d0342a 30%, #7a0e0a 52%, #9d1d16 66%, #e85a45 100%);
  background-blend-mode: overlay, normal; -webkit-background-clip: text; background-clip: text; }
@keyframes metal-sheen { 0% { background-position: 160% 0, center, 0 0; } 30%, 100% { background-position: -60% 0, center, 0 0; } }
/* 大廳標題 */
.lobby-center h1.metal-title { font-weight: 700; font-size: 72px; line-height: 1.1; letter-spacing: .04em; white-space: nowrap; color: #d9ccb3; text-shadow: none; }
.lobby-center > p { margin-top: 18px; }
html[lang='zh-Hant'] .lobby-center > p { font: 21px var(--tc); font-style: normal; letter-spacing: .5em; color: #bda57c; }
body.portrait .lobby-center h1.metal-title { font-size: 80px; letter-spacing: .03em; }
/* 過場大標題 */
.intro-box h2.metal-title, .rival-box h2.metal-title, .queue h2.metal-title { font-weight: 700; font-size: 48px; letter-spacing: .12em; color: #d9ccb3; }
.result-place .metal-title { display: block; font-weight: 700; font-size: 58px; letter-spacing: .06em; }
.result-place.victory .metal-title { transform: translateY(12%); }
body.portrait .result-place .metal-title { font-size: 52px; }

/* ══ 無接縫邊框：素材預先切片，改以多層背景繪製；中段往兩端各多蓋 1px，縮放或 3D 傾斜時不會露出細線 ══ */
:root {
  --dark-l: url('../assets/ui/slice/plate-dark-l.webp'); --dark-m: url('../assets/ui/slice/plate-dark-m.webp'); --dark-r: url('../assets/ui/slice/plate-dark-r.webp');
  --slim-l: url('../assets/ui/slice/plate-slim-l.webp'); --slim-m: url('../assets/ui/slice/plate-slim-m.webp'); --slim-r: url('../assets/ui/slice/plate-slim-r.webp');
  --red-l: url('../assets/ui/slice/plate-red-l.webp'); --red-m: url('../assets/ui/slice/plate-red-m.webp'); --red-r: url('../assets/ui/slice/plate-red-r.webp');
}
.act-btn, .btn-primary, .ghost-btn, .toggle, .tv-sizes > button, .lobby-nav button, .tv-badge, .tv-name, .tv-hud-left, .find-card {
  --bw: calc(var(--h) * var(--cap));
  border-image: none !important;
  background: var(--pl) left center / auto 100% no-repeat, var(--pr) right center / auto 100% no-repeat,
    var(--pm) center / calc(100% - var(--bw) * 2 + 2px) 100% no-repeat !important;
  background-origin: border-box !important; background-clip: border-box !important; }
.find-card { --h: 190px; --cap: .335; --pl: var(--red-l); --pm: var(--red-m); --pr: var(--red-r); height: var(--h); border-width: 0 var(--bw); }
body.portrait .find-card { --h: 170px; }
.modal { border-image: none !important; background: url('../assets/ui/slice/window-tl.webp') left top / 42px 42px no-repeat, url('../assets/ui/slice/window-tr.webp') right top / 42px 42px no-repeat, url('../assets/ui/slice/window-bl.webp') left bottom / 42px 42px no-repeat, url('../assets/ui/slice/window-br.webp') right bottom / 42px 42px no-repeat, url('../assets/ui/slice/window-t.webp') center top / calc(100% - 42px * 2 + 2px) 42px no-repeat, url('../assets/ui/slice/window-b.webp') center bottom / calc(100% - 42px * 2 + 2px) 42px no-repeat, url('../assets/ui/slice/window-l.webp') left center / 42px calc(100% - 42px * 2 + 2px) no-repeat, url('../assets/ui/slice/window-r.webp') right center / 42px calc(100% - 42px * 2 + 2px) no-repeat, url('../assets/ui/slice/window-c.webp') center / calc(100% - 42px * 2 + 2px) calc(100% - 42px * 2 + 2px) no-repeat !important; background-origin: border-box !important; background-clip: border-box !important; }
.modal.archive-bg { border-image: none !important; background: url('../assets/ui/slice/window-tl.webp') left top / 42px 42px no-repeat, url('../assets/ui/slice/window-tr.webp') right top / 42px 42px no-repeat, url('../assets/ui/slice/window-bl.webp') left bottom / 42px 42px no-repeat, url('../assets/ui/slice/window-br.webp') right bottom / 42px 42px no-repeat, url('../assets/ui/slice/window-t.webp') center top / calc(100% - 42px * 2 + 2px) 42px no-repeat, url('../assets/ui/slice/window-b.webp') center bottom / calc(100% - 42px * 2 + 2px) 42px no-repeat, url('../assets/ui/slice/window-l.webp') left center / 42px calc(100% - 42px * 2 + 2px) no-repeat, url('../assets/ui/slice/window-r.webp') right center / 42px calc(100% - 42px * 2 + 2px) no-repeat, url('../assets/ui/slice/window-c.webp') center / calc(100% - 42px * 2 + 2px) calc(100% - 42px * 2 + 2px) no-repeat !important; background-origin: border-box !important; background-clip: border-box !important; }
.today, .tv-log, .tv-reveal, .tv-reveal.tv-reveal, .lobby-me { border-image: none !important; background: url('../assets/ui/slice/window-tl.webp') left top / 26px 26px no-repeat, url('../assets/ui/slice/window-tr.webp') right top / 26px 26px no-repeat, url('../assets/ui/slice/window-bl.webp') left bottom / 26px 26px no-repeat, url('../assets/ui/slice/window-br.webp') right bottom / 26px 26px no-repeat, url('../assets/ui/slice/window-t.webp') center top / calc(100% - 26px * 2 + 2px) 26px no-repeat, url('../assets/ui/slice/window-b.webp') center bottom / calc(100% - 26px * 2 + 2px) 26px no-repeat, url('../assets/ui/slice/window-l.webp') left center / 26px calc(100% - 26px * 2 + 2px) no-repeat, url('../assets/ui/slice/window-r.webp') right center / 26px calc(100% - 26px * 2 + 2px) no-repeat, url('../assets/ui/slice/window-c.webp') center / calc(100% - 26px * 2 + 2px) calc(100% - 26px * 2 + 2px) no-repeat !important; background-origin: border-box !important; background-clip: border-box !important; }
.tv-table { border-image: none !important; background: url('../assets/ui/slice/table-tl.webp') left top / 338px 60px no-repeat, url('../assets/ui/slice/table-tr.webp') right top / 338px 60px no-repeat, url('../assets/ui/slice/table-bl.webp') left bottom / 338px 60px no-repeat, url('../assets/ui/slice/table-br.webp') right bottom / 338px 60px no-repeat, url('../assets/ui/slice/table-t.webp') center top / calc(100% - 338px * 2 + 2px) 60px no-repeat, url('../assets/ui/slice/table-b.webp') center bottom / calc(100% - 338px * 2 + 2px) 60px no-repeat, url('../assets/ui/slice/table-l.webp') left center / 338px calc(100% - 60px * 2 + 2px) no-repeat, url('../assets/ui/slice/table-r.webp') right center / 338px calc(100% - 60px * 2 + 2px) no-repeat, url('../assets/ui/slice/table-c.webp') center / calc(100% - 338px * 2 + 2px) calc(100% - 60px * 2 + 2px) no-repeat !important; background-origin: border-box !important; background-clip: border-box !important; }
body.portrait .tv-table { border-image: none !important; background: url('../assets/ui/slice/table-portrait-tl.webp') left top / 80px 456px no-repeat, url('../assets/ui/slice/table-portrait-tr.webp') right top / 80px 456px no-repeat, url('../assets/ui/slice/table-portrait-bl.webp') left bottom / 80px 456px no-repeat, url('../assets/ui/slice/table-portrait-br.webp') right bottom / 80px 456px no-repeat, url('../assets/ui/slice/table-portrait-t.webp') center top / calc(100% - 80px * 2 + 2px) 456px no-repeat, url('../assets/ui/slice/table-portrait-b.webp') center bottom / calc(100% - 80px * 2 + 2px) 456px no-repeat, url('../assets/ui/slice/table-portrait-l.webp') left center / 80px calc(100% - 456px * 2 + 2px) no-repeat, url('../assets/ui/slice/table-portrait-r.webp') right center / 80px calc(100% - 456px * 2 + 2px) no-repeat, url('../assets/ui/slice/table-portrait-c.webp') center / calc(100% - 80px * 2 + 2px) calc(100% - 456px * 2 + 2px) no-repeat !important; background-origin: border-box !important; background-clip: border-box !important; }

/* ══ 撲克牌牌面：容器單位排版，內容限制在牌框內框（橫 12–88%、縱 8–92%） ══ */
.card.face { container-type: size; }
.card.face .c-idx { position: absolute; display: grid; justify-items: center; line-height: .9; }
.card.face .c-idx.tl { left: 13cqw; top: 9cqh; }
.card.face .c-idx.br { right: 13cqw; bottom: 9cqh; transform: rotate(180deg); }
.card.face .c-idx b { font: 700 19cqh/1 var(--serif); letter-spacing: -.02em; }
.card.face.ten .c-idx b { font-size: 16cqh; letter-spacing: -.1em; margin-left: -.1em; }
.card.face .c-idx i { font-style: normal; font-size: 13cqh; line-height: 1; margin-top: .4cqh; }
.card.face .c-center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42cqh; line-height: 1; padding-top: 1cqh; filter: drop-shadow(0 .6cqh .4cqh #0003); }
.card.face .c-court { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; line-height: 1; }
.card.face .c-court::before, .card.face .c-court::after { content: ''; width: 34cqw; height: 1.6cqh; margin: 1.5cqh 0;
  background: linear-gradient(90deg, transparent, currentColor 25% 75%, transparent) center / 100% .5cqh no-repeat,
    radial-gradient(circle, currentColor 45%, transparent 50%) center / 1.6cqh 1.6cqh no-repeat; opacity: .7; }
.card.face .c-court b { font: 700 24cqh/1 var(--caps); }
.card.face .c-court i { font-style: normal; font-size: 13cqh; margin-top: 1cqh; }
.card.face.red { color: #a8231c; }
.card.face.black { color: #17120e; }

/* ══ 彈窗內容：與視窗框同一套設計語言（凹刻皮革、金細線、寶石、金屬標題） ══ */
.modal-x.modal-x { position: absolute; }
.modal { padding: 22px 30px 26px; }
.modal.wide { width: 1040px; }
.m-head { display: grid; justify-items: center; text-align: center; margin: 0 0 18px; }
.m-head .eyebrow { font-size: 12px; letter-spacing: .4em; color: #b89760; }
.modal h2.metal-title, .create-panel h2.metal-title, .file-head h2.metal-title { font-weight: 700; font-size: 38px; letter-spacing: .1em; margin: 6px 0 0; color: #d9ccb3; text-transform: none; }
.m-head h2.metal-title::after { content: ''; display: block; width: 360px; max-width: 100%; height: 14px; margin: 12px auto 0; background: var(--divider) center / 100% 100% no-repeat; }
.file-head h2.metal-title, .create-panel h2.metal-title { font-size: 42px; letter-spacing: .06em; }
.file-head h2.metal-title::after { display: none; }
.m-lead { text-align: center; max-width: 720px; margin: 0 auto 20px !important; color: #bba98a !important; font-size: 15px; line-height: 1.8; }
/* 段落標題：置中，兩側金色漸隱線 */
.modal h3 { display: flex; align-items: center; gap: 16px; margin: 26px 0 14px; font: 600 14px var(--caps); letter-spacing: .3em; color: var(--gold2); text-transform: uppercase; }
.modal h3::before, .modal h3::after { content: ''; flex: 1; height: 9px;
  background: linear-gradient(90deg, transparent, #c9a45f99) center / 100% 1px no-repeat, radial-gradient(circle, #c9a45f 40%, transparent 45%) right center / 9px 9px no-repeat; }
.modal h3::after { background: linear-gradient(90deg, #c9a45f99, transparent) center / 100% 1px no-repeat, radial-gradient(circle, #c9a45f 40%, transparent 45%) left center / 9px 9px no-repeat; }
.self-body h3:first-child { margin-top: 4px; }
.note-card h3 { display: block; letter-spacing: .2em; }
.note-card h3::before, .note-card h3::after { display: none; }
.volume h3 { justify-content: flex-start; }
.volume h3::before { display: none; }
/* 凹刻皮革底：數據、列表、徽章、設定列共用 */
.stat-grid > div, .person, .lb-row, .hand-row, .badge, .shown, .settings .set-row, .volume, .intro-card small, .life-row, .work-rows > div {
  --inset: linear-gradient(180deg, #0a0806e6, #17110de6); }
.stat-grid, .people-list, .hand-list, .lb { display: grid; gap: 10px; background: none; border: 0; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid > div, .person, .lb-row, .hand-row, .badge, .shown, .settings .set-row, .volume, .life-row, .work-rows > div {
  position: relative; border: 0; border-radius: 6px; background: var(--inset);
  box-shadow: inset 0 2px 8px #000d, inset 0 0 0 1px #7a5f3a66, inset 0 0 0 2px #0008, 0 1px 0 #ffffff0f; }
.stat-grid > div { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 86px; padding: 14px 10px 12px; text-align: center; }
.stat-grid > div::before { content: ''; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; transform: translateX(-50%); background: var(--gem) center / contain no-repeat; }
.stat-grid dt { font: 12px var(--tc); letter-spacing: .12em; color: #a4916f; }
.stat-grid dd { margin: 0; font: 700 26px/1.1 var(--serif); color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(180deg, #fff3d0, #e0bd78 45%, #a07a3e 60%, #f2d596); filter: drop-shadow(0 1px 0 #000); }
.person, .lb-row, .hand-row { padding: 12px 18px; transition: transform .18s, box-shadow .18s; }
.person:hover, .lb-row:hover { transform: translateX(4px); box-shadow: inset 0 2px 8px #000d, inset 0 0 0 1px #c9a45faa, 0 0 18px #c9a45f33; background: var(--inset); }
.person-portrait, .lb-row .lb-portrait { box-shadow: 0 0 0 2px #0b0806, 0 0 0 3px #b48d52, 0 4px 8px #000a; border: 0; }
.lb-row.me { box-shadow: inset 0 2px 8px #000d, inset 0 0 0 1px #d0584488, 0 0 18px #a0302833; }
.lb-row strong, .hand-meta b { color: transparent; -webkit-background-clip: text; background-clip: text; background-image: linear-gradient(180deg, #fff3d0, #e0bd78 45%, #a07a3e 60%, #f2d596); }
.hand-meta b.up { background-image: linear-gradient(180deg, #e2ffd6, #8fcf7f); } .hand-meta b.down { background-image: linear-gradient(180deg, #ffd9cf, #e07a64); }
.badge { padding: 14px 8px 12px; }
.shown { padding: 10px; }
.volume { padding: 18px 22px; margin-top: 12px; border-top: 0; }
.volume .stat-grid > div { min-height: 70px; }
.volume .stat-grid dd { font-size: 20px; }
.settings .set-row { margin: 0 0 8px; padding: 12px 18px; border-bottom: 0; }
.settings .set-row > span { font: 15px var(--tc); letter-spacing: .1em; color: var(--gold2); }
.mode-line { text-align: center; }
/* 分頁：按鈕牌匾 */
.self-left nav { gap: 8px; border: 0; margin-top: 22px; }
.self-left nav button.tab { --h: 46px; width: 100%; justify-content: flex-start; padding-left: 18px; border-bottom: 0; font: 600 15px var(--tc); letter-spacing: .2em; text-align: left; }
.self-left nav button.tab[aria-pressed='true'] { color: #fff0cf; }
/* 牌手檔案版面：頭像框不再壓到視窗邊 */
.self-file { grid-template-columns: 300px 1fr; gap: 44px; padding: 14px 6px 0; }
.framed { margin: 20px 0 0 18px; width: 262px; }
.self-portrait { width: 100%; height: 320px; }
.self-sign { margin: -64px 0 18px 30px; }
.self-left > .muted { padding-left: 18px; }
.file-head { gap: 34px; padding: 10px 6px 4px; }
.file-cols { gap: 30px; }
.badges { gap: 10px; }
body.portrait .modal.wide { width: 860px; }
body.portrait .self-file { grid-template-columns: 1fr; }
body.portrait .framed { width: 300px; margin: 20px auto 0; }
body.portrait .stat-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
.self-left nav button.tab.tab { border-left-color: transparent; border-left-width: calc(var(--h) * var(--cap)); }
.m-head { padding-top: 12px; }
.result-rows { display: grid; gap: 8px; }
.result-rows > div.result-rows > div, .result-rows > div { background: linear-gradient(180deg, #0a0806e6, #17110de6); border-radius: 6px; padding: 12px 20px;
  box-shadow: inset 0 2px 8px #000d, inset 0 0 0 1px #7a5f3a66, inset 0 0 0 2px #0008, 0 1px 0 #ffffff0f; }
.tv-badge.tv-badge { padding-inline: 7px; }
.find-card.find-card { border: 0 !important; padding-inline: calc(var(--bw) + 24px); box-sizing: border-box; }

/* ══ 第三批素材：選單圖示、操作圖示、開關、牌背特效 ══ */
.nav-icon { width: 38px; height: 38px; margin-left: -6px; filter: drop-shadow(0 2px 3px #000); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.lobby-nav button { grid-template-columns: 40px 1fr auto; }
.lobby-nav button:not(:disabled):hover .nav-icon { transform: scale(1.12) rotate(-6deg); }
.lobby-nav button:disabled .nav-icon { filter: grayscale(1) brightness(.55); }
body.portrait .nav-icon { width: 44px; height: 44px; }
.icon-btn.img { padding: 0; background: none; box-shadow: none; overflow: visible; }
.icon-btn.img img { width: 100%; height: 100%; filter: drop-shadow(0 3px 5px #000); transition: filter .2s; }
.icon-btn.img:hover img { filter: drop-shadow(0 0 10px #e0b56b88) brightness(1.15); }
.icon-btn.img[aria-pressed='true'] img { filter: drop-shadow(0 0 12px #e0b56b) brightness(1.2); }
.icon-btn.img.off img { filter: grayscale(1) brightness(.5); }
.tv-hud-right .icon-btn { width: 50px; height: 50px; }
.switch { width: 104px; height: 50px; background: url('../assets/icons/toggle-off.webp') center / contain no-repeat; filter: drop-shadow(0 3px 5px #000); }
.switch[aria-checked='true'] { background-image: url('../assets/icons/toggle-on.webp'); }
/* 牌背特效 */
.cardfx { position: relative; }
.cardfx-still, .cardfx-gl { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 5.5%; }
.cardfx-gl { visibility: hidden; }
.cardfx.live:not(.still) .cardfx-gl { visibility: visible; }
.cardfx.live:not(.still) .cardfx-still { visibility: hidden; }
.cardfx-particles { position: absolute; pointer-events: none; mix-blend-mode: screen; }
.table-card-effect { position:absolute; z-index:5; pointer-events:none; max-width:none; mix-blend-mode:screen; }
.tv-cards .card.special-card { overflow:visible; }
.c3d-effect canvas { mix-blend-mode:screen; }
.cardfx { filter: drop-shadow(0 18px 26px #000c); }
.create-card { position: absolute; right: 70px; bottom: 60px; z-index: 3; transform: rotate(5deg); animation: rise .9s .2s backwards; }
body.portrait .create-card { right: 40px; bottom: 30px; transform: rotate(5deg) scale(.8); transform-origin: bottom right; }
.result-card { display: grid; place-items: center; margin-bottom: 8px; animation: slam .9s ease-out; }

/* 反光層只落在卡片圖案上（用卡片本身的圖形當遮罩），不再露出方形亮框 */
.find-card .glare { -webkit-mask: var(--pl) left center / auto 100% no-repeat, var(--pr) right center / auto 100% no-repeat, var(--pm) center / calc(100% - var(--bw) * 2 + 2px) 100% no-repeat;
  mask: var(--pl) left center / auto 100% no-repeat, var(--pr) right center / auto 100% no-repeat, var(--pm) center / calc(100% - var(--bw) * 2 + 2px) 100% no-repeat; }
.season-card::after { -webkit-mask: url('../assets/ui/info-panel.webp') center / 100% 100% no-repeat; mask: url('../assets/ui/info-panel.webp') center / 100% 100% no-repeat; }
.intro-card::after { -webkit-mask: url('../assets/ui/item-frame.webp') center / 100% 100% no-repeat; mask: url('../assets/ui/item-frame.webp') center / 100% 100% no-repeat; }

/* 撲克牌牌面 v3：左上角點數＋花色，中央一個大花色；人頭牌中央花色外加金色細環 */
.card.face .c-idx { position: absolute; left: 13cqw; top: 8cqh; display: grid; justify-items: center; line-height: .82; transform: none; }
.card.face .c-idx b { font: 700 22cqh/1 'Cormorant Garamond', Georgia, serif; letter-spacing: -.03em; }
.card.face.ten .c-idx b { font-size: 19cqh; letter-spacing: -.12em; margin-left: -.12em; }
.card.face .c-idx i { font-style: normal; font-size: 12cqh; margin-top: 1.5cqh; }
.card.face .c-center { position: absolute; inset: 0; margin: auto; transform: translateY(8cqh); width: 60cqw; height: 42cqh; display: grid; place-items: center;
  font-size: 40cqh; line-height: 1; padding: 0; filter: drop-shadow(0 .8cqh .6cqh #0003); }
.card.face .c-idx.tl, .card.face .c-idx.br, .card.face .c-court { display: none; }
/* J Q K A 插圖：置中於奶油色內框，保留左上角點數 */
.card.face .c-art { position: absolute; left: 22cqw; right: 12cqw; top: 22cqh; bottom: 8cqh; width: auto; height: auto; margin: auto; filter: drop-shadow(0 .6cqh .6cqh #0003); }

/* ══ 置中與彈窗對齊修正 ══ */
/* 人物框與名牌拉開距離 */
.tv-plate.tv-plate, .tv-seat.hero .tv-plate { margin-top: 20px; }
/* 名牌文字垂直置中（字型上緣留白較多，微調基線） */
.tv-name.tv-name { line-height: 1; display: flex; align-items: center; justify-content: center; padding-top: 3px; }
/* 分頁：文字置中 */
.self-left nav button.tab { justify-content: center; padding-left: 8px; text-align: center; }
/* 彈窗：關閉鈕收進框內右上角，內容不再撐出捲軸 */
.modal { overflow-x: hidden; max-height: 860px; }
.modal-x.modal-x { top: 6px; right: 6px; width: 40px; height: 40px; z-index: 5; }
body.portrait .modal { max-height: 1540px; }
/* 按鈕列：同高、等寬、置中 */
.modal-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 220px); justify-content: center; gap: 18px; margin-top: 24px; }
.modal-actions .ghost-btn, .modal-actions .btn-primary { --h: 58px; width: 100%; min-width: 0; font-size: 16px; }
/* 設定：牌背一排，整體不捲動 */
.settings .set-row { padding: 10px 18px; margin-bottom: 7px; }
.back-grid.small { grid-template-columns: repeat(13, 1fr); gap: 5px; }
.back-grid.small .back-choice { padding: 4px 2px; }
.back-grid.small .card { width: 30px; height: 44px; }
.settings .set-row > span { flex-shrink: 0; min-width: 120px; }
body.portrait .back-grid.small { grid-template-columns: repeat(7, 1fr); }
/* 牌手檔案不超出視窗 */
.self-portrait { height: 280px; }
.stat-grid > div { min-height: 76px; padding: 10px 8px; }
.badge img { width: 64px; }
/* 撲克牌角落點數往內 */
.card.face .c-idx { left: 15cqw; top: 9cqh; }
.self-left nav button.tab { padding-inline: 8px; }
.modal.settings { width: 860px; }
.back-grid.small { flex: 0 1 auto; }

/* 外觀預览與儲存固定在框內，選取時不重建彈窗或重置捲動。 */
.settings-look-footer { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; margin: 12px 12px 6px; padding: 14px 6px 4px; border-top: 1px solid var(--line2); }
.settings-look-preview { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.settings-look-preview .portrait { width: 64px; height: 64px; flex: 0 0 64px; }
.settings-preview-card .card { width: 40px; height: 58px; }
.settings-preview-label { min-width: 0; display: grid; gap: 6px; }
.settings-preview-label b { color: var(--gold2); font: 16px var(--tc); }
.settings-preview-label small { color: #baac91; font: 14px var(--tc); overflow-wrap: anywhere; }
.settings-look-actions { flex: 0 1 320px; min-width: 0; }
.settings-look-actions p { color: #cbbd9f; font: 14px/1.5 var(--tc); margin: 0 0 8px; min-height: 42px; }
.settings-look-actions > div { display: flex; gap: 10px; }
.settings-look-actions button { --h: 48px; min-width: 130px; padding-inline: 12px; font-size: 15px; flex: 1; }
.settings-look-actions button:disabled { opacity: .45; cursor: default; transform: none; }
.settings .look-grid.small, .settings .back-grid.small, .settings .level-frame-grid { gap: 8px; }
body.portrait .settings-look-footer { flex-wrap: wrap; gap: 12px; }
body.portrait .settings-look-actions { flex: 1 1 100%; }
body.phone .settings-look-actions p, body.phone .settings-preview-label small { font-size: 23px; }
body.phone .settings-preview-label b, body.phone .settings-look-actions button { font-size: 28px; }
body.phone .settings-look-actions button { --h: 104px; }
body.phone .settings-look-actions > div { gap: 16px; }
body.phone .settings-look-preview .portrait { width: 96px; height: 96px; flex-basis: 96px; }
body.phone .settings-preview-card .card { width: 60px; height: 87px; }

/* ══ 懸停：沿元件外形發出暖金光並微微浮起，不改邊框顏色 ══ */
.lobby-me:hover, .ghost-btn:hover, .tv-sizes > button:hover:not(:disabled) { border-color: transparent !important; background-color: transparent; }
.lobby-me { transition: transform .25s cubic-bezier(.2, .8, .2, 1), filter .25s; cursor: pointer; }
.lobby-me:hover { transform: translateY(-3px); filter: drop-shadow(0 0 14px #e0b56b66) drop-shadow(0 16px 24px #000c); }
.lobby-me:hover .me-portrait { box-shadow: 0 0 0 3px #0b0a09, 0 0 0 4px #e0b56b, 0 0 16px #e0b56b88; }
.act-btn:hover:not(:disabled), .btn-primary:hover, .ghost-btn:hover, .toggle:hover, .tv-sizes > button:hover:not(:disabled), .lobby-nav button:not(:disabled):hover {
  transform: translateY(-2px); filter: brightness(1.12) drop-shadow(0 0 10px #f0c77a66) drop-shadow(0 6px 10px #000c); }
.tv-avatar { outline: none !important; transition: transform .25s cubic-bezier(.2, .8, .2, 1), filter .25s; }
.tv-seat:not(.hero) .tv-avatar:hover { transform: scale(1.05); filter: drop-shadow(0 0 14px #f0c77a77); }
button:focus:not(:focus-visible) { outline: none; }

/* ══ 行動倒數：黃銅刻度環 ══ */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
.tv-timer { display: none; }
.tv-clock { --p: 0; --c1: #fff0c2; --c2: #d9ad5c; position: absolute; inset: -9px; border-radius: 50%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; }
.tv-clock.on { opacity: 1; }
/* 刻度：60 格細刻痕，底層暗銅色 */
.tv-clock::before { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from -1deg, #3b2c1a 0 2deg, transparent 2deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 5px), #000 calc(50% - 4px), #000 50%, transparent calc(50% + 1px));
  mask: radial-gradient(circle, transparent calc(50% - 5px), #000 calc(50% - 4px), #000 50%, transparent calc(50% + 1px)); }
/* 剩餘時間：金色弧線，從 12 點鐘方向順時針燃盡 */
.tv-clock::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c2) 0turn, var(--c1) calc(var(--p) * 1turn - .02turn), #fff calc(var(--p) * 1turn), transparent calc(var(--p) * 1turn));
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 5px), #000 calc(50% - 4px), #000 50%, transparent calc(50% + 1px));
  mask: radial-gradient(circle, transparent calc(50% - 5px), #000 calc(50% - 4px), #000 50%, transparent calc(50% + 1px));
  filter: drop-shadow(0 0 4px var(--c2)) drop-shadow(0 0 8px var(--c2)); }
/* 前端火星：沿圓環移動 */
.tv-clock-ember { position: absolute; left: 50%; top: 0; width: 0; height: 50%; transform-origin: 50% 100%; transform: rotate(calc(var(--p) * 1turn)); }
.tv-clock-ember::before { content: ''; position: absolute; left: -5px; top: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 25%, var(--c1) 45%, transparent 72%); box-shadow: 0 0 10px 3px var(--c2), 0 0 20px 6px #ff9a4a55; animation: ember-flick .18s steps(2) infinite; }
@keyframes ember-flick { 50% { transform: scale(.8); opacity: .8; } }
/* 最後 5 秒：轉為暗紅燃燒，火星加大 */
.tv-seat.hurry .tv-clock { --c1: #ffb08a; --c2: #d8321f; }
.tv-seat.hurry .tv-clock-ember::before { width: 13px; height: 13px; left: -6.5px; box-shadow: 0 0 12px 4px #ff3a1c, 0 0 26px 8px #ff3a1c55; }
.tv-seat.hurry .tv-avatar { animation: none; }
.tv-seat.hurry .tv-clock { animation: clock-pulse .5s ease-in-out infinite alternate; }
@keyframes clock-pulse { to { filter: drop-shadow(0 0 10px #ff3a1c99); } }
.tv-seat.active .tv-avatar::after { display: none; }
body[data-motion='off'] .tv-clock-ember::before { animation: none; }
.tv-clock { z-index: 4; }
.tv-clock-ember::before { width: 12px; height: 12px; left: -6px; top: -4px; }

/* ══ 視窗規範 ══
   .modal：外框（九宮格視窗框），固定高度上限，不捲動。
   .m-head：頁首，固定在頂端。.modal-x：固定在框內右上角。
   .m-scroll：唯一可捲動區，內容只在框內顯示；捲軸隱藏，可捲方向淡出提示。 */
.modal { display: flex; flex-direction: column; overflow: hidden !important; max-height: 820px; padding: 18px 22px 20px; }
body.portrait .modal { max-height: 1480px; }
.modal > .m-head { flex: none; padding-top: 22px; margin-bottom: 12px; }
.modal-x.modal-x { top: 10px; right: 10px; }
.m-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 8px; scrollbar-width: none; overscroll-behavior: contain; }
.m-scroll::-webkit-scrollbar { display: none; }
.m-scroll.more-down { -webkit-mask: linear-gradient(#000 calc(100% - 36px), transparent); mask: linear-gradient(#000 calc(100% - 36px), transparent); }
.m-scroll.more-up { -webkit-mask: linear-gradient(transparent, #000 36px); mask: linear-gradient(transparent, #000 36px); }
.m-scroll.more-up.more-down { -webkit-mask: linear-gradient(transparent, #000 36px calc(100% - 36px), transparent); mask: linear-gradient(transparent, #000 36px calc(100% - 36px), transparent); }
.m-scroll > .m-head:first-child { padding-top: 22px; }

/* 牌手名字：放在頭像框正下方的橫向名牌，端正置中，不再斜寫壓在照片上 */
.self-sign { display: none; }
.self-name { --h: 54px; --cap: .256; --pl: var(--slim-l); --pm: var(--slim-m); --pr: var(--slim-r); --bw: calc(var(--h) * var(--cap));
  display: flex; align-items: center; justify-content: center; height: var(--h); margin: 30px 10px 6px; padding: 0 var(--bw);
  background: var(--pl) left center / auto 100% no-repeat, var(--pr) right center / auto 100% no-repeat, var(--pm) center / calc(100% - var(--bw) * 2 + 2px) 100% no-repeat;
  filter: drop-shadow(0 6px 10px #000c); }
.self-name span { font: 700 26px/1 var(--caps); letter-spacing: .14em; color: #f3e3c2; text-shadow: 0 1px 0 #000, 0 0 12px #e0b56b44; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.self-left > .muted { padding-left: 0; text-align: center; }
.framed { margin: 22px auto 0; }
/* 建立牌手：名字端正排版 */
.create-sign { transform: none; left: 60px; bottom: 56px; font: 700 64px/1 var(--caps); letter-spacing: .12em; color: #f0dcb2; text-shadow: 0 4px 18px #000, 0 0 20px #e0b56b33; }

/* ══ 牌桌縮小、座位外移：座位與扶手之間留間距 ══ */
.tv-table { left: 330px; top: 205px; width: 940px; height: 440px; }
.tv-felt-mark { top: 200px; }
.tv-seat .tv-plate { max-width: 190px; }
.tv-pot { left: 800px; top: 318px; }
.tv-rank { left: 800px; top: 506px; }
.tv-banner { top: 190px; }
body.portrait .tv-table { left: 180px; top: 262px; width: 540px; height: 900px; border-width: 353px 62px; }
body.portrait .tv-seat { width: 170px; }
body.portrait .tv-name.tv-name { max-width: 160px; }
body.portrait .tv-slot { transform: translate(-50%, -50%) scale(.8); }
body.portrait .tv-pot { top: 580px; }
body.portrait .tv-rank { top: 800px; }
body.portrait .tv-felt-mark { top: 380px; }
body.portrait .tv-table { background: url('../assets/ui/slice/table-portrait-tl.webp') left top / 62px 353px no-repeat, url('../assets/ui/slice/table-portrait-tr.webp') right top / 62px 353px no-repeat, url('../assets/ui/slice/table-portrait-bl.webp') left bottom / 62px 353px no-repeat, url('../assets/ui/slice/table-portrait-br.webp') right bottom / 62px 353px no-repeat, url('../assets/ui/slice/table-portrait-t.webp') center top / calc(100% - 62px * 2 + 2px) 353px no-repeat, url('../assets/ui/slice/table-portrait-b.webp') center bottom / calc(100% - 62px * 2 + 2px) 353px no-repeat, url('../assets/ui/slice/table-portrait-l.webp') left center / 62px calc(100% - 353px * 2 + 2px) no-repeat, url('../assets/ui/slice/table-portrait-r.webp') right center / 62px calc(100% - 353px * 2 + 2px) no-repeat, url('../assets/ui/slice/table-portrait-c.webp') center / calc(100% - 62px * 2 + 2px) calc(100% - 353px * 2 + 2px) no-repeat !important; }
body.portrait .tv-felt { inset: -330px -40px; }
.tv-felt { inset: -30px -310px; }
.create-sign { font-size: 44px; max-width: 720px; letter-spacing: .08em; }
body.portrait .create-sign { max-width: 520px; font-size: 40px; }
body.portrait .tv-table { background-origin: border-box !important; background-clip: border-box !important; }

/* ══ 3D 卡牌 ══ */
.c3d { position: relative; }
.c3d-stage { position: relative; height: 440px; perspective: 1100px; cursor: grab; touch-action: none; user-select: none; display: grid; place-items: center; }
.c3d-stage.dragging { cursor: grabbing; }
.c3d-ground { position: absolute; left: 50%; bottom: 22px; width: 220px; height: 24px; margin-left: -110px; background: #000; filter: blur(16px); border-radius: 50%; opacity: .8; }
.c3d-pos { position: relative; transform-style: preserve-3d; }
.c3d-card { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.c3d-paper, .c3d-face { position: absolute; inset: 0; border-radius: 13px; }
.c3d-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(1.2px); isolation: isolate; }
/* Blend artwork and light inside each plane before rotating it. Blended 3D siblings
   can flatten the opposite face behind the paper body in Chromium. */
.c3d-art { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; box-shadow: inset 0 0 0 1px #dbc395; background: #1a1411; }
.c3d-front { transform: rotateY(180deg) translateZ(1.2px); }
.c3d-front .c3d-art { background: #ddcba9; }
.c3d-front .card { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 13px; box-shadow: none; }
.c3d-front .card.blank { background: url('../assets/ui/card-face.webp') center / 100% 100%; }
/* 牌局外的 3D 預覽（卡面典藏、牌桌預覽頁）正面：Joker 插圖撐滿牌面，圓角跟牌身一致。 */
.c3d-front .card.art-face { overflow: hidden; background: #ddcba9; }
.c3d-front .card.art-face img { display: block; width: 100%; height: 100%; object-fit: fill; border-radius: inherit; pointer-events: none; user-select: none; }
.c3d-back img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.c3d-effect { position:absolute;inset:0;pointer-events:none; }
.c3d-effect canvas { position:absolute;max-width:none;pointer-events:none; }
.c3d-sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(var(--light, 120deg), transparent 12%, rgba(255,241,200,.02) 30%, rgba(255,247,221,var(--gloss,.18)) 49%, transparent 70%); }
.c3d-controls { display: grid; justify-items: center; gap: 12px; }
.c3d-buttons { display: flex; gap: 12px; justify-content: center; }
.c3d-buttons .ghost-btn { min-width: 130px; }
.c3d-buttons .ghost-btn[aria-pressed='true'] { color: #fff0cf; filter: drop-shadow(0 0 10px #e0b56b88); }
.c3d-hint { margin: 0 !important; font-size: 13px; color: #9d907a !important; letter-spacing: .1em; }
.c3d-state { text-align: center; margin: 4px 0 0 !important; font-size: 14px; color: #c9b38a !important; letter-spacing: .1em; min-height: 22px; }
.modal.c3d-modal { width: 620px; }
.modal.c3d-modal.wide { width: 1080px; }
.gallery { display: grid; grid-template-columns: 330px 1fr; gap: 26px; align-items: start; }
.gallery-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gallery-list .back-choice { padding: 6px 4px; }
.gallery-list .back-choice .card { width: 58px; height: 84px; margin: 0 auto; }
.gallery-main { display: grid; justify-items: center; gap: 6px; }
.gallery-main .c3d-stage { height: 400px; width: 100%; }
.gallery-name { margin: 0 !important; font: 600 26px var(--caps) !important; letter-spacing: .2em !important; color: var(--gold2) !important; }
.gallery-name::before, .gallery-name::after { display: none !important; }
.gallery-main .btn-primary { margin-top: 10px; min-width: 260px; }
.gallery-main .btn-primary:disabled { opacity: .55; }
body.portrait .modal.c3d-modal.wide { width: 860px; }
body.portrait .gallery { grid-template-columns: 1fr; }
body.portrait .gallery-list { grid-template-columns: repeat(7, 1fr); }
/* 牌桌：手牌可點開 3D */
.tv-cards.hero-hand { cursor: zoom-in; }
.tv-paused {position:absolute;inset:0;z-index:120;display:grid;place-items:center;background:#080706aa;}
.tv-paused[hidden] {display:none;}
.tv-paused>div {width:500px;max-width:80%;padding:38px;background:linear-gradient(145deg,#261c12,#0d0b09);border:1px solid #9c7a49;border-radius:10px;text-align:center;box-shadow:0 20px 60px #000a;}
.tv-paused h2 {margin:0 0 20px;font-size:32px;color:#e2c58d;}
.tv-paused p {margin:0 0 28px;line-height:1.8;font-size:23px;color:#c3b59f;}
.tv-paused .btn-primary {min-width:220px;}
body.portrait .tv-paused>div {width:640px;padding:46px;}
body.portrait .tv-paused h2 {font-size:38px;}
body.portrait .tv-paused p {font-size:29px;}
.gallery-main .c3d-stage { height: 330px; }
.gallery-main .c3d-buttons .ghost-btn { min-width: 104px; }
.gallery-main .c3d-buttons .btn-primary { --h: 50px; min-width: 200px; margin: 0; font-size: 15px; }
.gallery-list { align-self: center; }

/* Approved artwork includes its own frame: suppress legacy SVG-card decoration. */
.card.face.illustrated { background: transparent; }
.card.face.illustrated::before, .card.face.illustrated::after { content: none; display: none; }
.card.face.illustrated > .card-face-art { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; border-radius: inherit; pointer-events: none; }
