@media (max-width: 1199.98px) {
  .builder-stage {
    min-height: 420px;
  }

  .shop-list {
    max-height: 310px;
  }
}

@media (max-width: 767.98px) {
  .game-topbar {
    min-height: 52px;
    padding: 4px 12px;
  }

  .brand-link {
    font-size: 0.66rem;
  }

  .brand-mark {
    transform: rotate(45deg) scale(0.86);
  }

  .topbar-level {
    display: none;
  }

  .game-main {
    padding: 10px 8px 16px;
  }

  .game-intro {
    align-items: center;
    gap: 12px;
    padding: 0 4px 10px;
  }

  .game-intro h1 {
    font-size: 2rem;
  }

  .game-intro > p {
    max-width: 62%;
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .panel-heading {
    align-items: flex-start;
    padding: 13px 14px;
  }

  .panel-heading h2 {
    font-size: 1.35rem;
  }

  .stat-row {
    max-width: 190px;
  }

  .stat-pill {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 0.61rem;
  }

  .stat-pill strong {
    font-size: 0.7rem;
  }

  .builder-stage {
    min-height: 0;
    padding: 30px 8px 13px;
  }

  .build-grid {
    --cell-size: min(11vw, 48px);
    gap: 3px;
    padding: 8px;
    border-radius: 17px;
  }

  .build-cell {
    border-radius: 7px;
  }

  .build-cell--module {
    border-radius: 9px;
    box-shadow: 2px 2px 0 rgba(31, 37, 34, 0.16);
  }

  .builder-tip {
    margin-top: 10px;
    font-size: 0.64rem;
  }

  .launch-row {
    min-height: 65px;
    padding: 9px 12px;
  }

  .game-button.btn-primary {
    min-width: 116px;
    min-height: 44px;
    border-radius: 12px;
  }

  .panel-heading--dock {
    align-items: center;
  }

  .inventory-panel,
  .shop-panel {
    padding: 11px 12px;
  }

  .inventory-list {
    display: flex;
    max-height: none;
    padding-bottom: 5px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .module-chip {
    min-width: 160px;
    flex: 0 0 160px;
    scroll-snap-align: start;
  }

  .shop-list {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    max-height: none;
    padding-bottom: 7px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .shop-item {
    width: 250px;
    min-height: 66px;
    scroll-snap-align: start;
  }

  .hangar-footer {
    padding-inline: 5px;
  }

  .battle-hud {
    gap: 4px;
    margin-bottom: 6px;
  }

  .battle-hud > span {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 0.54rem;
  }

  .battle-hud > span:nth-child(2) {
    display: none;
  }

  .icon-button--pause {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .battle-stage {
    width: min(100%, calc((100dvh - 260px) * 4 / 3));
    min-width: 0;
    border-width: 3px;
    border-radius: 18px;
  }

  .ability-row {
    gap: 6px;
    margin-top: 7px;
  }

  .ability-button {
    min-width: 0;
    min-height: 50px;
    flex: 1 1 0;
    padding: 6px 8px;
  }

  .ability-key {
    width: 31px;
    height: 31px;
  }

  body.is-battling .game-intro {
    display: none;
  }
}

@media (max-width: 389.98px) {
  .brand-link > span:last-child {
    max-width: 98px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-intro > p {
    max-width: 58%;
    font-size: 0.63rem;
  }

  .stat-row {
    max-width: 148px;
  }

  .stat-pill:nth-child(3) {
    display: none;
  }

  .builder-tip {
    max-width: 300px;
  }

  .launch-row > div span {
    max-width: 178px;
  }

  .outcome-banner {
    align-items: flex-start;
  }

  .outcome-banner span:last-child {
    line-height: 1.3;
  }

  .battle-hud > span:first-child {
    display: none;
  }

  .battle-stage {
    width: min(100%, calc((100dvh - 215px) * 4 / 3));
  }
}

@media (min-width: 1200px) and (min-height: 760px) {
  .hangar-view > .row {
    min-height: calc(100dvh - 190px);
  }
}

@media (max-height: 900px) and (min-width: 768px) {
  .game-intro {
    padding-bottom: 10px;
  }

  .game-intro h1 {
    font-size: 2.2rem;
  }

  .builder-stage {
    min-height: 365px;
    padding-block: 22px 10px;
  }

  .build-grid {
    --cell-size: 45px;
  }

  .shop-list {
    max-height: 260px;
  }
}

@media (max-height: 760px) and (min-width: 768px) {
  .builder-stage {
    min-height: 330px;
  }

  .build-grid {
    --cell-size: 41px;
  }
}
