/* Compact play surface. The board gets the space left by real content rows. */
.mobile-label{display:none}
.compact-energy{display:none}
.skills-dialog{width:min(480px,calc(100% - 28px));max-height:calc(100dvh - 40px);padding:20px;overflow:hidden}
.skills-dialog[open]{display:flex;flex-direction:column;gap:16px}
.skills-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:none}
.skills-dialog-heading h2{margin:0;font-size:24px}
.skills-dialog-heading p{margin:6px 0 0!important;font-size:12px!important}
.skills-dialog-heading button{min-width:44px;min-height:44px;flex:none}
.skills-dialog .skill-grid{display:flex;flex-direction:column;margin:0;max-height:none;overflow:auto;overscroll-behavior:contain;min-height:0;padding:3px 5px 5px}
.skills-dialog .skill-card{flex-shrink:0}
.skills-dialog .skill-card:disabled{opacity:1;background:#f5f2e9}
.skills-dialog .skill-info>span,.skills-dialog .skill-info small{color:#66715c}
.skills-dialog .skill-info em{color:#756b35}

@media(max-width:620px), (max-width:1000px) and (max-height:500px){
 :root{--mobile-header:calc(56px + env(safe-area-inset-top))}
 body{background-attachment:scroll;min-height:100dvh}
 .site-header{height:var(--mobile-header);width:100%;margin:0;padding:env(safe-area-inset-top) 16px 0;flex:none}
 .brand{font-size:20px;gap:9px;letter-spacing:2px}
 .brand small,.quiet-label{display:none}
 .brand-stones{transform:scale(.75);transform-origin:left center;width:31px}
 .header-right{gap:8px}
 .icon-button{min-height:44px;min-width:44px;padding:8px;font-size:12px}
 .desktop-label{display:none}
 .mobile-label{display:inline}
 body:not(.in-room){display:flex;flex-direction:column}
 body:not(.in-room)>main{flex:1;display:flex;align-items:center}
 .home{display:flex;flex-direction:column;width:100%;max-width:440px;margin:0 auto;padding:14px 24px;gap:14px}
 .home-copy{width:100%}
 .home .eyebrow{margin-bottom:12px;font-size:11px}
 .home h1{font-size:30px;line-height:1.35;margin-bottom:12px}
 .home .intro{font-size:12px;line-height:1.7;margin-bottom:16px}
 .mode-picker{margin-bottom:16px;max-width:none}
 .mode-picker legend{font-size:11px}
 .mode-options label>span{padding:10px 4px;font-size:12px}
 .mode-options small{margin-top:4px;font-size:10px}
 .create-button,.join-form,.join-divider{max-width:none}
 .create-button,.join-form button,.join-form input{min-height:44px}
 .join-form input{font-size:16px}
 .join-divider{margin:16px 0 10px}
 .home-footnote{margin:12px 0 0;font-size:11px}
 #restore{min-height:44px}
 .home-art{width:100px;margin:0;padding:0}
 .art-caption,.art-note{display:none}
 .demo-frame{margin:0;padding:4px}
 footer{margin:0;padding:8px 20px calc(8px + env(safe-area-inset-bottom));font-size:10px}
 footer span:last-child{display:none}

 body.in-room{height:100dvh;min-height:0;display:flex;flex-direction:column}
 body.in-room>main{flex:1;min-height:0}
 body.in-room>footer{display:none}
 .room-layout{height:100%;max-width:560px;display:flex;flex-direction:column;gap:4px;margin:0 auto;padding:0 12px calc(8px + env(safe-area-inset-bottom));min-height:0}
 .room-aside{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0;flex:none;min-height:44px}
 .room-aside>.eyebrow,.room-title,.room-description,.room-rules,.mode-note,.invite .tiny-title,.invite .hint{display:none}
 .back{margin:0;min-height:44px;min-width:48px;padding:6px 0;font-size:12px;white-space:nowrap}
 .room-aside .invite{display:flex;align-items:center;gap:8px;padding:0;border:0;flex-wrap:nowrap}
 .room-code-line{margin:0;gap:2px}
 .room-code-line strong{font-size:16px;letter-spacing:1.5px}
 .room-code-line .icon-button{font-size:12px}
 .invite .wide{width:auto;min-height:44px;min-width:64px;padding:8px 10px;gap:6px;font-size:12px}
 .game-area{flex:1;min-height:0;display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto auto auto auto;gap:5px}
 .table-heading{grid-row:1;margin:0;min-height:22px}
 .table-label{font-size:14px;letter-spacing:1px}
 .connection{font-size:11px}
 .players{grid-row:2;margin:0;gap:8px;min-height:36px}
 .player{gap:8px}
 .stone-avatar{width:30px;height:30px}
 .player-name{font-size:12px}
 .player-state{font-size:10px;margin-top:3px}
 .energy-bar{grid-row:3;margin:0;font-size:12px;min-height:18px}
 .board-slot{grid-row:4;min-height:0;container-type:size;display:flex;align-items:center;justify-content:center}
 .board-slot .board-frame{width:min(100cqw,100cqh);aspect-ratio:1;padding:6px;border-radius:12px;flex:none}
 .board-slot canvas{width:100%;height:100%;aspect-ratio:1}
 .turn-line{grid-row:5;margin:0;min-height:42px;gap:8px}
 .turn-line>div{min-width:0}
 .turn-line strong{font-size:14px;letter-spacing:0}
 .turn-line p{font-size:11px;letter-spacing:0;margin:3px 0 0;line-height:1.4}
 .move-count{font-size:11px}
 .skill-panel{grid-row:6;margin:0;padding:0;border:0}
 .skill-heading{gap:8px}
 .skill-heading button{min-height:44px;padding:8px 14px;font-size:12px;flex:none}
 .skill-heading>span{font-size:11px;line-height:1.5;letter-spacing:0;color:#748164}
 .last-action{font-size:11px;line-height:1.4;margin:3px 0 0;color:#69765c;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
 .game-controls{grid-row:7;min-height:44px;gap:12px;flex-wrap:nowrap}
 .game-controls button{min-height:44px;min-width:44px;font-size:12px;padding:8px 12px}
 .game-controls .primary{min-width:160px}
 .result-banner{grid-row:8;font-size:11px;padding:6px;margin:0;line-height:1.5}
 .board-tip{display:none}
 .skill-target{position:static;transform:none;width:100%;padding:8px 10px;box-shadow:none;border-radius:10px;display:block}
 .skill-target strong{font-size:13px}
 .skill-target p{font-size:11px;line-height:1.4;margin-top:3px}
 .target-actions{margin-top:6px;gap:10px;justify-content:flex-end}
 .target-actions button{min-height:44px;min-width:44px;padding:8px 12px;font-size:12px}
 .skill-panel:has(.skill-target:not([hidden])) .skill-heading,
 .skill-panel:has(.skill-target:not([hidden])) .last-action,
 .game-area:has(.skill-target:not([hidden])) .game-controls{display:none}
 .skills-dialog{inset:auto 0 0;margin:0 auto;width:100%;max-width:560px;max-height:80dvh;border-radius:20px 20px 0 0;padding:16px 12px calc(16px + env(safe-area-inset-bottom))}
 .skills-dialog .skill-card{min-height:84px;padding:12px;gap:12px}
 .skills-dialog .skill-info strong{font-size:14px}
 .skills-dialog .skill-info>span{font-size:12px}
 .skills-dialog .skill-info small{font-size:11px}
 .skills-dialog .skill-icon{width:52px;height:52px}
 .toast{bottom:calc(14px + env(safe-area-inset-bottom));font-size:12px}
 @supports not (width:1cqw){.board-slot .board-frame{width:min(100%,calc(100dvh - 365px))}}
}
@media(max-width:620px) and (max-height:740px){
 :root{--mobile-header:calc(48px + env(safe-area-inset-top))}
 .home-art,.home .eyebrow,.home .intro,.home-footnote{display:none}
 .home h1{font-size:28px;margin-bottom:16px}
 .home{padding-block:12px}
 .compact-energy{display:inline}
 .energy-bar{display:none}
 .game-area{row-gap:4px}
 .skill-panel{display:flex;align-items:center;gap:10px}
 .skill-panel .last-action{flex:1;min-width:0;margin:0;-webkit-line-clamp:2;text-align:left}
 .skill-heading>span{display:none}
 .skill-heading{justify-content:center}
 .last-action{-webkit-line-clamp:1}
 .room-layout[data-status="waiting"] .last-action{display:none}
 .game-area:has(.skill-target:not([hidden])) .turn-line p{display:none}
 .skill-target{padding:6px 8px}
}
@media(max-width:1000px) and (max-height:500px) and (orientation:landscape){
 :root{--mobile-header:calc(44px + env(safe-area-inset-top))}
 .room-layout{max-width:none;padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 .game-area{grid-template-columns:minmax(0,1fr) minmax(210px,.85fr);grid-template-rows:auto auto auto auto auto auto minmax(0,1fr);gap:3px 16px}
 .game-area>*{grid-column:2;grid-row:auto}
 .game-area .board-slot{grid-column:1;grid-row:1/-1}
 .game-area .turn-line{min-height:36px}
 .game-area .last-action{-webkit-line-clamp:1}
 .home{max-width:760px;display:block;padding:8px 24px}
 .home-copy{display:grid;grid-template-columns:1fr 1fr;gap:8px 24px;align-items:center}
 .home .eyebrow,.home .intro,.home-art,.home-footnote,.join-divider{display:none}
 .home h1{grid-column:1;grid-row:1/4;font-size:28px;margin:0}
 .home .mode-picker,.home .create-button,.home .join-form,.home #restore{grid-column:2;margin:0}
 body:not(.in-room) footer{display:none}
 .skills-dialog{max-height:95dvh}
 @supports not (width:1cqw){.board-slot .board-frame{width:min(100%,calc(100dvh - 110px))}}
}
