.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  background: #e6edcf;
  color: #354a62;
}
.loading-screen p {
  max-width: 420px;
  margin: 0;
  font-size: 23px;
}
.loading-mark {
  font:
    56px 'Comarca Pixel',
    monospace;
  color: #b94b35;
}
.mobile-nav {
  display: none;
}
#install-dialog {
  max-width: 440px;
}
#install-dialog p {
  font-size: 21px;
}
#install-action {
  width: 100%;
  margin-top: 12px;
}
#update-button {
  color: #b24532;
}
/* A compact console: the map and two hands, with everything else in MENÚ. */
.mobile-menu-item,
.mobile-back-label {
  display: none !important;
}
body.mobile-game {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background: #d9dcd5;
}
.mobile-game .topbar {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 20;
  width: auto;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.mobile-game .brand,
.mobile-game .server-label,
.mobile-game .world-heading,
.mobile-game .world-footer,
.mobile-game .sidebar,
.mobile-game .trainer-strip,
.mobile-game .page-footer {
  display: none;
}
.mobile-game .menu-toggle {
  min-width: 64px;
  min-height: 44px;
  padding: 5px 10px;
  font-size: 19px;
  border-width: 2px;
  border-radius: 5px;
  background: #f8f4db;
  box-shadow: 0 2px 0 #4c5c62;
}
.mobile-game .menu-toggle kbd {
  display: none;
}
.mobile-game .game-layout {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 5px;
  display: block;
}
.mobile-game .world-column {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 158px;
}
.mobile-game .game-frame {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 4px solid #526361;
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px #f2efdc;
  overflow: hidden;
}
.mobile-game #world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.mobile-game .location-hint {
  top: 8px;
  left: 8px;
  width: fit-content;
  max-width: calc(100% - 94px);
  font-size: 15px;
  line-height: 1.05;
  padding: 5px 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out;
}
.mobile-game .location-hint.visible {
  opacity: 1;
  transform: translateY(0);
}
.mobile-game .interaction {
  bottom: 10px;
}
.mobile-game .interaction button {
  min-height: 40px;
  font-size: 18px;
  padding: 6px 12px;
}
.mobile-game .interaction kbd {
  display: none;
}
.mobile-game .touch-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 16px 4px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.mobile-game .dpad {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 0;
  filter: drop-shadow(0 3px 0 #141c27);
}
.mobile-game .dpad::before {
  content: '';
  grid-column: 2;
  grid-row: 2;
  background: #33404d;
  box-shadow: inset 0 0 12px #1e2934;
}
.mobile-game .dpad button {
  width: 44px;
  height: 44px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  font-size: 22px;
  color: #d9dfda;
  background: #33404d;
  box-shadow: none;
  touch-action: none;
}
.mobile-game .dpad [data-dir='up'] {
  grid-area: 1 / 2;
}
.mobile-game .dpad [data-dir='left'] {
  grid-area: 2 / 1;
}
.mobile-game .dpad [data-dir='right'] {
  grid-area: 2 / 3;
}
.mobile-game .dpad [data-dir='down'] {
  grid-area: 3 / 2;
}
.mobile-game .dpad button[aria-pressed='true'] {
  background: #17222d;
  color: #fff8d6;
  box-shadow: inset 0 2px 3px #070e16;
}
.mobile-game .touch-actions {
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
  align-items: center;
}
.mobile-game .touch-actions button {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  padding: 0;
  border: 3px solid #792d45;
  background: #ab3e5d;
  color: #fff4dd;
  box-shadow:
    0 4px 0 #682b3d,
    inset 0 2px 0 #d66d85;
  font-size: 27px;
  touch-action: none;
}
.mobile-game #touch-back {
  transform: translateY(26px);
}
.mobile-game .touch-actions button:active {
  background: #842a46;
  box-shadow: 0 1px 0 #682b3d;
}
.mobile-game #touch-action:disabled {
  opacity: 0.55;
}
.mobile-game .mobile-menu-item {
  display: block !important;
}
.mobile-game .mobile-back-label {
  display: inline !important;
}
.mobile-game dialog .close {
  font-size: 0;
  border-radius: 50%;
  color: #fff4dd;
  background: #ab3e5d;
  border: 2px solid #792d45;
}
.mobile-game dialog .close::before {
  content: 'B';
  font-size: 22px;
}
.mobile-game .classic-menu .menu-help {
  display: none;
}
.mobile-game #toasts {
  bottom: calc(176px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  width: auto;
  transform: none;
  max-width: none;
  pointer-events: none;
}
.mobile-game #toasts .toast {
  max-width: 100%;
  font-size: 17px;
  padding: 9px 12px;
}
.mobile-game dialog {
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  width: calc(100% - 20px);
  margin: auto;
  padding: 20px 16px;
  overflow: auto;
  overscroll-behavior: contain;
}
.mobile-game dialog button {
  min-height: 44px;
}
.mobile-game dialog input,
.mobile-game dialog select,
.mobile-game dialog textarea {
  font-size: 18px;
}
.mobile-game .starter-choices {
  gap: 4px;
}
.mobile-game .starter-choices img {
  width: 48px;
  height: 48px;
}
.mobile-game #welcome-dialog h2 {
  font-size: 31px;
  line-height: 0.95;
}
.mobile-game #welcome-dialog p {
  font-size: 19px;
  margin: 10px 0;
}
.mobile-game #welcome-dialog fieldset {
  margin: 10px 0;
}
.mobile-game .battle-dialog {
  padding: 0;
}
.mobile-game .battle-scene {
  height: min(29dvh, 230px);
  min-height: 185px;
}
.mobile-game .battle-console {
  grid-template-columns: 1fr;
}
.mobile-game #battle-log {
  max-height: 82px;
  min-height: 60px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 18px;
}
.mobile-game #battle-controls {
  padding: 10px;
}
.mobile-game #battle-question {
  font-size: 20px;
  margin: 0 0 6px;
}
.mobile-game .battle-commands button {
  min-height: 60px;
  font-size: 23px;
  padding: 5px 8px;
}
.mobile-game #battle-help {
  margin: 5px 0;
  min-height: 0;
  font-size: 15px;
}
.mobile-game .move-buttons button {
  min-height: 60px;
}
.mobile-game #nearby-dialog .panel {
  margin: 0;
  padding: 8px;
  border: 0;
  box-shadow: none;
}
@media (orientation: landscape) {
  .mobile-game .world-column {
    grid-template-columns: 144px minmax(0, 1fr) 136px;
    grid-template-rows: minmax(0, 1fr);
    gap: 5px;
  }
  .mobile-game .game-frame {
    grid-area: 1 / 2;
  }
  .mobile-game .touch-controls {
    display: contents;
  }
  .mobile-game .dpad {
    grid-area: 1 / 1;
    justify-self: center;
    align-self: center;
  }
  .mobile-game .touch-actions {
    grid-area: 1 / 3;
    justify-self: center;
    align-self: center;
    padding: 0;
    gap: 8px;
  }
  .mobile-game .topbar {
    right: calc(28px + env(safe-area-inset-right));
    top: calc(20px + env(safe-area-inset-top));
  }
  .mobile-game .menu-toggle {
    min-width: 94px;
  }
  .mobile-game .location-hint {
    max-width: calc(100% - 16px);
  }
  .mobile-game #toasts {
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: calc(160px + env(safe-area-inset-left));
    right: calc(152px + env(safe-area-inset-right));
  }
}
@media (orientation: landscape) and (max-height: 550px) {
  .mobile-game .classic-menu {
    width: min(560px, calc(100% - 32px));
    display: none;
  }
  .mobile-game .classic-menu[open] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
    padding: 12px 16px;
  }
  .mobile-game .classic-menu .eyebrow {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0 12px 6px;
  }
  .mobile-game .classic-menu > button {
    font-size: 21px;
    padding: 6px 12px;
  }
}
