/* Mobile scene composition: reuse the original artwork without scaling it
   to the height of copy, pricing cards or an expanded advice example. */
@media (max-width: 700px), (max-width: 1024px) and (pointer: coarse) {
  /* The hero keeps its scene, companion and actions in a readable document flow. */
  html[data-mobile-ux=true] .stage {
    display: flex;
    flex-direction: column;
    background: #0e120e;
  }
  html[data-mobile-ux=true] .stage::after { content: none; }
  html[data-mobile-ux=true] .stage > .ambient-background {
    position: relative;
    inset: auto;
    z-index: 0;
    order: 0;
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 1280 / 704;
    -webkit-mask-image: none;
    mask-image: none;
  }
  html[data-mobile-ux=true] .stage > .hero {
    order: 1;
    padding-top: 20px;
    padding-bottom: 24px;
  }
  html[data-mobile-ux=true] .stage .hero > .eyebrow { max-width: 100%; }
  html[data-mobile-ux=true] .stage > .session { order: 2; }
  html[data-mobile-ux=true] .stage > .mobile-chapter-cues { order: 3; }

  /* A fixed aspect ratio means opening a conversation never reframes its scene. */
  html[data-mobile-ux=true] :is(#auction, #raid, #pvp) {
    background: #0e120e;
  }
  html[data-mobile-ux=true] :is(#auction, #raid, #pvp) > .auction-media {
    position: relative;
    inset: auto;
    z-index: 0;
    order: 0;
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 1280 / 704;
    overflow: hidden;
  }
  html[data-mobile-ux=true] :is(#auction, #raid, #pvp) > .auction-shade {
    display: none;
  }
  html[data-mobile-ux=true] :is(#auction, #raid, #pvp) > .auction-layout {
    order: 1;
    padding-top: 20px;
  }
  html[data-mobile-ux=true] :is(#auction, #raid, #pvp) > .mobile-chapter-cues {
    order: 2;
    padding-left: 16px;
  }
  html[data-mobile-ux=true] :is(.ambient-background, .auction-media) > :is(img, video) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  html[data-mobile-ux=true] :is(.ambient-background, .auction-media)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 72%, #0e120e);
  }
  html[data-mobile-ux=true] :is(#auction-video-toggle, #raid-video-toggle, #pvp-video-toggle).auction-ambient-toggle,
  html[data-mobile-ux=true] .stage #ambient-toggle {
    inset: 12px max(16px, env(safe-area-inset-right, 0px)) auto auto;
    z-index: 3;
    width: 44px;
    height: 44px;
    background-color: #0e120ecc;
  }

  /* The treasury is a quiet header illustration, not a 1700px background. */
  html[data-mobile-ux=true] #pricing > .pricing-backdrop,
  html[data-mobile-ux=true] #pricing > .pricing-shade {
    inset: 0 0 auto;
    width: 100%;
    height: clamp(220px, 56vw, 360px);
  }
  html[data-mobile-ux=true] #pricing .pricing-backdrop > img {
    object-fit: cover;
    object-position: center 55%;
  }
  html[data-mobile-ux=true] #pricing > .pricing-shade {
    background: linear-gradient(180deg, #0e120e66 0%, #0e120e88 30%, #0e120ee6 76%, #0e120e 100%);
  }
}

/* On a sideways phone the whole scene remains visible in a compact area. */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  html[data-mobile-ux=true] .stage > .ambient-background,
  html[data-mobile-ux=true] :is(#auction, #raid, #pvp) > .auction-media {
    width: min(100%, calc(52svh * 1280 / 704));
    margin-inline: auto;
  }
  html[data-mobile-ux=true] :is(#auction-video-toggle, #raid-video-toggle, #pvp-video-toggle).auction-ambient-toggle,
  html[data-mobile-ux=true] .stage #ambient-toggle {
    right: max(16px, calc((100% - 52svh * 1280 / 704) / 2 + 12px));
  }
}
