/* Utilities share the header in the lobby, and the existing menu while playing. */
.app-menu-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
body[data-screen="menu"] .topbar { flex-wrap: wrap; gap: 8px 20px; }
body[data-screen="game"] .app-menu-actions { display: none; }
.app-menu-actions .button { min-height: 44px; }
.app-menu-actions .icon-button { width: 44px; padding: 8px; }
.app-menu-actions svg { width: 24px; height: 24px; display: block; }
#app-install-dialog p { margin: 12px 0 20px; line-height: 1.5; }
.app-display-status:empty { display: none; }
.app-display-status {
  position: fixed; z-index: 100; bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px);
  padding: 10px 16px; background: var(--pop-paper); color: var(--pop-ink);
  border: var(--pop-border); border-radius: 8px;
}
/* Keep the existing viewport geometry, adding the device's physical cutouts. */
@supports (padding: max(0px)) {
  body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  body[data-screen="game"] .app-shell { height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  body[data-remote-role="display"][data-screen="menu"] .app-shell { height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  body[data-screen="game"][data-remote-role="controller"] .app-shell { padding: 4px; }
}
@media (max-height: 650px) {
  #table-tools-dialog { padding: 12px 20px 18px; }
  #table-tools-dialog .dialog-heading { margin-bottom: 12px; }
  .table-tools-content { gap: 8px; }
  body .table-tools-content .table-menu-button { min-height: 44px; padding-block: 7px; }
}
@media (max-height: 500px) {
  .table-tools-content { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
  body .table-tools-content .table-menu-button { font-size: 17px; padding-inline: 8px; }
}
@media (max-width: 700px), (max-width: 1000px) and (max-height: 500px) {
  body[data-screen="menu"]:not([data-remote-role]) .topbar {
    flex-wrap: nowrap; justify-content: space-between; align-items: center;
    gap: 12px; margin-bottom: 20px;
  }
  body[data-screen="menu"]:not([data-remote-role]) .brand { min-width: 0; gap: 8px; align-items: center; }
  body[data-screen="menu"]:not([data-remote-role]) .brand-mark { width: 44px; height: 44px; }
  body[data-screen="menu"]:not([data-remote-role]) h1 { font-size: clamp(20px, 5.2vw, 28px); margin: 0; }
  body[data-screen="menu"] .app-menu-actions { margin-left: auto; align-self: center; }
}
/* The extra header controls must not squeeze TV catalogue labels at low height. */
@media (min-width: 760px) and (min-height: 601px) and (max-height: 800px) {
  body[data-remote-role="display"] .remote-catalog .game-box { padding-block: 6px 4px; }
  body[data-remote-role="display"] .remote-catalog .box-art { height: 48px; }
  body[data-remote-role="display"] .remote-catalog .box-art .card-art { top: 2px; }
}
@media (min-width: 760px) and (max-height: 450px) {
  body[data-remote-role="display"] .remote-catalog .game-boxes { gap: 4px 10px; padding-block: 2px 5px; }
  body[data-remote-role="display"] .remote-catalog .game-box { padding-block: 1px; }
  body[data-remote-role="display"] .remote-catalog .box-name { line-height: 1.1; }
}
