/* Header and navigation own their space; only the current content area can scroll. */
body{height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
#top,#mobile{flex:none}
body:not(.tour-page) #top{position:relative;top:auto}
body:not(.tour-page) #main{flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:12px}
body:not(.tour-page) #main>:last-child{margin-bottom:0}
#main:focus{outline:0}
body:not(.tour-page) #main.room-lobby,body:not(.tour-page) #main.room-portraits{padding-top:clamp(8px,2vh,24px)}
@media(max-width:860px){
  body:not(.in-tour) #mobile{position:relative;bottom:auto}
  body:has(#club-chat:not(:empty)) #mobile{padding-right:calc(56px + env(safe-area-inset-right))}
  #mobile .nav-item{min-width:0;flex:1 1 0;white-space:normal}
  #club-chat:has(>.guide-orb:only-child){bottom:max(5px,env(safe-area-inset-bottom));right:max(5px,env(safe-area-inset-right))}
  #club-chat .guide-orb{width:44px;height:44px}
  #club-chat .guide-orb span{width:16px;height:16px}
}
.seat-row{display:flex;align-items:end;gap:8px;margin:7px 0}
.seat-row .field{min-width:0;flex:1;margin:0}
.seat-row .field span{font-size:.82rem}
.seat-remove{display:grid;place-items:center;width:44px;height:44px;flex:none;border:1px solid var(--edge);border-radius:9px;color:var(--quiet)}
.seat-row~button[data-action=addPlayer]{color:var(--look-accent);font-weight:700}
body:not(.tour-page) #main:is(.solo-room,.room-arena){width:min(96%,1060px);padding:clamp(4px,1.2vh,12px) 2px 5px;display:flex;flex-direction:column;gap:6px}
#main .arena-title{display:flex;flex:none;align-items:center;gap:8px;margin:0;min-width:0}
#main .arena-title h1{min-width:0;font:600 clamp(1.17rem,4vw,2rem)/1.06 var(--serif);letter-spacing:-.035em;margin:0}
#main .arena-title p{margin:0 0 0 auto;font-size:.79rem;text-align:end}
#main .arena-title .room-back{min-width:40px;min-height:40px;justify-content:center;margin:0;padding:3px 6px}
.room-arena .arena-grid{flex:1;min-height:0;align-items:stretch;gap:8px}
.room-arena .felt-zone{align-self:start;max-height:100%;min-height:0;padding:14px;display:flex}
.board-scroll,.move-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.board-scroll{width:100%;border-radius:4px}
.move-zone{display:flex;min-height:0;flex-direction:column}
.move-zone .table-tools{flex:none;position:relative;margin:0}
.table-tools[open] .table-tool-list,.solo-menu[open] .table-tool-list{position:absolute;bottom:100%;left:0;z-index:3;max-height:40dvh;overflow:auto;width:min(100%,23rem);padding:8px;background:var(--surface);border:1px solid var(--edge);border-radius:10px;box-shadow:0 4px 16px #0003}
.move-zone .table-tools summary,.solo-menu summary{min-height:40px;cursor:pointer}
@media(max-width:720px) and (orientation:portrait){
  .room-arena .arena-grid{display:flex;flex-direction:column}
  .room-arena .felt-zone{width:100%;flex:0 1 auto;max-height:48%}
  .room-arena .move-zone{flex:1}
  .room-arena .hand-wrap .play-card{max-width:clamp(46px,14vw,74px)}
  .room-arena .duel .draw-area{margin:5px auto}
  .room-arena .duel .draw-target>span{max-height:clamp(52px,10vh,84px)}
}
@media(orientation:landscape) and (max-height:510px){
  .room-arena .arena-grid{grid-template-columns:1fr 1fr}
  #top .header-inner{min-height:40px}#mobile .nav-item{flex-direction:row}
}
.solo-room{position:relative}
.solo-workspace{min-height:0;flex:1;display:flex;flex-direction:column;max-height:850px;border-radius:14px;overflow:hidden;background:radial-gradient(ellipse at 50% 30%,#fff1,transparent 75%),var(--look-felt);color:var(--look-on-felt);border:1px solid #0002}
.solo-workspace .solo-felt{background:none;color:inherit;margin:0;padding:0;border-radius:0}
.solo-reserve{display:flex;flex:none;align-items:center;gap:10px;padding:8px clamp(8px,2vw,18px);border-bottom:1px solid #fff3}
.solo-reserve .solo-felt{flex:1;min-width:0}
.solo-reserve h2,.solo-layout h2{font:600 .84rem/1.1 var(--sans);margin:0 0 5px}
.solo-reserve .row{font-size:.85rem;padding:0;flex:1;border:0}
.solo-reserve .btn{margin:0;background:transparent;border:1px solid #fff6;color:inherit;min-height:42px}
.solo-workspace .solo-columns{display:grid;grid-template-columns:repeat(var(--count),minmax(0,1fr));gap:clamp(2px,.6vw,7px);align-items:start}
.solo-reserve .solo-pile{max-width:58px}
.solo-workspace .solo-pile small{font-size:clamp(9px,.69rem,14px);line-height:1.1;margin-bottom:3px}
.solo-reserve .solo-columns .solo-face:last-child{aspect-ratio:auto;min-height:32px;height:clamp(32px,6dvh,52px);justify-content:center;align-items:center;flex-direction:row;gap:2px;padding:2px}
.solo-reserve .solo-columns .solo-face i{font-size:1em;padding:0}
.solo-layout{flex:1;min-height:0;display:flex;padding:clamp(6px,1.3vh,15px) clamp(6px,2vw,18px);overflow:auto}
.solo-layout .solo-felt{flex:1;min-width:0;display:flex;flex-direction:column}
.solo-layout .solo-triangle,.solo-layout .solo-columns{flex:1;min-height:0;container-type:size}
.solo-triangle{display:flex;flex-direction:column;justify-content:safe center}
.solo-layout .solo-triangle .solo-pile{flex:none}
.solo-layout .solo-triangle .solo-pile>div{gap:3px;margin:1px 0}
.solo-layout .solo-triangle .solo-face{width:min(calc((100% - 18px)/7),10.5cqh,80px);height:min(103px,calc((100cqh - 14px)/7));min-height:0;font-size:clamp(13px,min(4.4cqw,5.2cqh),24px)}
.solo-layout .solo-columns .solo-face{padding:0 2px;min-height:0;height:clamp(20px,calc((100cqh - 64px)/var(--depth)),44px);font-size:clamp(12px,3.7cqw,20px)}
.solo-layout .solo-columns .solo-face:last-child{height:clamp(35px,12cqh,84px);min-height:0;aspect-ratio:auto}
.solo-columns .solo-face:last-child i{font-size:1.2em;padding:0}
.solo-foot{flex:none;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:3px 9px}
.solo-foot p{font-size:.88rem;line-height:1.25}
.solo-buttons{display:flex;align-items:center;gap:6px}
.solo-buttons .btn,.solo-menu summary{font-size:.88rem;margin:0;min-height:40px}
.solo-menu{position:relative}
.solo-menu summary{display:flex;align-items:center;gap:5px;padding:0 8px}
.solo-menu[open] .table-tool-list{left:auto;right:0;width:max-content;max-width:min(85vw,20rem);display:grid}
.deal-prompt{position:absolute;z-index:4;bottom:4px;left:0;right:0;padding:14px;color:var(--ink);background:var(--surface);border:1px solid var(--edge);border-radius:10px;box-shadow:0 3px 24px #0004}
body:has(.solo-room) #status{clip-path:inset(50%);width:1px;height:1px;pointer-events:none}
@media(orientation:landscape) and (max-height:500px){
  .solo-workspace{flex-direction:row}
  .solo-reserve{flex-direction:column;align-items:stretch;justify-content:flex-start;width:24%;padding:6px;border:0;border-right:1px solid #fff3;overflow:auto}
  .solo-reserve .solo-felt{flex:none}
  .solo-foot{flex-wrap:nowrap}
}
@media(min-width:861px){.solo-foot{padding-right:55px}}
.arena-title .room-back{flex:none}
.room-arena .hand-wrap .play-card.spanish small{font-size:clamp(8px,.52rem,11px)}
.solo-layout .solo-triangle .solo-face{width:min(calc((100% - 18px)/7),max(34px,10.5cqh),80px);font-size:clamp(12px,min(4.2cqw,4.3cqh),21px)}
@media (orientation:landscape) and (max-height:400px){
  body:not(.tour-page) #main.solo-room:has(.solo-triangle){
    display:grid;grid-template-columns:minmax(190px,38%) minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr) auto;gap:4px 8px
  }
  .solo-room:has(.solo-triangle) .solo-workspace{display:contents}
  .solo-room:has(.solo-triangle) .arena-title{grid-column:1;grid-row:1;flex-wrap:wrap}
  .solo-room:has(.solo-triangle) .solo-reserve{
    grid-column:1;grid-row:2;width:auto;flex-direction:row;align-items:center;justify-content:space-between;
    flex-wrap:wrap;gap:4px;padding:4px 8px;background:var(--look-felt);color:var(--look-on-felt);border-radius:9px
  }
  .solo-room:has(.solo-triangle) .solo-layout{
    grid-column:2;grid-row:1/-1;background:var(--look-felt);color:var(--look-on-felt);border-radius:10px
  }
  .solo-room:has(.solo-triangle) .solo-foot{grid-column:1;grid-row:3;flex-wrap:wrap}
}
.solo-columns .solo-pile small{white-space:nowrap}
.solo-reserve .solo-columns:has(>.solo-pile:only-child) .solo-pile{display:flex;align-items:center;gap:8px;max-width:none}
.solo-reserve .solo-columns:has(>.solo-pile:only-child) .solo-pile>div{width:50px;flex:none}
.solo-reserve .solo-pile:only-child small{margin:0;white-space:normal}
.solo-layout .solo-pile.has-backs>div::before{content:"";display:block;min-height:8px;margin:1px 2px 0;border:1px solid #b8a374;border-radius:4px 4px 0 0;background:repeating-linear-gradient(to bottom,#356154 0 2px,#dbc790 2px 3px)}
@media(min-width:901px),(min-width:721px) and (orientation:landscape){
  .tour-page main.room-intro{min-height:0;flex:1;display:flex;flex-direction:column;padding-block:clamp(5px,2.5dvh,30px);overflow:auto}
  .tour-page .chapter{min-height:0;max-height:100%}
  .tour-page .chapter-art{min-height:0}
  .tour-page .chapter-copy{overflow:auto;min-height:0}
}
body:not(.tour-page) #main.roster-room{width:min(94%,640px);display:flex;flex-direction:column;gap:8px;padding-top:6px}
.roster-room .arena-title{padding-block:3px}
.roster-room .roster-form{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 4px 4px}
.roster-room .panel{margin:0;padding:clamp(14px,2.7vw,26px)}
.roster-room .panel .subhead{margin:16px 0 7px;font-size:1.1rem}
.roster-room .panel .field{gap:4px}
.roster-room .body-text{font-size:.89rem}
.roster-submit{flex:none;align-self:stretch;display:flex;background:var(--surface);border:1px solid var(--edge);border-radius:12px;padding:6px}
.roster-submit .btn{flex:1;margin:0;min-height:44px}
@media(max-height:460px){
  .roster-room .arena-title{padding-block:0}
  .roster-room .roster-form{flex:1}
}
.move-zone>.arena-actions{flex:none;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.move-zone:has(.move-scroll:not(:empty))>.arena-actions{max-height:42%}
.move-zone>.move-scroll:empty+.arena-actions{flex:0 1 auto;min-height:0}
.room-arena>.result-stage{min-height:0;overflow:auto;width:100%;padding:clamp(8px,2vh,24px) 16px;margin:0 auto}
.room-arena>.room-back{align-self:flex-start;margin:0}
.room-arena>.arena-actions{flex:none}
.room-arena>.game-history{min-height:0;overflow:auto;width:100%}
.roster-submit:has(p){flex-direction:column;gap:6px}
.roster-submit p{padding:3px 6px;font-weight:600;font-size:.86rem}
body:has(.roster-submit p) #status{clip-path:inset(50%);height:1px;width:1px;pointer-events:none}
.solo-layout .solo-triangle .unavailable:not(.slot){opacity:.69}

.table-tools.opens-below .table-tool-list,.solo-menu.opens-below .table-tool-list{top:100%;bottom:auto}
.move-scroll .card-zone h2{position:sticky;top:0;z-index:1;background:var(--look-page);margin-top:0;padding:3px 0}
