/* One stable reserve, whether the manual AdSense unit is filled or empty. */
:root { --ad-reserve:calc(82px + env(safe-area-inset-bottom,0px)); --game-header:calc(70px + env(safe-area-inset-top,0px)); }
html, body { height:100%; min-height:100%; overflow:hidden; }
.app-shell { height:100svh; height:100dvh; min-height:0; padding-top:0; padding-bottom:0; grid-template-rows:var(--game-header) minmax(0,1fr) var(--ad-reserve); }
.topbar { padding-top:env(safe-area-inset-top,0px); min-width:0; }
#app { min-height:0; padding:8px 4px 14px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; align-items:center; container-type:size; scrollbar-width:thin; }
#app > section { margin-block:auto; flex-shrink:0; }
#advertising-slot { position:fixed; inset:auto 0 0; height:var(--ad-reserve); display:flex; flex-direction:column; align-items:center; gap:4px; padding:6px 0 calc(8px + env(safe-area-inset-bottom,0px)); background:rgba(221,243,255,.96); border-top:1px solid rgba(86,153,206,.25); z-index:90; }
.ad-label { color:#476b88; font-size:10px; line-height:13px; font-weight:400; }
.ad-frame { width:320px; height:50px; flex:none; line-height:0; }
#advertising-slot .adsbygoogle { width:320px; height:50px; }
#toast { bottom:calc(var(--ad-reserve) + 10px); }
/* Native modal dialogs stay in the top layer, above both game and banner. */
dialog { bottom:0; max-height:calc(100dvh - 24px); overflow-x:hidden; overflow-y:auto; }
[data-google-privacy] { overflow-wrap:anywhere; }
@media(max-width:860px) { :root { --game-header:calc(64px + env(safe-area-inset-top,0px)); } #app { padding:6px 4px 12px; } }
/* A fixed 320px creative cannot be requested in a narrower viewport. */
@media(max-width:319px) { .ad-frame { display:none; } }
@media(orientation:landscape) and (max-height:550px) { :root { --game-header:calc(54px + env(safe-area-inset-top,0px)); } #app { padding:5px 4px 10px; } .topbar .icon-button { width:42px; min-width:42px; height:42px; } .mini-brand img { height:45px; } }
@media(max-width:600px) and (orientation:portrait) {
  [data-google-privacy], .menu-row[data-action="privacy"] { grid-column:1/-1; min-height:44px; padding-block:10px; }
  [data-google-privacy] { overflow-wrap:normal; }
}
