/* Full-bleed scenery, with controls inside the notch and gesture safe area. */
.stage-safe-area{position:fixed;left:0;top:0;width:0;height:0;visibility:hidden;pointer-events:none;
 padding-left:max(env(safe-area-inset-left,0px),var(--native-safe-left,0px));
 padding-top:calc(max(env(safe-area-inset-top,0px),var(--native-safe-top,0px)) + var(--native-toolbar-height,0px));
 padding-right:max(env(safe-area-inset-right,0px),var(--native-safe-right,0px));
 padding-bottom:max(env(safe-area-inset-bottom,0px),var(--native-safe-bottom,0px))}
#lobbyStage,#gameStage{width:var(--stage-width,1280px);height:var(--stage-height,640px);left:var(--view-center-x,50%);top:var(--view-center-y,50%)}
.stage-content{position:absolute;left:var(--stage-safe-left,0px);top:var(--stage-safe-top,0px);right:var(--stage-safe-right,0px);bottom:var(--stage-safe-bottom,0px)}
#lobbyStage[data-page=home]{--home-hud:clamp(116px,calc(var(--layout-height,640px)*.18),156px)}
#lobbyStage[data-page=home] .lobby-hud{height:var(--home-hud)}
#lobbyStage .rank-summary-copy>:is(b,span:not(.rank-progress)){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#lobbyStage[data-page=home] #lobbyPages{top:var(--home-hud);bottom:80px}
#lobbyStage[data-page=home] #home.page.active{gap:24px;padding:36px 0 10px}
#lobbyStage[data-page=home] #home.page.active:has(.home-notices:not(:empty)){gap:12px;padding-top:16px}
#lobbyStage .mode-cards{width:calc(100% - 100px);max-width:1600px;max-height:430px;grid-template-columns:repeat(4,minmax(0,1fr));margin:auto;gap:20px}
#lobbyStage .mode-card .mode-art{min-height:70px;overflow:hidden}
#lobbyStage .mode-card .rank-badge{max-height:100%}
#lobbyStage .home-rank-name{font-size:18px;line-height:1.2;margin-bottom:4px}
#lobbyStage .mode-card .portrait{max-height:calc(100% - 12px)}
#lobbyStage .training-card-face strong{width:52px;height:65px;left:12px;right:auto;line-height:0}
/* Table and rails use the available safe area, not a second 1280px frame. */
#gameStage .table{left:var(--layout-table-left,240px);top:var(--layout-table-top,146px);width:var(--layout-table-width,800px);height:var(--layout-table-height,272px)}
#gameStage #players{left:calc(-1 * var(--layout-table-left,240px) - 6px);top:calc(-1 * var(--layout-table-top,146px) - 6px);width:var(--layout-width,1280px);height:var(--layout-height,640px)}
#gameStage .seat0{left:calc(var(--layout-table-left,240px) + var(--layout-table-width,800px) + 65px);top:73%!important}
#gameStage .four .seat1,#gameStage .six .seat1,#gameStage .six .seat2{left:calc(var(--layout-table-left,240px) + var(--layout-table-width,800px) + 65px)!important}
#gameStage .four .seat3,#gameStage .six .seat4,#gameStage .six .seat5{left:calc(var(--layout-table-left,240px) - 205px)!important}
#gameStage .four .seat1,#gameStage .four .seat3{top:calc(var(--layout-table-top,146px) + var(--layout-table-height,272px)/2 - 60px)!important}
#gameStage .four .seat2,#gameStage .six .seat3{left:calc(50% - 70px)!important;top:8px!important}
#gameStage .six .seat2,#gameStage .six .seat4{top:20%!important}
#gameStage .six .seat1,#gameStage .six .seat5{top:48%!important}
#gameStage .hand,#gameStage[data-players="6"] .hand{top:var(--hand-top,497px);height:var(--hand-height,199px);width:calc(100% - 280px)}
#gameStage[data-choices=bidding] .controls,#gameStage[data-choices=trump] .controls{top:calc(50% - 150px)}
/* A single choice row leaves the entire fan visible, including when the
   joker question adds an action below the bidding buttons. */
#gameStage[data-choices=bidding] .controls,#gameStage[data-choices=trump] .controls{width:640px}
#gameStage[data-choices=bidding] .buttons{grid-template-columns:repeat(6,minmax(0,1fr))}
#gameStage[data-choices=trump] .buttons{grid-template-columns:repeat(4,minmax(0,1fr))}
#gameStage[data-phase=upgrade] .controls{top:calc(50% - 101px)}
#gameStage[data-phase=result] .controls,#gameStage[data-phase=finished] .controls{top:calc(50% - 145px)}
#gameStage[data-phase=playing] .controls{left:132px;top:calc(100% - 176px);width:230px}
#gameStage[data-players="6"][data-choices=""]:is([data-phase="playing"],[data-phase="bidding"],[data-phase="trump"]) .controls{left:420px;top:24px}

/* These are vector shapes, so font preferences cannot resize suit artwork. */
.suit-art{display:block;width:100%;height:100%;overflow:visible;pointer-events:none}
.card{-webkit-text-size-adjust:none;text-size-adjust:none}
.card :is(.readable-suit,.ace-symbol){position:absolute;left:50%;top:53%;width:48%;height:40%;margin:0;transform:translate(-50%,-50%);line-height:0}
.card .corner small,.drag-card .corner small,.motion-face .corner small{width:21px;height:25px;margin:2px auto 0;line-height:0}
#gameStage .played .corner small,.motion-face .corner small{width:18px;height:22px}
.trump-badge .suit-art{width:85%;height:85%;margin:auto}
#gameStage .buttons .suit>.suit-art{width:42px;height:48px;margin:auto}
.trump-emblem{width:100px;height:120px}

/* The reference hand has grey paper, a thick white frame and shallow corners. */
@font-face{font-family:PoundCardNumbers;src:url('/fonts/pound-card-numbers.woff') format('woff');font-weight:100 900;font-display:swap}
body:is([data-cards=classic],[data-cards=royal],[data-cards=bold]) :is(#gameStage .card,.drag-card){--paper:#dedede;color:#080808}
body:is([data-cards=classic],[data-cards=royal],[data-cards=bold]) :is(#gameStage .card,.drag-card).red{color:#e34141}
#gameStage #hand.hand .card{border:var(--card-frame,7px) solid #f5f5f5;box-shadow:0 2px 5px #03142155}
#gameStage #hand.hand .corner{font-family:PoundCardNumbers,Arial,sans-serif;font-size:var(--card-corner,38px);left:var(--card-padding,6px);top:var(--card-padding,6px)}
#gameStage #hand.hand .corner small{width:var(--card-suit-width,25px);height:var(--card-suit-height,29px);margin-top:3px}
#gameStage #hand.hand .corner.mirrored{right:var(--card-padding,6px);bottom:var(--card-padding,6px);left:auto;top:auto}
#gameStage #hand.hand .card:is([data-rank=K],[data-rank=J]) .corner{font-family:Georgia,serif}
.drag-card{border:var(--card-frame,7px) solid #f5f5f5}
.drag-card .corner{font-family:PoundCardNumbers,Arial,sans-serif;font-size:var(--card-corner,38px);left:var(--card-padding,6px);top:var(--card-padding,6px)}
.drag-card .corner small{width:var(--card-suit-width,25px);height:var(--card-suit-height,29px);margin-top:3px}
.drag-card .corner.mirrored{right:var(--card-padding,6px);bottom:var(--card-padding,6px);left:auto;top:auto}
.drag-card:is([data-rank=K],[data-rank=J]) .corner{font-family:Georgia,serif}
