/* Mobile homepage: static character, interactive rune orbit, no WebGL boot. */
@media (max-width: 820px) {
  .world-page {
    /* Let the document own vertical scrolling; nested body scrollers are brittle on iOS. */
    overflow: visible;
    background: #06020d;
  }

  .world-stage {
    min-height: 920px;
  }

  .world-webgl {
    display: none;
  }

  .world-particles,
  .world-compass,
  .tech-gate,
  .archive-tower,
  .core-ring {
    display: none;
  }

  .world-layer,
  .world-location,
  .world-ground {
    transition: none;
    will-change: auto;
  }

  .world-sky {
    inset: 0;
    background:
      radial-gradient(circle at 50% 60%, rgba(122, 54, 194, .28), transparent 25%),
      radial-gradient(circle at 82% 32%, rgba(32, 140, 171, .12), transparent 22%),
      radial-gradient(circle at 12% 38%, rgba(191, 44, 183, .1), transparent 20%),
      linear-gradient(180deg, #070210 0%, #10051d 48%, #06020d 100%);
  }

  .world-moon {
    top: 38%;
    right: 50%;
    width: 300px;
    transform: translateX(50%);
    opacity: .22;
  }

  .world-far-city {
    inset: auto -12% 8%;
    height: 29%;
    opacity: .2;
  }

  .world-runes {
    inset: 42% 0 24%;
    opacity: .32;
  }

  .world-intro {
    top: 84px;
    left: 18px;
    width: calc(100% - 36px);
    text-align: left;
  }

  .world-kicker {
    justify-content: flex-start;
    margin-bottom: 13px;
  }

  .world-intro h1 {
    max-width: 520px;
    /* Keep phone typography continuous around the 520px breakpoint. */
    font-size: clamp(41px, 8vw, 52px);
    line-height: .94;
  }

  .world-intro > p:not(.world-kicker) {
    max-width: 500px;
    margin: 15px 0 0;
    font-size: 13px;
    line-height: 1.55;
  }

  .world-intro-actions {
    justify-content: flex-start;
    margin-top: 17px;
  }

  .world-webgl-fallback {
    inset: 350px 0 174px;
    height: auto;
    display: grid;
    place-items: center;
    overflow: visible;
  }

  .world-webgl-fallback::before,
  .world-webgl-fallback::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 51%;
    width: min(66vw, 330px);
    aspect-ratio: 1;
    border: 1px solid rgba(87, 241, 255, .18);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 54px rgba(157, 92, 255, .14), inset 0 0 44px rgba(87, 241, 255, .045);
  }

  .world-webgl-fallback::after {
    width: min(48vw, 240px);
    border-color: rgba(227, 90, 255, .22);
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .world-webgl-fallback img {
    position: relative;
    z-index: 2;
    width: min(64vw, 310px);
    height: auto;
    aspect-ratio: 1;
    object-position: center bottom;
    filter: drop-shadow(0 24px 28px rgba(0, 0, 0, .72));
  }

  .voidex-actor {
    left: 50%;
    top: 378px;
    bottom: auto;
    width: min(60vw, 290px);
    height: 330px;
  }

  .world-location,
  .webgl-capable .world-location {
    width: auto;
    height: auto;
    transform: none;
  }

  .location-gate,
  .webgl-capable .location-gate {
    top: 414px;
    bottom: auto;
    left: 14px;
  }

  .location-archive,
  .webgl-capable .location-archive {
    top: 414px;
    right: 14px;
    bottom: auto;
  }

  .location-oracle,
  .webgl-capable .location-oracle {
    top: 554px;
    right: auto;
    left: 14px;
  }

  .location-core,
  .webgl-capable .location-core {
    top: 554px;
    right: 14px;
    left: auto;
  }

  .world-location::after {
    content: "";
    position: absolute;
    top: 50%;
    width: clamp(12px, 6vw, 34px);
    border-top: 1px solid rgba(87, 241, 255, .26);
  }

  .location-gate::after,
  .location-oracle::after {
    left: 100%;
  }

  .location-archive::after,
  .location-core::after {
    right: 100%;
  }

  .world-location .hotspot {
    position: relative;
    left: auto;
    bottom: auto;
    width: clamp(126px, 34vw, 164px);
    min-height: 58px;
    max-width: none;
    padding: 8px;
    transform: none;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(8, 3, 18, .94), rgba(35, 15, 50, .9));
    backdrop-filter: none;
  }

  .world-location .hotspot:hover,
  .world-location .hotspot:focus-visible {
    transform: translateY(-2px);
  }

  .hotspot::before {
    top: 50%;
    left: auto;
    right: -5px;
    transform: translateY(-50%) rotate(45deg);
  }

  .location-archive .hotspot::before,
  .location-core .hotspot::before {
    right: auto;
    left: -5px;
  }

  .hotspot img {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  .hotspot span {
    display: block;
    max-width: 92px;
    font-size: 8px;
    line-height: 1.35;
  }

  .hotspot small {
    display: block;
    margin: 0 0 3px;
  }

  .voidex-dialogue {
    top: 690px;
    right: 16px;
    bottom: auto;
    left: 16px;
    width: auto;
    min-height: 58px;
    padding: 10px 13px;
    border-radius: 8px;
    background: rgba(7, 3, 15, .9);
    backdrop-filter: none;
  }

  .voidex-dialogue::before {
    display: none;
  }

  .archive-beacon {
    top: 774px;
    right: 16px;
    bottom: auto;
    left: 16px;
    width: auto;
    padding: 11px 14px;
    transform: none;
    clip-path: polygon(0 0, 96% 0, 100% 20%, 100% 100%, 4% 100%, 0 80%);
  }

  .archive-beacon strong {
    margin-top: 7px;
    font-size: 25px;
  }

  .world-ground {
    bottom: -2%;
    height: 22%;
    opacity: .65;
  }

  .lore-panel {
    border-radius: 8px;
  }
}

@media (max-width: 640px) {
  /* Do not flip primary actions into a cramped desktop row on wide phones. */
  .world-intro-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .world-primary {
    width: 100%;
  }

  .world-text-button {
    align-self: center;
  }
}

@media (max-width: 520px) {
  .world-stage {
    min-height: 920px;
  }

  .world-intro h1 {
    font-size: clamp(38px, 10.6vw, 42px);
  }

  .world-webgl-fallback {
    top: 362px;
  }

  .world-webgl-fallback img {
    width: min(68vw, 280px);
  }

  .world-location .hotspot {
    width: clamp(124px, 35vw, 144px);
  }
}

@media (max-width: 350px) {
  .world-intro {
    left: 14px;
    width: calc(100% - 28px);
  }

  .world-location .hotspot {
    width: 120px;
  }

  .hotspot span {
    max-width: 67px;
    font-size: 7px;
  }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .world-webgl-fallback::before,
  .world-webgl-fallback::after {
    box-shadow: none;
  }
}
