/* Shared black and gold surfaces, matching the playing table. */
:root{--bg:#0c0c0d;--panel:#181819;--line:#39332a;--gold:#d7b97b;--muted:#aaa398;color-scheme:dark}
body{background:#0c0c0d;color:#eee9df}aside{background:#111112;border-color:#383027}header{background:#101011;border-color:#393128}p,label{color:#b8b1a6}button{background:#252322;border-color:#494136}input,select,textarea{background:#101011;color:#eee9df;border-color:#494136}.gold,.finance-popup-open{background:var(--gold);color:#191714;border-color:var(--gold)}.nav{color:#b8b1a6}.nav.active{background:#30281c;color:#f0d297;border-color:#75603b}.navtitle,.sidebottom,footer,.brand small{color:#9b9285}.online{color:#d1bc8b}dialog{background:#191819;border-color:#77613e;color:#eee9df}.stat,.room,.tip,.admin-panel,.finance-account-card,.finance-section,.finance-metric,.finance-wallet-balances>div{background:#191819;border-color:#484034}.hero{background:radial-gradient(ellipse at 83% 80%,#5a462533,transparent 55%),linear-gradient(120deg,#29231b,#151516);border-color:#675334}.avatar{background:#30291f;border-color:#786341}.empty{background:transparent}.tag{background:#29251d;border-color:#655536;color:#d8c18c}.lobby-rate-tabs button,.lobby-status-tabs button,.lobby-room-row,.lobby-no-rooms,.lobby-main-actions>button:not(.gold){background:#191819;border-color:#423b30}.lobby-rate-tabs .active,.lobby-status-tabs .active{background:#d7b97b;color:#191714}.lobby-room-row.my-room-row{background:#2b241b;border-color:#9c7c45}.lobby-seat-avatar,.lobby-seat-empty{background:#232122;border-color:#64543b}.finance-bank-choice,.finance-secret,.finance-drawer{background:#191819;border-color:#695537}.finance-drawer textarea{background:#0e0e0f;border-color:#514536}.finance-popup,.finance-popup.withdrawal,.finance-popup.account{background:#211e19}.finance-popup p{color:#d9d0bf}.finance-popup-icon{color:#1c1913}.room-chat,.room-chat-header,.social-panel,.profile-popover,.profile-card{background:#181819;border-color:#685638}.room-chat input,.room-chat textarea{background:#101011}.admin-alert{background:#30261a;border-color:#7e6135;color:#ecd09a}.finance-member-entry{padding:13px 0;border-bottom:1px solid var(--line)}.finance-member-entry>div{display:flex;justify-content:space-between;gap:12px;align-items:center}.finance-member-entry small{color:var(--muted);overflow-wrap:anywhere}.finance-member-entry p{margin:7px 0;font-size:12px}.finance-member-entry summary{cursor:pointer;line-height:1.8}.finance-member-entry summary span{display:block;color:var(--gold);font-size:12px}.finance-member-dialog{width:min(900px,94vw);max-height:90dvh;overflow:auto}.finance-member-heading{display:flex;gap:16px;align-items:center}.finance-member-heading h2{margin:0}.finance-member-heading p{margin:4px 0}.finance-member-heading img{width:72px;height:72px;border-radius:50%;object-fit:cover;border:2px solid var(--gold)}.finance-member-heading small{color:var(--muted);overflow-wrap:anywhere}.finance-user-link{background:none;border:0;padding:0;color:var(--gold);text-decoration:underline;text-underline-offset:4px;font:inherit;text-align:left;min-height:32px}.finance-adjust-deposit{padding:12px;border:1px solid #78613a;border-radius:9px;margin:16px 0;background:#242019}.finance-adjust-deposit label{margin-top:0}.finance-adjust-deposit input{font-size:22px;color:#ebcc8d}.finance-adjust-deposit small{display:block;margin-top:7px;color:#c3b69f}.finance-adjust-deposit p{font-size:12px;margin-bottom:0}#finance-member-warning{margin:15px 0}.finance-user-link:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media(max-width:760px){.finance-member-dialog{padding:20px 16px}.finance-member-heading img{width:58px;height:58px}.finance-member-dialog .finance-metrics{grid-template-columns:1fr 1fr}.finance-member-entry>div{align-items:flex-start}.finance-member-dialog .finance-tabs{gap:5px}.finance-member-dialog .finance-tabs button{flex:1;padding:9px 6px}}

.seat-profile-card,.play-history,.play-history-drawer,.private-chat{background:linear-gradient(145deg,#24211b,#141415);border-color:#78623d}.chat-bubble,.private-message{background:#292724}.my-message .chat-bubble,.private-message.mine{background:#393124}.profile-avatar,.chat-avatar{background:#30291f;border-color:#75613b}.member-profile .profile-secondary-actions{display:flex;justify-content:center;border-top:1px solid var(--line);padding-top:12px;margin-top:16px}.member-profile button.profile-chat-toggle{display:inline-flex;align-items:center;justify-content:center;width:auto;max-width:100%;min-height:34px;margin:0;padding:6px 12px;font-size:11px;font-weight:400;line-height:1.5;background:transparent;border:1px solid #4d463c;border-radius:7px;color:#bcb3a5}.member-profile button.profile-chat-toggle[aria-pressed=true]{color:#dec28a;border-color:#846738}.member-profile .social-profile-actions{margin-top:14px}.member-profile .social-profile-actions button{min-height:36px;font-size:12px;padding:7px 12px}

.finance-report-card{padding:18px;margin:14px 0;border:1px solid var(--line);border-radius:10px;background:#1c1b1a}.finance-report-card>div:first-child{display:flex;justify-content:space-between;gap:12px;align-items:center}.finance-report-reason{white-space:pre-wrap;overflow-wrap:anywhere}.finance-report-card small{color:var(--muted);display:block}

.finance-deposit-destination{display:grid;grid-template-columns:minmax(0,1fr) 164px;align-items:center;gap:16px}.finance-deposit-destination>div{display:grid;gap:8px;min-width:0;overflow-wrap:anywhere}.finance-deposit-destination:not(:has(.finance-receiving-qr)){grid-template-columns:1fr}.finance-receiving-qr{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0;color:var(--gold);font-size:10px;text-align:center;text-decoration:none}.finance-receiving-qr img{display:block;width:156px;height:156px;object-fit:contain;background:#fff;border:8px solid #fff;border-radius:8px}.finance-receiving-qr[hidden]{display:none}#finance-receiving-qr-preview{margin-top:18px}#finance-receiving-qr-remove{font-size:11px;padding:6px 10px;margin-top:8px}@media(max-width:600px){.finance-deposit-destination{grid-template-columns:1fr}.finance-receiving-qr img{width:176px;height:176px}.finance-deposit-destination .finance-receiving-qr{border-top:1px solid var(--line);padding-top:14px}}

.live-play-pile{display:flex;flex-direction:column;align-items:center;gap:5px;max-width:100%;min-width:0}.pile-owner{display:flex;align-items:center;justify-content:center;gap:6px;max-width:100%;font-size:12px}.pile-owner img,.pile-owner-avatar{width:23px;height:23px;border-radius:50%;object-fit:cover;border:1px solid #a88a4d}.pile-owner-avatar{display:grid;place-items:center;background:#32291c;color:#e6c780;font-size:11px}.pile-owner b{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f0dcaf}.pile-owner small{font-size:9px;color:#b9a777}.pile-set-label{border:1px solid #8f733d;border-radius:20px;padding:2px 11px;font-size:10px;color:#e5c88c;background:#302719}.live-seat-center .pile-main-cards{display:flex;gap:3px;justify-content:center;min-height:61px;max-height:none;overflow:visible;margin:0}.live-seat-center .pile-main-cards .card{width:43px;height:61px;font-size:20px;padding:5px;margin:0;box-shadow:0 4px 14px #0008,0 0 15px #d0a34d16;pointer-events:none}.live-seat-center .pile-main-cards:has(.card:nth-child(7)) .card{width:29px;height:47px;font-size:14px}.pile-recent{display:flex;justify-content:center;gap:7px;max-width:100%;margin-top:3px}.pile-recent>button{padding:4px 7px;min-height:31px;display:flex;gap:5px;align-items:center;max-width:155px;background:#141413b3;border:1px solid #5c4c30;border-radius:7px}.pile-recent-name{font-size:9px;color:#b3a58a;max-width:54px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pile-recent-cards{display:flex;gap:2px;align-items:center}.pile-mini-card{display:inline-flex;gap:1px;align-items:center;background:#d3cbb5;color:#171719;padding:2px 3px;border-radius:3px;font:11px Georgia}.pile-mini-card.red{color:#ae323a}.pile-recent-cards>small{font-size:9px}.live-table .live-seat-center>.timer{position:static;transform:none;font-size:13px;margin-top:3px}.pile-empty-symbol{color:#8b7442;font-size:28px;line-height:1.1}.pile-empty-title{font-size:13px;color:#dbc28b}.empty-pile>small{color:#bdb19c;font-size:10px}@media(min-width:761px) and (max-height:720px){.live-play-pile{gap:3px}.live-seat-center .pile-main-cards{min-height:44px}.live-seat-center .pile-main-cards .card{width:32px;height:44px;font-size:15px;padding:3px}.pile-owner img,.pile-owner-avatar{width:18px;height:18px}.pile-recent{margin-top:0}.pile-recent>button{min-height:24px;padding:2px 5px}.live-table .live-seat-center>.timer{font-size:11px;margin-top:0}}@media(max-width:760px){.live-play-pile{gap:3px}.pile-owner{font-size:10px;gap:4px}.pile-owner img,.pile-owner-avatar{width:17px;height:17px}.pile-owner b{max-width:86px}.pile-owner small{font-size:8px}.pile-set-label{font-size:9px;padding:1px 8px}.live-seat-center .pile-main-cards{min-height:48px;max-height:none;gap:2px;overflow:visible;justify-content:center}.live-seat-center .pile-main-cards .card{width:30px;height:46px;font-size:16px;padding:3px}.live-seat-center .pile-main-cards:has(.card:nth-child(6)) .card{width:21px;height:35px;font-size:12px;padding:2px}.pile-recent{gap:3px;margin-top:1px}.pile-recent>button{padding:3px;min-height:23px;gap:3px;max-width:96px}.pile-recent-name{max-width:34px;font-size:8px}.pile-mini-card{font-size:9px;padding:1px 2px}.live-table .live-seat-center>.timer{font-size:10px;margin-top:1px}}

.live-table[data-phase="play"] .live-seat-center{transform:translateY(-10px)}.live-table[data-phase="play"] .live-seat-center>.timer{display:none}.live-activity{background:#191819;border-color:#594b31}@media(min-width:761px) and (max-height:720px){.live-seat-center .pile-main-cards .card{width:36px;height:52px;font-size:17px}.live-seat-center .pile-main-cards{min-height:52px}}@media(max-width:760px){.live-table[data-phase="play"] .live-seat-center{transform:translateY(-6px)}}

@media(max-width:760px){.live-table[data-phase="play"] .middle-dock{top:1%}.live-table[data-phase="play"] .live-seat-center{transform:translateY(-14px)}}@media(min-width:761px) and (max-height:720px){.live-table[data-phase="play"] .middle-dock{top:2%}}
@media(max-width:760px) and (min-height:700px){.live-table[data-phase="play"] .live-seat-center{transform:translateY(-36px)}.pile-owner small{display:none}.pile-owner b{max-width:76px}}@media(max-width:760px) and (max-height:699px){.live-play-pile{gap:1px}.live-seat-center .pile-main-cards{min-height:34px}.live-seat-center .pile-main-cards .card{width:25px;height:34px;font-size:13px}.pile-owner small{display:none}.pile-recent>button{min-height:18px;padding:1px 3px}.pile-set-label{font-size:8px}}

/* Keep wallet shortcuts beside the balance without consuming lobby/table space. */
.player-header{gap:16px}.player-header>span{white-space:nowrap}.player-header>div{align-items:center;min-width:0}.player-header .header-wallet{display:flex;align-items:center;gap:8px;min-width:0}.player-header .balance{white-space:nowrap;min-width:0}.player-header button.header-deposit,.player-header button.header-withdraw{min-width:72px;min-height:44px;padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;color:#fff;white-space:nowrap;flex-shrink:0}.player-header button.header-deposit{background:#237348;border-color:#38975f}.player-header button.header-withdraw{background:#a73540;border-color:#d15360}.player-header button.header-deposit:hover{background:#2c8656}.player-header button.header-withdraw:hover{background:#be414e}.player-header button:focus-visible{outline:2px solid #f0d39b;outline-offset:3px}
@media(min-width:761px) and (max-width:1200px){.player-header>span{display:none}.player-header{justify-content:flex-end}}
@media(max-width:760px){header.player-header,body:has(.seat-table) header.player-header,body:has(.compact-result) header.player-header{padding:0 8px;height:56px;min-height:56px;gap:0}header.player-header>div{width:100%;gap:4px;justify-content:flex-end;align-items:center}.player-header .header-wallet{flex:1;gap:4px}.player-header .balance,body:has(.seat-table) .player-header .balance{flex:1;padding:4px 2px;font-size:12px;overflow:hidden;text-align:left}.player-header .balance b{margin:0 2px;font-size:13px}.player-header .balance small{display:none}.player-header button.header-deposit,.player-header button.header-withdraw{min-width:44px;min-height:44px;padding:6px 9px;font-size:12px}.player-header .sound-control,body:has(.seat-table) .player-header .sound-control{width:32px;min-width:32px;height:44px;padding:4px;font-size:20px}.player-header #account,body:has(.seat-table) .player-header #account{max-width:88px;padding:4px;height:44px}.player-header .room-chat-toggle{min-height:44px;min-width:32px;padding:4px}body:has(.seat-table) #content{flex:1;min-height:0}body:has(.seat-table) #content:has(.player-hand-zone),body:has(.seat-table) #content:has(.special-hand-zone){height:calc(100dvh - 112px)}}
@media(max-width:480px){.player-header #account,body:has(.seat-table) .player-header #account,body:has(.compact-result) .player-header #account{width:32px;min-width:32px;max-width:32px;font-size:0;display:inline-flex;align-items:center;justify-content:center;line-height:1}.player-header #account::after{content:'☺';font-size:22px;line-height:1;color:#d7b97b}.player-header .balance b{font-size:12px}}
@media(max-width:760px) and (max-height:620px){body:has(.seat-table) #content:has(.player-hand-zone),body:has(.seat-table) #content:has(.special-hand-zone){height:calc(100dvh - 100px)}}

@media(max-width:480px){.player-header #account:has(.account-avatar)::after{display:none}.player-header #account .account-avatar{width:26px;height:26px;margin:0;flex-shrink:0}}

.finance-queue-header-actions{display:flex;gap:8px;flex-wrap:wrap}.finance-queue-header-actions button{min-height:42px}#finance-queue-refresh{border-color:#947643;color:#f0d39b}#finance-queue-update{min-height:20px}#finance-admin-panel[aria-busy="true"] #finance-queue-refresh{opacity:.7}@media(max-width:600px){#finance-admin-panel:has(#finance-queue-refresh)>.sectiontitle{align-items:flex-start;flex-direction:column;gap:10px}.finance-queue-header-actions{width:100%}.finance-queue-header-actions button{flex:1;min-height:44px}}

.finance-queue-header-actions{align-items:center}.finance-auto-control{display:flex;align-items:center;gap:7px;margin:0;font-size:12px;white-space:nowrap}.finance-auto-control select{width:auto;min-height:42px;margin:0;padding:7px 10px}#finance-auto-status{font-size:10px;color:var(--muted);min-width:96px}@media(max-width:600px){.finance-auto-control{flex:1}.finance-auto-control select{flex:1;min-height:44px}#finance-auto-status{width:100%;order:2}}

/* Two explicit game modes share the table layout, never the wallet. */
[hidden]{display:none!important}.mode-switch{display:flex;gap:8px;flex-shrink:0}.mode-switch button{min-height:48px;min-width:150px;padding:10px 18px;font-size:14px;border:1px solid #78633d;background:#1a1917;color:#ddd0b5}.mode-switch button.active{background:#d7b97b;color:#191714;border-color:#f4d698;font-weight:700;box-shadow:0 0 0 2px #d7b97b22}.lobby-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.mode-description{margin:0 0 12px;color:#bfb49d;font-size:12px}.lobby-main-actions{justify-content:flex-end}.lobby-main-actions>button{flex:0 0 auto}.room-mode-tag{display:inline-block;font-size:9px;padding:3px 6px;border:1px solid #665433;border-radius:5px;color:#ceb98a}.player-header .header-free-claim{min-height:44px;min-width:112px;background:#76602f;border-color:#b59651;color:#fff2ce;font-size:12px;padding:7px 10px;white-space:nowrap}.player-header .header-free-claim:disabled{opacity:.8;color:#d7c69e;background:#2f291e}.free-wallet-amount{display:block;font-size:32px;color:var(--gold);margin:20px 0}.free-wallet-amount small{font-size:14px}.profile-mode-stats{padding:8px;border:1px solid var(--line);border-radius:8px;font-size:12px}.profile-mode-stats p{margin:5px 0}.history-mode-tabs{display:flex;gap:6px;flex-wrap:wrap;padding:10px 0;align-items:center}.history-mode-tabs b{font-size:11px;color:var(--gold)}.history-mode-tabs button{font-size:12px;min-height:40px;padding:7px 10px}@media(max-width:1000px){.mode-switch button{min-width:125px;font-size:12px;padding:9px 11px}}@media(max-width:760px){.lobby-heading{flex-wrap:wrap;gap:8px}.mode-switch{width:100%;gap:7px;margin:0 0 8px}.mode-switch button{flex:1;min-width:0;min-height:48px;font-size:13px}.mode-description{font-size:11px;line-height:1.7}.player-header .header-free-claim{min-width:100px;font-size:11px;padding:6px}.lobby-main-actions{display:flex;justify-content:flex-end}.lobby-main-actions>button{min-width:120px;min-height:44px}.room-mode-tag{font-size:8px}.lobby-room-name>div{flex-wrap:wrap}}

.sectiontitle h2 small.table-mode-label,body:has(.seat-table) .sectiontitle h2 small.table-mode-label{display:inline-block!important;font-size:10px;line-height:1.6;vertical-align:middle;color:#dfc98f;padding:2px 6px;border:1px solid #685532;border-radius:5px;margin-left:5px}#free-settings-form{max-width:780px}#free-settings-form fieldset{border:1px solid var(--line);border-radius:10px;padding:16px}#free-settings-form label{display:block;margin:10px 0}#free-settings-form p{font-size:12px;line-height:1.8}@media(max-width:760px){.sectiontitle h2 small.table-mode-label,body:has(.seat-table) .sectiontitle h2 small.table-mode-label{font-size:8px;padding:1px 4px;margin-left:3px}}

.lobby-heading{flex-wrap:wrap}.mode-switch{margin-left:auto}.mode-description{line-height:1.8}
.card-watermark{display:none}
body.signed-out .player-header .header-wallet{display:none}
@media(max-width:760px){
 body.signed-out header.player-header{display:none}
 body.signed-out>aside{min-height:60px;padding:8px 10px;gap:6px;overflow:hidden}
 body.signed-out>aside>.nav{display:none!important}
 body.signed-out>aside .brand{margin:0 auto 0 0;font-size:25px;gap:4px;min-width:0}
 body.signed-out>aside .brand span{display:block!important;font-size:16px;white-space:nowrap}
 body.signed-out>aside .language-switch{margin:0;flex-shrink:0}
 body>aside>#account{order:10;flex-shrink:0;min-height:40px;max-width:110px;margin-left:auto;padding:6px 9px;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body>aside>#account.is-guest{width:auto;min-width:104px;max-width:158px;font-size:12px;line-height:1.4;padding:7px 10px;color:#191714;background:#d7b97b;border-color:#e6c98e}
 body>aside>#account.is-guest::after{display:none}
 body>aside>#account .account-avatar{width:25px;height:25px;margin-right:4px}
}
@media(max-width:760px){
 .player-header:has(#account.is-guest) .header-wallet{display:none}
 .player-header #account.is-guest,body:has(.seat-table) .player-header #account.is-guest,body:has(.compact-result) .player-header #account.is-guest{width:auto;min-width:112px;max-width:190px;height:44px;padding:8px 13px;font-size:13px;line-height:1.4;color:#191714;background:#d7b97b;border-color:#e6c98e;white-space:nowrap}
 .player-header #account.is-guest::after{display:none}
}
.mobile-live-history{display:none}
/* The finish effect occupies the same flex slot as the table it wraps. */
.round-finish-stage{flex:1 1 0;min-height:0!important;display:flex;flex-direction:column;width:100%;align-self:stretch}
body:has(.live-table) #content .round-finish-stage>.live-table{flex:1 1 0;min-height:180px;height:auto;max-height:none;margin:8px auto 12px}
/* Keep five seats and the public cards in separate lanes on phones.
   Never shrink the table to absorb the fixed hand controls. */
@media(max-width:760px){
 body:has(.live-table) #content:has(.player-hand-zone),body:has(.live-table) #content:has(.special-hand-zone){height:calc(100dvh - 56px);overflow-y:auto;overflow-x:hidden;display:block;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
 body:has(.live-table) .player-hand-zone,body:has(.live-table) .special-hand-zone{position:relative;inset:auto;max-height:none;width:100%;box-sizing:border-box;margin:12px 0 0}
 body:has(.live-table)>aside{display:none}body:has(.live-table) main{height:100dvh}
 body:has(.live-table) .live-activity{display:none}.live-room-tools .mobile-live-history{display:inline-block}
 body:has(.live-table) .live-room-tools{flex-wrap:wrap;height:auto;min-height:26px}.live-room-tools>span{display:none}
 body:has(.live-table) #content .live-table{flex:none;width:100%;height:260px;min-height:260px;max-height:none;margin:12px 0 10px}
 .live-table .table-seat{width:72px;height:88px;min-height:88px;padding:4px 3px;gap:1px;box-sizing:border-box}
 .live-table .seat-pos-0{left:50%;top:84%}.live-table .seat-pos-1{left:11%;top:51%}.live-table .seat-pos-4{left:89%;top:51%}.live-table .seat-pos-2{left:25%;top:16%}.live-table .seat-pos-3{left:75%;top:16%}
 .live-table .table-seat .seat-avatar{width:32px;height:32px;font-size:17px}
 .live-table .table-seat b{max-width:100%;font-size:10px;line-height:1.4;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .live-table .table-seat .seat-number{display:none}.live-table .table-seat .seat-count{font-size:8px;line-height:1.3}
 .live-table .seat-hand-count{position:static;min-width:0;gap:3px;padding:1px 5px;border-radius:4px;box-shadow:none;line-height:1.1;max-width:100%}
 .live-table .seat-hand-count strong{font-size:13px}.live-table .seat-hand-count small{font-size:9px}
 .live-table .seat-felt{inset:62px 12px 35px}
 .live-table .middle-dock,.live-table[data-phase="play"] .middle-dock{top:16px;gap:2px}
 .live-table .live-seat-center,.live-table[data-phase="play"] .live-seat-center{inset:88px 24% 86px;transform:none;gap:3px;justify-content:center}
 .live-table .pile-owner{max-width:100%;font-size:9px}.live-table .pile-owner b{max-width:80px}.live-table .pile-owner small{display:none}
 .live-table .pile-main-cards{min-height:42px;flex-wrap:nowrap}.live-table .pile-main-cards .card{width:27px;height:40px;font-size:15px}
 .live-table .pile-main-cards:has(.card:nth-child(6)) .card{width:18px;height:32px;font-size:11px;padding:2px}
 .live-table .pile-recent{display:none}
 .live-table .selection-card{top:28px;right:-31px;width:27px;height:40px}.live-table .seat-pos-3 .selection-card,.live-table .seat-pos-4 .selection-card{left:-31px;right:auto}
 .live-table .seat-clock-label{bottom:-20px;font-size:9px;padding:2px 6px}
 body:has(.live-table) .sectiontitle{align-items:flex-start;flex-wrap:wrap;gap:6px}
 body:has(.live-table) .sectiontitle>div{min-width:0;flex:1}.room-result-tools{height:auto;min-height:24px;display:flex;flex-wrap:wrap;gap:5px}
 body:has(.live-table) .player-hand-zone{display:grid;grid-template-columns:minmax(95px,1fr) minmax(0,1.65fr);gap:4px;padding:6px}
 body:has(.live-table) .player-hand-zone .turn-notice{grid-column:1;grid-row:1;margin:0;min-height:32px;padding:4px;gap:3px;font-size:10px;flex-wrap:wrap}
 body:has(.live-table) .player-hand-zone .turn-notice>span{display:none}
 body:has(.live-table) .player-hand-zone .turn-notice b{font-size:11px;line-height:1.4}
 body:has(.live-table) .player-hand-zone .hand-sort-tools{grid-column:2;grid-row:1;min-width:0;margin:0;gap:3px;flex-wrap:nowrap;align-items:center}
 body:has(.live-table) .player-hand-zone .hand-sort-tools button{padding:4px;font-size:9px;min-width:0}
 body:has(.live-table) .player-hand-zone .hand-sort-tools select{min-width:0;width:95px;padding:4px;font-size:10px}
 body:has(.live-table) .player-hand-zone .hand{grid-column:1/-1;grid-row:2;margin:0}
 body:has(.live-table) .player-hand-zone .actions{grid-column:1/-1;grid-row:3;margin:0;min-width:0}
 dialog h2{padding-right:28px;overflow-wrap:anywhere}
}
.round-finish-stage{position:relative;isolation:isolate;min-height:280px}.round-finish-stage .live-table{margin-top:18px}.finish-shade{position:absolute;inset:0;z-index:2;border-radius:16px;background:radial-gradient(ellipse at center,#17130b99,#0004 65%,#0002);animation:finish-shade-in .5s ease-out both;pointer-events:none}.finish-announcement{position:absolute;inset:12% 8% auto;z-index:3;display:flex;align-items:center;flex-direction:column;gap:8px;text-align:center;padding:16px 20px;background:linear-gradient(150deg,#211b11f5,#12110ff5);border:1px solid #b18a42;border-radius:16px;box-shadow:0 12px 45px #0009,0 0 40px #b78b3029;animation:finish-reveal .65s cubic-bezier(.2,.75,.25,1) .3s both;max-width:480px;margin:auto}.finish-emblem{color:#e6c474;font-size:48px;line-height:1;text-shadow:0 0 20px #cf9a3c88}.finish-announcement h2{font-size:28px;font-weight:700;color:#f5d98f;line-height:1.7;overflow-wrap:anywhere}.finish-announcement p{font-size:13px;margin:0;color:#d2c5a8}.finish-announcement>button{font-size:12px;background:transparent;border-color:#79633b;margin-top:5px;min-height:36px;color:#e5cf9f}.finish-net{animation:finish-reveal .5s ease-out .95s both;color:#f2d590}.finish-net>small{display:block;color:#baaf99;font-size:12px}.finish-net strong{display:block;font-size:29px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.5}.finish-net strong small{font-size:13px;font-weight:400}.finish-special-cards{display:flex;justify-content:center;gap:2px;flex-wrap:wrap;max-width:100%;animation:finish-reveal .5s ease-out .2s both}.finish-special-cards .card{width:31px;height:46px;font-size:13px;padding:3px;margin:0;pointer-events:none}.round-finish-stage .winner-seat{border:2px solid #f4d48a!important;background:linear-gradient(145deg,#695222,#292012)!important;box-shadow:0 0 0 3px #dcb55233,0 0 30px #dcb55299!important;animation:finish-winner-glow 1.1s ease-in-out 2}.round-finish-stage .pile-main-cards{animation:finish-last-card .4s ease-out both}.round-finish-stage.is-redeal .pile-main-cards{animation:finish-collect .8s ease-in .2s both}.is-redeal .finish-emblem{font-size:40px}.is-redeal .finish-announcement{border-color:#8e805d}.is-redeal .finish-announcement h2{color:#e3d8bb}@keyframes finish-shade-in{from{opacity:0}to{opacity:1}}@keyframes finish-reveal{from{opacity:0;transform:translateY(12px) scale(.94)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes finish-last-card{from{transform:scale(1.06)}to{transform:scale(1)}}@keyframes finish-winner-glow{50%{box-shadow:0 0 0 5px #dcb55222,0 0 40px #dcb552aa}}@keyframes finish-collect{to{transform:translateY(18px) scale(.7);opacity:.2}}@media(max-width:760px){.round-finish-stage{min-height:270px}.finish-announcement{inset:15% 7% auto;padding:14px 12px;gap:5px;border-radius:12px}.finish-emblem{font-size:37px}.finish-announcement h2{font-size:22px}.finish-net strong{font-size:25px}.finish-special-cards .card{width:25px;height:37px;font-size:11px;padding:2px}.finish-announcement p{font-size:11px}.finish-announcement>button{font-size:11px;min-height:34px}}@media(prefers-reduced-motion:reduce){.round-finish-stage *{animation:none!important;transition:none!important}}
@media(max-width:760px){
 .player-hand-zone .hand,.special-hand-zone .hand{--mobile-card-width:clamp(60px,18vw,78px);--hand-intervals:1;--mobile-overlap:min(0px,calc((100% - var(--mobile-card-width)) / var(--hand-intervals) - var(--mobile-card-width)));display:flex;flex-wrap:nowrap;justify-content:center;align-items:flex-end;gap:0;padding:18px 8px 6px;min-height:124px;overflow:visible;isolation:isolate}
 .hand:has(>.card:nth-child(3)){--hand-intervals:2}.hand:has(>.card:nth-child(4)){--hand-intervals:3}.hand:has(>.card:nth-child(5)){--hand-intervals:4}.hand:has(>.card:nth-child(6)){--hand-intervals:5}.hand:has(>.card:nth-child(7)){--hand-intervals:6}.hand:has(>.card:nth-child(8)){--hand-intervals:7}.hand:has(>.card:nth-child(9)){--hand-intervals:8}
 .player-hand-zone .hand .card,.special-hand-zone .hand .card{position:relative;flex:0 0 var(--mobile-card-width);width:var(--mobile-card-width);height:100px;margin:0;padding:7px 5px;align-items:flex-start;justify-content:flex-start;gap:1px;font-size:21px;line-height:1;border-radius:7px;text-align:left;overflow:visible;box-shadow:-2px 2px 5px #0004}
 .player-hand-zone .hand .card+.card,.special-hand-zone .hand .card+.card{margin-left:var(--mobile-overlap)}
 .player-hand-zone .hand .card>span:first-child,.special-hand-zone .hand .card>span:first-child{min-height:23px;letter-spacing:-1px}
 .player-hand-zone .hand .card>span:nth-child(2),.special-hand-zone .hand .card>span:nth-child(2){font-size:19px}
 .player-hand-zone .hand .card .card-watermark,.special-hand-zone .hand .card .card-watermark{display:block;position:absolute;right:7px;bottom:6px;font-size:34px;opacity:.25;pointer-events:none}
 .hand-drag-ghost{align-items:flex-start;justify-content:flex-start;gap:1px;font-size:21px;padding:7px 5px}.hand-drag-ghost .card-watermark{display:block;position:absolute;right:7px;bottom:6px;font-size:34px;opacity:.25}
 .player-hand-zone .hand .card.selected,.special-hand-zone .hand .card.selected{transform:translateY(-13px);outline:2px solid #f6d58d;outline-offset:0;box-shadow:-2px 3px 7px #0007}
 .hand .hand-drop-before::before{left:-3px;top:-5px;bottom:-5px;z-index:50;pointer-events:none}.hand .hand-drop-after::after{left:calc(var(--hand-visible-edge,60px) - 2px);right:auto;top:-5px;bottom:-5px;z-index:50;pointer-events:none}
 .player-hand-zone,.special-hand-zone{max-height:57dvh}
 body:has(.seat-table) #content:has(.player-hand-zone),body:has(.seat-table) #content:has(.special-hand-zone){padding-bottom:calc(280px + env(safe-area-inset-bottom))}
}
@media(max-width:760px) and (max-height:620px){.player-hand-zone .hand,.special-hand-zone .hand{min-height:104px;padding-top:16px}.player-hand-zone .hand .card,.special-hand-zone .hand .card{height:80px}.player-hand-zone .hand .card .card-watermark,.special-hand-zone .hand .card .card-watermark{font-size:26px}body:has(.seat-table) #content:has(.player-hand-zone),body:has(.seat-table) #content:has(.special-hand-zone){padding-bottom:calc(255px + env(safe-area-inset-bottom))}}
.finance-wallet-balances>div,.finance-rake-summary>span{min-width:0}.finance-wallet-balances b,.finance-rake-summary b{overflow-wrap:anywhere;line-height:1.35}.finance-status.approved.withdrawal-pending{color:#ead099;background:#3c402b}@media(max-width:760px){.finance-wallet-balances small{display:block;line-height:1.4;min-height:2.8em;overflow-wrap:anywhere}}
/* Phone game is a single viewport: fixed controls get space before the table. */
@media(max-width:760px){
 body:has(.live-table) #content:has(.player-hand-zone),body:has(.live-table) #content:has(.special-hand-zone){height:calc(100dvh - 56px);display:flex;flex-direction:column;overflow:hidden;padding:5px 8px calc(5px + env(safe-area-inset-bottom));gap:4px}
 body:has(.live-table) .sectiontitle{min-height:0;flex:none;gap:4px;margin:0}
 body:has(.live-table) .sectiontitle h2{font-size:14px;line-height:1.35}
 body:has(.live-table) .sectiontitle h2 .table-mode-label{display:none!important}
 body:has(.live-table) .sectiontitle>button{padding:5px 7px;min-height:30px;font-size:9px}
 body:has(.live-table) .rake-room{margin-top:2px;font-size:9px}.rake-room .rake-badge summary{padding:2px 5px}
 body:has(.live-table) #live-connection{font-size:9px;line-height:1.3}
 body:has(.live-table) .live-room-tools{flex:none;min-height:22px;margin:0;gap:4px}
 body:has(.live-table) .live-room-tools button{min-height:22px;padding:3px 6px;font-size:9px}
 body:has(.live-table) #content .live-table{flex:1 1 0;height:auto;min-height:210px;max-height:none;margin:2px 0 4px}
 .live-table .table-seat{width:68px;height:76px;min-height:76px;padding:3px;gap:1px}
 .live-table .table-seat .seat-avatar{width:26px;height:26px;font-size:15px}
 .live-table .table-seat b{font-size:9px;line-height:1.25}.live-table .table-seat .seat-count{font-size:8px;line-height:1.15}
 .live-table .seat-hand-count{padding:1px 4px}.live-table .seat-hand-count strong{font-size:12px}
 .live-table .seat-pos-2,.live-table .seat-pos-3{top:18%}.live-table .seat-pos-0{top:82%}
 .live-table .middle-dock,.live-table[data-phase="play"] .middle-dock{top:5px}
 .live-table .live-seat-center,.live-table[data-phase="play"] .live-seat-center{inset:30% 24% 30%;transform:none}
 .live-table .live-play-pile{gap:1px}.live-table .pile-owner{font-size:8px;line-height:1.2}.live-table .pile-owner img,.live-table .pile-owner-avatar{width:14px;height:14px}
 .live-table .pile-set-label{font-size:8px;padding:0 5px;line-height:1.5}
 .live-table .pile-main-cards{min-height:33px}.live-table .pile-main-cards .card{width:25px;height:33px;font-size:13px;padding:2px}
 .live-table .middle-slot,.live-table .middle-card{width:25px;height:34px}.live-table .middle-card{font-size:12px}
 body:has(.live-table) .player-hand-zone{flex:none;margin:0;padding:5px;gap:3px;overflow:visible}
 body:has(.live-table) .player-hand-zone .turn-notice{min-height:28px;padding:3px;flex-wrap:nowrap}
 body:has(.live-table) .player-hand-zone .turn-notice b{font-size:10px}.player-hand-zone .turn-notice strong{font-size:10px;white-space:nowrap}
 body:has(.live-table) .player-hand-zone .hand{padding:13px 6px 3px;min-height:98px}
 body:has(.live-table) .player-hand-zone .hand .card{height:82px;padding:5px 4px;font-size:19px}
 body:has(.live-table) .player-hand-zone .hand .card>span:first-child{min-height:21px}.player-hand-zone .hand .card>span:nth-child(2){font-size:17px}
 body:has(.live-table) .player-hand-zone .actions{gap:5px;display:flex}
 body:has(.live-table) .player-hand-zone .actions button{min-height:42px;padding:6px;font-size:11px;flex:1}
 body:has(.live-table) .player-hand-zone .actions .gold{flex:1.7}
 body:has(.live-table) .reserved-wait-notice{flex:none;padding:5px 8px;margin:0;font-size:10px}
 body:has(.live-table) .reserved-wait-notice span{display:none}
}
@media(max-width:760px) and (max-height:620px){
 body:has(.live-table) .player-hand-zone .hand{min-height:86px;padding-top:11px}
 body:has(.live-table) .player-hand-zone .hand .card{height:72px;font-size:18px}
 .live-table .seat-pos-2,.live-table .seat-pos-3{top:18%}.live-table .seat-pos-0{top:82%}
}
@media(max-width:360px){.live-table .pile-main-cards:has(.card:nth-child(6)) .card{width:15px;height:28px;font-size:10px;padding:1px}.live-table .pile-main-cards:has(.card:nth-child(6)){gap:1px}}
@media(max-width:760px){
 /* Apply the viewport layout to waiting, selection and dealing as well as play. */
 body:has(.live-table) #content{height:calc(100dvh - 56px);min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:5px 8px calc(5px + env(safe-area-inset-bottom));gap:4px}
 body:has(.live-table) #content>.live-table{flex:1 1 0;min-height:210px;height:auto;max-height:none}
 body:has(.live-table) #content .round-finish-stage>.live-table{min-height:210px;margin:2px 0 4px;width:100%}
 body:has(.live-table) .live-wait-actions{flex:none;display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0;padding:6px 0 0}
 body:has(.live-table) .live-wait-actions p{grid-column:1/-1;text-align:center;margin:0;font-size:11px;line-height:1.5}
 body:has(.live-table) .live-wait-actions button,body:has(.live-table) .live-wait-actions .gold{width:100%;min-height:46px;margin:0;padding:8px;font-size:12px}
 body:has(.live-table) .live-spectator-note{flex:none;margin:0;padding:6px;font-size:11px}
 body:has(.live-table) .dealt-my-hand{flex:none;margin:0;min-height:85px;padding:6px 0;flex-wrap:nowrap;gap:2px}
 body:has(.live-table) .dealt-my-hand .card{width:clamp(24px,8vw,40px);height:65px;font-size:16px;flex-shrink:1;margin:0;padding:4px}
 .live-table[data-phase="waiting"] .live-seat-center{inset:32% 24% 28%}
 .live-table[data-phase="waiting"] .live-seat-center h2{font-size:12px;line-height:1.5;margin:0}
 .live-table[data-phase="waiting"] .live-seat-center p{margin:0;font-size:10px}
}
.rake-lobby{display:flex;align-items:center;flex-wrap:wrap;gap:5px 12px;margin:10px 0;color:#d8c28f;font-size:12px}.rake-lobby b{border:1px solid #806630;border-radius:7px;padding:5px 10px;background:#292318;color:#f0d596}.rake-lobby small{flex-basis:100%;line-height:1.6;color:#b5ac99}.rake-zero b,.rake-badge.rake-zero summary{color:#9ed3ad;border-color:#47664d;background:#19281e}.rake-room{display:flex;gap:6px 12px;align-items:flex-start;flex-wrap:wrap;margin-top:7px;font-size:12px}.rake-room>small{color:#c4bda9;line-height:1.6}.rake-badge{position:relative}.rake-badge summary{cursor:pointer;list-style:none;color:#f0d596;border:1px solid #806630;background:#292318;padding:4px 9px;border-radius:6px;white-space:nowrap}.rake-badge summary::-webkit-details-marker{display:none}.rake-badge summary:focus-visible{outline:2px solid #f0d596;outline-offset:3px}.rake-badge p{position:absolute;top:100%;left:0;z-index:30;width:260px;max-width:75vw;background:#20201e;border:1px solid #806630;padding:12px;border-radius:8px;box-shadow:0 8px 20px #0009;color:#e3ddcd;line-height:1.7;margin-top:7px}.rake-next{padding:5px 0;color:#f0d596!important}.reserved-seat{border:2px dashed #b89c63!important;background:#28271f!important}.reserved-seat .seat-count{color:#f4d38c!important;font-weight:700}.reserved-wait-notice{display:flex;flex-wrap:wrap;gap:4px 14px;padding:10px 14px;border:1px solid #806630;border-radius:8px;background:#292318;font-size:12px;line-height:1.6}.reserved-wait-notice b{color:#f0d596}.reserved-wait-notice span{color:#d2c8ae}@media(max-width:760px){.rake-room{font-size:10px;margin-top:4px;gap:4px 8px}.rake-badge summary{padding:3px 7px}.rake-lobby{gap:4px 8px;font-size:11px;margin:8px 0}.reserved-seat .seat-count{font-size:9px!important;white-space:normal;line-height:1.4}.reserved-wait-notice{font-size:11px;padding:8px 10px}}

/* Keep room creation beside search, within the room-list toolbar. */
.room-directory .lobby-search-actions{display:flex;align-items:center;gap:8px;min-width:0}
.room-directory .lobby-create{min-height:44px;padding:10px 18px;white-space:nowrap;font-weight:700;color:#211a0d;background:linear-gradient(135deg,#f0d79d,#d7b675);border:1px solid #f2d99e;box-shadow:0 2px 8px #d7b67522}
.room-directory .lobby-create:hover{background:linear-gradient(135deg,#ffe7b2,#e3c382)}
@media(max-width:1050px){.room-directory .lobby-search-actions{flex:1}.room-directory .lobby-search-actions #lobby-search{flex:1;min-width:0;width:auto}}
@media(max-width:760px){.room-directory .lobby-list-tools{display:flex;flex-direction:column;align-items:stretch;gap:9px}.room-directory .lobby-search-actions{order:-1;flex:none}.room-directory .lobby-status-tabs{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:0}.room-directory .lobby-create{font-size:12px;padding:10px 12px;min-height:44px}}
