/* Keep the playing surface, hand and actions in the available viewport. */
body.game-screen{height:100dvh;min-height:0;overflow:hidden;padding:0}
.game-screen #app{height:calc(100dvh - var(--coach-space,0px));min-height:0;display:flex;flex-direction:column;overflow:hidden}
.game-screen .topbar{height:52px;min-height:52px;padding:7px 22px;gap:10px}
.game-screen .brand img{width:78px}
.game-screen .brand span{font-size:14px;letter-spacing:3px}
.game-screen .textbtn{padding:8px 11px;font-size:11px;white-space:nowrap}
.game-screen .game-layout{width:100%;max-width:1440px;flex:1;min-height:0;margin:0 auto;padding:10px 18px 12px;grid-template-columns:minmax(0,1fr) 225px;gap:16px;overflow:hidden}
.game-screen .table-area{--hand-height:clamp(126px,20dvh,180px);display:flex;flex-direction:column;min-width:0;min-height:0;gap:6px;overflow-y:auto;scrollbar-width:thin}
.game-screen .game-status{flex:0 0 22px;min-height:22px;margin:0;font-size:11px;padding:0 3px}
.game-screen .table{flex:1;min-height:160px;height:auto;margin:0 6px 3px;border-width:7px;border-radius:130px;box-shadow:inset 0 0 32px #0004,0 0 0 1px #9c7b4844,0 5px 15px #0003}
.game-screen .table::after{inset:9px;border-radius:122px}
.game-screen .seat{width:120px;padding:7px 8px;border-radius:6px}
.game-screen .seat-name{font-size:10px;line-height:1.3}
.game-screen .role-tag{font-size:8px;margin-top:2px}
.game-screen .portrait{width:29px;height:36px}
.game-screen .portrait img{width:42px;transform:translate(-6px,-9px)}
.game-screen .hearts{margin-top:5px;gap:3px}
.game-screen .bullet{height:12px;width:7px;border-bottom-width:2px}
.game-screen .hp-number{font-size:9px}
.game-screen .seat-bottom{font-size:9px;margin-top:5px}
.game-screen .equipment-dots{flex-wrap:nowrap;max-height:13px;overflow:hidden;margin-top:4px;gap:3px}
.game-screen .equipment-tag{white-space:nowrap;padding:1px 3px;font-size:8px}
.game-screen .table-center{top:56%;width:180px}
.game-screen .table-wordmark{font-size:19px;letter-spacing:6px;margin-bottom:6px}
.game-screen .piles{gap:13px}
.game-screen .pile{width:48px;height:75px}
.game-screen .card-back{border-width:3px}
.game-screen .card-back span{font-size:13px}
.game-screen .pile .rank-overlay{font-size:10px}
.game-screen .pile-count{font-size:8px;bottom:-16px}
.game-screen .table-instruction{font-size:9px;margin-top:21px;line-height:1.4;min-height:0}
.game-screen .player-strip{flex:0 0 auto;min-height:52px;padding:6px 3px;gap:10px}
.game-screen .own-char{height:42px;width:28px}
.game-screen .my-name{font-size:12px;margin:0 0 3px}
.game-screen .my-name span{font-size:10px}
.game-screen .my-ability{font-size:10px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.game-screen .my-health .hearts{margin-top:0}
.game-screen .my-health small{font-size:9px;margin-top:5px}
.game-screen .my-equip{gap:4px;margin-top:4px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.game-screen .my-equip button{white-space:nowrap;padding:3px 6px;font-size:9px;min-height:25px}
.game-screen .hand-header{flex:0 0 20px;min-height:20px;font-size:11px;margin:0;padding:0 3px}
.hand-tools{display:flex;align-items:center;gap:9px}
.hand-log-button{border:1px solid var(--line);border-radius:4px;background:#233b2c;padding:4px 8px;font-size:10px;line-height:1.2}
.game-screen .hand{position:relative;flex:0 0 var(--hand-height);height:var(--hand-height);min-height:0;margin:0;padding:10px 8px 4px;gap:9px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;align-items:flex-start}
.game-screen .hand-card{flex:0 0 calc((var(--hand-height) - 44px)*.642674);width:calc((var(--hand-height) - 44px)*.642674);max-width:118px}
.game-screen .card-label{font-size:10px;line-height:1.4;margin-top:5px}
.game-screen .hand-card:hover,.game-screen .hand-card.selected{transform:translateY(-5px)}
.game-screen .rank-overlay{font-size:clamp(11px,1.5dvh,17px)}
.game-screen .hand-card .playable-dot{top:-7px;width:5px;height:5px}
.game-screen .controls{flex:0 0 auto;min-height:62px;margin:0;padding:9px 11px;gap:12px;border-radius:6px}
.game-screen .selection-info strong{font-size:12px}
.game-screen .selection-info p{font-size:11px;line-height:1.5;margin:3px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.game-screen .controls .primary,.game-screen .controls .secondary{font-size:11px;padding:10px 14px;min-height:40px}
.game-screen .action-buttons{flex-shrink:0;gap:6px}
.game-screen .mobile-log,.game-screen #app>.credits{display:none}
.game-screen .log-panel{min-height:0;max-height:none;padding-left:14px}
.game-screen .mission-card{padding:12px}
.game-screen .mission-body{gap:10px;margin-top:9px}
.game-screen .mission-body img{width:40px}
.game-screen .mission-body h3{font-size:13px;margin-bottom:5px}
.game-screen .mission-body p{font-size:10px;line-height:1.6}
.game-screen .log-title{margin:16px 0 9px;font-size:10px}
.game-screen .log-list{min-height:0}
.game-screen .log-item{padding:6px 0;font-size:10px}
.game-screen .tips{padding-top:10px;margin-top:10px;font-size:9px}

/* The tutorial reserves only its actual height and never scrolls the whole page. */
.game-screen.training{padding:0}
.game-screen.training .table-area{--hand-height:clamp(104px,16dvh,140px)}
.game-screen.training .table{min-height:130px}
.game-screen.training .controls{padding:0;min-height:0;background:none;border:0}
.game-screen.training .controls .selection-info{display:none}
.game-screen.training .controls:not(.training-action){display:none}
.game-screen.training .controls .action-buttons{width:100%;justify-content:flex-end}
.game-screen.training .controls button:disabled{display:none}
.game-screen.training .controls button:not(:disabled){min-height:38px}
.game-screen.training .tutorial-focus{outline-offset:3px!important;outline-width:2px!important;box-shadow:0 0 0 5px #e5bb652b,0 0 18px #e5bb6544!important}
.game-screen.training .hand-card.tutorial-focus{transform:translateY(-3px)}
.game-screen .tutorial-coach{bottom:max(6px,env(safe-area-inset-bottom,0px));width:min(920px,calc(100% - 24px));padding:12px 18px;border-radius:9px;box-shadow:0 5px 30px #0006}
.game-screen .coach-top{font-size:10px;line-height:1.2}
.game-screen .coach-top button{min-height:24px}
.game-screen .coach-progress{margin:5px 0 8px}
.game-screen .coach-copy h2{font-size:17px;margin:0 0 4px;line-height:1.3}
.game-screen .coach-copy p{font-size:12px;line-height:1.55}
.game-screen .coach-bottom{margin-top:7px;gap:10px}
.game-screen .coach-bottom>span{font-size:10px;line-height:1.4}
.game-screen .coach-bottom .primary{font-size:11px;min-height:34px;padding:7px 13px}
.game-screen .coach-tap{font-size:10px}
.game-screen.training .overlay{padding-top:8px;padding-bottom:var(--coach-space,160px)}
.game-screen.training .modal{max-height:calc(100dvh - var(--coach-space,160px) - 18px)}

/* A shorter first screen keeps Play and Learn visible together. */
.lobby-screen .topbar{height:58px;padding:9px 4vw}
.lobby-screen .brand img{width:82px}
.lobby-screen .lobby{padding:26px 5vw 8px;width:100%;max-width:1150px}
.lobby-screen .hero{min-height:0;gap:38px}
.lobby-screen .hero-copy h1{font-size:clamp(34px,3.8vw,52px);margin:13px 0;line-height:1.2}
.lobby-screen .hero-copy .intro{font-size:12px;line-height:1.6}
.lobby-screen .learn-entry{margin-top:18px;padding:13px 15px;gap:12px}
.lobby-screen .learn-entry strong{font-size:13px}
.lobby-screen .learn-entry small{font-size:10px;margin-top:4px}
.lobby-screen .setup{margin-top:15px;padding-top:15px}
.lobby-screen .setup-row{margin-bottom:11px}
.lobby-screen .start-row{margin-top:13px}
.lobby-screen .setup-note{margin:9px 0 0;font-size:9px}
.lobby-screen .hero-art{height:350px}
.lobby-screen .feature-row{gap:20px;margin-top:22px;padding-top:18px}
.lobby-screen .feature p{font-size:10px}
.lobby-screen .feature strong{margin-bottom:5px}
.lobby-screen .credits{font-size:9px;line-height:1.6;padding:12px}

@media(max-width:1050px){
 .game-screen .game-layout{grid-template-columns:minmax(0,1fr) 190px;padding:8px 12px 10px;gap:12px}
 .game-screen .seat{width:106px;padding:6px}
 .game-screen .portrait{width:25px;height:31px}
 .game-screen .portrait img{width:36px;transform:translate(-5px,-8px)}
 .game-screen .seat-name{font-size:9px}
 .game-screen .controls{gap:7px}
 .game-screen .controls .primary,.game-screen .controls .secondary{padding:10px 10px}
}
@media(max-width:850px){
 .game-screen .game-layout{display:block;padding:6px 12px 10px;max-width:780px}
 .game-screen .table-area{height:100%}
 .game-screen .log-panel{display:none}
 .game-screen .seat{width:116px}
 .game-screen .table{min-height:155px}
 .lobby-screen .hero-art{height:300px}
 .lobby-screen .hero{gap:20px}
}
@media(max-width:620px){
 .game-screen .topbar{height:44px;min-height:44px;padding:5px 10px;gap:7px}
 .game-screen .brand img{width:60px}
 .game-screen .brand span{display:none}
 .game-screen .nav{gap:4px}
 .game-screen .textbtn{font-size:10px;padding:7px 8px;min-height:32px}
 .game-screen .iconbtn{width:30px;min-height:32px;padding:5px}
 .game-screen .practice-label{font-size:9px;margin:0}
 .game-screen .game-layout{padding:5px 8px 8px}
 .game-screen .table-area{--hand-height:clamp(124px,20dvh,164px);gap:4px}
 .game-screen .game-status{flex-basis:20px;min-height:20px;font-size:10px;padding:0 2px}
 .game-screen .status-left{min-width:0;gap:5px}
 .game-screen .status-left strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}
 .game-screen .turn-badge{font-size:8px;padding:3px 6px;flex-shrink:0}
 .game-screen .table{height:auto;min-height:175px;margin:0 2px 2px;border-width:5px;border-radius:90px}
 .game-screen .table::after{inset:6px;border-radius:84px}
 .game-screen .seat,.game-screen .table.players-7 .seat,.game-screen .table.players-6 .seat{width:88px;padding:5px 5px 4px}
 .game-screen .seat-top{gap:4px}
 .game-screen .seat-name{font-size:9px;line-height:1.2;min-width:0}
 .game-screen .role-tag{font-size:8px;white-space:nowrap}
 .game-screen .portrait{width:21px;height:27px}
 .game-screen .portrait img{width:31px;transform:translate(-5px,-7px)}
 .game-screen .seat .hearts{gap:2px;margin-top:4px}
 .game-screen .seat .bullet{width:5px;height:10px}
 .game-screen .seat .hp-number{font-size:8px;margin-left:3px}
 .game-screen .seat-bottom{font-size:8px;margin-top:4px}
 .game-screen .equipment-dots{max-height:10px;margin-top:2px;gap:2px}
 .game-screen .equipment-tag{font-size:7px;padding:0 2px}
 .game-screen .table-center,.game-screen .table.players-7 .table-center,.game-screen .table.players-6 .table-center{top:55%;width:150px}
 .game-screen .table-wordmark{font-size:14px;letter-spacing:4px;margin-bottom:4px}
 .game-screen .piles{gap:10px}
 .game-screen .pile{width:35px;height:55px;border-radius:4px}
 .game-screen .card-back span{font-size:10px}
 .game-screen .card-back::before{inset:3px}
 .game-screen .pile-count{font-size:8px;bottom:-14px}
 .game-screen .table-instruction{font-size:8px;margin-top:18px}
 .game-screen .player-strip{min-height:46px;padding:5px 2px;gap:7px}
 .game-screen .own-char{height:35px;width:23px}
 .game-screen .my-name{font-size:11px;margin-bottom:3px;white-space:nowrap}
 .game-screen .my-name span{font-size:9px;margin-left:4px}
 .game-screen .my-ability{font-size:9px}
 .game-screen .my-health{min-width:55px}
 .game-screen .my-health .bullet{width:6px;height:11px}
 .game-screen .my-health small{font-size:8px;white-space:nowrap}
 .game-screen .my-equip{margin-top:3px;gap:3px}
 .game-screen .my-equip button{font-size:9px;padding:2px 5px;min-height:24px}
 .game-screen .hand-header{font-size:10px;flex-basis:22px;min-height:22px}
 .game-screen .hand-header span{font-size:9px}
 .game-screen .hand-tools{gap:6px}
 .game-screen .hand-log-button{font-size:10px;min-height:26px;padding:4px 9px}
 .game-screen .hand{gap:7px;padding:8px 6px 3px}
 .game-screen .card-label{font-size:10px;line-height:1.3;margin-top:4px}
 .game-screen .controls{padding:7px 9px;min-height:0;gap:5px;flex-wrap:wrap}
 .game-screen .selection-info{flex-basis:100%}
 .game-screen .selection-info strong{font-size:11px}
 .game-screen .selection-info p{font-size:10px;line-height:1.45;margin-top:2px;-webkit-line-clamp:2}
 .game-screen .action-buttons{width:100%;gap:6px}
 .game-screen .controls .primary,.game-screen .controls .secondary{font-size:11px;min-height:38px;padding:8px 10px;flex:1}
 .game-screen.training .table-area{--hand-height:clamp(108px,15dvh,128px)}
 .game-screen.training .table{min-height:136px}
 .game-screen.training .table-instruction{display:none}
 .game-screen.training .my-ability{display:none}
 .game-screen.training .player-strip{min-height:38px;padding:3px 2px}
 .game-screen.training .own-char{height:30px;width:20px}
 .game-screen.training .hand-header{flex-basis:18px;min-height:18px}
 .game-screen.training .hand-log-button{display:none}
 .game-screen.training .controls button:not(:disabled){min-height:36px}
 .game-screen .tutorial-coach{width:calc(100% - 12px);padding:9px 12px;bottom:max(5px,env(safe-area-inset-bottom,0px));border-radius:8px}
 .game-screen .coach-top{font-size:9px;line-height:1.2}
 .game-screen .coach-top button{font-size:9px;min-height:24px}
 .game-screen .coach-progress{margin:3px 0 6px;gap:4px}
 .game-screen .coach-copy h2{font-size:15px;line-height:1.25;margin-bottom:4px}
 .game-screen .coach-copy p{font-size:12px;line-height:1.45}
 .game-screen .coach-bottom{margin-top:5px;gap:6px;flex-wrap:nowrap}
 .game-screen .coach-bottom>span{font-size:9px;line-height:1.35;min-width:0}
 .game-screen .coach-bottom .primary{font-size:10px;min-height:32px;padding:7px 10px}
 .game-screen .coach-tap{display:none}
 .game-screen.training .response-modal{padding:16px}
 .game-screen.training .response-modal .danger-icon{display:none}
 .game-screen.training .response-modal h2{font-size:19px;margin:7px 0}
 .game-screen.training .response-modal p{font-size:12px;line-height:1.5}
 .game-screen.training .response-modal .modal-cards .hand-card{flex-basis:82px;width:82px}
 .game-screen.training .response-modal .modal-actions button{min-height:38px}
 .lobby-screen .topbar{height:48px;padding:6px 12px}
 .lobby-screen .brand img{width:64px}
 .lobby-screen .brand span{display:none}
 .lobby-screen .nav{gap:5px}
 .lobby-screen .textbtn{padding:8px;font-size:10px;min-height:32px}
 .lobby-screen .lobby{padding:12px 22px 0}
 .lobby-screen .hero{gap:0}
 .lobby-screen .hero-art{height:clamp(115px,21dvh,180px);margin:0 0 8px}
 .lobby-screen .hero-card{width:clamp(65px,11.5dvh,96px)}
 .lobby-screen .hero-card.center{width:clamp(76px,13dvh,110px);transform:translate(0,-2px) rotate(-3deg)}
 .lobby-screen .hero-card.left{transform:translate(-64px,3px) rotate(-19deg)}
 .lobby-screen .hero-card.right{transform:translate(64px,6px) rotate(18deg)}
 .lobby-screen .sun-ring{width:160px;height:160px}
 .lobby-screen .eyebrow{font-size:8px;letter-spacing:2px}
 .lobby-screen .hero-copy h1{font-size:30px;line-height:1.16;margin:8px 0;letter-spacing:-1.5px}
 .lobby-screen .hero-copy h1{word-break:keep-all}
 .lobby-screen .hero-copy .intro{font-size:11px;line-height:1.5;margin:8px 0}
 .lobby-screen .intro br{display:none}
 .lobby-screen .learn-entry{padding:10px 12px;margin-top:12px;gap:9px}
 .lobby-screen .learn-entry strong{font-size:12px}
 .lobby-screen .learn-entry small{font-size:9px;margin-top:3px}
 .lobby-screen .learn-entry .learn-icon{font-size:24px}
 .lobby-screen .setup{padding-top:11px;margin-top:12px}
 .lobby-screen .setup-row{font-size:11px;margin-bottom:8px;gap:8px}
 .lobby-screen .segmented button{font-size:10px;padding:7px 12px;min-height:30px}
 .lobby-screen .setup select{font-size:11px;padding:6px;min-height:32px}
 .lobby-screen .start-row{margin-top:10px;gap:8px}
 .lobby-screen .start-row button{font-size:12px;padding:11px 13px;min-height:44px}
 .lobby-screen .setup-note{margin:8px 0 0;font-size:8px}
 .lobby-screen .feature-row{display:none}
 .lobby-screen .credits{font-size:8px;padding:10px 12px;line-height:1.4}
}
@media(max-height:740px){
 .game-screen .table-area{--hand-height:clamp(110px,19dvh,142px);gap:4px}
 .game-screen .game-layout{padding-top:4px;padding-bottom:6px}
 .game-screen .table{min-height:140px}
 .game-screen .player-strip{padding-top:4px;padding-bottom:4px;min-height:42px}
 .game-screen .table-instruction{display:none}
 .game-screen .table-wordmark{display:none}
 .game-screen .controls{padding-top:6px;padding-bottom:6px}
 .game-screen.training .table-area{--hand-height:104px;gap:3px}
 .game-screen.training .table{min-height:120px}
 .game-screen .coach-bottom>span{display:none}
 .game-screen .coach-bottom:has(.coach-tap){display:none}
 .game-screen .coach-bottom{justify-content:flex-end}
 .game-screen .coach-copy p{font-size:12px}
 .lobby-screen .feature-row{display:none}
 .lobby-screen .lobby{padding-top:14px}
 .lobby-screen .hero-art{height:260px}
}
@media(max-width:620px) and (max-height:740px){
 .game-screen .table.players-7 .seat,.game-screen .table.players-6 .seat{padding:4px;width:84px}
 .game-screen .table.players-7 .portrait,.game-screen .table.players-6 .portrait{display:none}
 .game-screen .table.players-7 .seat-top,.game-screen .table.players-6 .seat-top{min-height:22px}
 .game-screen .selection-info p{-webkit-line-clamp:1}
 .game-screen.training .table-center{top:62%}
 .lobby-screen .lobby{padding-top:8px}
 .lobby-screen .hero-art{height:112px;margin-bottom:6px}
 .lobby-screen .hero-card{width:62px}
 .lobby-screen .hero-card.center{width:72px}
 .lobby-screen .hero-card.left{transform:translate(-48px,3px) rotate(-19deg)}
 .lobby-screen .hero-card.right{transform:translate(48px,5px) rotate(18deg)}
 .lobby-screen .sun-ring{width:110px;height:110px}
 .lobby-screen .hero-copy h1{font-size:27px;margin:6px 0}
 .lobby-screen .learn-entry{margin-top:8px;padding:8px 11px}
 .lobby-screen .setup{margin-top:10px;padding-top:9px}
}
@media(max-width:370px){
 .game-screen .textbtn{font-size:9px;padding:7px 6px}
 .game-screen .seat{width:82px}
 .game-screen .seat .portrait{display:none}
 .game-screen .my-name{font-size:10px}
 .game-screen .my-name span{font-size:8px}
 .game-screen .my-ability{font-size:8px}
 .game-screen .hand-header>span>span{font-size:8px}
}
@media(max-height:500px) and (min-width:621px){
 .game-screen .topbar{height:40px;min-height:40px}
 .game-screen .game-layout{display:block;padding:4px 10px 6px}
 .game-screen .log-panel{display:none}
 .game-screen .table-area{display:grid;height:100%;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(110px,1fr) auto;gap:6px 12px;overflow:auto}
 .game-screen .game-status{grid-column:1;grid-row:1}
 .game-screen .table{grid-column:1;grid-row:2/4;min-height:135px;height:100%;margin:0}
 .game-screen .player-strip{grid-column:2;grid-row:1;min-height:32px;padding:0;border:0}
 .game-screen .own-char,.game-screen .my-ability{display:none}
 .game-screen .hand-header{display:none}
 .game-screen .hand{grid-column:2;grid-row:2;--hand-height:118px;height:118px}
 .game-screen .controls{grid-column:2;grid-row:3;min-height:0;padding:5px;flex-wrap:wrap}
 .game-screen .selection-info{flex-basis:100%}
 .game-screen .selection-info p{display:none}
 .game-screen .controls .primary,.game-screen .controls .secondary{min-height:32px;padding:6px 8px;font-size:10px}
 .game-screen .seat{width:84px;padding:4px}
 .game-screen .seat .portrait{display:none}
 .game-screen .table-center{top:59%}
 .game-screen .pile{width:29px;height:45px}
 .game-screen .card-back span{font-size:9px}
}
