/* Shared device layout, loaded after each game's styles. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-bottom:24px}
body{min-width:0;min-height:100svh}
.shell{width:100%;padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right));padding-bottom:max(32px,env(safe-area-inset-bottom))}
.topbar,.top-actions,.game-header,.hand-heading{flex-wrap:wrap}
.topbar{padding:12px 0}.top-actions{gap:12px}
.game-layout>*,.setup>*,.net-setup>*,.net-builder-fields>*,.field{min-width:0}
input,select{max-width:100%;font-size:16px!important}
button,a,summary{touch-action:manipulation}
.button,.text-button,summary{min-height:44px}
.seat strong,.net-me strong,.net-waiting-seats strong,.statusbar p{overflow-wrap:anywhere}
dialog{max-width:calc(100vw - 24px);max-height:calc(100svh - 24px);overflow:auto}
.hand .playing-card{margin-left:0}
@media(min-width:1001px){.shell{padding-left:max(38px,env(safe-area-inset-left));padding-right:max(38px,env(safe-area-inset-right))}}
@media(max-width:750px){
 .net-avatar-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .net-avatar-choice{width:100%;min-width:0}.net-avatar-choice .net-cartoon{max-width:100%}
 .net-upload input{width:100%;min-width:0}
 .net-waiting-seats>div{min-width:0;flex:1}.net-waiting-seats .net-photo,.net-waiting-seats .net-cartoon{width:min(70px,100%);height:70px}
 .net-setup{gap:18px}.net-room-form,.net-avatar-editor{padding:18px}
}
@media(max-width:620px){
 .shell{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
 .topbar{min-height:68px}.top-actions{width:100%;justify-content:space-between}
 .intro{margin:28px 0 22px}.setup{padding:18px;gap:20px}
 .hand-heading{gap:10px}.hand-heading>*{min-width:0}
 .hand,.hand-arranger .hand{gap:6px;row-gap:22px}
 .hand .playing-card{--cw:clamp(44px,10.7vw,62px)}
 .statusbar .actions{display:flex;flex-wrap:wrap;gap:10px}.statusbar .actions .button{flex:1 1 110px;white-space:normal}
 .tonk-cast-picker{grid-template-columns:minmax(0,1fr)}
 .net-builder-fields{grid-template-columns:minmax(0,1fr)}
 .bj-controls label{width:100%}.bj-controls input{width:100%}.bj-settings{min-width:0}.bj-bank{gap:10px;flex-wrap:wrap;padding:14px}
}
/* Animated Tonk seats need their own compact landscape layout. */
@media(min-width:621px) and (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 .game-layout>section{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}
 .tonk-stage{min-height:365px;border-radius:34px;padding:10px;border-width:5px}
 .tonk-stage .seat{width:42%;max-width:145px;top:38%}
 .tonk-stage .seat.left{left:0}.tonk-stage .seat.right{right:0}
 .tonk-stage .tonk-person{width:100%;height:135px}
 .tonk-stage .seat strong{font-size:13px}.tonk-stage .seat small{font-size:10px}
 .tonk-stage .table-center{max-width:100%;padding:235px 0 12px}
 .tonk-stage .pile-area{gap:20px}.tonk-stage .playing-card{--cw:44px}
 .tonk-stage .tonk-bubble,.net-stage .net-talk{width:130px;max-width:100%;font-size:11px;padding:8px}
 .hand-arrange-tools{gap:6px;margin-bottom:16px}.hand-arrange-tools button{padding:9px;font-size:11px}
 .bj-table{min-height:260px;padding:16px}.bj-dealer{padding-bottom:16px}
}
