@media (max-width: 620px), (max-width: 980px) and (max-height: 500px) and (orientation: landscape) {
  #world {
    --lobby-top: max(12px, env(safe-area-inset-top, 0px));
    --lobby-left: max(14px, env(safe-area-inset-left, 0px));
    --lobby-right: max(14px, env(safe-area-inset-right, 0px));
    --lobby-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    position: fixed;
    inset: 0;
    height: 100dvh;
    display: grid;
    grid-template: "mast" auto
                   "landscape" minmax(100px, 1fr)
                   "choices" auto
                   "nav" auto / minmax(0, 1fr);
    gap: 10px;
    padding: var(--lobby-top) var(--lobby-right) var(--lobby-bottom) var(--lobby-left);
    background: radial-gradient(ellipse at 50% 40%, #163729, #081810 72%);
    overflow: auto;
  }

  #mast {
    grid-area: mast;
    position: static;
    max-width: none;
    min-width: 0;
    text-shadow: none;
  }

  #mast .lobby-brand {
    width: clamp(132px, 38vw, 168px);
    max-width: calc(100% - 114px);
    margin: 0 0 6px;
  }

  #mast h2 {
    font-size: clamp(23px, 6.1vw, 32px);
    max-width: none;
    margin: 4px 0 0;
  }

  #mast p,
  #mast.compact h2,
  #status,
  #stateTitle,
  #instructions {
    display: none;
  }

  #languagePanel {
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    min-height: 44px;
  }

  #viewport {
    grid-area: landscape;
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    align-self: center;
    border-radius: 12px;
    background: #081810;
  }

  #wash,
  #grain {
    display: none;
  }

  #panoramaChoices,
  #world .menu {
    grid-area: choices;
    position: static;
    inset: auto !important;
    width: 100%;
    max-width: none;
    max-height: none;
    min-width: 0;
    margin: 0;
    transform: none !important;
    gap: 6px;
  }

  #panoramaChoices {
    align-self: center;
    grid-template-columns: minmax(0, 1fr);
  }

  #panoramaChoices button,
  #world .access {
    min-height: 56px;
    padding: 9px 11px;
    background: #0d2a1e;
    border-color: #a1966c;
    box-shadow: none;
  }

  #panoramaChoices button small {
    margin-bottom: 4px;
    line-height: 1.2;
  }

  #panoramaChoices button strong {
    font-size: clamp(14px, 4vw, 17px);
    line-height: 1.2;
  }

  #panoramaChoices button span {
    margin-top: 3px;
  }

  #panoramaChoices button:is(:hover, :focus-visible),
  #world .access:is(:hover, :focus-visible) {
    transform: none !important;
  }

  #world .menu:not(.active) {
    visibility: hidden;
  }

  #world .words,
  #panoramaChoices button {
    overflow-wrap: anywhere;
  }

  #bottomNav {
    grid-area: nav;
    position: static;
    transform: none;
    justify-self: center;
    max-width: 100%;
    padding: 4px 6px;
    gap: 6px;
    background: #0b241a;
    box-shadow: none;
  }

  #bottomNav .navText {
    min-width: 0;
    padding: 0 6px;
    text-align: center;
  }

  #bottomNav .navBtn {
    width: 44px;
    height: 44px;
    flex: none;
  }

  #introCaption {
    top: max(66px, calc(env(safe-area-inset-top, 0px) + 52px));
  }

  #introHelp {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    padding-inline: 12px;
  }

  #introSkip {
    left: 50%;
    right: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: max-content;
    max-width: calc(100% - 28px);
    transform: translateX(-50%);
    text-align: center;
  }
}

@media (max-width: 980px) and (max-height: 500px) and (orientation: landscape) {
  #world {
    grid-template: "mast mast" auto
                   "landscape choices" minmax(100px, 1fr)
                   "nav nav" auto / minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 6px 12px;
  }

  #mast {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-right: 112px;
  }

  #mast small {
    display: none;
  }

  #mast .lobby-brand {
    width: 132px;
    max-width: 42%;
    margin: 0;
    flex-shrink: 0;
  }

  #mast h2 {
    font-size: 22px;
    margin: 0;
  }

  #world .menu {
    align-self: center;
  }
}
