#mobileToolbarHandle[hidden] { display: none; }
@media (pointer: coarse) and (orientation: landscape) {
  body.mobile-toolbar-active > .topbar {
    position: fixed; top: env(safe-area-inset-top,0px); left: 0; right: 0;
    z-index: 1100; transform: translateY(calc(-100% - env(safe-area-inset-top,0px)));
    transition: transform .16s ease-out;
  }
  body.mobile-toolbar-active .top-actions { min-width: 0; overflow-x: auto; flex-wrap: nowrap; }
  body.mobile-toolbar-active .top-actions > button { flex-shrink: 0; white-space: nowrap; }
  body.mobile-toolbar-open > .topbar { transform: translateY(0); }
  #mobileToolbarHandle {
    position: fixed; top: env(safe-area-inset-top,0px); left: 50%; transform: translateX(-50%);
    z-index: 1101; width: 96px; min-height: 44px; padding: 4px 10px;
    border: 1px solid #ff20b5; border-top: 0; border-radius: 0 0 12px 12px;
    background: #111019ed; color: #ffd21c; font: 700 12px system-ui,sans-serif;
    touch-action: none; user-select: none; cursor: pointer;
    transition: top .16s ease-out;
  }
  body.mobile-toolbar-open #mobileToolbarHandle { top: calc(env(safe-area-inset-top,0px) + 44px); }
  body.mobile-toolbar-active #gameScreen:not([hidden]) {
    top: env(safe-area-inset-top,0px);
    height: calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  body.mobile-toolbar-active > .topbar, #mobileToolbarHandle { transition: none; }
}
