* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; -webkit-text-size-adjust: 100%; }
body {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  background: #12161c;
  color: #e8e8e8;
  font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: 15px;
}
.hidden { display: none !important; }
.red { color: #e0343c; }
.black { color: #ddd; }
.gold { color: #f5c542; }
.err { color: #ff6b6b; min-height: 1.4em; margin-top: 8px; }

input {
  background: #1d232c; color: #eee; border: 1px solid #3a4452; border-radius: 6px;
  padding: 6px 8px; font-size: 15px; width: 90px;
}
.btn {
  background: #2b3542; color: #eee; border: 1px solid #45526a; border-radius: 8px;
  padding: 8px 14px; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.2); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 12px 22px; font-size: 17px; }
.btn.gold { background: #b8860b; border-color: #e0a92a; color: #fff; }
.btn.fold { background: #6b2a2a; border-color: #8f3a3a; }
.btn.check, .btn.call { background: #245c3a; border-color: #2f7a4c; }
.btn.raise { background: #8a5a12; border-color: #b77b1c; }

/* 進場 */
.screen { display: flex; align-items: center; justify-content: center; height: 100%; }
.join-box {
  background: #1b2129; padding: 32px; border-radius: 14px; width: min(92vw, 380px);
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px #0008;
}
.join-box h1 { margin: 0 0 6px; text-align: center; font-size: 26px; }
.join-box input { width: 100%; font-size: 17px; padding: 10px; }
.join-box details summary { cursor: pointer; color: #9aa; font-size: 13px; }
.join-box details input { margin-top: 8px; }

/* 版面 */
#game { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
/* 多桌頁籤 */
#tabBar { display: flex; align-items: stretch; gap: 4px; padding: 4px 6px 0; background: #0d1116; border-bottom: 1px solid #2a3240; overflow-x: auto; flex: none; scrollbar-width: thin; }
#tabBar.hidden { display: none; }
.tab-i { flex: none; display: flex; align-items: center; gap: 6px; max-width: 260px; padding: 5px 10px; border: 1px solid #2a3240; border-bottom: none; border-radius: 9px 9px 0 0;
  background: #161c24; color: #b8c2cf; font-size: 13px; cursor: pointer; white-space: nowrap; position: relative; }
.tab-i .tn { overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
.tab-i .ts { color: #f5c542; font-size: 12px; }
.tab-i .tt { font-size: 11.5px; color: #5be38a; }
.tab-i .tt.dim { color: #7d8896; }
.tab-i.on { background: #1f2a36; color: #fff; border-color: #f5c542; box-shadow: inset 0 3px 0 #f5c542; }
.tab-i.myturn .tt.turn { color: #fff; background: #e0483e; border-radius: 6px; padding: 0 6px; font-weight: bold; }
.tab-i.alert { animation: tab-flash 0.9s ease-in-out infinite; border-color: #e0483e; }
.tab-i.alert.hurry { animation-duration: .45s; }
@keyframes tab-flash { 50% { background: #5a1d1a; box-shadow: 0 0 14px #e0483e99; } }
.tab-x { margin-left: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center; border-radius: 50%; color: #9aa6b4; font-size: 15px; font-weight: bold; }
.tab-x:hover { background: #e0483e; color: #fff; }
#watchWarn { flex: none; text-align: center; padding: 5px 10px; background: #3b2a08; color: #ffd76a; font-size: 13px; font-weight: bold; border-bottom: 1px solid #f5c54255; }
#watchWarn.hidden { display: none; }
#watchWarn.hurry { background: #5a1d1a; color: #fff; }
.lt-meta.nowatch { color: #ffb4a8; }
/* 頁籤底下的思考倒數進度條 */
.tab-pb { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #00000066; border-radius: 0 0 2px 2px; overflow: hidden; pointer-events: none; }
.tab-pb i { display: block; height: 100%; width: 100%; background: #5be38a; transition: width .25s linear, background-color .3s; }
.tab-pb i.mid { background: #f5c542; }
.tab-pb i.low { background: #ff4d3d; }
@media (max-width: 640px) { .tab-i { padding: 4px 8px; font-size: 12px; max-width: 170px; } .tab-x { margin-left: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center; border-radius: 50%; color: #9aa6b4; font-size: 15px; font-weight: bold; }
.tab-x:hover { background: #e0483e; color: #fff; }
#watchWarn { flex: none; text-align: center; padding: 5px 10px; background: #3b2a08; color: #ffd76a; font-size: 13px; font-weight: bold; border-bottom: 1px solid #f5c54255; }
#watchWarn.hidden { display: none; }
#watchWarn.hurry { background: #5a1d1a; color: #fff; }
.lt-meta.nowatch { color: #ffb4a8; }
.tab-i.lobby .tn { display: none; } }
/* 標題列只有一排:左邊牌桌資訊,右邊功能按鈕 + 語音名單排成一條,放不下就左右滑動(牌桌空間比較大) */
header {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px;
  background: #1a1f27; border-bottom: 1px solid #2a3240; flex-wrap: nowrap; flex: none;
}
#info { font-weight: bold; color: #f5c542; flex: 0 1 auto; min-width: 0; max-width: 42%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#voice { flex: none; display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.vchip { background: #263040; border-radius: 12px; padding: 2px 9px; font-size: 13px; flex: none; white-space: nowrap; }
.vchip.on { background: #1f5a36; }
.hdr-btns { display: flex; gap: 6px; flex: 1 1 0; min-width: 0; align-items: center; flex-wrap: nowrap;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.hdr-btns::-webkit-scrollbar { display: none; }
.hdr-btns > .btn { flex: none; white-space: nowrap; }
/* 右邊 / 左邊還有按鈕沒顯示:邊緣淡出,提示可以滑 */
.hdr-btns.more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.hdr-btns.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.hdr-btns.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
body.no-mic #micBtn { display: none; }

/* 牌桌滿版長方形,座位位置與大小由 app.js fitTable() 依桌子大小計算 */
#tableWrap { flex: 1; display: flex; padding: 6px; min-height: 0; }
#table {
  position: relative; flex: 1; min-width: 0; overflow: hidden;
  border-radius: 22px;
  background: radial-gradient(ellipse at center, #1f8a47 0%, #136332 60%, #0c4423 100%);
  border: 6px solid #5b3a1f;
  box-shadow: 0 0 0 2px #3d2511, inset 0 0 50px #0007;
}
/* 桌布顏色(主持人面板色票點選);--felt = 絨布中間色,給遮蔽頭貼用 */
#table { --felt: #136332; }
#table.felt-green { --felt: #136332; } #table.felt-emerald { --felt: #0e4a29; }
#table.felt-blue { --felt: #1d5390; }  #table.felt-navy { --felt: #172e58; }
#table.felt-red { --felt: #6e1824; }   #table.felt-purple { --felt: #482270; }
#table.felt-teal { --felt: #0e6865; }  #table.felt-black { --felt: #24262a; }
#table.felt-green,   .felt-sw.felt-green   { background-image: radial-gradient(ellipse at center, #1f8a47 0%, #136332 60%, #0c4423 100%); }
#table.felt-emerald, .felt-sw.felt-emerald { background-image: radial-gradient(ellipse at center, #17663a 0%, #0e4a29 60%, #072e19 100%); }
#table.felt-blue,    .felt-sw.felt-blue    { background-image: radial-gradient(ellipse at center, #2f75c0 0%, #1d5390 60%, #0f3463 100%); }
#table.felt-navy,    .felt-sw.felt-navy    { background-image: radial-gradient(ellipse at center, #22427a 0%, #172e58 60%, #0c1a36 100%); }
#table.felt-red,     .felt-sw.felt-red     { background-image: radial-gradient(ellipse at center, #9a2433 0%, #6e1824 60%, #440d15 100%); }
#table.felt-purple,  .felt-sw.felt-purple  { background-image: radial-gradient(ellipse at center, #66329a 0%, #482270 60%, #2b1345 100%); }
#table.felt-teal,    .felt-sw.felt-teal    { background-image: radial-gradient(ellipse at center, #16908c 0%, #0e6865 60%, #074341 100%); }
#table.felt-black,   .felt-sw.felt-black   { background-image: radial-gradient(ellipse at center, #3a3d42 0%, #24262a 60%, #111214 100%); }
.felt-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0 12px; }
.felt-sw { height: 52px; border-radius: 10px; border: 3px solid #5b3a1f; cursor: pointer; position: relative; padding: 0; display: flex; align-items: flex-end; justify-content: center; }
.felt-sw span { font-size: 11px; color: #fffd; text-shadow: 0 1px 2px #000; padding-bottom: 3px; }
.felt-sw.on { outline: 3px solid #f5c542; outline-offset: 2px; }
.felt-sw.on::after { content: '✓'; position: absolute; top: 2px; right: 6px; color: #f5c542; font-weight: bold; }
#center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; width: 60%;
}
#board { display: flex; gap: 5px; justify-content: center; min-height: 3.8em; font-size: var(--bfs, 19px); }
#board .card, #board .flip3d { font-size: var(--bfs, 19px); }
#pot { margin-top: 8px; font-weight: bold; color: #ffe08a; font-size: calc(17px * var(--ts, 1)); min-height: 1.3em; }
#results { margin-top: 4px; font-size: calc(14px * var(--ts, 1)); color: #fff; text-shadow: 0 1px 2px #000; }
#results div:first-child { font-weight: bold; color: #ffe08a; }

/* 牌 */
/* 經典撲克牌:左上/右下角標、中間按點數排花色(J Q K 是人頭框),背面白邊+菱格花紋 */
.card {
  position: relative; display: inline-block; overflow: hidden;
  width: 2.7em; height: 3.8em; border-radius: .22em;
  background: linear-gradient(160deg, #ffffff 0%, #f6f4ee 100%); color: #161616;
  box-shadow: 0 0 0 .04em #0003, 0 2px 5px #0007;
  font-family: Georgia, "Times New Roman", "PMingLiU", serif; font-weight: bold;
  font-size: calc(15px * var(--cs, 1.3)); line-height: 1; flex-shrink: 0;
}
.card.red { color: #c8102e; }
.su { display: block; width: 1em; height: 1em; fill: currentColor; }
/* 角標:點數 + 花色都放大,黑桃/梅花、紅心/方塊一眼分得出來 */
.cidx {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: .2em;
  font-size: .66em; line-height: .9; text-align: center; letter-spacing: -.07em;
}
.cidx .su { width: .92em; height: .92em; }
.cidx.tl { top: .18em; left: .14em; }
.cidx.br { bottom: .18em; right: .14em; transform: rotate(180deg); }
.pip { position: absolute; font-size: .46em; line-height: 1; transform: translate(-50%, -50%); }
.pip.f { transform: translate(-50%, -50%) rotate(180deg); }
.pip.ace, .pip.big { font-size: 1.25em; }
.pip.big { display: none; }
/* 小張的牌(座位上的手牌)花色排列會糊成一團:改成中間一個大花色 */
.card { container-type: size; }
@container (max-width: 52px) {
  .pip:not(.big):not(.ace), .card .face { display: none; }
  .pip.ace { font-size: 1.15em; }
  .pip.big { display: block; font-size: 1.15em; }
}
.face {
  position: absolute; inset: 15% 21%; border: .05em solid currentColor; border-radius: .08em;
  background: linear-gradient(180deg, #fbf1d3, #f3e2b2 50%, #fbf1d3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .04em;
}
.face .fg { font-size: .85em; }
.face .fl { font-size: .5em; letter-spacing: .02em; }
.face .fs { font-size: .45em; }
.card.back { background: #fdfdfd; }
.card.back::before {
  content: ""; position: absolute; inset: .14em; border-radius: .14em;
  background-color: var(--cb, #a3172c);
  background-image:
    repeating-linear-gradient(45deg, #ffffff40 0 .03em, transparent .03em .26em),
    repeating-linear-gradient(-45deg, #ffffff40 0 .03em, transparent .03em .26em);
  box-shadow: inset 0 0 0 .05em #ffffff80, inset 0 0 0 .12em var(--cb, #a3172c), inset 0 0 0 .15em #ffffff60;
}
/* 個人牌色(⚙ 設定 → 牌的顏色):牌背顏色 + 國際四色牌(♦ 藍、♣ 綠) */
body.back-red    { --cb: #a3172c; }
body.back-blue   { --cb: #1f4f9e; }
body.back-green  { --cb: #17683a; }
body.back-black  { --cb: #26282d; }
body.back-purple { --cb: #5a2a8c; }
body.deck4 .card.s-d, body.deck4 .ct.s-d { color: #1760d6; }
body.deck4 .card.s-c, body.deck4 .ct.s-c { color: #138a3c; }
#deckModal { z-index: 40; }
/* 選單裡的範例牌固定照各自的配色顯示 */
.deck-opt .p2 .card.s-d { color: #c8102e; }
.deck-opt .p2 .card.s-c { color: #161616; }
.deck-opt .p4 .card.s-d { color: #1760d6; }
.deck-opt .p4 .card.s-c { color: #138a3c; }
.deck-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.deck-opt { background: #12161c; border: 2px solid #3a4452; border-radius: 10px; padding: 10px 6px 8px; cursor: pointer; color: #eee; font: inherit; position: relative; }
.deck-opt.on { border-color: #f5c542; }
.deck-opt.on::after { content: '✓'; position: absolute; top: 4px; right: 8px; color: #f5c542; font-weight: bold; }
.deck-opt .cards { display: flex; gap: 3px; justify-content: center; font-size: 13px; margin-bottom: 6px; }
.deck-opt .card { font-size: 13px; }
.deck-opt b { display: block; font-size: 14px; }
.deck-opt i { display: block; font-size: 11px; color: #9aa; font-style: normal; margin-top: 2px; }
.back-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.back-opts .deck-opt { padding: 8px 2px 6px; }
.back-opts .card { font-size: 16px; margin: 0 auto 4px; display: block; }
.back-opts b { font-size: 12px; }
.card.rabbit { opacity: .55; outline: 2px dashed #ffe08a; }
.card.shown { outline: 2px solid #ffe08a; }

/* 座位 */
.seat {
  position: absolute; transform: translate(-50%, -50%) scale(var(--ts, 1));
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 120px;
}
.seat .cards { display: flex; gap: 3px; min-height: 2.6em; }
.seat .cards .card { font-size: calc(13px * var(--cs, 1.3)); }
.seat.me .cards .card { font-size: calc(16px * var(--cs, 1.3)); }
.plate {
  background: #0f1319ee; border: 2px solid #3a4452; border-radius: 10px;
  padding: 3px 10px 3px 36px; text-align: center; min-width: 110px; position: relative;
}
.seat.me .plate { border-color: #4a90e2; }
/* 輪到誰:名牌外框黃白交替閃、外圈粗光暈一縮一放,頭像也一起閃 */
.seat.turn { z-index: 2; }
.seat.turn .plate { border-color: #ffd34d; animation: turnPulse .7s ease-in-out var(--ph, 0s) infinite alternate; }
.seat.turn .av { animation: turnAv .7s ease-in-out var(--ph, 0s) infinite alternate; }
@keyframes turnPulse {
  from { border-color: #ffb300; box-shadow: 0 0 0 2px #ffb30099, 0 0 8px 2px #ffb30088; background: #0f1319ee; }
  to { border-color: #fff6c8; box-shadow: 0 0 0 5px #ffd34d, 0 0 28px 10px #ffd34dcc; background: #3a3210ee; }
}
@keyframes turnAv {
  from { box-shadow: 0 0 0 3px #ffb300, 0 0 6px 2px #ffb30088; }
  to { box-shadow: 0 0 0 6px #fff1a8, 0 0 26px 10px #ffd34dcc; }
}
.seat.folded .cards, .seat.folded .plate { opacity: .45; }
.seat.offline .nm::after { content: " (離線)"; color: #f88; font-size: 11px; }
.nm { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.stk { color: #ffe08a; font-size: 14px; white-space: nowrap; overflow: hidden; max-width: 100%; }
.la { font-size: 12px; color: #9fd3ff; min-height: 1.1em; }
.tags { position: absolute; top: -10px; right: -12px; display: flex; gap: 2px; }
.tag { border-radius: 50%; width: 22px; height: 22px; font-size: 11px; font-weight: bold;
  display: flex; align-items: center; justify-content: center; }
.tag.d { background: #fff; color: #111; }
/* 莊家按鈕:獨立的白色大圓片(像實體桌上的 Dealer 鈕),放在座位外側下角,棄牌也不會變淡 */
.dealer-btn {
  position: absolute; right: -16px; bottom: -8px; z-index: 3; /* 頭像在另一側 */
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 900 17px/1 Arial, sans-serif; color: #111; letter-spacing: 0;
  background: radial-gradient(circle at 35% 30%, #fff 0 45%, #e4e4e4 75%, #bdbdbd 100%);
  border: 2px solid #d4a017; box-shadow: 0 0 0 2px #0008, 0 0 10px 2px #ffd34daa, 0 3px 5px #000a;
  pointer-events: none;
}
.seat.avr .dealer-btn { right: auto; left: -16px; }
.tag.sb { background: #3b82c4; color: #fff; }
.tag.bb { background: #c4483b; color: #fff; }
.seat .note { font-size: 11px; color: #f5c542; }
.seat.empty .sitBtn { background: #0008; color: #cfe; border: 1px dashed #8ab; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.seat.empty .emptyLbl { color: #fff5; font-size: 12px; }
.bet {
  position: absolute; transform: translate(-50%, -50%) scale(var(--ts, 1)); white-space: nowrap; z-index: 1;
  display: flex; align-items: flex-end; gap: 4px; font-size: 13px; font-weight: bold; color: #ffe08a;
}
.bet .amt { background: #000a; border-radius: 10px; padding: 0 7px; line-height: 1.5; }
.bet.drop { animation: betDrop .28s ease-out both; }
@keyframes betDrop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--ts, 1) * 1.35)); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(calc(var(--ts, 1) * .92)); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(var(--ts, 1)); }
}

/* 籌碼:10 紅、100 黑、1000 金是圓形;10000 藍、100000 酒紅是長方形籌碼牌;零頭是白色 */
.chip {
  --c: #c62828; --e: #fff; --t: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.55em; height: 1.55em; border-radius: 50%; font-style: normal;
  background:
    radial-gradient(circle closest-side, var(--c) 0 56%, var(--e) 58% 63%, var(--c) 65% 69%, transparent 71%),
    repeating-conic-gradient(var(--e) 0 15deg, var(--c) 15deg 45deg);
  box-shadow: 0 0 0 .06em #0008, 0 .1em 0 #0007;
}
.chip b { font-size: .5em; font-weight: 900; color: var(--t); letter-spacing: -.03em; line-height: 1; }
.chip.c1 { --c: #ececec; --e: #3a6fd8; --t: #234; }
.chip.c10 { --c: #c62828; --e: #fff; }
.chip.c100 { --c: #1d1d1d; --e: #e9e9e9; }
.chip.c1000 { --c: #e8b923; --e: #6b2d00; --t: #4a2000; }
.chip.plq {
  width: 2.2em; height: 1.4em; border-radius: .25em;
  background:
    linear-gradient(135deg, #fff6 0%, #fff0 40%, #0000 60%, #0003 100%),
    var(--c);
  box-shadow: inset 0 0 0 .1em var(--e), inset 0 0 0 .17em var(--c), inset 0 0 0 .21em #fff8, 0 0 0 .06em #0009, 0 .1em 0 #0007;
}
.chip.plq b { font-size: .55em; text-shadow: 0 1px 1px #0008; }
.chip.c10000 { --c: #1f5fc8; --e: #cfe0ff; }
.chip.c100000 { --c: #8a1538; --e: #f1c95a; --t: #ffe9a8; }
.piles { display: inline-flex; align-items: flex-end; gap: .12em; vertical-align: bottom; }
.pile { position: relative; flex: none; width: 1.55em; height: calc(1.55em + (var(--n) - 1) * .22em); }
.pile.pp { width: 2.2em; height: calc(1.4em + (var(--n) - 1) * .22em); }
.pile .chip { position: absolute; left: 0; bottom: calc(var(--j) * .22em); }
.pile .chip:not(:last-child) b { visibility: hidden; }
#pot { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
#pot .piles { font-size: .95em; }
.bet .piles { font-size: 1.1em; }

/* 飛來飛去的籌碼、贏家 */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 18; overflow: hidden; }
.fly { position: fixed; will-change: transform; filter: drop-shadow(0 3px 3px #0008); }
.winpop {
  position: fixed; transform: translate(-50%, -50%); font-weight: 900; color: #ffe08a; white-space: nowrap;
  text-shadow: 0 2px 4px #000, 0 0 14px #ff9800; animation: winPop 2s ease-out both;
}
@keyframes winPop {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.4); }
  15% { opacity: 1; transform: translate(-50%, -70%) scale(1.3); }
  30% { transform: translate(-50%, -80%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}
.seat.winning .av { animation: winGlow .7s ease-in-out infinite alternate; }
.seat.winning .stk { color: #ffe08a; text-shadow: 0 0 8px #ff9800; }
@keyframes winGlow {
  from { box-shadow: 0 0 0 3px #ffd54a, 0 0 10px 2px #ffb300aa; }
  to { box-shadow: 0 0 0 5px #ffd54a, 0 0 32px 12px #ffb300cc; }
}

/* 下方 */
#bottom {
  background: #1a1f27; border-top: 1px solid #2a3240;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
/* 第一行固定一行高,不換行 */
#myInfo { display: flex; gap: 10px; align-items: center; height: 24px; white-space: nowrap; overflow: hidden; }
#myInfo .hn { color: #9fd3ff; }
.hint { color: #9aa; }

/* 控制面板:固定高度,按鈕位置永遠不變;結束/觀戰時用 ctrl-end 蓋在上面 */
#ctrl { position: relative; display: flex; gap: 8px; align-items: center; height: 48px; }
.ctrl-main, .ctrl-raise { display: flex; gap: 8px; align-items: center; height: 100%; }
.ctrl-raise { flex: 1; }
.ctrl-raise input[type=range] { flex: 1; min-width: 80px; max-width: 320px; }
.ctrl-raise input[type=number] {
  width: 120px; height: 44px; font-size: 18px; font-weight: bold; text-align: center;
  color: #ffe08a; background: #10141a; border: 2px solid #b77b1c; border-radius: 8px;
}
.ctrl-raise input[type=number]:disabled { opacity: .3; border-color: #3a4452; }
.ctrl-raise input[type=number]::placeholder { color: #776; font-size: 14px; font-weight: normal; }
#ctrl .btn { height: 44px; min-width: 92px; font-size: 16px; font-weight: bold; }
#ctrl .btn:disabled { opacity: .3; filter: grayscale(1); cursor: default; }
.btn.allin { background: #7a1f5c; border-color: #a12d7b; }
.ctrl-presets { display: flex; gap: 6px; align-items: center; height: 100%; flex-shrink: 0; }
#ctrl .btn.preset { min-width: 58px; padding: 0 8px; font-size: 15px; background: #2c3a4e; border-color: #4a5d78; }
.btn.armed { outline: 3px solid #ffd34d; outline-offset: 1px; }
.status { width: 92px; font-weight: bold; color: #9aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.mine { color: #4ade80; }
.status.low { color: #ef4444; animation: blink .5s infinite alternate; }
.ctrl-end {
  position: absolute; inset: 0; background: #1a1f27; z-index: 2;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.ctrl-end .btn { height: 44px; }

/* 主持人面板 */
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(100vw, 460px);
  background: #181d24; border-left: 1px solid #333; z-index: 20; overflow-y: auto; padding: 14px;
  box-shadow: -10px 0 40px #000a;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer h2 { margin: 0; color: #f5c542; }
.drawer section { border-top: 1px solid #2a3240; padding: 12px 0; }
.drawer h3 { margin: 0 0 8px; font-size: 15px; color: #aab; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.grow { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px 0; border-bottom: 1px dashed #2a3240; }
.grow .gname { font-weight: bold; }
.grow .ginfo { color: #aab; font-size: 13px; grid-column: 1 / -1; }
.grow .gctl { grid-column: 1 / -1; display: flex; gap: 6px; }

/* 結算 */
.modal { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal-box { background: #1b2129; border-radius: 14px; padding: 22px; width: min(94vw, 520px); max-height: 90vh; overflow-y: auto; }
.modal-box h2 { margin-top: 0; color: #f5c542; }
.settle { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.settle th, .settle td { padding: 8px; border-bottom: 1px solid #2a3240; text-align: right; }
.settle th:first-child, .settle td:first-child { text-align: left; }
.settle td.win { color: #4ade80; font-weight: bold; font-size: 18px; }
.settle td.lose { color: #f87171; font-weight: bold; font-size: 18px; }
.warn { background: #5a3d0a; padding: 8px; border-radius: 8px; margin-bottom: 10px; }

#toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%);
  background: #000d; color: #fff; padding: 10px 18px; border-radius: 8px;
  opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 40;
}
#toast.show { opacity: 1; }

/* 個人設定:收在 ⚙ 下拉選單 */
header { position: relative; }
#prefs { display: none; position: absolute; top: 100%; right: 8px; z-index: 15;
  background: #1a1f27; border: 1px solid #3a4452; border-radius: 10px; padding: 8px; gap: 6px;
  flex-direction: column; min-width: 150px; box-shadow: 0 10px 30px #000a; }
#prefs.open { display: flex; }
#prefs .vol-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #cfd6e0; padding: 2px 2px 4px; }
#prefs .vol-row b { color: #f5c542; }
#prefs .vol-row input[type=range] { width: 100%; margin: 0; }
#prefs hr { width: 100%; border: 0; border-top: 1px solid #3a4452; margin: 2px 0; }

/* 頭像:貼在名牌左邊 */
.av {
  position: absolute; left: -40px; top: 50%; transform: translateY(-50%);
  width: 70px; height: 70px; border-radius: 50%; object-fit: cover;
  border: 2px solid #ffffffcc; box-shadow: 0 2px 6px #000a; background: #333;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: bold; font-size: 28px;
}
.av.mine { cursor: pointer; }
/* 遮蔽頭貼:跟牌桌底色同色(--felt 由 #table.felt-* 設定) */
.av.blocked, .seat.turn .av.blocked, .seat.winning .av.blocked { background: var(--felt, #136332); border-color: transparent; box-shadow: none; animation: none; }
/* 右排座位:頭像放外側(右邊),中間留給公牌 */
.seat.avr .av { left: auto; right: -40px; }
.seat.avr .plate { padding: 3px 36px 3px 10px; }
.seat.avr .tags { right: auto; left: -12px; }
.seat:not(.me):not(.empty) .plate { cursor: pointer; }

/* 我的資訊列 + 亮一張 / 聊天按鈕 */
.info-row { display: flex; gap: 6px; align-items: center; }
.info-row #myInfo { flex: 1; min-width: 0; }
.btn.tiny { height: 26px; padding: 0 9px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }

/* 小視窗(亮一張、點玩家選單) */
.popup {
  position: fixed; z-index: 25; background: #1b2129; border: 1px solid #3a4452; border-radius: 12px;
  box-shadow: 0 10px 40px #000c; padding: 12px;
}
#peekPanel { left: 50%; bottom: 150px; transform: translateX(-50%); width: min(94vw, 400px); }
#peekPanel .row { margin: 8px 0 0; }
#peekPanel input[type=range] { flex: 1; }
.peek-row { display: flex; gap: 18px; align-items: flex-end; justify-content: center; margin-top: 8px; }
.peek-cards { display: flex; gap: 6px; }
.peek-cards .card { font-size: 22px; }
.peek-prev { text-align: center; }
.peek-prev .peek-cards { justify-content: center; }
.pick { cursor: pointer; border-radius: .4em; padding: 3px; border: 3px solid transparent; }
.pick.sel { border-color: #ffd34d; }
.pick-pct { text-align: center; font-size: 12px; color: #ffe08a; margin-top: 2px; }
#seatMenu { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
#seatMenu.hidden { display: none; }
.menu-title { font-weight: bold; color: #f5c542; padding: 0 2px 4px; }
.menu-stk { padding: 0 2px 4px; font-size: 15px; }
.menu-stk b { font-size: 18px; }

/* 別人亮給大家看的那張(可能只掀一部分) */
.pk { position: relative; flex-shrink: 0; }
.pk .card { position: relative; }
.pk .sqf { position: absolute; inset: 0; filter: drop-shadow(0 3px 3px #000a); }
.pk .sqf .card { position: absolute; inset: 0; outline: 2px solid #ffe08a; }

/* 聊天 */
#chatBar {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 24;
  display: flex; flex-direction: column; gap: 6px; width: min(94vw, 480px);
  background: #1b2129; border: 1px solid #3a4452; border-radius: 12px; padding: 8px; box-shadow: 0 10px 40px #000c;
}
#chatBar.hidden { display: none; }
#chatBar .chat-row { display: flex; gap: 6px; }
/* 聊天紀錄:在輸入框上面,最新的在最下面 */
#chatLog { max-height: min(38vh, 300px); overflow-y: auto; font-size: 14px; line-height: 1.5; padding: 2px 4px; overscroll-behavior: contain; }
#chatLog .cl { padding: 2px 0; border-bottom: 1px solid #262e3a; word-break: break-word; }
#chatLog .cl:last-child { border-bottom: 0; }
#chatLog .cl .cl-t { color: #7d8794; font-size: 12px; margin-right: 6px; }
#chatLog .cl b { color: #cfd6e0; }
#chatLog .cl.me b { color: #f5c542; }
#chatInput { flex: 1; min-width: 0; height: 40px; font-size: 16px; }
.bubble {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%); z-index: 3;
  background: #fff; color: #111; border-radius: 12px; padding: 4px 10px; font-size: 14px; font-weight: bold;
  width: max-content; max-width: 180px; overflow-wrap: anywhere; box-shadow: 0 3px 10px #000a;
}
.bubble.new { animation: pop .2s ease-out; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

/* 動畫表情 */
#emotePanel {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 24; width: min(94vw, 440px);
  background: #1b2129; border: 1px solid #3a4452; border-radius: 14px; padding: 10px; box-shadow: 0 10px 40px #000c;
}
#emotePanel.hidden { display: none; }
#emoteTo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
#emoteTo:empty { display: none; }
#emoteTo button { background: #232b36; border: 1px solid #364152; border-radius: 14px; color: #e8ecf1; padding: 3px 10px; font-size: 13px; cursor: pointer; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#emoteTo button.on { background: #f5c542; color: #2a1f00; border-color: #f5c542; font-weight: bold; }
#emoteGrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
@media (max-width: 560px) { #emoteGrid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); } }
#emoteGrid button { background: #232b36; border: 1px solid #364152; border-radius: 10px; color: #e8ecf1; padding: 6px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; transition: transform .1s; }
#emoteGrid button b { font-size: 30px; line-height: 1.15; font-weight: normal; }
#emoteGrid button:hover { border-color: #f5c542; transform: translateY(-2px); }
#emoteGrid button:active { transform: scale(.92); }
#emoteLayer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.emo { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.emo .big { font-size: 64px; line-height: 1; filter: drop-shadow(0 4px 10px #000b); }
.emo .lbl { margin-top: 4px; background: #000c; color: #fff; font-size: 13px; font-weight: bold; padding: 2px 10px; border-radius: 10px; white-space: nowrap;
  animation: emo-lbl 2.8s ease forwards; }
.emo .pt { position: absolute; left: 50%; top: 50%; font-size: 22px; pointer-events: none; }
@keyframes emo-lbl { 0% { opacity: 0; transform: translateY(6px); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* 主體動畫 */
.emo.a-pop .big { animation: emo-pop 2.8s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.emo.a-bounce .big { animation: emo-bounce 2.8s ease forwards; }
.emo.a-shake .big { animation: emo-shake 2.8s ease forwards; }
.emo.a-spin .big { animation: emo-spin 2.8s ease forwards; }
.emo.a-pulse .big { animation: emo-pulse 2.8s ease forwards; }
.emo.a-float .big { animation: emo-float 2.8s ease forwards; }
.emo.a-rocket .big { animation: emo-rocket 2.8s cubic-bezier(.5, 0, .9, .4) forwards; }
.emo.a-tilt .big { animation: emo-tilt 2.8s ease forwards; }
@keyframes emo-pop { 0% { transform: scale(0); opacity: 0; } 15% { transform: scale(1.25); opacity: 1; } 25%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(.6) translateY(-30px); opacity: 0; } }
@keyframes emo-bounce { 0% { transform: translateY(40px) scale(.3); opacity: 0; } 12% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  22% { transform: translateY(0) scale(1, .9); } 32% { transform: translateY(-14px); } 42% { transform: translateY(0); } 52% { transform: translateY(-6px); } 60%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
@keyframes emo-shake { 0% { transform: scale(0); opacity: 0; } 10% { transform: scale(1.2); opacity: 1; }
  15%, 25%, 35%, 45%, 55% { transform: translateX(-8px) rotate(-8deg); } 20%, 30%, 40%, 50%, 60% { transform: translateX(8px) rotate(8deg); } 65%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; transform: scale(.7); } }
@keyframes emo-spin { 0% { transform: scale(0) rotate(-180deg); opacity: 0; } 25% { transform: scale(1.15) rotate(20deg); opacity: 1; } 35%, 82% { transform: scale(1) rotate(0); opacity: 1; } 100% { transform: scale(.4) rotate(180deg); opacity: 0; } }
@keyframes emo-pulse { 0% { transform: scale(0); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 24% { transform: scale(1.25); } 36% { transform: scale(1); } 48% { transform: scale(1.25); } 60%, 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes emo-float { 0% { transform: translateY(20px); opacity: 0; } 15% { opacity: 1; } 50% { transform: translateY(-8px) rotate(-5deg); } 85% { opacity: 1; transform: translateY(-16px) rotate(5deg); } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes emo-rocket { 0% { transform: translateY(30px) scale(.5); opacity: 0; } 15% { transform: translateY(0) scale(1.1); opacity: 1; } 30% { transform: translate(-2px, 2px); } 35% { transform: translate(2px, -2px); } 40% { transform: none; }
  100% { transform: translateY(-260px) scale(.8); opacity: 0; } }
@keyframes emo-tilt { 0% { transform: scale(0); opacity: 0; } 15% { transform: scale(1.1) rotate(-12deg); opacity: 1; } 35% { transform: rotate(12deg); } 55% { transform: rotate(-8deg); } 70%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
/* 粒子:往下掉(錢幣、眼淚)、往上飄(Zzz、火花)、四散(星星) */
.pt.p-fall { animation: emo-fall var(--d, 1.6s) ease-in var(--dl, 0s) forwards; opacity: 0; }
.pt.p-rise { animation: emo-rise var(--d, 1.8s) ease-out var(--dl, 0s) forwards; opacity: 0; }
.pt.p-burst { animation: emo-burst var(--d, 1.2s) ease-out var(--dl, 0s) forwards; opacity: 0; }
@keyframes emo-fall { 0% { opacity: 0; transform: translate(var(--x), -90px) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--x) * 1.2), 90px) rotate(var(--r, 200deg)); } }
@keyframes emo-rise { 0% { opacity: 0; transform: translate(var(--x), 10px) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--x) + 20px), -110px) scale(1.2); } }
@keyframes emo-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1); } }
@media (max-width: 700px) { .emo .big { font-size: 48px; } #emotePanel { bottom: 175px; } }
.tbadge { font-size: 12px; border: 1px solid #4a5566; border-radius: 8px; padding: 0 6px; color: #c9d3de; margin-left: 4px; white-space: nowrap; }
.tbadge.big { border-color: #f5c542; color: #f5c542; }
.tbadge.lock { border-color: #c084fc; color: #e9d5ff; }
.wallet-box { background: #1f2a1f; border: 1px solid #4b6b3a; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.wallet-box > b { font-size: 20px; }
.emo-hint { margin-top: 8px; text-align: center; font-size: 12px; color: #9aa6b4; }
.emo-fly { position: absolute; font-size: 44px; line-height: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 8px #000a); will-change: transform; }
.menu-emo { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; padding: 2px 0 4px; width: min(264px, calc(100vw - 40px)); }
.menu-emo button { background: #232b36; border: 1px solid #364152; border-radius: 8px; font-size: 20px; line-height: 1.25; padding: 3px 0; cursor: pointer; transition: transform .1s; }
.menu-emo button:hover { border-color: #f5c542; transform: translateY(-2px); }
.menu-emo button:active { transform: scale(.9); }
.tag.mute, .tag.host, .tag.admin { background: #000c; font-size: 12px; }
.tag.admin { background: #1d3f8ccc; box-shadow: 0 0 0 1px #7fb0ff; } /* 總管理:藍色盾牌,跟主持人的皇冠分開 */
.vchip { cursor: pointer; }
.vchip.blocked { text-decoration: line-through; opacity: .5; }
.vchip.monitor { background: #3a2f12; color: #f5c542; cursor: default; }
.vchip.monitor.on { background: #8a6410; color: #fff; }
/* 正在講話:語音名單亮綠色跳動 + 🔊,座位頭像加綠色光圈(名單會左右捲,光暈用 inset 才不會被切掉) */
.vchip.talking { background: #2fae5f; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 2px #b6ffd2; animation: vtalk .7s ease-in-out infinite alternate; }
.vchip.talking::after { content: ' 🔊'; }
@keyframes vtalk { from { background: #238a4a; } to { background: #3fd67a; } }
.seat.talking .av { outline: 3px solid #4dff9a; outline-offset: 2px; }

/* ── 大廳(選桌) ── */
#lobbyView { display: none; }
body.in-lobby #lobbyView { display: block; flex: 1; overflow-y: auto; padding: 14px 16px 30px; }
body.in-lobby #tableWrap, body.in-lobby #bottom, body.in-lobby #micBtn, body.in-lobby #camBtn, body.in-lobby #spkBtn,
body.in-lobby #prefs [data-a="sitout"], body.in-lobby #prefs [data-a="stand"], body.in-lobby #prefs [data-a="revoice"] { display: none !important; }
/* 大廳上方錦標賽橫幅(輪播) */
.lobby-banner { position: relative; margin: 0 auto 16px; max-width: 1400px; aspect-ratio: 3 / 1; min-height: 170px; max-height: 360px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 34px #000a, 0 0 0 1px #f5c54255; background: #0b1a12; }
.bn-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; cursor: pointer; }
.bn-slide.on { opacity: 1; visibility: visible; }
.bn-slide.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 28px 18px 12px; background: linear-gradient(transparent, #000d 55%); }
.bn-slide.art { display: flex; align-items: center; gap: 16px; padding: 18px clamp(16px, 4vw, 48px);
  background: radial-gradient(ellipse at 28% 50%, #1f6b45 0%, #0f3a26 45%, #07140d 100%); }
.bn-slide.art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, #f5c54222 50%, transparent 60%); background-size: 250% 100%;
  animation: bn-shine 5s linear infinite; pointer-events: none; }
.bn-slide.art::after { content: ''; position: absolute; inset: 8px; border: 1px solid #f5c54255; border-radius: 12px; pointer-events: none; }
@keyframes bn-shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.bn-deco span { position: absolute; color: #f5c5421a; font-size: clamp(60px, 12vw, 150px); line-height: 1; pointer-events: none; }
.bn-deco span:nth-child(1) { right: 22%; top: -14%; transform: rotate(-14deg); }
.bn-deco span:nth-child(2) { right: 4%; bottom: -18%; transform: rotate(12deg); color: #ff5b5b1c; }
.bn-deco span:nth-child(3) { left: 40%; bottom: -30%; transform: rotate(8deg); }
.bn-deco span:nth-child(4) { right: 38%; bottom: 8%; font-size: clamp(30px, 5vw, 60px); color: #ff5b5b18; }
.bn-chips { font-size: clamp(34px, 6vw, 74px); filter: drop-shadow(0 6px 10px #000a); flex: none; animation: bn-float 4s ease-in-out infinite; }
@keyframes bn-float { 50% { transform: translateY(-6px) rotate(-3deg); } }
.bn-main { flex: 1; min-width: 0; position: relative; }
.bn-kicker { color: #f5c542; font-size: clamp(11px, 1.3vw, 15px); letter-spacing: .12em; font-weight: bold; }
.bn-title { font-size: clamp(22px, 4vw, 50px); font-weight: 900; line-height: 1.1; margin: 4px 0 6px;
  background: linear-gradient(180deg, #fff6d6, #f5c542 55%, #b9851a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 6px #000b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-info { min-width: 0; }
.bn-when { color: #fff; font-size: clamp(12px, 1.4vw, 16px); font-weight: bold; }
.bn-cd { color: #ffd76a; margin-left: 6px; }
.bn-live { color: #5be38a; margin-left: 6px; }
.bn-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: #d9e4dc; font-size: clamp(11px, 1.25vw, 15px); }
.bn-stats b { color: #f5c542; }
.bn-prize { margin-top: 4px; color: #ffe4a0; font-size: clamp(11px, 1.25vw, 14px); }
.bn-act { position: relative; flex: none; }
.bn-cta { font-size: clamp(13px, 1.5vw, 17px); padding: 10px 18px; box-shadow: 0 0 0 0 #f5c542aa; animation: bn-pulse 2s infinite; white-space: nowrap; }
@keyframes bn-pulse { 70% { box-shadow: 0 0 0 12px #f5c54200; } 100% { box-shadow: 0 0 0 0 #f5c54200; } }
.bn-ok { color: #5be38a; font-weight: bold; white-space: nowrap; }
.bn-dots { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.bn-dots i { width: 9px; height: 9px; border-radius: 50%; background: #fff5; cursor: pointer; }
.bn-dots i.on { background: #f5c542; width: 22px; border-radius: 6px; }
@media (max-width: 640px) {
  .lobby-banner { aspect-ratio: auto; min-height: 0; height: auto; }
  .lobby-banner .bn-slide { position: relative; display: none; }
  .lobby-banner .bn-slide.on { display: flex; }
  .bn-slide.art { flex-wrap: wrap; padding: 26px 16px 16px; }
  .bn-slide.img { display: none; flex-direction: column; }
  .bn-slide.img.on { display: flex; }
  .bn-slide.img img { height: auto; aspect-ratio: 3 / 1; }
  .bn-bar { position: static; padding: 10px 12px; background: #0b1a12; }
  .bn-chips { position: absolute; right: 14px; top: 14px; font-size: 26px; opacity: .85; }
  .bn-main { flex-basis: 100%; }
  .bn-title { white-space: normal; font-size: 26px; }
  .bn-kicker { padding-right: 96px; }
  .bn-act { width: 100%; }
  .bn-cta { width: 100%; }
}
/* 賽事詳細:錢圈獎勵表、AI 廣告提示詞 */
.paytable { display: flex; flex-wrap: wrap; gap: 6px; }
.paytable span { background: #1d232c; border: 1px solid #364152; border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.paytable span.top { border-color: #f5c54288; }
.paytable i { font-style: normal; margin-left: 4px; }
.adprompt { width: 100%; background: #0f141a; color: #dfe6ee; border: 1px solid #3a4452; border-radius: 8px; padding: 8px; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.ad-preview { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 10px; margin-top: 6px; border: 1px solid #3a4452; }
/* 牌桌上方賽事列:錢圈 / 泡沫 */
.itm-tag { color: #3a2a00; background: #f5c542; border-radius: 8px; padding: 0 6px; font-weight: bold; }
.bubble-tag { color: #fff; background: #3b82f6; border-radius: 8px; padding: 0 6px; font-weight: bold; animation: bubble-blink 1.4s ease-in-out infinite; }
@keyframes bubble-blink { 50% { opacity: .55; } }
/* 泡沫 / 錢圈大視窗 */
.t-alert { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: #000b; opacity: 0; pointer-events: none; transition: opacity .3s; overflow: hidden; }
.t-alert.show { opacity: 1; pointer-events: auto; }
.ta-box { position: relative; z-index: 1; width: min(92vw, 460px); text-align: center; padding: 24px 20px 16px; border-radius: 18px; background: linear-gradient(160deg, #1b2a3d, #101820);
  border: 2px solid #5aa9ff; box-shadow: 0 0 40px #3b82f688; transform: scale(.6); transition: transform .45s cubic-bezier(.2, 1.6, .4, 1); }
.t-alert.ta-itm .ta-box { background: linear-gradient(160deg, #3a2c08, #15100a); border-color: #f5c542; box-shadow: 0 0 50px #f5c54288; }
.t-alert.show .ta-box { transform: scale(1); }
.ta-title { font-size: 34px; font-weight: 900; color: #9fd0ff; text-shadow: 0 3px 12px #000; }
.t-alert.ta-itm .ta-title { color: #ffd76a; }
.ta-tour { color: #c9d3de; margin-top: 4px; }
.ta-text { margin: 12px 0 8px; font-size: 16px; line-height: 1.55; color: #fff; }
.ta-meta { color: #f5c542; margin-bottom: 8px; }
.ta-meta b { font-size: 20px; }
.ta-p { position: absolute; bottom: -60px; animation: ta-rise var(--d) ease-in var(--dl) infinite; opacity: .9; }
.t-alert.ta-itm .ta-p { bottom: auto; top: -60px; animation-name: ta-fall; }
@keyframes ta-rise { to { transform: translateY(-115vh) translateX(20px); opacity: 0; } }
@keyframes ta-fall { to { transform: translateY(115vh) rotate(540deg); } }
.lobby-head h2 { margin: 0 0 4px; color: #f5c542; }
.lobby-head .warn { margin-top: 8px; }
.lobby-sub { color: #f5c542; margin: 22px 0 8px; font-size: 16px; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.ltable { background: #1b2129; border: 2px solid #2f3a48; border-radius: 14px; padding: 12px 14px; cursor: pointer;
  background-image: radial-gradient(ellipse at top right, #1f8a4733, transparent 60%); display: flex; flex-direction: column; gap: 5px; }
.ltable:hover { border-color: #b8860b; }
.ltable.mine { border-color: #f5c542; box-shadow: 0 0 0 1px #f5c542, 0 0 14px #f5c54255; position: relative; }
.ltable .lt-mine { position: absolute; top: -12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(#ffe27a, #d79b12); border: 2px solid #fff3c4; box-shadow: 0 2px 6px #000a;
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
.ltable .lt-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ltable .lt-head b { font-size: 17px; }
.ltable .lt-st { margin-left: auto; font-size: 12px; color: #8a96a8; }
.ltable.playing .lt-st { color: #5fd38a; }
.ltable .lt-meta { font-size: 13px; color: #c3cbd6; }
.ltable .lt-players { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.ltable .lt-players span:not(.hint) { background: #263040; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.ltable .btn { align-self: flex-start; margin-top: 4px; }

/* ── 總管理面板 ── */
.atable { border: 1px solid #2f3a48; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.atable .row { margin: 4px 0; }
.atable select { max-width: 260px; }
.atable label { display: inline-flex; align-items: center; gap: 4px; }
.atable label input[type="checkbox"] { width: auto; margin: 0; }
/* 主持人(不是總管理)不能派發籌碼:只留請離座、重設密碼 */
#hostPanel.no-give .admin-only, #hostPanel.no-give .gctl input, #hostPanel.no-give [data-g="give"], #hostPanel.no-give [data-g="take"] { display: none !important; }

/* 上傳的桌面底圖 */
#table.custom-bg { background-size: cover; background-position: center; }

/* 回到牌桌中 */
.join-loading { display: none; font-size: 18px; color: #aab; }
#join.connecting .join-loading { display: block; }
#join.connecting .join-box { display: none; }

/* 公牌翻牌 */
.flip3d { width: 2.7em; height: 3.8em; font-size: calc(15px * var(--cs, 1.3)); perspective: 600px; flex-shrink: 0; }
.flip3d .in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  animation: flipIn var(--t) ease-in-out var(--d) both; }
.flip3d.slow .in { animation-name: flipInSlow; }
.flip3d .card { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip3d .ff { transform: rotateY(180deg); }
@keyframes flipIn { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes flipInSlow {
  0%   { transform: translateY(0) rotateY(0) scale(1); }
  30%  { transform: translateY(-12px) rotateY(0) scale(1.12); }
  80%  { transform: translateY(-12px) rotateY(180deg) scale(1.12); }
  100% { transform: translateY(0) rotateY(180deg) scale(1); }
}

/* 瞇牌 */
.sq { position: relative; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.sq.drag { cursor: grabbing; }
.sq .sqf { position: absolute; inset: 0; filter: drop-shadow(0 3px 3px #000a); pointer-events: none; }
.sq .sqf .card { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); transition: clip-path .25s ease-out; }
.sq.drag .sqf .card { transition: none; }
.sq .card.back { box-shadow: 0 0 0 2px #ffd34d88, 0 2px 5px #0007; }
.sq .card { position: relative; }

/* 思考倒數 */
.timer { height: 4px; background: #0006; border-radius: 2px; margin-top: 3px; overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: #4ade80; transition: width .2s linear; }
.timer i.low { background: #ef4444; }
.acttimer { font-weight: bold; color: #4ade80; min-width: 64px; }
.acttimer.low { color: #ef4444; animation: blink .5s infinite alternate; }
@keyframes blink { to { opacity: .4; } }
.small-hint { font-size: 12px; }

/* 歷史紀錄 */
.modal-box.wide { width: min(96vw, 820px); }
/* 德州撲克小辭典:疊在錦標賽視窗上面 */
#glossModal { z-index: 32; }
.gloss-q { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 8px; border: 1px solid #3a4452; background: #11161c; color: #eee; font-size: 15px; }
.gloss-tabs { flex-wrap: wrap; }
.gloss-tabs .tab { padding: 5px 10px; font-size: 13px; }
.gloss-cat { color: #f5c542; margin: 14px 0 6px; font-size: 15px; }
.gloss-item { padding: 8px 10px; border-bottom: 1px solid #2a323d; line-height: 1.55; }
.gloss-item b { color: #fff; font-size: 15px; }
.gloss-item .en { color: #8fa3b8; font-size: 12px; margin-left: 6px; }
.gloss-item p { margin: 3px 0 0; color: #ccd3db; font-size: 14px; }
.gloss-item .ex { color: #9fb88f; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tab { background: #263040; color: #ccc; border: 1px solid #3a4452; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.tab.active { background: #b8860b; color: #fff; border-color: #e0a92a; }
.hist tr.click { cursor: pointer; }
.hist tr.click:hover td { background: #232b36; }
.live { background: #1f5a36; color: #9fe8b8; border-radius: 6px; padding: 0 6px; font-size: 12px; }
#historyBody h3 { margin: 12px 0 2px; }
#historyBody h4 { margin: 18px 0 6px; color: #f5c542; }
.handrow { border-bottom: 1px dashed #2a3240; padding: 6px 0; font-size: 14px; }
.handrow .board { margin-left: 6px; }
.handrow .hp { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.handrow .hp .fd { opacity: .6; }
.handrow i { color: #9fd3ff; font-style: normal; font-size: 12px; }
.myhand { padding-left: 8px; border-left: 3px solid transparent; }
.myhand.won { border-left-color: #4ade80; }
.myhand.lost { border-left-color: #f87171; }
.myhand .mine { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.myhand .mnet { margin-left: auto; font-size: 13px; color: #bbb; }
#myHistModal { z-index: 36; }

/* ───── 單獨一手的歷程(牌局紀錄點某一手) ───── */
.handrow[data-hand] { cursor: pointer; border-radius: 6px; }
.handrow[data-hand]:hover { background: #232b36; }
.handrow .hd-go { float: right; color: #f5c542; font-size: 12px; margin-left: 8px; }
#handModal { z-index: 38; }
.hd-box { padding: 12px 14px 14px; width: min(98vw, 860px); background: #14181e; }
.hd-box .drawer-head h2 { font-size: 17px; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-nav { display: flex; gap: 6px; flex: none; }
.hd-sub { color: #9aa6b6; font-size: 13px; margin: 2px 0 8px; }
.hd-table { position: relative; width: 100%; aspect-ratio: 16 / 9.4; min-height: 250px; container-type: inline-size; margin-bottom: 4px; }
.hd-felt { position: absolute; left: 7%; right: 7%; top: 15%; bottom: 17%; border-radius: 50%;
  background: radial-gradient(ellipse at center, #256b47, #0f3d28 78%); border: 8px solid #6b4a2b; box-shadow: inset 0 0 22px #000a, 0 3px 10px #000a; }
.hd-mid { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); text-align: center; z-index: 1; white-space: nowrap; }
.hd-pot { color: #f5c542; font-weight: bold; font-size: clamp(12px, 2.6cqw, 18px); text-shadow: 0 1px 2px #000; margin-top: 4px; }
.hd-c { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; color: #14181e; border-radius: .18em;
  width: 1.5em; height: 2.05em; font-size: clamp(15px, 4.4cqw, 34px); font-weight: 800; line-height: 1; margin: 0 .06em; box-shadow: 0 1px 3px #0009; vertical-align: middle; }
.hd-c i { font-style: normal; font-size: .82em; line-height: 1; }
.hd-c.red { color: #d0312d; }
body.deck4 .hd-c.s-d { color: #1f6fd0; } body.deck4 .hd-c.s-c { color: #1e8f3e; }
.hd-c.back { background: repeating-linear-gradient(45deg, #9b2335, #9b2335 4px, #7a1a29 4px, #7a1a29 8px); border: 2px solid #eee; }
.hd-seat { position: absolute; transform: translate(-50%, -50%); z-index: 2; display: flex; flex-direction: column; align-items: center; width: clamp(76px, 20cqw, 150px); }
.hd-seat .hd-hole { margin-bottom: -6px; white-space: nowrap; }
.hd-seat .hd-hole .hd-c { font-size: clamp(12px, 3cqw, 24px); }
.hd-av { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; color: #fff; font-weight: bold;
  width: clamp(34px, 8.6cqw, 62px); height: clamp(34px, 8.6cqw, 62px); font-size: clamp(14px, 3.6cqw, 26px); border: 2px solid #3a4452; flex: none; background: #445; }
.hd-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hd-plate { background: #0d1116ee; border: 1px solid #3a4452; border-radius: 8px; padding: 1px 6px 2px; margin-top: -8px; z-index: 1; max-width: 100%; text-align: center;
  font-size: clamp(11px, 2.3cqw, 15px); line-height: 1.25; }
.hd-plate b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-plate span { color: #7fd4ff; font-variant-numeric: tabular-nums; }
.hd-seat.me .hd-plate b { color: #ffb648; }
.hd-seat.fold { opacity: .55; }
.hd-seat.win .hd-av { border-color: #f5c542; box-shadow: 0 0 12px #f5c542cc; }
.hd-win { margin-top: 2px; z-index: 3; background: linear-gradient(#ffd24a, #e08a12); color: #3a1c00; font-weight: 900;
  border-radius: 8px; padding: 0 7px; font-size: clamp(11px, 2.4cqw, 15px); white-space: nowrap; box-shadow: 0 2px 6px #000a; }
.hd-dealer { position: absolute; right: 4%; top: 30%; background: #f5c542; color: #3a2a00; border-radius: 50%; width: 1.5em; height: 1.5em; line-height: 1.5em; text-align: center;
  font-size: clamp(10px, 2cqw, 13px); font-weight: bold; z-index: 3; }
/* 下面:盲注 / 翻牌前 / 翻牌 / 轉牌 / 河牌 各一欄 */
.hd-cols { display: flex; overflow-x: auto; background: #2a2d33; border-radius: 8px; }
.hd-col { flex: 1 1 0; min-width: 112px; border-right: 1px solid #1a1d22; display: flex; flex-direction: column; }
.hd-col:last-child { border-right: 0; }
.hd-colh { background: #101317; text-align: center; padding: 5px 4px; font-size: 14px; color: #dfe5ee; min-height: 50px; }
.hd-colh .hd-potat { display: block; color: #f5c542; font-size: 13px; font-variant-numeric: tabular-nums; }
.hd-colh .hd-c { font-size: 12px; }
.hd-colc { white-space: nowrap; margin: 2px 0; }
.hd-bub { white-space: nowrap; }
.hd-acts { padding: 6px 5px 10px; display: flex; flex-direction: column; gap: 8px; }
.hd-act { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 5px; align-items: start; }
.hd-act .hd-who { grid-row: span 2; display: flex; flex-direction: column; align-items: center; width: 40px; }
.hd-act .hd-av { width: 32px; height: 32px; font-size: 14px; border-width: 1px; }
.hd-pos { font-size: 11px; background: #3c4a2c; color: #e6f2c8; border-radius: 4px; padding: 0 4px; margin-top: -5px; z-index: 1; white-space: nowrap; }
.hd-pos.btn { background: #5a3a22; color: #ffe2bf; } .hd-pos.sb { background: #5d6a2a; } .hd-pos.bb { background: #2f5f4a; color: #d6fff0; }
.hd-pos.ep { background: #24555c; color: #d3f6ff; } .hd-pos.mp { background: #2a3c66; color: #dbe6ff; }
.hd-act .hd-nm { font-size: 12px; color: #cfd6e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-bub { justify-self: start; background: #fff; color: #14181e; border-radius: 7px; padding: 2px 8px; font-weight: bold; font-size: 14px; line-height: 1.25; }
.hd-bub small { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.hd-bub.a-fold, .hd-bub.a-check { font-weight: normal; }
.hd-act.me { display: flex; justify-content: flex-end; }
.hd-act.me .hd-bub { background: #ffc94d; text-align: center; }
.hd-none { color: #8a96a8; font-size: 12px; text-align: center; padding: 8px 0; }
.hd-res { margin-top: 10px; font-size: 14px; }
.hd-res .line { color: #ffe08a; margin: 2px 0; }
.hd-res table { width: 100%; }
@media (max-width: 700px) {
  .hd-box { padding: 10px 8px 12px; }
  .hd-col { min-width: 96px; }
  .hd-bub { font-size: 13px; padding: 2px 6px; }
}
.ct { background: #f4f4f4; color: #111; border-radius: 3px; padding: 0 3px; margin-right: 2px; font-size: 12px; font-weight: bold; }
.ct.red { color: #d0101c; }
.pos { color: #4ade80; font-weight: bold; }
.neg { color: #f87171; font-weight: bold; }

/* 我的牌局紀錄:錦標賽依日期分組 */
#myHistBody .tcard.click { cursor: pointer; }
#myHistBody .tcard.click:hover { border-color: #b8860b; }
#myHistBody h4.myday { color: #f5c542; margin: 14px 0 6px; border-bottom: 1px solid #3a4452; padding-bottom: 3px; }

/* 手機直式 */
@media (max-width: 700px) {
  input { font-size: 16px; } /* 避免 iOS 點輸入框自動放大 */
  /* 手機:資訊一行(小字)+ 按鈕一排(左右滑) */
  header { padding: 3px 8px 4px; gap: 3px; flex-wrap: wrap; }
  #info { font-size: 12px; flex: 1 1 100%; max-width: 100%; }
  #voice { font-size: 12px; }
  .hdr-btns { flex: 1 1 100%; gap: 5px; }
  .vchip { font-size: 11px; padding: 1px 7px; }
  #bottom { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  #myInfo { font-size: 14px; gap: 6px; height: 20px; }
  /* 手機:兩排固定高度 —— 上排 狀態/過牌棄牌/跟注/全下,下排 加注 */
  #ctrl { flex-wrap: wrap; height: 100px; gap: 6px; align-content: space-between; }
  .ctrl-main, .ctrl-raise { width: 100%; height: 46px; gap: 6px; }
  .ctrl-main .btn { flex: 1 1 0; min-width: 0 !important; padding: 0 4px; }
  .status { width: 58px; font-size: 13px; }
  .ctrl-raise input[type=range] { max-width: none; }
  .ctrl-raise input[type=number] { width: 110px; }
  /* 手機:快捷鍵另外一排,放在加注那排上面 */
  #ctrl.presets-on { height: 146px; }
  .ctrl-presets { width: 100%; height: 40px; order: 1; }
  .ctrl-raise { order: 2; }
  #ctrl .btn.preset { flex: 1 1 0; min-width: 0; height: 40px; font-size: 14px; }
  .ctrl-end { align-content: center; }
  .modal-box { padding: 14px; }
  .settle th, .settle td { padding: 6px 4px; font-size: 13px; }
  .settle td.win, .settle td.lose { font-size: 15px; }
  #tableWrap { padding: 4px; }
  #table { border-width: 4px; border-radius: 16px; }
  .seat { width: 84px; }
  .plate { min-width: 70px; padding: 2px 4px 2px 22px; }
  .nm { max-width: 72px; font-size: 13px; }
  .stk { font-size: 12px; }
  .seat .cards .card { font-size: calc(11px * var(--cs, 1.3)); }
  .seat.me .cards .card { font-size: calc(14px * var(--cs, 1.3)); }
  .card { font-size: calc(12px * var(--cs, 1.3)); }
  .flip3d { font-size: calc(12px * var(--cs, 1.3)); }
  .av { width: 50px; height: 50px; left: -30px; font-size: 20px; }
  .seat.avr .av { left: auto; right: -30px; }
  .seat.avr .plate { padding: 2px 22px 2px 4px; }
  .seat.avr .tags { right: auto; left: -8px; }
  /* 手機:別人的兩張牌疊在一起(扇形),座位比較窄,公牌可以更大 */
  .seat:not(.me) { width: 72px; }
  .seat:not(.me) .plate { min-width: 0; width: 100%; }
  .seat:not(.me) .nm { max-width: 100%; }
  .seat:not(.me) .cards { gap: 0; margin-bottom: calc(-0.9 * 11px * var(--cs, 1.3)); }
  .seat:not(.me) .plate { z-index: 1; }
  /* 別人的座位壓扁:籌碼和動作同一行、贏多少浮在名牌下面,讓中間公牌多一點空間 */
  /* 籌碼優先:數字放得下就跟動作同一行,放不下動作換到下一行 */
  .seat:not(.me) .sl { display: flex; flex-wrap: wrap; column-gap: 4px; justify-content: center; align-items: baseline; white-space: nowrap; }
  .seat:not(.me) .stk { flex: 0 1 auto; min-width: 0; }
  .seat:not(.me) .la { min-height: 0; font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .seat:not(.me) .la:empty { display: none; }
  .seat:not(.me) .note { position: absolute; top: 100%; left: -10px; right: -10px; text-align: center; z-index: 2;
    text-shadow: 0 1px 2px #000; white-space: nowrap; }
  .seat:not(.me) .cards > * + * { margin-left: calc(-1.25 * 11px * var(--cs, 1.3)); }
  .btn.tiny { padding: 0 6px; font-size: 12px; }
  #peekPanel, #chatBar { bottom: 175px; }
  .bubble { max-width: 120px; font-size: 13px; }
  #center { width: 80%; }
  .tags { right: -8px; }
  .dealer-btn { width: 24px; height: 24px; font-size: 14px; right: -10px; bottom: -6px; }
  .seat.avr .dealer-btn { left: -10px; }
}

/* 手機橫式 */
@media (max-height: 500px) and (orientation: landscape) {
  header { padding: 3px 8px; }
  #tableWrap { padding: 3px; }
  #bottom { flex-direction: row; flex-wrap: wrap; padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); }
  .seat .cards .card { font-size: calc(10px * var(--cs, 1.3)); }
  .seat.me .cards .card { font-size: calc(12px * var(--cs, 1.3)); }
  .card { font-size: calc(12px * var(--cs, 1.3)); }
  .seat { width: 96px; }
}

/* 錦標賽 */
.badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: #e0343c; color: #fff;
  font-size: 11px; font-weight: bold; text-align: center; margin-left: 4px; padding: 0 4px; vertical-align: 1px; }
#tbar { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 4px 12px; font-size: 13px;
  background: linear-gradient(90deg, #3a2a08, #1a1f27 70%); border-bottom: 1px solid #5a4410; }
#tbar b { color: #ffe08a; }
#tbar .tl { color: #fff; font-weight: bold; }
.tclock { font-weight: bold; color: #4ade80; font-variant-numeric: tabular-nums; }
.tclock.low { color: #ef4444; }
.ok { color: #4ade80; font-weight: bold; }
.tcard { background: #222a35; border: 1px solid #3a4452; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.tch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 17px; margin-bottom: 4px; }
.tch b { color: #ffe08a; }
.tst { font-size: 12px; border-radius: 6px; padding: 1px 7px; background: #3a4452; }
.tst.s0 { background: #1f5a36; color: #9fe8b8; }
.tst.s1 { background: #8a5a12; color: #fff; animation: blink .8s infinite alternate; }
.tst.s3 { background: #5a2a2a; }
.tmeta { font-size: 14px; margin: 3px 0; color: #ccd; }
.tcard .row { margin: 8px 0 0; }
.prizes { display: flex; flex-wrap: wrap; gap: 6px 16px; }
#tourBody h4 { margin: 16px 0 6px; color: #f5c542; }
.tlevels td, .tlevels th { padding: 4px 8px; }
.tlevels tr.brk td { color: #9fd3ff; }
.tlevels tr.cur td { background: #5a4410; color: #fff; font-weight: bold; }
.tlist td { vertical-align: middle; }
.tform { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.tf { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #aab; }
.tf input { width: 100%; min-width: 0; }
.tf select { width: 100%; min-width: 0; background: #1d232c; color: #eee; border: 1px solid #3a4452; border-radius: 6px; padding: 6px 4px; font-size: 14px; }
.tf.wide { margin-top: 10px; }
.tf textarea { width: 100%; background: #1d232c; color: #eee; border: 1px solid #3a4452; border-radius: 6px; padding: 6px 8px;
  font-size: 14px; font-family: Consolas, monospace; }
.settle tr.champ td { color: #ffe08a; font-weight: bold; font-size: 17px; }
.seat.busted .plate, .seat.busted .cards { opacity: .4; filter: grayscale(.8); }
.seat.busted .note { color: #f87171; font-weight: bold; }
/* 倒數時間固定寬度、數字等寬:秒數跳動時旁邊的字不會跟著左右晃 */
#tbar { font-variant-numeric: tabular-nums; }
#tbar .tclock { display: inline-block; min-width: 4.6em; }
#tbar #tstart, [data-cd] { display: inline-block; min-width: 6.2em; font-variant-numeric: tabular-nums; }
/* 比賽中的資訊列:左邊固定(剩餘時間、盲注 / 前注),右邊超慢速跑馬燈,永遠一行、高度不變 */
#tbar.tb-live { flex-wrap: nowrap !important; overflow: hidden !important; white-space: nowrap; gap: 8px; }
#tbar.tb-live .tb-fix { flex: none; display: flex; gap: 8px; align-items: center; order: 0 !important; }
#tbar.tb-live .tb-mq { flex: 1 1 auto; min-width: 0; overflow: hidden; order: 0 !important;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
#tbar.tb-live .tb-mq-in { display: inline-block; padding-left: 100%; color: #e6dcc0; animation: tb-mq 40s linear infinite; }
#tbar.tb-live .tb-dot { font-style: normal; color: #8a7a50; margin: 0 10px; }
#tbar.tb-live .tb-info { flex: none; order: 0 !important; }
@keyframes tb-mq { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { #tbar.tb-live .tb-mq-in { animation: none; padding-left: 0; } }
/* 出局 / 旁觀比賽桌:聊天按鈕下面的大按鈕 */
#tourActs { flex: 1 1 100%; width: 100%; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 4px 0 2px; }
#tourActs.hidden { display: none; }
#tourActs .btn { flex: 1 1 0; min-width: 110px; max-width: 220px; padding: 10px 12px; font-size: 16px; font-weight: bold; }
/* 手機(直的或橫的):資訊列固定一行、高度不變,放不下的往右滑看,不會一下兩行一下三行把牌桌推來推去 */
@media (max-width: 900px), (max-height: 500px) {
  #tbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #tbar::-webkit-scrollbar { display: none; }
  #tbar > * { flex: none; }
  /* 按鈕(賽事資訊、晚報名、再進場)排在賽事名稱後面,不用往右滑才找得到 */
  #tbar > b:first-child { order: -2; }
  #tbar > button { order: -1; }
}
@media (max-width: 700px) {
  #tbar { font-size: 11px; padding: 3px 8px; gap: 2px 8px; }
  .tform { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
/* 線上付款狀態 */
.settle td.pay1 { color: #4ade80; }
.settle td.pay2 { color: #9aa; }
.settle td.pay3 { color: #fbbf24; font-weight: bold; }
.settle td.pay4 { color: #9aa; }

.tf .sw { display: inline-flex; align-items: center; gap: 4px; color: #eee; font-size: 15px; cursor: pointer; }
.tf .sw input { width: auto; }


/* 活動費記帳 */
.owe { color: #fbbf24; font-weight: bold; }
.tmeta.owe { background: #3a2a08; border-radius: 6px; padding: 3px 8px; }


/* 活動費統計 */
.feesum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 14px; }
.feesum div { background: #222a35; border: 1px solid #3a4452; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.feesum span { font-size: 13px; color: #aab; }
.feesum b { font-size: 22px; }
.feesum i { font-size: 11px; color: #9aa; font-style: normal; }
.tmeta.fees { background: #1d2a22; border-radius: 6px; padding: 3px 8px; }


/* 主持人視訊浮動視窗:每個人自己拖到任何位置、放大縮小 */
#camFloat {
  position: fixed; z-index: 16; border-radius: 16px; overflow: hidden; background: #000;
  border: 3px solid #f5c542; box-shadow: 0 8px 26px #000b; cursor: move; touch-action: none; user-select: none;
}
#camFloat.hidden { display: none; }
#camBox, #camBox .camv { width: 100%; height: 100%; }
#camBox .camv { object-fit: cover; display: block; background: #000; pointer-events: none; }
.camv.mirror { transform: scaleX(-1); }
/* 剛出現時的操作提示,幾秒後淡出 */
.cam-hint {
  position: absolute; inset: auto 6px 6px 6px; padding: 6px 8px; border-radius: 10px; background: #000c; color: #fff;
  font-size: 12px; line-height: 1.5; text-align: center; opacity: 0; transition: opacity .6s; pointer-events: none;
}
.cam-hint.on { opacity: 1; }
/* 右下角拉把:放大縮小 */
.cam-rs {
  position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #f5c542cc 50%, #f5c542cc 62%, transparent 62%, transparent 74%, #f5c542cc 74%, #f5c542cc 86%, transparent 86%);
}


/* 登入 / 註冊 */
.auth-tabs { margin: 0; }
.auth-tabs .tab { flex: 1; font-size: 16px; padding: 8px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input { width: 100%; font-size: 17px; padding: 10px; }
.auth-form details summary { cursor: pointer; color: #9aa; font-size: 13px; }
.auth-form details input { margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

/* 推薦碼(主持人面板) */
.refrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #2a3240; }
.refcode { font-family: Consolas, monospace; font-size: 22px; letter-spacing: 3px; color: #ffe08a; }
.refleft { color: #4ade80; font-weight: bold; min-width: 64px; }
.refrow.expired { opacity: .45; }
.refrow.expired .refleft { color: #f87171; }

/* 點數 */
.pts-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.pts-sum div { background: #222a35; border: 1px solid #3a4452; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; font-size: 13px; color: #aab; }
.pts-sum b { font-size: 26px; color: #eee; }
.pts-sum b.gold { color: #f5c542; }
#shareModal { z-index: 40; }

/* 賽事廣告小視窗 */
#promoModal { z-index: 35; }
.promo-box {
  position: relative; width: min(92vw, 380px); text-align: center; padding: 20px 18px 14px;
  background: radial-gradient(ellipse at top, #3a2c0c 0%, #1b2129 62%);
  border: 2px solid #c8961e; box-shadow: 0 0 34px #f5c54255; animation: promoIn .35s ease-out;
}
@keyframes promoIn { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.promo-x { position: absolute; top: 8px; right: 8px; }
.promo-tag { display: inline-block; font-size: 13px; color: #1b1406; background: #f5c542; border-radius: 99px; padding: 2px 12px; font-weight: bold; }
.promo-box h2.promo-name { margin: 10px 0 4px; font-size: 22px; color: #ffe08a; }
.promo-time { font-size: 15px; margin-bottom: 8px; }
.promo-time .hint { display: block; font-size: 13px; color: #f5c542; }
.promo-prize { margin: 6px auto 10px; padding: 8px; border-radius: 10px; background: #f5c5421a; border: 1px dashed #c8961e; }
.promo-prize b { display: block; font-size: 17px; color: #ffe08a; margin-top: 2px; }
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.promo-grid div { background: #12161c; border-radius: 8px; padding: 6px 4px; }
.promo-grid span { display: block; font-size: 12px; color: #9aa; }
.promo-grid b { font-size: 15px; }
.promo-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 6px; }
.promo-btns .btn.big { width: 100%; font-size: 19px; padding: 12px; }
.promo-ok { width: 100%; font-size: 16px; font-weight: bold; padding: 8px; }
.promo-off { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: #9aa; cursor: pointer; }
.promo-off input { width: auto; margin: 0; flex: none; }
#shareText { width: 100%; box-sizing: border-box; background: #12161c; color: #eee; border: 1px solid #3a4452; border-radius: 8px; padding: 10px; font-family: inherit; font-size: 14px; line-height: 1.55; resize: vertical; }
.share-link { margin: 6px 0 2px; font-size: 13px; color: #8ab4f8; word-break: break-all; }
tr.off td { opacity: .55; }
#ptsTabs { flex-wrap: wrap; }
/* 監控牆嵌入的「💎 點數管理 / 🏆 錦標賽」:只顯示那個視窗 */
body.embed header, body.embed #tabBar, body.embed #tbar, body.embed #watchWarn, body.embed #lobbyView, body.embed #tableWrap, body.embed #bottom { display: none !important; }
/* 控制台嵌入:不是彈出視窗,而是整頁的清單畫面(標題、關閉鈕由控制台的功能表 / 標題列取代) */
body.ctl #historyModal { background: #12161c; align-items: stretch; justify-content: stretch; }
body.ctl #historyModal .modal-box { width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; padding: 10px 16px 24px; background: #12161c; }
body.ctl #ptsModal, body.ctl #tourModal, body.ctl #plModal { background: #12161c; align-items: stretch; justify-content: stretch; }
body.ctl #ptsModal .modal-box, body.ctl #tourModal .modal-box, body.ctl #plModal .modal-box { width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; padding: 10px 16px 24px; background: #12161c; }
body.ctl #ptsModal .drawer-head, body.ctl #tourModal .drawer-head, body.ctl #plModal .drawer-head, body.ctl #ptsTabs { display: none; }
body.embed .tlist { border: 1px solid #2f3a48; font-size: 14px; }
body.embed .tlist th { background: #22303f; color: #c9d6e5; font-weight: normal; white-space: nowrap; border-right: 1px solid #2f3a48; padding: 7px 8px; }
body.embed .tlist td { padding: 6px 8px; border-right: 1px solid #1f2731; }
body.embed .tlist tr:nth-child(even) td { background: #161c24; }
body.ctl .tlist th, body.ctl .tlist td { text-align: left; }
.tlist tr.click { cursor: pointer; }
.tlist tr.click:hover td { background: #1c2836; }
body.embed select { background: #1d232c; color: #eee; border: 1px solid #3a4452; border-radius: 6px; padding: 6px 8px; font-size: 15px; font-family: inherit; }
.chk-inline { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.chk-inline input { width: auto; margin: 0; }
.pl-grid th, .pl-grid td, .tg-grid th, .tg-grid td { text-align: left; }
.pl-acc, .tg-name { color: #8ab4f8; text-decoration: underline; }
.tg-ops { white-space: nowrap; }
.tg-new { color: #8ab4f8; text-decoration: underline; cursor: pointer; white-space: nowrap; }
@media (max-width: 700px) { body.ctl #ptsModal .modal-box, body.ctl #tourModal .modal-box, body.ctl #plModal .modal-box { padding: 8px 8px 20px; } body.embed .tlist { font-size: 13px; } }

/* 大廳牌桌卡片上的主持人視訊(點一下全螢幕) */
.lt-cam { position: relative; margin: 6px 0; aspect-ratio: 4 / 3; max-height: 200px; border-radius: 10px; overflow: hidden; background: #0b0f14; border: 1px solid #f5c54266; cursor: zoom-in; display: flex; align-items: center; justify-content: center; }
.lt-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lt-cam::after { content: '⛶ 全螢幕'; position: absolute; right: 6px; bottom: 6px; background: #000a; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; pointer-events: none; }
.lt-cam.live::before { content: '● LIVE'; position: absolute; left: 6px; top: 6px; background: #e0483e; color: #fff; font-size: 11px; font-weight: bold; padding: 0 6px; border-radius: 6px; z-index: 1; }
.lt-cam video:fullscreen { object-fit: contain; background: #000; }
.lobby-cam-sw { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #b8c2cf; margin: 2px 0 4px; cursor: pointer; }
.lobby-cam-sw input { width: auto; margin: 0; }

/* ───────────── 🐉 射龍門 ───────────── */
#dgCtrl { display: none; }
body.dragon #dgCtrl { display: block; }
body.dragon #ctrl { display: none; }
body.dragon #center { width: 78%; }
body.dragon #board { min-height: 4.6em; }
.dg-row { display: flex; align-items: center; justify-content: center; gap: .55em; }
.dg-row .card, .dg-row .flip3d, .dg-sus { font-size: calc(var(--bfs, 19px) * 1.22); }
.dg-pillar { position: relative; filter: drop-shadow(0 6px 10px #000a); }
.dg-pillar::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: -.35em; height: .25em; border-radius: 50%; background: #0007; filter: blur(3px); }
.dg-gate { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.4em;
  padding: .25em .35em .3em; border-radius: .5em; border: 2px dashed #ffe08a88; background: #00000033; font-size: calc(var(--bfs, 19px) * 1.22); }
.dg-gap { font-size: .42em; color: #ffe08a; font-weight: bold; white-space: nowrap; margin-bottom: .2em; }
.dg-guess { font-size: .45em; font-weight: bold; color: #9fd3ff; margin-top: .2em; white-space: nowrap; }
.dg-q { width: 2.7em; height: 3.8em; border-radius: .22em; display: flex; align-items: center; justify-content: center;
  font-size: 1em; font-weight: 900; color: #ffe08a; border: 2px solid #ffe08a55; background: repeating-linear-gradient(45deg, #ffffff08 0 6px, transparent 6px 12px); }
.dg-q.wait { animation: dgPulse 1.1s ease-in-out infinite; }
.dg-row.nogap .dg-q { color: #ff8a80; border-color: #ff8a8088; }
@keyframes dgPulse { 0%, 100% { box-shadow: 0 0 0 0 #ffe08a00; transform: scale(1); } 50% { box-shadow: 0 0 18px 4px #ffe08a88; transform: scale(1.05); } }
/* 第三張:蓋著抖一抖(越抖越快)→ 慢慢翻開 */
/* 外層抖(懸念),內層翻(兩個動畫分開放,才不會互相蓋掉);翻完剛好回到原本大小,換成正面牌時不會跳 */
.dg-sus { width: 2.7em; height: 3.8em; perspective: 700px; animation: dgShakeCard var(--sus) ease-in both; }
.dg-sus .in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  animation: dgFlip var(--fl) cubic-bezier(.3,.1,.3,1) var(--sus) both; }
.dg-sus .card { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.dg-sus .ff { transform: rotateY(180deg); }
@keyframes dgShakeCard {
  0% { transform: translateY(-1.2em) scale(.8); opacity: 0; }
  12% { transform: translateY(0) scale(1); opacity: 1; }
  30% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 50% { transform: rotate(-4deg) scale(1.03); } 58% { transform: rotate(4deg) scale(1.05); }
  66% { transform: rotate(-5deg) scale(1.07); } 72% { transform: rotate(5deg) scale(1.08); } 78% { transform: rotate(-6deg) scale(1.1); } 83% { transform: rotate(6deg) scale(1.1); }
  88% { transform: rotate(-6deg) scale(1.12); } 92% { transform: rotate(6deg) scale(1.12); } 96% { transform: rotate(-3deg) scale(1.06); } 100% { transform: rotate(0) scale(1); }
}
@keyframes dgFlip { from { transform: rotateY(0); } 55% { transform: translateY(-.25em) rotateY(120deg) scale(1.12); } to { transform: rotateY(180deg); } }
.dg-sus .ff { box-shadow: 0 0 0 0 #ffe08a; }
.dg-third.dg-pop, .dg-pop { animation: dgPopIn .45s cubic-bezier(.2,1.4,.4,1) both, dgGlow 1.2s ease-out both; }
@keyframes dgGlow { 0% { box-shadow: 0 0 0 0 #ffe08acc; } 40% { box-shadow: 0 0 22px 8px #ffe08a99; } 100% { box-shadow: 0 0 14px 2px #ffe08a66; } }
.dg-gate.hit-win { border-color: #ffe08a; border-style: solid; animation: dgGateWin .9s ease-out 2; }
.dg-gate.hit-post { border-color: #ff1744; border-style: solid; animation: dgGatePost .5s ease-out 3; }
.dg-gate.hit-lose { border-color: #cfd8dc99; border-style: solid; }
@keyframes dgGateWin { 0% { box-shadow: 0 0 0 0 #ffd54a; } 100% { box-shadow: 0 0 40px 14px #ffd54a00; } }
@keyframes dgGatePost { 0% { box-shadow: 0 0 0 0 #ff1744; background: #ff174455; } 100% { box-shadow: 0 0 36px 12px #ff174400; background: #00000033; } }
.dg-third { box-shadow: 0 0 14px 2px #ffe08a99; }
/* 底池:越多越亮 */
.dg-pot { display: flex; align-items: flex-end; justify-content: center; gap: 8px; padding: 2px 12px; border-radius: 20px; }
.dg-pot span { white-space: nowrap; }
.dg-pot.big { background: radial-gradient(ellipse at center, #ffd54a33, transparent 70%); }
.dg-pot.huge { background: radial-gradient(ellipse at center, #ffd54a55, transparent 72%); animation: dgPotGlow 1.6s ease-in-out infinite alternate; }
.dg-pot.huge b { font-size: 1.25em; color: #fff3b0; text-shadow: 0 0 10px #ff9800; }
@keyframes dgPotGlow { from { filter: drop-shadow(0 0 2px #ffd54a); } to { filter: drop-shadow(0 0 12px #ffb300); } }
.dg-who { font-weight: bold; color: #ffe08a; }
.dg-res { font-weight: bold; }
.dg-res.win, .dg-res.sweep { color: #ffe08a; }
.dg-res.post { color: #ff8a80; }
.dg-res.lose, .dg-res.pass, .dg-res.nogap, .dg-res.timeout { color: #cfd8dc; }
#results .dg-foot { font-weight: normal; color: #b8c7d6; font-size: .8em; margin-top: 2px; }
.dg-banner { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #ffe08a; text-shadow: 0 2px 6px #000; }
.dg-banner b { font-size: 1.15em; }
.dg-banner span { font-size: .7em; color: #e6eef7; }
.dg-dragon { font-size: 2.2em; line-height: 1; animation: dgFloat 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 8px #000a); }
.dg-banner.go .dg-dragon { animation: dgRoar .9s ease-out both, dgFloat 2.4s ease-in-out .9s infinite; }
@keyframes dgFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes dgRoar { 0% { transform: scale(.3) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.5) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
/* 大字特效 */
.dg-shout { position: fixed; transform: translate(-50%, -50%); z-index: 19; pointer-events: none; text-align: center; white-space: nowrap;
  font-size: clamp(30px, 7vw, 64px); font-weight: 900; line-height: 1.1; animation: dgShout var(--dur, 2.3s) cubic-bezier(.2,.9,.3,1.2) both; }
.dg-shout small { display: block; font-size: .42em; font-weight: 800; margin-top: 4px; }
.dg-shout.win { color: #ffe08a; text-shadow: 0 3px 0 #b36b00, 0 0 24px #ff9800, 0 6px 12px #000; }
.dg-shout.sweep { color: #fff3b0; font-size: clamp(36px, 9vw, 84px); text-shadow: 0 3px 0 #c62828, 0 0 30px #ffd54a, 0 0 60px #ff6d00, 0 8px 14px #000; }
.dg-shout.post { color: #ff5252; text-shadow: 0 3px 0 #6d0000, 0 0 26px #ff1744, 0 6px 12px #000; }
.dg-shout.lose { color: #cfd8dc; font-size: clamp(24px, 5.5vw, 46px); text-shadow: 0 2px 0 #37474f, 0 6px 12px #000; }
.dg-shout.go { color: #ffe08a; font-size: clamp(26px, 6vw, 52px); text-shadow: 0 3px 0 #1b5e20, 0 0 22px #69f0ae, 0 6px 12px #000; }
@keyframes dgShout {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-8deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(3deg); }
  24% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(.9); }
}
.dg-flash { position: fixed; inset: 0; pointer-events: none; z-index: 17; animation: dgFlash .85s ease-out both; }
.dg-flash.red { background: radial-gradient(ellipse at center, #ff174477, #b7000055 60%, #00000000); }
.dg-flash.gold { background: radial-gradient(ellipse at center, #fff59dcc, #ffb30066 55%, #00000000); }
@keyframes dgFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.dg-cf { position: fixed; border-radius: 2px; will-change: transform; z-index: 19; }
.winpop.lose { color: #ff8a80; text-shadow: 0 2px 4px #000, 0 0 12px #d50000; }
/* 下方操作面板 */
.dg-act { display: flex; flex-direction: column; gap: 6px; }
.dg-guessrow, .dg-quick, .dg-betrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dg-guessrow span { color: #ffe08a; font-size: 14px; }
.dg-g { min-width: 92px; height: 40px; font-size: 16px; font-weight: bold; }
.dg-g.on { background: #1e6fd9; border-color: #9fd3ff; color: #fff; box-shadow: 0 0 10px #4fa3ff; }
.dg-quick .preset { flex: 1; min-width: 70px; height: 34px; }
.dg-quick .dg-all { color: #ffe08a; border-color: #b77b1c; font-weight: bold; }
.dg-betrow input[type=number] { width: 120px; height: 44px; font-size: 18px; font-weight: bold; text-align: center;
  color: #ffe08a; background: #10141a; border: 2px solid #b77b1c; border-radius: 8px; }
.dg-betrow input[type=range] { flex: 1; min-width: 80px; }
.dg-shoot { height: 46px; min-width: 140px; font-size: 18px; font-weight: 900; background: linear-gradient(180deg, #ffcf4a, #e08e0b); color: #2a1600; border-color: #ffe08a; }
.dg-shoot.all { background: linear-gradient(180deg, #ff6b6b, #c62828); color: #fff; animation: dgPulse 1s ease-in-out infinite; }
.dg-betrow .fold { height: 46px; }
.dg-shoot.dg-locked { background: linear-gradient(180deg, #8d6e63, #5d4037); color: #ffe08a; border-color: #ffb300; animation: dgPulse .5s ease-in-out infinite; }
.dg-risk { font-size: 13px; color: #b8c7d6; }
.dg-risk .red { color: #ff8a80; }
.dg-wait { display: flex; gap: 10px; align-items: center; min-height: 48px; }
.ltable.lt-dg { border-color: #ffb30088; background: linear-gradient(160deg, #2a2310, #1a1f27 60%); }
.lt-dgpot b { font-size: 1.1em; }
@media (max-width: 700px) {
  /* 手機直式:左右兩排座位中間只剩大約 4 成寬,牌不放大、門框變窄,文字小一點 */
  body.dragon #center { width: 60%; }
  .dg-row { gap: .25em; }
  .dg-row .card, .dg-row .flip3d, .dg-sus, .dg-gate { font-size: calc(var(--bfs, 15px) * .85); }
  .dg-gate { min-width: 0; padding: .15em .2em .2em; border-width: 1px; }
  .dg-gap, .dg-guess { font-size: .5em; }
  .dg-pot .piles { font-size: .75em; }
  #results .dg-foot { font-size: .7em; }
  .dg-betrow input[type=number] { width: 92px; height: 40px; font-size: 16px; }
  .dg-shoot { min-width: 0; flex: 1; height: 42px; font-size: 16px; }
  .dg-betrow input[type=range] { flex: 1 1 100%; order: 5; }
  .dg-g { min-width: 76px; height: 36px; font-size: 15px; }
  .dg-quick .preset { min-width: 0; font-size: 13px; }
  .dg-risk { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .dg-sus .in, .dg-dragon, .dg-q.wait, .dg-pot.huge, .dg-shoot.all { animation: none; } .dg-sus .in { transform: rotateY(180deg); } }
/* 射龍門:瞇牌 */
.dg-sqz { width: 2.7em; height: 3.8em; }
.dg-sqz .card { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit; }
.dg-sqz .card.back { animation: dgPulse 1.2s ease-in-out infinite; }
.dg-gate .pk { width: 2.7em; height: 3.8em; }
.dg-gate .pk .card { width: 100%; height: 100%; font-size: inherit; }
.dg-sqhint { font-size: .4em; color: #ffe08a; margin-top: .25em; white-space: nowrap; }
.dg-pop { animation: dgPopIn .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes dgPopIn { 0% { transform: scale(.6) rotate(-6deg); } 100% { transform: scale(1) rotate(0); } }
.dg-glow { animation: dgGlow 1.2s ease-out both; }
/* 即時機率條 */
.dg-bar { display: flex; width: min(440px, 96%); margin: 3px auto 1px; border-radius: 8px; overflow: hidden; font-size: .78em; font-weight: bold; box-shadow: 0 1px 4px #0008; }
.dg-bar span { padding: 2px 5px; white-space: nowrap; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; transition: opacity .3s; }
.dg-bar b { font-size: 1.1em; }
.dg-bar i { font-style: normal; color: #ffe08a; }
.dg-bar .win, .dg-bar .hi, .dg-bar .lo { background: linear-gradient(180deg, #2e9d4d, #1b6b33); }
.dg-bar .lo { background: linear-gradient(180deg, #2f7fd0, #1d5596); }
.dg-bar .hit { background: linear-gradient(180deg, #e53935, #8e0000); animation: dgHitPulse 1.1s ease-in-out infinite alternate; }
.dg-bar .miss { background: linear-gradient(180deg, #607d8b, #37474f); }
.dg-bar .on { box-shadow: inset 0 0 0 2px #ffe08a; }
.dg-bar .off { opacity: .35; }
@keyframes dgHitPulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }
@media (max-width: 700px) { .dg-bar { font-size: .66em; } .dg-bar span { padding: 1px 2px; } }
/* 不打:開來看看 */
.dg-whatif { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 48px; }
.dg-whatif .btn { height: 44px; font-size: 17px; font-weight: 900; animation: dgPulse 1.1s ease-in-out infinite; }
.dg-nextcd { color: #ffe08a; }
/* 加碼:座位旁邊的標籤、底池「含加碼」 */
.seat .dg-pl { position: absolute; right: -8px; bottom: -.9em; z-index: 6; white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: bold; color: #2a1600; background: linear-gradient(180deg, #ffe08a, #f0a81c); border: 1px solid #fff3b0;
  border-radius: 10px; padding: 1px 8px; box-shadow: 0 2px 6px #000a; }
.seat .dg-pl b { color: #7a1d00; }
.dg-plsum { font-size: .7em; color: #ffe08a; font-weight: normal; }
/* 加碼底池 */
.dg-cheer { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dg-cheer .btn { height: 36px; font-weight: bold; color: #ffe08a; border-color: #b77b1c; }
.dg-cheer .btn.big { background: linear-gradient(180deg, #ffcf4a, #e08e0b); color: #2a1600; }
/* 瞇牌放大:蓋在牌桌上,中間一張大牌 */
#dgBig { position: fixed; z-index: 16; display: flex; align-items: center; justify-content: center; border-radius: 22px;
  background: radial-gradient(ellipse at center, #0b1a12ee, #000000f2 75%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); touch-action: none; }
#dgBig .dg-bar { width: min(460px, 92%); font-size: clamp(12px, 2.2vw, 15px); }
#dgBig.hidden { display: none; }
.dg-big-in { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.dg-big-in.enter { animation: dgBigIn .45s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes dgBigIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dg-big-top { color: #ffe08a; font-weight: 900; font-size: clamp(16px, 3.4vw, 26px); text-shadow: 0 2px 6px #000; }
.dg-big-hint { color: #e6eef7; font-size: clamp(13px, 2.4vw, 17px); text-shadow: 0 1px 3px #000; animation: dgPulse 1.4s ease-in-out infinite; }
.dg-big-row { display: flex; align-items: center; gap: calc(var(--bigfs) * .5); }
.dg-big-post { font-size: calc(var(--bigfs) * .5); opacity: .9; }
.dg-big-post .card { font-size: inherit; }
.dg-big-mid { font-size: var(--bigfs); filter: drop-shadow(0 0 18px #ffd54a88) drop-shadow(0 10px 18px #000); }
.dg-big-mid .card, .dg-big-mid .pk { font-size: inherit; }
.dg-big-mid .pk, .dg-big-mid .dg-sqz { width: 2.7em; height: 3.8em; }
.dg-big-mid .pk .card { width: 100%; height: 100%; }
.dg-big-mid .dg-sqz { cursor: grab; }
.dg-big-mid .dg-sqz.drag { cursor: grabbing; }
/* 中柱:鐵鎚敲頭、BONK、眼冒金星、錢長翅膀飛走 */
.dg-bonk { position: fixed; z-index: 20; pointer-events: none; transform: translate(-50%, -50%); font-weight: 900; white-space: nowrap; }
.dg-bonk.word { font-size: clamp(34px, 8vw, 72px); color: #ffeb3b; -webkit-text-stroke: 3px #b71c1c; paint-order: stroke fill; text-shadow: 0 4px 0 #5d0000, 0 8px 16px #000; letter-spacing: 2px; }
.dg-bonk.burst { width: 1em; height: 1em; font-size: clamp(110px, 22vw, 200px); background: #ffd600;
  clip-path: polygon(50% 0, 61% 30%, 95% 15%, 72% 42%, 100% 55%, 68% 63%, 82% 96%, 52% 72%, 28% 100%, 32% 66%, 0 70%, 24% 48%, 4% 20%, 38% 32%); }
.dg-bonk.emo { font-size: clamp(34px, 7vw, 60px); filter: drop-shadow(0 4px 6px #000a); }
.dg-bonk.cap { font-size: clamp(16px, 3.6vw, 26px); color: #fff; background: #000c; border: 2px solid #ff5252; border-radius: 14px; padding: 4px 12px; }
.seat.dg-dizzy { animation: dgDizzy .5s ease-in-out 4; }
@keyframes dgDizzy { 0%, 100% { rotate: 0deg; translate: 0 0; } 25% { rotate: -9deg; translate: -4px 0; } 75% { rotate: 9deg; translate: 4px 0; } }

/* ── 射龍門彩金(2026-11-28)── */
.dg-jpbox { margin-left: 10px; padding: 1px 10px; border-radius: 12px; background: linear-gradient(90deg, #6a1b9a, #c2185b); color: #fff; font-size: .85em; box-shadow: 0 0 10px #ff4081aa; animation: jpBox 1.4s ease-in-out infinite alternate; }
.dg-jpbox b { color: #ffe08a; }
@keyframes jpBox { from { box-shadow: 0 0 4px #ff408166; } to { box-shadow: 0 0 14px #ff4081; } }
.lt-jp { color: #ff80ab; }
.lt-jp b { color: #ffe08a; }
.dg-jpchance { margin: 4px auto 0; padding: 4px 10px; max-width: 640px; border-radius: 10px; background: #4a148c99; border: 1px solid #ff80ab; color: #fff; font-size: .85em; text-align: center; animation: jpBox 1s ease-in-out infinite alternate; }
.dg-jpchance b { color: #ffe08a; }
.dg-jpchance span { display: block; font-size: .85em; color: #f8bbd0; }
.dg-jpchance .h { font-weight: bold; }
.dg-jpchance .t { line-height: 1.45; }
.dg-jpq { margin-top: 3px; color: #f8bbd0; }
.dg-jpq.ok { color: #ffe08a; font-weight: bold; text-shadow: 0 0 6px #ff4081; }
.dg-risk small { opacity: .75; margin-left: 2px; }
.seat.jp-winner .av { animation: winGlow .35s ease-in-out infinite alternate; }
.seat.jp-winner::before { content: '👑'; position: absolute; left: 50%; top: -30px; font-size: 30px; transform: translateX(-50%); animation: jpCrown .5s ease-in-out infinite alternate; z-index: 3; }
@keyframes jpCrown { from { transform: translate(-50%, 0) rotate(-10deg); } to { transform: translate(-50%, -8px) rotate(10deg); } }

.jp-show { position: fixed; inset: 0; pointer-events: auto; cursor: pointer; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #4a148ccc, #12002acc 70%); animation: jpIn .35s ease-out; }
@keyframes jpIn { from { opacity: 0; } to { opacity: 1; } }
.jp-rays { position: absolute; left: 50%; top: 30%; width: 220vmax; height: 220vmax; transform: translate(-50%, -50%); opacity: .35;
  background: repeating-conic-gradient(from 0deg, #ffd54a 0 6deg, transparent 6deg 18deg); animation: jpSpin 9s linear infinite; }
.jp-rays.b { opacity: .18; background: repeating-conic-gradient(from 9deg, #ff4081 0 4deg, transparent 4deg 22deg); animation-duration: 13s; animation-direction: reverse; }
@keyframes jpSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.jp-head { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); text-align: center; width: min(94vw, 720px); }
.jp-title { font-size: clamp(40px, 11vw, 96px); font-weight: 900; letter-spacing: 2px; color: #ffe08a; white-space: nowrap;
  text-shadow: 0 0 6px #fff, 0 0 18px #ff9800, 0 0 40px #ff4081, 4px 4px 0 #b71c1c; animation: jpTitle .6s ease-in-out infinite alternate; }
@keyframes jpTitle { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.08) rotate(2deg); } }
.jp-reels { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.jp-reel { width: clamp(54px, 14vw, 84px); height: clamp(60px, 16vw, 92px); border-radius: 12px; background: linear-gradient(#fff, #e0e0e0 45%, #fff); border: 4px solid #ffd54a; box-shadow: 0 0 14px #ff9800, inset 0 0 10px #0004; display: flex; align-items: center; justify-content: center; font-size: clamp(32px, 9vw, 56px); }
.jp-reel i { font-style: normal; filter: blur(1px); }
.jp-reel.stop i { filter: none; animation: jpStop .3s ease-out; }
@keyframes jpStop { from { transform: translateY(-30%) scale(1.3); } to { transform: none; } }
.jp-tier { font-size: clamp(18px, 4.6vw, 30px); font-weight: 900; color: #fff; text-shadow: 0 0 10px #ff4081; }
.jp-who { font-size: clamp(16px, 4vw, 24px); color: #f8bbd0; margin-top: 4px; }
.jp-amt { font-size: clamp(34px, 9vw, 72px); font-weight: 900; color: #ffe08a; text-shadow: 0 0 12px #ff9800, 3px 3px 0 #6d4c00; font-variant-numeric: tabular-nums; }
.jp-stage { position: absolute; left: 0; right: 0; bottom: 6%; height: 40%; }
.jp-girl { position: absolute; left: 0; bottom: 0; transform: translate(-300px, 0); display: flex; flex-direction: column-reverse; align-items: center; margin-left: -40px; width: 80px; }
.jp-girl .b { font-size: clamp(52px, 12vw, 92px); line-height: 1; filter: drop-shadow(0 6px 6px #0008); animation: jpFlip .4s steps(1) infinite; }
.jp-girl.hi .sign { margin-bottom: 30px; }
@keyframes jpFlip { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
.jp-girl .sign { font-size: clamp(11px, 2.6vw, 15px); font-weight: bold; white-space: nowrap; padding: 2px 8px; border-radius: 8px; background: #fff; color: #c2185b; border: 2px solid #ff4081; box-shadow: 0 2px 6px #0006; transform: rotate(-4deg); }
.jp-peel { position: absolute; bottom: 0; font-size: clamp(24px, 6vw, 40px); }
.jp-bubble { position: absolute; bottom: 62%; padding: 4px 12px; border-radius: 14px; background: #fff; color: #333; font-weight: bold; font-size: clamp(13px, 3.2vw, 18px); white-space: nowrap; box-shadow: 0 3px 8px #0006; }
.jp-bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; transform: translateX(-50%); }
.jp-coin { position: absolute; top: 0; font-style: normal; font-size: clamp(22px, 5vw, 36px); }
.jp-tap { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: #fff9; font-size: 12px; }
.jp-show.super { background: radial-gradient(ellipse at 50% 35%, #b8860bdd, #3e0000dd 70%); }
.jp-show.big { background: radial-gradient(ellipse at 50% 35%, #0d47a1cc, #12002acc 70%); }
.jp-bar { position: fixed; top: 64px; left: 0; display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 0 30px 30px 0; white-space: nowrap; max-width: 100vw;
  background: linear-gradient(90deg, #6a1b9a, #c2185b, #ff9800); color: #fff; box-shadow: 0 0 18px #ff4081; font-size: clamp(13px, 3.4vw, 18px); }
.jp-bar b { overflow: hidden; text-overflow: ellipsis; }
.jp-bar .g i { font-style: normal; font-size: 1.6em; display: inline-block; animation: jpHop .3s ease-in-out infinite alternate; }
.jp-bar .g i:nth-child(2) { animation-delay: .15s; }
@keyframes jpHop { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-6px) rotate(8deg); } }
/* ───────────── 🎴 搶莊炸金花(2026-11-29)───────────── */
#zjCtrl { display: none; }
body.zjh #zjCtrl { display: block; }
body.zjh #ctrl { display: none; }
body.zjh #center { width: 74%; }
body.zjh #board { min-height: 4.2em; }
/* 座位上三張牌疊一點 */
body.zjh .seat .cards.zj3 { gap: 0; }
body.zjh .seat .cards.zj3 > * + * { margin-left: -0.9em; }
body.zjh .seat .cards .card.zj-3rd { box-shadow: 0 0 0 2px #ffd34d99, 0 2px 5px #0007; }
body.zjh .seat .cards .card.zj-peeking { animation: dgPulse .9s ease-in-out infinite; }
.card.zj-pop { animation: zjPop .55s cubic-bezier(.2,1.6,.4,1); }
@keyframes zjPop { from { transform: rotateY(90deg) scale(1.3); } to { transform: none; } }
.zj-banner { text-align: center; color: #fff; text-shadow: 0 2px 6px #000; }
.zj-banner .zj-t { font-size: clamp(20px, 4.6vw, 34px); font-weight: 900; color: #ffe08a; letter-spacing: 1px; }
.zj-banner .zj-s { font-size: clamp(12px, 2.6vw, 16px); color: #e6eef7; }
.zj-banner.bid .zj-t, .zj-banner.bet .zj-t { animation: dgPulse 1.1s ease-in-out infinite; }
.zj-banner.result .zj-t { font-size: clamp(22px, 5.4vw, 40px); }
.zj-cd { display: inline-block; min-width: 1.6em; font-size: clamp(22px, 5vw, 36px); font-weight: 900; color: #fff; text-shadow: 0 0 10px #40c4ff, 0 2px 4px #000; }
.zj-cd.hurry { color: #ff5252; text-shadow: 0 0 12px #ff1744, 0 2px 4px #000; animation: dgPulse .5s ease-in-out infinite; }
.zj-act .zj-cd, .zj-big-top .zj-cd { font-size: 1.1em; margin-left: 6px; }
.zj-pot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; font-size: .9em; }
.zj-pot b { color: #ffe08a; }
.zj-bk { padding: 1px 10px; border-radius: 12px; background: linear-gradient(90deg, #b8860b, #ff9800); color: #fff; box-shadow: 0 0 10px #ffb300aa; }
.zj-bk b { color: #fff; }
.zj-rule { width: 100%; text-align: center; font-size: .78em; color: #cfe3d6; }
.zj-res { margin: 4px auto 0; max-width: 620px; font-size: .82em; color: #fff; background: #0006; border-radius: 10px; padding: 4px 10px; text-align: center; }
.zj-foot a { color: #ffe08a; }
.zj-rules { margin: 6px auto 0; max-width: 520px; background: #0b1a12ee; border: 1px solid #ffd54a66; border-radius: 10px; padding: 6px 10px; font-size: .8em; color: #fff; }
.zj-rules table { width: 100%; border-collapse: collapse; }
.zj-rules th, .zj-rules td { padding: 2px 6px; text-align: center; border-bottom: 1px solid #ffffff1a; }
.zj-rules tr.lv5 td { color: #ff8a80; font-weight: bold; }
.zj-rules tr.lv4 td { color: #ffe08a; font-weight: bold; }
.zj-rules tr.lv3 td { color: #f8bbd0; }
/* 座位上的標籤:搶幾倍 / 莊家 / 下注 / 牌型 / 輸贏 */
.zj-b { position: absolute; left: 50%; bottom: -1.5em; transform: translateX(-50%); display: flex; gap: 3px; white-space: nowrap; z-index: 3; pointer-events: none; font-size: 12px; }
.zj-b > span { padding: 1px 7px; border-radius: 10px; font-weight: bold; box-shadow: 0 1px 4px #0008; }
.zj-bid { background: #1565c0; color: #fff; }
.zj-bid.no { background: #546e7a; color: #cfd8dc; }
.zj-crown { background: linear-gradient(90deg, #ffd54a, #ff9800); color: #4e2600; }
.zj-bet { background: #2e7d32; color: #fff; }
.zj-bet.b3 { background: #ef6c00; }
.zj-bet.b5 { background: #c62828; animation: dgPulse .9s ease-in-out infinite; }
.zj-sq { background: #4a148c; color: #fff; }
.zj-wait { background: #0009; color: #ffe08a; animation: dgPulse 1s ease-in-out infinite; }
.zj-type { background: #263238; color: #fff; }
.zj-type.lv1 { background: #00695c; }
.zj-type.lv2 { background: #1565c0; }
.zj-type.lv3 { background: #ad1457; }
.zj-type.lv4 { background: linear-gradient(90deg, #ffd54a, #ff6d00); color: #3e1c00; box-shadow: 0 0 12px #ffd54a; }
.zj-type.lv5 { background: linear-gradient(90deg, #b71c1c, #ff1744); color: #fff; box-shadow: 0 0 14px #ff1744; animation: dgPulse .7s ease-in-out infinite; }
.zj-type.lv-1 { background: #6d4c41; }
.zj-delta.win { background: #ffd54a; color: #3e2700; }
.zj-delta.lose { background: #b71c1c; color: #fff; }
.seat.zj-banker .av { box-shadow: 0 0 0 3px #ffd54a, 0 0 18px #ff9800; }
.seat.zj-spot .av { box-shadow: 0 0 0 4px #fff, 0 0 30px 8px #ffd54a; transform: scale(1.12); transition: transform .08s; }
/* 下方操作 */
.zj-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; }
.zj-q { font-weight: bold; color: #ffe08a; font-size: 15px; }
.zj-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.zj-btns .btn { min-width: 74px; font-size: 17px; font-weight: 900; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.zj-btns .btn small { font-size: 11px; font-weight: normal; opacity: .85; }
.zj-btns .zj-no { background: #455a64; color: #fff; }
.zj-btns .zj-b1, .zj-btns .zj-x1 { background: #1e88e5; color: #fff; }
.zj-btns .zj-b2, .zj-btns .zj-x2 { background: #43a047; color: #fff; }
.zj-btns .zj-b3, .zj-btns .zj-x3 { background: #fb8c00; color: #fff; }
.zj-btns .zj-b4, .zj-btns .zj-x5 { background: linear-gradient(90deg, #e53935, #ff6d00); color: #fff; box-shadow: 0 0 12px #ff6d00aa; }
.zj-btns .btn.on { outline: 3px solid #fff; transform: scale(1.06); }
.zj-mebk { color: #ffe08a; font-weight: bold; margin-left: 8px; }
/* 瞇牌放大 */
#zjBig { position: fixed; z-index: 16; display: flex; align-items: center; justify-content: center; border-radius: 22px; background: radial-gradient(ellipse at center, #08140ee8, #000c 75%); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#zjBig.hidden { display: none; }
.zj-big-in { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.zj-big-in.enter { animation: dgBigIn .45s cubic-bezier(.2,1.3,.4,1) both; }
.zj-big-top { color: #ffe08a; font-weight: 900; font-size: clamp(16px, 3.4vw, 26px); text-shadow: 0 2px 6px #000; }
.zj-big-hint { color: #e6eef7; font-size: clamp(13px, 2.4vw, 17px); text-shadow: 0 1px 3px #000; }
.zj-big-hint .zj-type { padding: 2px 10px; border-radius: 12px; font-size: 1.2em; }
.zj-big-row { display: flex; align-items: center; gap: calc(var(--bigfs) * .35); font-size: var(--bigfs); }
.zj-big-row > .card { font-size: inherit; }
.zj-sqz { width: 2.7em; height: 3.8em; touch-action: none; }
.zj-sqz .card { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit; }
.zj-sqz .card.back { animation: dgPulse 1.2s ease-in-out infinite; }
/* 特效 */
.zj-flycard { position: fixed; z-index: 20; pointer-events: none; font-size: 12px; }
.zj-flycard .card { font-size: inherit; }
.zj-runner { position: fixed; left: 0; z-index: 21; pointer-events: none; line-height: 1; filter: drop-shadow(0 8px 8px #000a); }
/* 大廳 / 歷程 */
.lt-zj { color: #ffe08a; }
.hd-dg { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0; }
.hd-dgrow { display: flex; align-items: flex-end; gap: 12px; font-size: 20px; }
.hd-dggate { display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border: 2px dashed #ffd54a88; border-radius: 10px; }
.hd-dggate small { font-size: 11px; color: #ffe08a; }
.hd-dgres { font-size: 18px; font-weight: 900; color: #cfd8dc; }
.hd-dgres.win { color: #ffd54a; }
.hd-dgres.lose { color: #ff6e6e; }
.hd-dgwho { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.hd-zj { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0; }
.hd-zjp { min-width: 130px; padding: 6px 8px; border-radius: 10px; background: #ffffff0d; border: 1px solid #ffffff1f; text-align: center; }
.hd-zjp.bk { border-color: #ffd54a; box-shadow: 0 0 10px #ffd54a55; }
.hd-zjp.win { background: #ffd54a14; }
.hd-zjp.lose { background: #ff174412; }
.hd-zjp .nm { display: flex; align-items: center; justify-content: center; gap: 4px; }
.hd-zjp .cs { margin: 4px 0; font-size: 16px; }
.hd-zjp .ty { font-weight: bold; color: #ffe08a; }
.hd-zjp .mu { font-size: 12px; color: #b8c2cf; }
.hd-zjp .nt { font-weight: bold; }

.zj-b { flex-wrap: wrap; justify-content: center; width: 170px; }
.zj-b.up { bottom: auto; top: -1.75em; flex-wrap: wrap-reverse; }
.zj-foot2 { text-align: center; font-size: 12px; color: #b8c2cf; margin-top: 4px; }
.zj-foot2 a, .zj-rules-pop a { color: #ffe08a; }
#zjCtrl .zj-res { margin: 4px auto 0; font-size: 12px; background: #ffffff0f; }
.zj-rules-pop { position: fixed; left: 50%; top: 50%; translate: -50% -50%; z-index: 40; width: min(94vw, 520px); cursor: pointer; animation: dgBigIn .3s cubic-bezier(.2,1.3,.4,1) both; }
.zj-rules-pop .zj-rules { margin: 0; max-width: none; font-size: 14px; box-shadow: 0 10px 40px #000c; }
.zj-btns .btn:disabled { opacity: .38; filter: grayscale(.7); cursor: not-allowed; }

.zj-big-mid { position: relative; width: 2.7em; height: 3.8em; }
.zj-big-mid > .card, .zj-big-mid .pk, .zj-big-mid .sq { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit; }
.zj-big-mid .pk .card, .zj-big-mid .pk .sqf { position: absolute; inset: 0; width: 100%; height: 100%; font-size: inherit; }
.zj-big-in.bsq .zj-big-top { font-size: clamp(18px, 4vw, 30px); color: #fff3b0; text-shadow: 0 0 14px #ff9800, 0 2px 6px #000; }
.zj-big-in.bsq .zj-big-mid { filter: drop-shadow(0 0 16px #ffd54a); }
/* ── 表情貼圖(2026-11-29:自己畫的 Q 版貼圖 + 真人語音)── */
#emoteGrid { grid-template-columns: repeat(6, 1fr); }
#emoteGrid button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px 3px; }
#emoteGrid button small { font-size: 11px; color: #cfd8dc; white-space: nowrap; }
#emoteGrid .emo-pic { width: 54px; height: 54px; object-fit: contain; transition: transform .15s; }
#emoteGrid button:hover .emo-pic { transform: scale(1.15) rotate(-4deg); }
.menu-emo .emo-pic { width: 28px; height: 28px; object-fit: contain; display: block; margin: 0 auto; }
.emo-pic { pointer-events: none; user-select: none; -webkit-user-select: none; }
.emo-txt { font-size: 1.6em; }
.emo .big { font-size: 64px; }
.emo .big .emo-pic { width: clamp(96px, 16vw, 150px); height: clamp(96px, 16vw, 150px); object-fit: contain; filter: drop-shadow(0 6px 14px #000c) drop-shadow(0 0 2px #fff); display: block; }
.emo-fly .emo-pic { width: 70px; height: 70px; object-fit: contain; display: block; }
/* 台詞泡泡(漫畫風):貼圖上方斜斜冒出來 */
.emo .cap { position: absolute; top: -18px; white-space: nowrap; padding: 4px 12px; border-radius: 16px; background: #fff; color: #222; font-weight: 900; font-size: clamp(13px, 2.6vw, 17px);
  border: 3px solid #222; box-shadow: 3px 3px 0 #222; animation: emo-cap 3s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.emo .cap.r { left: 55%; transform-origin: 0 100%; }
.emo .cap.l { right: 55%; transform-origin: 100% 100%; }
.emo .cap::after { content: ''; position: absolute; bottom: -11px; border: 8px solid transparent; border-top: 10px solid #222; }
.emo .cap.r::after { left: 14px; }
.emo .cap.l::after { right: 14px; }
@keyframes emo-cap { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 12% { transform: scale(1.15) rotate(3deg); opacity: 1; } 20% { transform: scale(1) rotate(-2deg); } 85% { transform: scale(1) rotate(-2deg); opacity: 1; } 100% { transform: scale(.8) translateY(-10px); opacity: 0; } }
/* 光暈、衝擊波、閃光 */
.emo .glow { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: radial-gradient(circle, #ffe08a99, #ff408133 45%, transparent 70%); animation: emo-glow 2.8s ease-out forwards; }
@keyframes emo-glow { 0% { transform: scale(.2); opacity: 0; } 15% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.4) rotate(90deg); opacity: 0; } }
.emo .ring { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 4px solid #ffe08a; box-shadow: 0 0 18px #ffd54a;
  animation: emo-ring .8s ease-out forwards; }
.emo .ring.r2 { animation-delay: .15s; border-color: #ff80ab; box-shadow: 0 0 18px #ff4081; opacity: 0; }
@keyframes emo-ring { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.emo-flash { position: fixed; inset: 0; background: radial-gradient(ellipse at center, #ffffffaa, transparent 70%); animation: emo-flash .5s ease-out forwards; }
@keyframes emo-flash { from { opacity: 1; } to { opacity: 0; } }
#emoteGrid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#emoteGrid button small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  #emoteGrid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  #emoteGrid .emo-pic { width: 44px; height: 44px; }
  #emoteGrid button small { font-size: 10px; }
}