/* Opt-in traditional card layouts. Use native dimensions, not CSS zoom/scale: animations use viewport pixels. */
body.card-game #table[data-card-layout="desktop"]{width:var(--card-frame-w);height:var(--card-frame-h);inset:0;margin:auto;max-width:none;border:1px solid #ffffff25;border-radius:20px}
body.card-game .overlay{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);padding:max(12px,var(--safe-t,0px)) max(12px,var(--safe-r,0px)) max(12px,var(--safe-b,0px)) max(12px,var(--safe-l,0px))}
body.card-game .sheet{max-width:100%;max-height:100%}

/* Bidding/calling is bounded between the top bar and the hand, rather than centered with negative overflow. */
body.card-game #center:has(.trick-wrap):not(.choosing){top:calc(44px + var(--safe-t,0px));bottom:calc(var(--ch) + 20px + var(--safe-b))}
body.card-game #center.choosing{top:calc(44px * var(--card-ui,1) + var(--safe-t,0px));bottom:calc(var(--ch) + 20px * var(--card-ui,1) + var(--safe-b));transform:translateX(-50%);align-items:center;justify-content:center}
body.card-game #center.choosing .trick-wrap{height:100%;min-height:0;min-width:0;flex:1;justify-content:center}
body.card-game #center.choosing .bid-panel{min-height:0;max-height:100%;overflow-y:auto;touch-action:pan-y;scrollbar-width:thin;animation:fade .2s ease-out}
body.card-game #center.choosing .bid-panel>*{flex-shrink:0}
@media(max-height:480px){
 body.card-game #center.choosing{width:calc(100% - 300px - var(--safe-l) - var(--safe-r));gap:12px}
 body.card-game #center.choosing .bid-panel{width:100%;max-width:100%;padding:6px 10px;gap:4px}
 body.card-game #center.choosing .turnup:has(.spot.empty){display:none}
 body.card-game #center.choosing .bids,body.card-game #center.choosing .ranks{gap:4px;max-width:none}
 body.card-game #center.choosing .bp-title{font-size:16px;line-height:1.15;text-align:center}
 body.card-game #center.choosing .ranks button{min-width:36px;height:36px;font-size:20px;padding:0 4px}
 body.card-game #center.choosing .bids button{min-width:36px;height:36px;font-size:18px;padding:0 8px}
 body.card-game #center.choosing .bid-panel .note{font-size:12px;line-height:1.2}
 body.card-game .trick-wrap .center-msg{padding:4px 8px;font-size:13px;line-height:1.15}
}

