/* Final layout polish for the single root version. */

.tracker-device-frame {
  width: min(100%, 1400px);
  height: min(100%, 900px);
  grid-template-rows: 76px minmax(0, 1fr) 72px;
}

.frame-top-bar {
  grid-template-columns: 66px minmax(0, 1fr) 66px;
  gap: 14px;
  padding: 8px 16px;
}

.pixel-orb,
.system-signal {
  width: 58px;
  height: 58px;
}

.tracker-logo-image {
  width: clamp(210px, 28vw, 340px);
}

.frame-main-content {
  margin: 0 14px;
}

.action-rpg-screen {
  gap: 8px;
  padding: 10px 14px 8px;
  grid-template-rows: auto auto minmax(300px, 1fr) auto auto;
}

.game-hud-strip {
  grid-template-columns: minmax(230px, .95fr) 62px minmax(320px, 1.6fr) minmax(200px, .8fr);
  gap: 8px;
}

.action-combat-stage {
  min-height: 330px;
  background:
    radial-gradient(circle at 34% 55%, rgba(84, 182, 208, .13), transparent 20%),
    radial-gradient(circle at 69% 58%, rgba(240, 100, 92, .12), transparent 18%),
    linear-gradient(#02060b 0 58%, #050d18 58% 100%);
}

.action-fighter--hero {
  left: 13%;
  bottom: 34px;
  width: 27%;
}

.action-fighter--enemy {
  right: 25%;
  bottom: 34px;
  width: 24%;
}

.action-fighter--hero .arena-hero-sprite {
  width: 176px;
  height: 130px;
}

.combat-sigil {
  width: 138px;
  height: 138px;
}

.combat-sigil--threat {
  width: 126px;
  height: 126px;
}

.combat-info-panel {
  width: 232px;
}

.combat-action-bar {
  gap: 8px;
}

.game-primary-nav {
  bottom: 10px;
}

.frame-bottom-bar {
  padding: 9px 14px;
}

@media (max-width: 800px) {
  .tracker-viewport {
    padding: 0;
  }

  .tracker-device-frame {
    width: 100%;
    height: 100dvh;
    grid-template-rows: 62px minmax(0, 1fr) 58px;
    border-width: 3px;
  }

  .frame-top-bar {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 6px;
    padding: 5px 8px;
  }

  .pixel-orb,
  .system-signal {
    width: 46px;
    height: 46px;
    border-width: 3px;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5), 3px 3px 0 rgba(0, 0, 0, .32);
  }

  .pixel-orb svg {
    width: 22px;
    height: 22px;
  }

  .system-signal span {
    display: none;
  }

  .tracker-logo-image {
    width: clamp(150px, 48vw, 210px);
  }

  .brand-subtitle {
    display: none;
  }

  .frame-main-content {
    margin: 0 7px;
    border-width: 4px;
  }

  .action-rpg-screen {
    inset: 0 0 58px;
    padding: 6px 7px;
    gap: 6px;
    grid-template-rows: auto auto minmax(330px, 1fr) auto auto;
  }

  .game-hud-strip {
    grid-template-columns: minmax(94px, 1fr) 48px minmax(132px, 1.35fr);
    gap: 5px;
    min-height: 50px;
  }

  .hud-avatar {
    gap: 6px;
    padding: 4px 5px;
  }

  .hud-avatar strong {
    max-width: 68px;
    font-size: 6px;
  }

  .hud-avatar small,
  .hud-stat small {
    font-size: 6px;
  }

  .hud-bars label {
    grid-template-columns: 28px 1fr auto;
    gap: 4px;
    font-size: 5px;
  }

  .quest-directive {
    grid-template-columns: 1fr auto;
    min-height: 24px;
    padding: 5px 7px;
  }

  .quest-directive span {
    display: none;
  }

  .quest-directive strong {
    text-align: left;
    font-size: 7px;
    line-height: 1.25;
  }

  .quest-directive em {
    font-size: 6px;
    white-space: nowrap;
  }

  .action-combat-stage {
    min-height: 330px;
  }

  .combat-location {
    left: 10px;
    top: 9px;
  }

  .combat-location strong {
    font-size: 7px;
  }

  .action-fighter--hero {
    left: 4%;
    bottom: 68px;
    width: 42%;
  }

  .action-fighter--enemy {
    right: 7%;
    bottom: 66px;
    width: 37%;
  }

  .action-fighter--hero .arena-hero-sprite {
    width: 144px;
    height: 108px;
  }

  .combat-sigil {
    width: 108px;
    height: 108px;
  }

  .combat-sigil--threat {
    width: 94px;
    height: 94px;
  }

  .combat-info-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    min-height: 38px;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .combat-info-panel > small {
    align-self: center;
  }

  .combat-action-bar {
    gap: 4px;
  }

  .combat-action-bar button {
    min-height: 50px;
  }

  .ultimate-meter {
    min-height: 22px;
    padding-block: 4px;
  }

  .game-primary-nav {
    bottom: 5px;
    width: calc(100% - 12px);
  }

  .game-primary-nav button {
    min-height: 48px;
  }

  .frame-bottom-bar {
    min-height: 58px;
    padding: 6px 8px 6px 44px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ticker-wrap {
    height: 38px;
  }

  .spidey-head-turn-sprite {
    left: 3px;
    bottom: 1px;
    width: 34px;
    height: 49px;
    background-size: 2584px 55px;
  }
}

@media (max-width: 500px) {
  .action-rpg-screen {
    grid-template-rows: auto auto minmax(340px, 1fr) auto auto;
  }

  .action-combat-stage {
    min-height: 340px;
  }

  .hud-mask {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .hud-avatar strong {
    max-width: 54px;
  }

  .action-fighter--hero {
    left: 1%;
    bottom: 72px;
  }

  .action-fighter--enemy {
    right: 3%;
    bottom: 72px;
  }

  .action-fighter--hero .arena-hero-sprite {
    width: 136px;
    height: 102px;
  }

  .combat-sigil {
    width: 98px;
    height: 98px;
  }

  .combat-sigil--threat {
    width: 84px;
    height: 84px;
  }

  .combat-action-bar strong {
    font-size: 5px;
  }

  .frame-bottom-bar {
    padding-left: 8px;
  }

  .spidey-head-turn-sprite {
    display: none;
  }
}
