/* Landscape drawers overlay the board rather than taking its columns. */
.kg-compact-handle,.kg-compact-shade,.kg-mobile-fullscreen{display:none!important}
.ks-settings .ks-dialog-actions button[aria-label="Fullscreen / install"],.kingdom-options-dialog [data-display-mode]{display:none!important}
.kg-mobile-controls .kg-mobile-fullscreen{display:inline-flex!important}
.ks-standard .ks-jade-app{display:block!important}
.ks-jade-grid .canvas-wrap{width:100%!important;max-height:none!important}
.kg-short-landscape{--kg-drawer-width:min(300px,75vw);--kg-panel-bg:var(--ks-panel,#0c2036);--kg-panel-line:var(--ks-line,#ffffff24)}
.kg-short-landscape .ks-header,.kg-short-landscape .ks-header.kg-shell,.kg-short-landscape .game-header{height:44px!important;min-height:44px!important;padding:3px max(6px,env(safe-area-inset-right)) 3px max(6px,env(safe-area-inset-left))!important;gap:7px!important}
.kg-short-landscape .ks-header-audio,.kg-short-landscape .ks-shortcuts,.kg-short-landscape .header-audio,.kg-short-landscape .header-shortcuts{display:none!important}
.kg-short-landscape .ks-brand{height:32px;width:32px}.kg-short-landscape .ks-header .ks-button{min-width:36px;min-height:36px;padding:7px}.kg-short-landscape .ks-title{font-size:12px}
.kg-short-landscape.ks-standard :is(.table-main,.ks-jade-app,.ks-native-app,.ks-three-app,.ks-dynamic-app,.ks-party-app,.ks-party-home,.ks-arcade-app){height:calc(100dvh - var(--kg-compact-header,44px))!important;width:100%!important;max-width:none!important}
.kg-short-landscape.ks-standard[data-ks-game=crownfall]>main,.kg-short-landscape.ks-standard:has(.ks-boards-grid)>main{height:calc(100dvh - var(--kg-compact-header,44px))!important}
.kg-short-landscape.ks-standard>main{height:calc(100dvh - var(--kg-compact-header,44px))!important}
.kg-short-landscape .ks-native-grid #board{padding:6px!important;min-height:0!important}.kg-short-landscape .ks-native-grid .board-caption{margin:4px 0;font-size:10px}
.kg-short-landscape.ks-standard .ks-play-grid{position:relative;width:100%;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) auto!important;grid-template-areas:'board' 'bottom'!important;overflow:hidden}
.kg-short-landscape.ks-standard .ks-play-grid.ks-no-bottom{grid-template-rows:minmax(0,1fr)!important}
.kg-short-landscape [data-compact-panel]{position:fixed!important;top:var(--kg-compact-header,44px)!important;bottom:0!important;width:var(--kg-drawer-width)!important;height:auto!important;max-height:none!important;min-height:0!important;z-index:72!important;background:var(--kg-panel-bg)!important;border:1px solid var(--kg-panel-line)!important;border-radius:0!important;padding:12px 22px!important;display:flex!important;flex-direction:column!important;overflow:auto!important;overscroll-behavior:contain;visibility:hidden;transition:transform .18s ease,visibility .18s;box-shadow:0 4px 24px #0007;align-self:auto!important}
.kg-short-landscape [data-compact-panel=left]{left:env(safe-area-inset-left);right:auto!important;transform:translateX(-105%)}
.kg-short-landscape [data-compact-panel=right]{right:env(safe-area-inset-right);left:auto!important;transform:translateX(105%)}
.kg-short-landscape [data-compact-open]{transform:translateX(0);visibility:visible}
.kg-short-landscape .kg-compact-handle:not([hidden]){display:flex!important;position:fixed;top:52%;z-index:74;width:26px;min-width:26px;height:52px;min-height:52px;padding:0;align-items:center;justify-content:center;border:1px solid #54dfff88;background:#0c2036ec;color:#54dfff;font:32px/1 system-ui;touch-action:manipulation;box-shadow:0 2px 10px #0004}
.kg-compact-handle[data-edge=left]{left:env(safe-area-inset-left);border-radius:0 9px 9px 0}.kg-compact-handle[data-edge=right]{right:env(safe-area-inset-right);border-radius:9px 0 0 9px}.kg-compact-handle:focus-visible{outline:3px solid #54dfff;outline-offset:-3px}
.kg-short-landscape .kg-compact-shade:not([hidden]){display:block!important;position:fixed;inset:var(--kg-compact-header,44px) 0 0;z-index:71;border:0;border-radius:0;margin:0;padding:0;background:#02091255;cursor:default}
.kg-short-landscape .ks-board{container-type:size;overflow:auto;padding:3px;gap:3px}
.kg-short-landscape .ks-bottom{max-height:23dvh;padding:3px max(6px,env(safe-area-inset-right)) 3px max(6px,env(safe-area-inset-left))!important;gap:5px}
.kg-short-landscape .ks-bottom .playing-card{width:42px;height:59px;min-width:36px}
.kg-short-landscape .ks-jade-grid .game{padding:0!important;gap:0}.kg-short-landscape .ks-jade-grid .arena-top{padding:0 28px!important;min-height:26px;gap:8px}.kg-short-landscape .ks-jade-grid .arena-top .eyebrow,.kg-short-landscape .ks-jade-grid .arena-label{display:none}.kg-short-landscape .ks-jade-grid .arena-top h1{font-size:12px;margin:0}.kg-short-landscape .ks-jade-grid .stats{gap:12px}.kg-short-landscape .ks-jade-grid .stats>div{flex-direction:row;align-items:center;gap:5px}.kg-short-landscape .ks-jade-grid .stats small{font-size:8px;letter-spacing:0}.kg-short-landscape .ks-jade-grid .stats strong{font-size:13px}.kg-short-landscape .ks-jade-grid .controls{flex-wrap:nowrap;justify-content:space-between}.kg-short-landscape .ks-jade-grid #touch-swap{min-height:32px;padding:4px 10px;font-size:12px}.kg-short-landscape .ks-jade-grid #message{padding:0;font-size:11px}
.kg-short-landscape .ks-boards-grid #board-wrap,.kg-short-landscape .ks-board :is(.cc-board-wrap,.hb-board,.sp-map,.sl-board-frame,.ft-board-section,.cb-console),.kg-short-landscape .ks-arcade-grid .match-grid,.kg-short-landscape .ks-dynamic-grid :is(.board-wrap,.board-frame){width:min(100%,calc(100cqh - 6px))!important;min-height:0!important;max-height:100%}
.kg-short-landscape .ks-map-viewport{min-height:0!important}.kg-short-landscape .ks-arcade-grid .arcade-canvas{max-height:100cqh!important;width:auto;max-width:100%}.kg-short-landscape .ks-arcade-grid .game-area{min-height:0!important;max-height:100%;height:100%;display:flex;justify-content:center;align-items:center}
.kg-short-landscape .game:has(>.game-body){height:100dvh!important;min-height:0!important;grid-template-rows:44px minmax(0,1fr) auto!important}.kg-short-landscape .game>.game-body{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}.kg-short-landscape .game>.game-body>.game-stage{grid-column:1!important;grid-row:1!important;min-height:0!important}.kg-short-landscape .board-canvas{min-height:0!important}.kg-short-landscape .resource-bar{max-height:23dvh!important;padding:3px 8px!important;overflow:auto}.kg-short-landscape .resource-intro{display:none}.kg-short-landscape .board-topbar{top:6px;left:30px;right:30px}.kg-short-landscape .board-legend{display:none}.kg-short-landscape .board-caption strong{font-size:14px}
@media(prefers-reduced-motion:reduce){.kg-short-landscape [data-compact-panel]{transition:none}}
.kg-compact-reduced [data-compact-panel]{transition:none}

/* Portrait phones use a labeled bottom tool bar and one roomy drawer. */
.kg-compact-dock,.kg-compact-quick{display:none!important}
.kg-compact{--kg-drawer-width:min(340px,calc(100vw - 36px));--kg-panel-bg:var(--ks-panel,#0c2036);--kg-panel-line:var(--ks-line,#ffffff24)}
.kg-compact [data-compact-panel]{position:fixed!important;top:var(--kg-compact-header,60px)!important;bottom:calc(var(--kg-mobile-dock,0px) + env(safe-area-inset-bottom))!important;width:var(--kg-drawer-width)!important;height:auto!important;max-height:none!important;min-height:0!important;z-index:72!important;background:var(--kg-panel-bg)!important;border:1px solid var(--kg-panel-line)!important;border-radius:0!important;padding:16px!important;display:flex!important;flex-direction:column!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin;visibility:hidden;transition:transform .18s ease,visibility .18s;box-shadow:0 4px 24px #0007;align-self:auto!important}
.kg-compact [data-compact-panel=left]{left:env(safe-area-inset-left);right:auto!important;transform:translateX(-105%)}
.kg-compact [data-compact-panel=right]{right:env(safe-area-inset-right);left:auto!important;transform:translateX(105%)}
.kg-compact [data-compact-open]{transform:translateX(0);visibility:visible}
.kg-compact .kg-compact-shade:not([hidden]){display:block!important;position:fixed;inset:var(--kg-compact-header,60px) 0 calc(var(--kg-mobile-dock,0px) + env(safe-area-inset-bottom));z-index:71;border:0;border-radius:0;margin:0;padding:0;background:#02091288;cursor:default}
.kg-short-landscape .kg-compact-dock:not([hidden]){display:contents!important}.kg-short-landscape .kg-compact-handle:not([hidden]){width:44px!important;min-width:44px!important;height:52px!important;min-height:52px!important}
.kg-short-landscape .kg-compact-status:not([hidden]){display:block;position:fixed;left:0;right:0;bottom:env(safe-area-inset-bottom);z-index:74;height:26px;box-sizing:border-box;margin:0;padding:3px max(12px,env(safe-area-inset-right)) 3px max(12px,env(safe-area-inset-left));overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font:500 14px/20px Inter,system-ui,sans-serif;color:var(--ks-ink);background:var(--ks-panel);border-top:1px solid var(--ks-line)}
.kg-short-landscape.ks-standard :is(.table-main,.ks-jade-app,.ks-native-app,.ks-three-app,.ks-dynamic-app,.ks-party-app,.ks-party-home,.ks-arcade-app),.kg-short-landscape.ks-standard>main,.kg-short-landscape.ks-standard[data-ks-game=crownfall]>main,.kg-short-landscape.ks-standard:has(.ks-boards-grid)>main{height:calc(100dvh - var(--kg-compact-header,52px) - var(--kg-compact-status,0px) - env(safe-area-inset-bottom))!important}
.kg-short-landscape .ks-header .ks-button{min-width:44px!important;min-height:44px!important;padding:8px!important}.kg-short-landscape .ks-header,.kg-short-landscape .ks-header.kg-shell{height:52px!important;min-height:52px!important}.kg-short-landscape .ks-jade-grid #touch-swap{min-height:44px;padding:8px 12px}
.kg-phone-controls .kg-compact-dock:not([hidden]){display:flex!important;position:fixed;left:0;right:0;bottom:0;z-index:74;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 8px;height:calc(var(--kg-mobile-dock,56px) + env(safe-area-inset-bottom));box-sizing:border-box;padding:6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:var(--ks-panel);border-top:1px solid var(--ks-line)}
.kg-phone-controls .kg-compact-status:not([hidden]){display:block;flex:none;width:100%;margin:0;height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 14px/20px Inter,system-ui,sans-serif;text-align:center;color:var(--ks-ink);background:none}
.kg-phone-controls .kg-compact-handle:not([hidden]),.kg-phone-controls .kg-compact-quick:not([hidden]){display:inline-flex!important;position:static;align-items:center;justify-content:center;flex:1;gap:6px;width:auto;min-width:44px;max-width:180px;height:44px;min-height:44px;box-sizing:border-box;padding:8px 16px;border:1px solid var(--ks-line);border-radius:12px;background:var(--ks-bg);color:var(--ks-ink);font:650 13px/1.2 Inter,system-ui,sans-serif;touch-action:manipulation;box-shadow:none}
.kg-phone-controls .kg-compact-handle::before{content:'\2630';font-size:18px;color:var(--ks-accent)}.kg-phone-controls .kg-compact-handle[data-edge=right]::before{content:'\25CE'}.kg-phone-controls .kg-compact-handle.kg-panel-open{background:var(--ks-accent);border-color:var(--ks-accent);color:#062433}.kg-phone-controls .kg-compact-handle.kg-panel-open::before{content:'\00D7';color:inherit}.kg-phone-controls .kg-compact-quick:disabled{opacity:.4}.kg-phone-controls .kg-compact-quick::before{content:'\21B6';font-size:18px}.kg-compact :is(.kg-compact-handle,.kg-compact-quick):focus-visible{outline:3px solid var(--ks-accent);outline-offset:-3px}
html[data-kg-theme=light] .kg-phone-controls .kg-compact-handle.kg-panel-open{color:#fff}
.kg-phone-controls.ks-standard :is(.table-main,.ks-jade-app,.ks-native-app,.ks-three-app,.ks-dynamic-app,.ks-party-app,.ks-party-home,.ks-arcade-app),.kg-phone-controls.ks-standard>main{height:calc(100dvh - var(--kg-compact-header,60px) - var(--kg-mobile-dock,0px) - env(safe-area-inset-bottom))!important;width:100%!important;max-width:none!important}
.kg-phone-controls.ks-standard .ks-play-grid{position:relative;width:100%;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) auto!important;grid-template-areas:'board' 'bottom'!important;overflow:hidden}
.kg-phone-controls.ks-standard .ks-play-grid.ks-no-bottom{grid-template-rows:minmax(0,1fr)!important}
.kg-phone-controls .ks-board{padding:12px 8px;gap:10px;justify-content:flex-start;overflow:auto;overscroll-behavior:contain}
.kg-phone-controls .ks-bottom{max-height:26dvh;padding:8px!important;gap:8px;border-top:1px solid var(--ks-line)}
.kg-phone-controls .ks-boards-grid #board-wrap,.kg-phone-controls .ks-board :is(.cc-board-wrap,.hb-board,.sp-map,.sl-board-frame,.ft-board-section,.cb-console),.kg-phone-controls .ks-dynamic-grid :is(.board-wrap,.board-frame){width:min(100%,calc(100dvh - var(--kg-compact-header,60px) - var(--kg-mobile-dock,56px) - 100px))!important;max-width:520px;min-height:0!important}
.kg-phone-controls .ks-map-viewport{min-height:0!important}.kg-phone-controls .ks-crown-grid .ks-board{padding:0}.kg-phone-controls .ks-jade-grid .game{height:auto;padding:0;gap:8px}.kg-phone-controls .ks-jade-grid .arena-top{padding:0 4px}.kg-phone-controls .ks-jade-grid .canvas-wrap{flex:none;aspect-ratio:1000/720;container-type:inline-size}.kg-phone-controls .ks-jade-grid #arena{width:100%;height:auto;max-height:none}.kg-phone-controls .ks-jade-grid .controls{flex-wrap:wrap}.kg-phone-controls .ks-jade-grid #touch-swap{min-height:44px}
.kg-phone-controls .ks-party-grid .ks-board{justify-content:center}.kg-phone-controls .ks-arcade-grid .game-area{min-height:0!important}.kg-phone-controls .ks-arcade-grid .match-grid{width:min(100%,calc(100dvh - var(--kg-compact-header,60px) - var(--kg-mobile-dock,56px) - 150px))!important}.kg-phone-controls .ks-arcade-grid .arcade-canvas{max-height:calc(100dvh - var(--kg-compact-header,60px) - var(--kg-mobile-dock,56px) - 150px);width:auto;max-width:100%}.kg-phone-controls .ks-native-grid .grids{width:100%}.kg-phone-controls .ks-native-grid #board{width:100%;min-height:0}.kg-phone-controls .ks-native-grid .ship-editor{display:flex;gap:6px;flex-wrap:wrap}.kg-phone-controls .ks-native-grid .ship-editor select{flex:1;min-width:0;font-size:16px;min-height:44px}
@media(prefers-reduced-motion:reduce){.kg-compact [data-compact-panel]{transition:none}}
.kg-compact-reduced [data-compact-panel]{transition:none}

/* Drawer dimensions take precedence over compact game sidebar rules. */
.ks-standard.kg-compact [data-compact-panel]{height:auto!important;max-height:none!important;min-height:0!important;padding:16px!important;box-sizing:border-box}
.ks-standard.kg-compact [data-compact-panel] :is(button,input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]),select){min-height:44px!important}
.ks-standard.kg-compact [data-compact-panel] :is(input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]),select){font-size:16px!important}