/* Desktop furniture grows with the cards, keeping a bounded table instead of an empty monitor-sized felt. */
body.card-game #table[data-card-layout="desktop"] .topbar{left:calc(10px * var(--card-ui));right:calc(10px * var(--card-ui));top:calc(8px * var(--card-ui));font-size:calc(15px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .topbar .round-info{font-size:calc(15px * var(--card-ui));gap:calc(10px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .icon-btn{min-width:calc(32px * var(--card-ui));height:calc(34px * var(--card-ui));font-size:calc(20px * var(--card-ui));border-radius:calc(10px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .topbar .btn{font-size:calc(15px * var(--card-ui));padding:calc(8px * var(--card-ui)) calc(12px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .avatar{width:calc(40px * var(--card-ui));height:calc(40px * var(--card-ui));font-size:calc(20px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .me-name,body.card-game #table[data-card-layout="desktop"] .seat .name{font-size:calc(15px * var(--card-ui));line-height:1.15}
body.card-game #table[data-card-layout="desktop"] .me-name small,body.card-game #table[data-card-layout="desktop"] .seat-info,body.card-game #table[data-card-layout="desktop"] .seat-status,body.card-game #table[data-card-layout="desktop"] .bidline{font-size:calc(13px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .seat-hands{--sw:calc(52px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .status,body.card-game #table[data-card-layout="desktop"] .center-msg{font-size:calc(15px * var(--card-ui));padding:calc(6px * var(--card-ui)) calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .hand-tools,body.card-game #table[data-card-layout="desktop"] .hand-tools .chip{font-size:calc(13px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .hand-tools .chip{padding:calc(5px * var(--card-ui)) calc(10px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .hand-tools .btn{font-size:calc(15px * var(--card-ui));padding:calc(10px * var(--card-ui)) calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .zone-label,body.card-game #table[data-card-layout="desktop"] .slot{font-size:calc(12px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .dealer-spot .who{font-size:calc(13px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .seat.side.top{top:calc(76px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .pile-label,body.card-game #table[data-card-layout="desktop"] .pile-count,body.card-game #table[data-card-layout="desktop"] .turnup .lbl,body.card-game #table[data-card-layout="desktop"] .tslot .who{font-size:calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .actions .btn{font-size:calc(17px * var(--card-ui));padding:calc(8px * var(--card-ui)) calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"]:has(#actions:not([hidden])) .my-hands{bottom:calc(72px * var(--card-ui) + var(--safe-b))}
body.card-game #table[data-card-layout="desktop"] #center:not(.choosing){top:calc(56px * var(--card-ui));bottom:calc(var(--ch) + 64px * var(--card-ui) + var(--safe-b));transform:translateX(-50%);justify-content:center}
body.card-game #table[data-card-layout="desktop"] #center:has(.melds){left:calc(172px * var(--card-ui));right:calc(130px * var(--card-ui));transform:none;align-items:stretch;gap:calc(10px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .bid-panel .bp-title{font-size:calc(18px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .bid-panel .note{font-size:calc(13px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .bid-panel button{font-size:calc(19px * var(--card-ui));min-height:calc(38px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .melds-empty{font-size:calc(15px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .pass-btn{font-size:calc(14px * var(--card-ui));padding:calc(6px * var(--card-ui)) calc(16px * var(--card-ui))}

/* Cribbage keeps its portrait composition; its cards, pegs and controls grow as a unit on desktops. */
body.card-game #table[data-card-layout="desktop"][data-card-portrait="true"] .cr{max-width:none;--tw:calc(56px * var(--card-ui));--th:calc(var(--tw) * 1.43);--hw:calc(80px * var(--card-ui));--hh:calc(var(--hw) * 1.4);--g:calc(10px * var(--card-ui));padding:calc(8px * var(--card-ui)) calc(14px * var(--card-ui)) calc(10px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .cr-top{min-height:calc(44px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .ic{width:calc(44px * var(--card-ui));height:calc(44px * var(--card-ui));font-size:calc(20px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .ic svg{width:calc(24px * var(--card-ui));height:calc(24px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] #phaseTitle,body.card-game #table[data-card-layout="desktop"] .cr .nm{font-size:calc(16px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] #phaseSub,body.card-game #table[data-card-layout="desktop"] .pa-lbl{font-size:calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .sc .pts{font-size:calc(28px * var(--card-ui));line-height:1.15}
body.card-game #table[data-card-layout="desktop"] .board-labels{font-size:calc(13px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .opp .avatar{width:calc(40px * var(--card-ui));height:calc(40px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .opp .name,body.card-game #table[data-card-layout="desktop"] .opp .hint{font-size:calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .pc-n{font-size:calc(56px * var(--card-ui))}

/* The Gang uses poker-card components and chip history instead of the standard hand strip. */
body.card-game #table[data-card-layout="desktop"] .middle{top:calc(48px * var(--card-ui));bottom:calc(8px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .st-top b{font-size:calc(15px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .st-top .avatar{width:calc(24px * var(--card-ui));height:calc(24px * var(--card-ui));font-size:calc(13px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .st-top .wait,body.card-game #table[data-card-layout="desktop"] .st-top .rdy{font-size:calc(12px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .my-hand{font-size:calc(16px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .tip{font-size:calc(14px * var(--card-ui))}
body.card-game #table[data-card-layout="desktop"] .my-side{max-width:calc(240px * var(--card-ui))}
