.game-fullscreen-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-bottom:8px;position:relative;z-index:8;flex-shrink:0}
.game-fullscreen-toolbar[hidden]{display:none!important;margin:0}
.game-fullscreen-menu-control{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
.game-fullscreen-menu-control>.game-fullscreen-status{max-width:230px;white-space:normal}
.site-nav .game-fullscreen-button{min-height:44px;white-space:normal;text-align:left}
.game-fullscreen-button:disabled{opacity:.6;cursor:not-allowed}
.game-fullscreen-toolbar .game-fullscreen-button{min-height:44px}
.game-fullscreen-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 12px;border:1px solid #a7bce0;border-radius:8px;background:#fff;color:#254f99;font:inherit;font-size:12px;cursor:pointer}
.game-fullscreen-button:focus-visible{outline:3px solid #146d6b;outline-offset:2px}
.game-header-sound:focus-visible{outline:3px solid #146d6b;outline-offset:2px}
@media(max-width:620px){
 .site-header>.game-fullscreen-menu-control{display:flex;flex-wrap:nowrap;gap:2px;flex-shrink:0;width:90px}
 .site-header>.game-fullscreen-menu-control>:is(.game-fullscreen-button,.game-header-sound){display:flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid #a7bce0;border-radius:8px;background:#fff;color:#254f99;flex-shrink:0}
 .site-header>.game-fullscreen-menu-control>.game-fullscreen-button>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .site-header>.game-fullscreen-menu-control>:is(#sound-toggle,#exp-sound,#lab-sound,#chess-sound).game-header-sound{font-size:0}
 .site-header>.game-fullscreen-menu-control>.game-header-sound::before{content:'\266A';font-size:22px}
 .site-header>.game-fullscreen-menu-control>.game-header-sound[aria-pressed=true]{background:#254f99;color:#fff}
 .site-header>.game-fullscreen-menu-control>.game-fullscreen-status{position:absolute;top:var(--site-header-height);left:8px;right:8px;max-width:none;background:#fff;border-radius:6px}
 .site-header>.game-fullscreen-menu-control>.game-fullscreen-status:empty{display:none}
 .site-header:has(>.game-fullscreen-menu-control)>.nav-current-game{width:44px;max-width:44px;overflow:hidden;text-overflow:ellipsis;display:block;line-height:36px;padding:4px}
 .site-header:has(>.game-fullscreen-menu-control)>.nav-play>summary{width:44px;min-width:44px;font-size:11px;gap:1px;padding:3px}
}
@media(max-width:379px){
 .site-header.play-compact>.nav-current-game{width:44px;max-width:44px;overflow:hidden;text-overflow:ellipsis;display:block;line-height:36px;padding:4px}
 .site-nav .game-header-sound{min-height:44px;padding:8px;font-size:14px;text-align:left}
}
.game-fullscreen-toolbar .text-button{margin:0;min-height:44px;padding:8px;border:1px solid #a7bce0;border-radius:8px;background:#fff;color:#254f99;font-size:12px}
.game-fullscreen-status{font-size:11px;max-width:230px;color:#254f99}
.game-stage>.game-fullscreen-toolbar{position:absolute;top:12px;right:12px;left:12px;pointer-events:none}
.game-stage>.game-fullscreen-toolbar button{pointer-events:auto}
.game-stage .game-fullscreen-status{background:#fff;border-radius:4px}
body.game-fullscreen-open{overflow:hidden}
.game-is-fullscreen{position:fixed!important;inset:0!important;z-index:1000;width:100%!important;height:100dvh!important;min-height:0!important;max-width:none!important;margin:0!important;box-sizing:border-box;overflow:auto;background:#f3f4fc;padding: max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
.game-stage.game-is-fullscreen{padding:0;background:#080b1f;display:block}
.game-is-fullscreen .game-fullscreen-toolbar{top:0;flex-shrink:0}
.game-stage.game-is-fullscreen>.game-fullscreen-toolbar{top:max(8px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));left:10px}
.game-stage.game-is-fullscreen .hud{position:absolute!important;top:max(64px,calc(env(safe-area-inset-top) + 56px))!important}
.game-stage.game-is-fullscreen .game-message{top:170px!important}
.game-stage.game-is-fullscreen .stage-center{max-height:calc(100dvh - 90px);overflow:auto;margin-top:58px}
.game-stage #welcome{max-height:calc(100% - 120px);overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;box-sizing:border-box;scrollbar-gutter:stable}
.game-stage.game-is-fullscreen #welcome{top:64px;transform:translateX(-50%);margin-top:0;max-height:calc(100dvh - 80px)}
@media(max-height:600px){.game-stage:not(.game-is-fullscreen) #welcome{top:64px;transform:translateX(-50%);max-height:min(calc(100% - 96px),calc(100dvh - var(--site-header-height,70px) - 80px))}}
.exp-play.game-is-fullscreen,.lab-play.game-is-fullscreen{display:flex;flex-direction:column;align-items:stretch}
.exp-play.game-is-fullscreen>.exp-heading,.lab-play.game-is-fullscreen>.lab-heading,.game-is-fullscreen>.lab-cooperation-actions,.game-is-fullscreen>.lab-control-note,.game-is-fullscreen>.exp-keyboard-note{display:none}
.exp-play.game-is-fullscreen>.exp-board,.lab-play.game-is-fullscreen>.lab-board{flex:1;min-height:100px;max-height:none!important;width:100%!important;aspect-ratio:auto;margin:0}
.lab-play.game-is-fullscreen>.lab-board canvas{width:100%;height:100%;object-fit:contain}
.game-is-fullscreen>.exp-mission{min-height:0;padding:5px 0;flex-shrink:0}
.game-is-fullscreen>.exp-hud,.game-is-fullscreen>.lab-hud{flex-shrink:0}
.game-is-fullscreen>.exp-game-controls{flex-shrink:0;margin:4px 0}
.game-is-fullscreen>.lab-controls{flex-shrink:0}
@media(max-height:500px){.game-is-fullscreen>.exp-hud-context,.game-is-fullscreen>.lab-objective-row,.game-is-fullscreen>.lab-status{display:none}.game-fullscreen-button{min-height:36px}.game-fullscreen-toolbar{margin-bottom:4px}.game-is-fullscreen>.exp-mission{padding:3px 0;font-size:11px}.game-is-fullscreen>.exp-mission>strong,.game-is-fullscreen #exp-next-sector{display:none}.game-is-fullscreen #exp-objective{margin:2px 0;line-height:1.2}.game-is-fullscreen .exp-mission>span{margin-top:2px}.game-is-fullscreen .exp-sequence{margin:2px 0}}

/* Fullscreen keeps the arena, its current state and 44px controls together. */
.game-is-fullscreen{--fullscreen-content-height:calc(100dvh - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom)))}
.game-is-fullscreen .game-fullscreen-toolbar{gap:6px;min-height:44px;margin:0 0 6px;justify-content:flex-end;order:0;flex-wrap:nowrap}
.game-is-fullscreen .game-fullscreen-toolbar button{display:inline-flex;align-items:center;justify-content:center;width:44px!important;min-width:44px;max-width:44px;height:44px;min-height:44px!important;margin:0;padding:0!important;border:1px solid #a7bce0;border-radius:10px;background:#fff;color:#254f99;flex-shrink:0}
.game-is-fullscreen .game-fullscreen-button>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.game-is-fullscreen .game-fullscreen-button svg{width:22px;height:22px}
.game-is-fullscreen .game-fullscreen-toolbar .game-header-sound{font-size:0!important}
.game-is-fullscreen .game-fullscreen-toolbar .game-header-sound::before{content:'\266A';font-size:22px}
.game-is-fullscreen .game-fullscreen-toolbar .game-header-sound[aria-pressed=true]{background:#254f99;color:#fff}
.game-is-fullscreen .game-fullscreen-status{flex:1;max-width:none;min-width:0;font-size:11px;line-height:1.3;text-align:left;order:-1;color:#254f99}
.game-is-fullscreen .game-fullscreen-status:empty{display:none}
.game-stage.game-is-fullscreen .game-fullscreen-status{padding:5px 7px;border-radius:6px;flex:none}
.game-stage.game-is-fullscreen .hud{top:calc(env(safe-area-inset-top) + 60px)!important;left:10px!important;right:10px!important;gap:6px;align-items:center}
.game-stage.game-is-fullscreen .hud-item{flex:1;min-width:0;padding:6px 8px;gap:2px;background:#080b1fe0}
.game-stage.game-is-fullscreen .hud-item span{font-size:9px;letter-spacing:.06em}
.game-stage.game-is-fullscreen .hud-item strong{font-size:20px;line-height:1.1}
.game-stage.game-is-fullscreen .hud-button{min-height:44px;padding:8px 10px;font-size:12px;margin-left:0;flex-shrink:0}
.game-stage.game-is-fullscreen .game-message{top:calc(env(safe-area-inset-top) + 120px)!important;margin:0;font-size:12px}
.game-stage.game-is-fullscreen .sector-guide{padding:6px 8px;font-size:11px;gap:3px}
.exp-page .exp-play.game-is-fullscreen{gap:4px;overflow:hidden}
.exp-play.game-is-fullscreen>.exp-heading,.exp-play.game-is-fullscreen>.exp-hud-context,.exp-play.game-is-fullscreen>.exp-keyboard-note{display:none}
.exp-play.game-is-fullscreen>.exp-hud{padding:4px 0;gap:6px}
.exp-play.game-is-fullscreen .exp-hud strong{font-size:20px;line-height:1.1;margin-top:2px}
.exp-play.game-is-fullscreen .exp-hud span{font-size:9px;letter-spacing:.04em}
.exp-play.game-is-fullscreen .exp-hud button{min-height:44px;padding:6px 10px}
.exp-play.game-is-fullscreen>.exp-mission{min-height:0;padding:4px 0}
.exp-play.game-is-fullscreen>.exp-mission>strong,.exp-play.game-is-fullscreen #exp-next-sector{display:none}
.exp-play.game-is-fullscreen #exp-objective{font-size:12px;line-height:1.3;margin:0 0 4px}
.exp-play.game-is-fullscreen .exp-mission>span{margin-top:3px;font-size:11px}
.exp-play.game-is-fullscreen>.exp-game-controls{margin:0;gap:8px;flex-wrap:wrap}
.exp-play.game-is-fullscreen :is(#exp-controls-toggle,#exp-power,.exp-direction button){min-height:44px}
.exp-play.game-is-fullscreen .exp-direction{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}
.exp-play.game-is-fullscreen .exp-power{max-width:none;display:flex;align-items:center;gap:6px}
.exp-play.game-is-fullscreen .exp-power span{margin:0}
.exp-play.game-is-fullscreen>.exp-status{margin:0;font-size:11px;min-height:0}
.exp-play.game-is-fullscreen>.exp-board{min-height:0;flex:1;border-radius:10px}
.lab-page .lab-play.game-is-fullscreen .lab-tools .lab-heading{display:none}
.lab-page .lab-play.game-is-fullscreen .lab-hud{padding:4px 0;gap:6px;margin-inline:0}
.lab-page .lab-play.game-is-fullscreen .lab-hud span{font-size:9px;line-height:11px;min-height:0;letter-spacing:.04em}
.lab-page .lab-play.game-is-fullscreen .lab-hud strong{font-size:20px;line-height:1.1;margin-top:2px}
.lab-page .lab-play.game-is-fullscreen .lab-hud button{min-height:44px;padding:6px 10px}
.lab-page .lab-play.game-is-fullscreen :is(#lab-protection,#lab-map-notice)[hidden]{display:none!important}
.lab-page .lab-play.game-is-fullscreen :is(.lab-objective,.lab-status){margin-block:4px;font-size:11px;line-height:1.35;min-height:0}
.lab-page .lab-play.game-is-fullscreen #lab-toggle-controls{min-height:44px;margin:2px 0;padding:6px}
.lab-page .lab-play.game-is-fullscreen .lab-controls{margin:0}
.lab-page .lab-play.game-is-fullscreen>.lab-board{min-height:0;border-radius:10px}
@media(min-width:700px) and (max-height:500px){
 .exp-page .exp-play.game-is-fullscreen{display:grid;grid-template-columns:minmax(0,1fr) 220px;grid-template-rows:44px auto auto auto minmax(0,1fr);gap:6px 12px;align-items:start}
 .exp-play.game-is-fullscreen>*{grid-column:2}
 .exp-play.game-is-fullscreen>.exp-board{grid-column:1;grid-row:1/-1;height:100%;min-height:0;width:100%!important}
 .exp-play.game-is-fullscreen>.game-fullscreen-toolbar{grid-row:1;margin:0}
 .exp-play.game-is-fullscreen>.exp-hud{grid-row:2;grid-template-columns:repeat(3,minmax(0,1fr))}
 .exp-play.game-is-fullscreen .exp-hud button{grid-column:1/-1}
 .exp-play.game-is-fullscreen>.exp-mission{grid-row:3}
 .exp-play.game-is-fullscreen>.exp-game-controls{grid-row:4}
 .exp-play.game-is-fullscreen>.exp-status{grid-row:5}
}
@media(min-width:1100px),(min-width:700px) and (max-height:500px) and (orientation:landscape){
 .lab-page .lab-play.game-is-fullscreen{display:grid;grid-template-columns:minmax(0,1fr) 220px;grid-template-rows:44px minmax(0,1fr);gap:4px 12px;align-items:start}
 .lab-page .lab-play.game-is-fullscreen>.game-fullscreen-toolbar{grid-column:2;grid-row:1;flex-wrap:nowrap;margin:0;justify-content:flex-end}
 .lab-page .lab-play.game-is-fullscreen .lab-tools{display:block;grid-column:2;grid-row:2;max-height:calc(var(--fullscreen-content-height) - 50px);overflow:auto;padding-inline:2px}
 .lab-page .lab-play.game-is-fullscreen .lab-hud{grid-template-columns:repeat(3,minmax(0,1fr))}
 .lab-page .lab-play.game-is-fullscreen .lab-hud>button{grid-column:1/-1;justify-self:stretch}
 .lab-page .lab-play.game-is-fullscreen .lab-hud span{max-width:100%;min-height:24px;overflow-wrap:anywhere;letter-spacing:0}
 .lab-page .lab-play.game-is-fullscreen>.lab-board{grid-column:1;grid-row:1/-1;justify-self:center;align-self:center;flex:none;width:min(100%,calc(var(--fullscreen-content-height)*15/19))!important;max-height:var(--fullscreen-content-height)!important;height:auto;aspect-ratio:15/19;margin:0}
}
.chess-page #chess-game.game-is-fullscreen{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;align-content:start;align-items:start;overflow:auto;background:#f2f5fc}
.chess-page #chess-game.game-is-fullscreen>.game-fullscreen-toolbar{position:sticky;top:0;margin:0;background:#f2f5fc}
.chess-page #chess-game.game-is-fullscreen .chess-table{width:min(100%,calc(100dvh - 250px));justify-self:center;gap:4px}
.chess-page #chess-game.game-is-fullscreen #chess-board{width:100%;margin:0}
.chess-page #chess-game.game-is-fullscreen .chess-arena{display:block;width:100%;min-height:0;flex:none;overflow:visible}
.chess-page #chess-game.game-is-fullscreen .chess-sidebar{width:100%;max-width:720px;justify-self:center;gap:8px}
.chess-page #chess-game.game-is-fullscreen #chess-options-toggle{display:none}
.chess-page #chess-game.game-is-fullscreen #chess-friends{display:none!important}
.chess-page #chess-game.game-is-fullscreen #chess-history{max-height:160px}
@media(min-width:900px),(orientation:landscape) and (max-height:500px){
 .chess-page #chess-game.game-is-fullscreen{grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:44px minmax(0,1fr);gap:8px 16px;align-content:stretch;overflow:hidden}
 .chess-page #chess-game.game-is-fullscreen>.game-fullscreen-toolbar{grid-column:2;grid-row:1;position:static}
 .chess-page #chess-game.game-is-fullscreen .chess-table{grid-column:1;grid-row:1/-1;width:min(100%,calc(100dvh - 156px));align-self:center;padding:6px}
 .chess-page #chess-game.game-is-fullscreen .chess-sidebar{grid-column:2;grid-row:2;height:100%;min-height:0;overflow:auto;overscroll-behavior:contain}
}
@media(orientation:landscape) and (max-height:500px){
 .chess-page #chess-game.game-is-fullscreen{grid-template-columns:minmax(0,1fr) 240px;gap:6px 12px}
 .chess-page #chess-game.game-is-fullscreen .chess-table{width:min(100%,calc(100dvh - 136px));padding:4px;gap:3px}
 .chess-page #chess-game.game-is-fullscreen .chess-player{min-height:36px;padding:3px 5px}
 .chess-page #chess-game.game-is-fullscreen .chess-player strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .chess-page #chess-game.game-is-fullscreen #chess-turn{font-size:12px;min-height:20px}
 .chess-page #chess-game.game-is-fullscreen #chess-variant{font-size:11px;padding-bottom:0}
 .chess-page #chess-game.game-is-fullscreen :is(#chess-turn,#chess-variant){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .chess-page #chess-game.game-is-fullscreen .chess-sidebar{padding:10px}
}
@media(orientation:landscape) and (max-height:360px){
 .chess-page #chess-game.game-is-fullscreen{grid-template-rows:44px 36px 20px 16px 36px minmax(0,1fr);gap:4px 12px}
 .chess-page #chess-game.game-is-fullscreen .chess-table{display:contents}
 .chess-page #chess-game.game-is-fullscreen .chess-arena{grid-column:1;grid-row:1/-1;width:min(100%,calc(100dvh - 16px));align-self:center;justify-self:center}
 .chess-page #chess-game.game-is-fullscreen .chess-player-opponent{grid-column:2;grid-row:2}
 .chess-page #chess-game.game-is-fullscreen #chess-turn{grid-column:2;grid-row:3;padding:0;align-self:center}
 .chess-page #chess-game.game-is-fullscreen #chess-variant{grid-column:2;grid-row:4;padding:0;align-self:center}
 .chess-page #chess-game.game-is-fullscreen .chess-player-own{grid-column:2;grid-row:5}
 .chess-page #chess-game.game-is-fullscreen .chess-sidebar{grid-column:2;grid-row:6}
}
