@media (max-width: 720px) {
  .app-shell {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    gap: 10px;
  }

  .topbar {
    min-height: 54px;
  }

  .brand-kicker {
    font-size: 0.55rem;
  }

  .build-badge {
    padding: 7px 9px;
    font-size: 0.56rem;
  }

  .game-frame {
    min-height: calc(var(--app-height) - 84px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 20px;
  }

  .hud {
    padding: 10px 12px;
  }

  .hud-label {
    font-size: 0.56rem;
  }

  .hud-item strong {
    font-size: 0.88rem;
  }

  .battlefield {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 76px 16px 18px;
  }

  .foundation-copy {
    text-align: center;
    justify-self: center;
  }

  .foundation-copy h2 {
    max-width: none;
    margin: 5px 0 8px;
    font-size: clamp(1.55rem, 8vw, 2.5rem);
  }

  .foundation-copy p {
    max-width: 38ch;
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .core-node {
    top: 12px;
    width: 52px;
    height: 52px;
  }

  .board-preview {
    width: min(100%, 330px);
    padding: 10px;
    gap: 8px;
    border-radius: 18px;
  }

  .board-preview__slot {
    border-radius: 12px;
  }

  .control-dock {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  .environment-status {
    justify-content: center;
    gap: 7px 13px;
    font-size: 0.54rem;
  }

  .primary-action {
    min-height: 48px;
  }
}

@media (max-height: 680px) and (max-width: 720px) {
  .brand-kicker,
  .foundation-copy p {
    display: none;
  }

  .app-shell {
    gap: 7px;
  }

  .topbar {
    min-height: 44px;
  }

  .battlefield {
    padding-top: 58px;
    gap: 8px;
  }

  .foundation-copy h2 {
    font-size: 1.42rem;
  }

  .core-node {
    width: 44px;
    height: 44px;
  }

  .board-preview {
    width: min(100%, 270px);
  }

  .primary-action {
    min-height: 42px;
  }
}

@media (min-width: 721px) and (max-height: 700px) {
  .app-shell {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar {
    min-height: 50px;
  }

  .game-frame {
    grid-template-rows: auto minmax(360px, 1fr) auto;
  }

  .battlefield {
    min-height: 360px;
    padding-top: 42px;
    padding-bottom: 36px;
  }
}
