/* Shared tablet/phone sizing. Never scale the whole page or suppress overflow. */
body[data-layout] :is(main,#app,.wrap){min-width:0}
body[data-layout] :is(.table,.card-table,.stage,.center,.hand-wrap,.your-area,.panel,aside){min-width:0}
body[data-layout] button{touch-action:manipulation}
@media(max-width:1100px){
 body[data-layout]{font-size:16px}
 body[data-layout] :is(main,#app,.wrap){padding:10px 12px 80px}
 body[data-layout] :is(header,.top){gap:8px;margin-bottom:10px;padding-bottom:8px;min-height:44px}
 body[data-layout] :is(.welcome,.intro){margin:16px auto;gap:20px}
 body[data-layout] :is(.welcome,.intro) h1{font-size:clamp(34px,6vw,58px)}
 body[data-layout] :is(.game-hero-art,.family-hero){max-height:190px;width:100%;object-fit:cover;margin:12px 0}
 body[data-layout] :is(.setup,.setup-panel,.panel){padding:16px}
 body[data-layout] :is(.controls,.actions,.actionbar,.bid-buttons) button{min-height:44px}
 body[data-layout] :is(input,select){font-size:16px;min-height:44px}
 body[data-layout] :is(.controls,.actionbar){scroll-margin-bottom:80px}
 body[data-layout] :is(.table-heading,.board-title,.game-heading){gap:8px;margin-bottom:6px}
 body[data-layout] :is(.table-heading,.board-title,.game-heading) h1{font-size:25px}
 body[data-layout] .table-heading>strong{font-size:14px;padding:7px 10px}
 body[data-layout=classics] .table{padding:14px;border-radius:34px;border-width:5px}
 body[data-layout=classics] .seated-table{grid-template-columns:minmax(110px,145px) minmax(0,1fr) minmax(110px,145px);gap:8px}
 body[data-layout=classics] .seated-table .player{padding:7px 8px}
 body[data-layout=classics] .seated-table .family-stage .discard .family-card{width:74px;height:106px}
 body[data-layout=classics] .seated-table .family-stage .discard .family-center{font-size:39px}
 body[data-layout=classics] .seated-table .family-stage .discard .family-center>span{font-size:28px}
 body[data-layout=classics] .stage{min-height:0;padding:8px}
 body[data-layout=classics] .family-stage p{font-size:14px;margin-bottom:6px}
 body[data-layout=classics] .family-stage h2{font-size:21px;margin-bottom:7px}
 body[data-layout=classics] .hand-wrap{padding:8px 0}
 body[data-layout=classics] .hand-wrap h2{font-size:18px;margin-bottom:8px}
 body[data-layout=classics] .hand{gap:6px}
 body[data-layout=classics] .hand :is(.family-card,.card.detailed-card){width:64px;min-width:64px;height:94px}
 body[data-layout=classics] .hand .family-center{font-size:35px}
 body[data-layout=classics] .hand .family-center>span{font-size:25px}
 body[data-layout=classics] .hand .family-caption{font-size:9px}
 body[data-layout=classics] .players{gap:6px;margin:10px 0;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}
 body[data-layout=classics] .players .player{padding:7px 9px}
 body[data-layout=classics] .controls{padding-top:10px;gap:6px}
 body[data-layout=classics] .controls button{font-size:14px;padding:8px 12px;white-space:normal;overflow-wrap:anywhere}
 body[data-layout=board] .game{gap:14px;grid-template-columns:minmax(0,1fr) minmax(230px,.7fr)}
 body[data-layout=board] .board-wrap{min-width:0;width:100%}
 body[data-layout=board] .game aside h1{font-size:28px}
 body[data-layout=board] .player{padding:7px 9px}
 body[data-layout=board] .game aside .muted{font-size:14px}
 body[data-layout=board] .board{border-width:6px}
 body[data-layout=skip-bo] .table,body[data-layout=trash] .table{padding:12px;gap:10px;border-radius:28px;border-width:5px}
 body[data-layout=skip-bo] .your-area{gap:12px}
 body[data-layout=skip-bo] .building{gap:7px}
 body[data-layout=skip-bo] .build-target{padding:6px}
 body[data-layout=skip-bo] .build-target .card{width:60px}
 body[data-layout=skip-bo] .build-target>span{font-size:12px}
 body[data-layout=skip-bo] .opponents,body[data-layout=trash] .opponents{display:flex;overflow-x:auto;gap:8px;padding:4px 3px 8px;scroll-snap-type:x proximity}
 body[data-layout=skip-bo] .opponents>.seat,body[data-layout=trash] .opponents>.seat{flex:0 0 190px;scroll-snap-align:start}
 body[data-layout=skip-bo] .opponents .card{width:30px}
 body[data-layout=trash] .opponents .card{width:27px;height:39px}
 body[data-layout=oh-well] .table{gap:8px;padding:12px;border-radius:30px}
 body[data-layout=oh-well] .seat{padding:6px 8px}
 body[data-layout=oh-well] .seat-name>b,body[data-layout=oh-well] .nickname-button{font-size:14px}
 body[data-layout=oh-well] .seat-name>strong{font-size:20px}
 body[data-layout=oh-well] .progress{display:none}
 body[data-layout=pinochle] .card-table{padding:12px;gap:8px;border-radius:30px}
 body[data-layout=pinochle] .card-table .hand-area{margin-top:0;padding:6px}
 body[data-layout=pinochle] .card-table .hand{min-height:0;padding:6px 0;justify-content:center}
 body[data-layout=pinochle] .table-center{gap:8px}
}
@media(max-width:760px){
 body[data-layout]{padding-top:58px!important}
 body[data-layout]>jtv-account{position:absolute!important;top:5px!important;right:10px!important}
 body[data-layout] :is(main,#app,.wrap){padding:6px 8px 76px}
 body[data-layout] :is(header,.top){padding-top:0;padding-right:0;flex-wrap:wrap;font-size:14px}
 body[data-layout] header nav{gap:5px;flex-wrap:wrap}
 body[data-layout] :is(header,.top) button{min-height:44px;padding:8px 10px;font-size:14px}
 body[data-layout] :is(.welcome,.intro){grid-template-columns:1fr;margin:6px auto;gap:12px}
 body[data-layout] :is(.welcome,.intro) h1{font-size:36px;margin:0 0 6px}
 body[data-layout] .welcome h1>span{font-size:22px;margin-top:8px}
 body[data-layout] :is(.welcome,.intro) :is(.lead,.lede){font-size:18px;margin-bottom:8px}
 body[data-layout] :is(.game-hero-art,.family-hero){display:none!important}
 body[data-layout] :is(.controls,.actionbar){position:sticky;bottom:0;z-index:25;background:#17392f;padding:9px;border:1px solid #799780;border-radius:12px;box-shadow:0 -4px 14px #0004;max-height:38dvh;overflow:auto;overscroll-behavior:contain}
 body[data-layout]:has(.table-chat-host:not([hidden])) :is(.controls,.actionbar){bottom:62px}
 body[data-layout] :is(.controls,.actionbar) p{font-size:14px;margin-bottom:6px}
 body[data-layout=classics] .seated-table{grid-template-columns:minmax(0,1fr);grid-template-areas:'heading' 'opponents' 'seat-hint' 'play' 'hand' 'controls';gap:8px;border-radius:24px;padding:10px}
 body[data-layout=classics] .table-opponents{grid-area:opponents;display:flex;overflow-x:auto;gap:8px;padding:4px 3px 6px;scroll-snap-type:x proximity}
 body[data-layout=classics] :is(.seats-top,.seats-left,.seats-right){display:contents}
 body[data-layout=classics] .table-opponents .player{flex:0 0 138px;scroll-snap-align:start}
 body[data-layout=classics] .seat-scroll-hint{display:block;grid-area:seat-hint;font-size:12px;color:#d0dfce;margin:0}
 body[data-layout=classics] .seat-card-backs{display:none}
 body[data-layout=classics] .your-table-seat{margin:0 auto 7px;max-width:260px}
 body[data-layout=classics] .your-table-seat .player{padding:5px 9px}
 body[data-layout=classics] .your-table-seat .player small{display:inline}
 body[data-layout=classics] .your-table-seat .player p{display:inline;margin-left:6px}
 body[data-layout=classics] .table-heading h1{font-size:23px}
 body[data-layout=classics] .table-heading .eyebrow{font-size:10px}
 body[data-layout=classics] .table-play-area .notice{font-size:13px;padding:6px 9px}
 body[data-layout=classics] .discard{gap:14px}
 body[data-layout=classics] .stage{padding:3px 0}
 body[data-layout=classics] .family-stage .discard .family-card{width:66px;height:96px}
 body[data-layout=classics] .hand :is(.family-card,.card.detailed-card){width:56px;min-width:56px;height:84px}
 body[data-layout=classics] .hand .family-center{font-size:31px}
 body[data-layout=classics] .hand .family-center>span{font-size:23px}
 body[data-layout=classics] .hand .family-index{font-size:12px}
 body[data-layout=classics] .hand .wild-badge{font-size:6px}
 body[data-layout=classics] .hand .family-caption{font-size:8px;bottom:5px}
 body[data-layout=classics] .phase-table{grid-template-columns:minmax(0,1fr);margin:8px 0}
 body[data-layout=classics] .phase-table article{padding:8px}
 body[data-layout=classics] .phase-group>div{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
 body[data-layout=classics] .go-out-options{padding:7px;gap:6px;font-size:14px}
 body[data-layout=classics] .go-out-options button{flex:1 1 140px;font-size:14px}
 body[data-layout=classics] .crown-table{grid-template-columns:minmax(0,1fr)}
 body[data-layout=classics] .trick{gap:8px}
 body[data-layout=classics] .trick .card{width:62px;min-width:62px;height:90px}
 body[data-layout=board] .game{grid-template-columns:minmax(0,1fr);gap:8px}
 body[data-layout=board] .board-wrap{max-width:min(100%,65dvh);min-width:0}
 body[data-layout=board] .game aside h1{font-size:24px;margin:4px 0}
 body[data-layout=board] .game aside p{margin-bottom:7px}
 body[data-layout=board] .actions{gap:6px}
 body[data-layout=board] .actions button{font-size:14px;padding:8px 10px}
 body[data-layout=board] .capture-art{width:28px;height:28px}
 body[data-layout=board] :is(.practice,.agreement,.replay){padding:10px;margin-top:10px}
 body[data-layout=oh-well] .top-seats{display:flex;overflow-x:auto;gap:6px;padding:3px}
 body[data-layout=oh-well] .top-seats .seat{flex:1 0 125px}
 body[data-layout=oh-well] .table{padding:10px;gap:7px}
 body[data-layout=oh-well] :is(.left-seats,.right-seats){gap:6px}
 body[data-layout=oh-well] .seat-stats{gap:7px;font-size:13px}
 body[data-layout=oh-well] .center{padding:3px;gap:6px;min-height:0}
 body[data-layout=oh-well] .hand .card.detailed-card,body[data-layout=pinochle] .hand .card.detailed-card{width:56px;min-width:56px;height:81px}
 body[data-layout=pinochle] .trick-cards{display:flex;flex-wrap:wrap;gap:7px}
 body[data-layout=pinochle] .trick-slot{min-width:65px}
 body[data-layout=pinochle] .card-table .player{padding:7px}
 body[data-layout=pinochle] .card-table .meld-list{max-height:115px}
 body[data-layout=trash] .your-seat .layout{gap:4px}
 body[data-layout=trash] .your-seat .card{width:clamp(44px,12vw,60px);height:auto;aspect-ratio:70/100}
 body[data-layout=skip-bo] .your-area{grid-template-columns:minmax(0,1fr);gap:8px}
 body[data-layout=skip-bo] .building{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 body[data-layout=skip-bo] .build-target{min-width:0;padding:4px 2px}
 body[data-layout=skip-bo] .build-target>span{font-size:11px}
 body[data-layout=skip-bo] .build-target .card{width:clamp(42px,12vw,60px)}
 body[data-layout=skip-bo] .hand{gap:5px;margin:7px 0}
 body[data-layout=skip-bo] .your-area .seat{min-width:0}
 body[data-layout=skip-bo] .your-area .card{width:clamp(46px,13vw,62px)}
 body[data-layout=prisoners] .prison-intro:before{display:none}
}
@media(max-width:1100px) and (orientation:landscape) and (max-height:650px){
 body[data-layout=board] .game{grid-template-columns:minmax(240px,1fr) minmax(220px,1fr)}
 body[data-layout=board] .board-wrap{width:min(100%,72dvh)}
 body[data-layout=classics] .seated-table{gap:6px}
 body[data-layout=classics] .hand :is(.family-card,.card.detailed-card){width:54px;min-width:54px;height:80px}
}
@media(prefers-reduced-motion:reduce){body[data-layout] *{scroll-behavior:auto!important}}
