/* Fit the application into the available browser viewport. */
html{height:100%;overflow:hidden}
body.fit-screen{height:100dvh!important;min-height:0!important;max-height:100dvh;overflow:hidden!important;display:flex;flex-direction:column;margin:0}
.fit-screen>header{flex:0 0 auto;height:auto;min-height:0;padding:10px 20px}
.fit-screen>main{flex:1 1 0;min-height:0;width:100%;max-width:none!important;margin:0;display:flex!important;flex-direction:column;gap:0!important;padding:6px 12px 12px!important;overflow:hidden}
.fit-screen footer,.fit-screen .control-strip{display:none!important}
.fit-screen .game-shell,.fit-screen.at-title .game-shell,.fit-screen .game-shell.playing{flex:1 1 0;min-height:0!important;height:0!important;width:100%!important;aspect-ratio:auto!important;margin:0!important;border-radius:0;overflow:hidden!important}
.fit-screen .game-shell canvas{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto!important}
.fit-screen #map-toolbar,.fit-screen main>.phase-card{flex:0 0 auto}
.fit-screen .game-shell>.phase-card{bottom:12px;left:12px;right:12px;padding:12px 16px;grid-template-columns:minmax(0,1fr) 240px}
.fit-screen .game-shell>.phase-card h2{font-size:14px;margin:4px 0}
.fit-screen .game-shell>.phase-card p{font-size:15px}
.fit-screen .game-shell>.phase-card .primary{min-height:44px;padding:10px;font-size:11px}
.fit-screen .game-shell>.phase-card .emenda-button{padding:8px!important;min-height:42px;font-size:17px!important;margin-top:4px}
.fit-screen .title-screen{overflow-y:auto;justify-content:safe center}
@media(max-width:900px),(pointer:coarse){
 .fit-screen>header{padding:8px 12px!important;gap:6px!important}
 .fit-screen>main{padding:6px 8px 8px!important}
 .fit-screen .top-stats>span{padding:5px 7px!important}
 .fit-screen main>.phase-card{margin:8px 0 0;padding:10px 12px;gap:5px}
 .fit-screen main>.phase-card h2{font-size:12px}
 .fit-screen main>.phase-card p{font-size:12px;margin:0 0 3px}
 .fit-screen main>.phase-card .primary{min-height:44px;padding:8px}
 .fit-screen main>.phase-card .emenda-button{min-height:42px;padding:8px!important}
 .fit-screen .game-shell.playing{display:flex;flex-direction:column}
 .fit-screen .playing canvas{position:relative;inset:auto;flex:1 1 0;min-height:0;height:0!important;width:100%}
 .fit-screen .playing .touch-controls{position:relative;inset:auto;flex:0 0 auto;min-height:90px;padding-top:10px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
 .fit-screen:has(.playing)>header{display:none!important}
}
@media(orientation:landscape) and (max-height:600px){
 .fit-screen>header .top-stats{order:0;width:auto;display:flex;flex:1;justify-content:center;gap:18px}
 .fit-screen>header .top-stats>span{background:none;border:0;padding:0!important}
 .fit-screen>header .brand{font-size:10px}.fit-screen>header .city-stat{width:125px}
 .fit-screen .game-shell>.phase-card{grid-template-columns:minmax(0,1fr) 210px;padding:8px 12px;gap:2px 12px;bottom:8px}
 .fit-screen .game-shell>.phase-card h2{font-size:11px}
 .fit-screen .game-shell>.phase-card p{font-size:13px}
 .fit-screen .game-shell>.phase-card .eyebrow{font-size:10px}
 .fit-screen .playing .touch-controls{position:absolute;inset:auto 0 0;min-height:0}
 .fit-screen .playing canvas{position:absolute;inset:0;height:100%!important}
 .fit-screen:has(.playing)>main{padding:0!important}
}
