/* The ride section of the landing: a three.js ride through Red Dead Redemption 2 (ride.js). */
@scope (.ride) {
  :scope {
    /* Same side margins as the landing's .wrap container. */
    --ride-gutter: max(56px, calc((100vw - 1240px) / 2));
    --paper: var(--color-fg);
    --muted: var(--color-fg-muted);
    --red: var(--color-highlight-warm);
    --gold: var(--color-accent);
    --ink: var(--color-bg);
    --rarity: var(--color-fg-soft);
    position: relative;
    /* Fixed layers below stay viewport-sized but only paint while the ride covers the screen. */
    clip-path: inset(0);
    background: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-body);
  }

  * {
    box-sizing: border-box;
  }

  button {
    font: inherit;
    cursor: pointer;
    color: inherit;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  button:focus-visible,
  a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 5px;
  }

  p,
  h2 {
    margin-top: 0;
  }

  .header-actions {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 18px;
  }

  .ride-skip,
  .motion-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: #191c18b3;
    backdrop-filter: blur(12px);
    font-size: 11px;
    line-height: 1;
    color: var(--color-fg-soft);
  }

  .ride-skip:hover,
  .motion-toggle:hover {
    color: var(--color-fg);
  }

  /* The map button exists only on a phone, where the map would cover the scene. */
  .map-toggle {
    display: none;
  }

  .world {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(#243b48, #91aaa9 52%, #384951);
  }

  #landscape {
    width: 100%;
    height: 100%;
    display: block;
  }

  .world-shade {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg, #10120fd9, #10120f80 30%, transparent 63%),
      linear-gradient(0deg, #10120fd9, transparent 24%, transparent 80%, #10120f99);
  }

  @media (min-width: 701px) {
    /* The glass provides text contrast; let the scene remain visible beneath it. */
    :scope:has(.chapter.is-current) .world-shade {
      background:
        linear-gradient(90deg, #10120f26, transparent 63%),
        linear-gradient(0deg, #10120fd9, transparent 24%, transparent 80%, #10120f99);
    }
  }

  .letterbox {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 120px #10120f44;
  }

  .header {
    position: fixed;
    top: 24px;
    left: var(--ride-gutter);
    right: var(--ride-gutter);
    z-index: 15;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .edition {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .edition i {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: var(--shadow-glow);
  }

  .edition > span {
    margin-left: 20px;
    color: var(--color-fg-muted);
    font-size: 9px;
  }

  .motion-symbol {
    color: var(--color-accent);
    font-size: 12px;
  }

  .location-panel {
    position: fixed;
    z-index: 4;
    top: 108px;
    right: var(--ride-gutter);
    display: flex;
    align-items: center;
    gap: 13px;
    text-align: right;
    text-shadow: 0 2px 10px #10120f;
  }

  .compass-mark {
    order: 2;
    font-size: 32px;
    color: var(--color-accent);
  }

  .location-panel div {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .location-panel small {
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--color-fg-soft);
  }

  #location {
    font-family: var(--font-display);
    font-size: 20px;
  }

  #weather {
    font-size: 8px;
    color: var(--color-fg-muted);
  }

  /* Scroll supplies world distance. Reading cards occupy a reserved viewport lane,
   so neither incoming nor outgoing text can slide beneath fixed navigation. */
  .beat {
    min-height: 115svh;
    position: relative;
  }

  /* Hold the platinum on screen for one more screen of scroll before the section leaves. */
  .ride-beats::after {
    content: "";
    display: block;
    height: 100svh;
  }

  .ride-hero {
    min-height: 100svh;
  }

  .copy {
    position: fixed;
    z-index: 3;
    left: var(--ride-gutter);
    top: 50%;
    transform: translateY(-50%);
    width: min(480px, 40vw);
    max-height: calc(100svh - 220px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-strong) transparent;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .is-current .copy {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .chapter .copy {
    /* Light text stays AA even over white snow behind the 76% dark glass. */
    --color-fg-muted: #d3d9cb;
    --color-fg-subtle: #d3d9cb;
    padding: 28px;
    border: 1px solid color-mix(in srgb, var(--color-border-strong) 85%, transparent);
    border-radius: var(--radius-3xl);
    background: linear-gradient(145deg, rgb(22 28 23 / 76%), rgb(15 20 17 / 80%));
    box-shadow: var(--shadow-popover);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .ride-hero-copy {
    width: min(610px, 46vw);
    padding: 10px 6px;
  }

  .ride-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--color-fg-muted);
    margin-bottom: 24px;
  }

  .red-line {
    width: 24px;
    height: 2px;
    background: var(--color-accent);
  }

  .ride-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 5.4vw, 86px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.06em;
    margin-bottom: 24px;
  }

  .ride-title em {
    font-style: normal;
    color: var(--color-accent);
  }

  .hero-line {
    font-family: var(--font-display);
    font-size: clamp(20px, 1.8vw, 28px);
    line-height: 1.4;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
  }

  .intro {
    color: var(--color-fg-soft);
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 24px;
  }

  .start {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 20px;
    background: var(--color-accent);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-on-accent);
    border-radius: var(--radius-xl);
    transition: background 0.2s;
  }

  .start:hover {
    background: var(--color-accent-hover);
  }

  .start b {
    font-size: 20px;
    line-height: 1;
  }

  .scroll-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 8px;
    letter-spacing: 0.08em;
    color: var(--color-fg-muted);
    margin-top: 16px;
  }

  .scroll-hint span {
    font-size: 15px;
  }

  .scroll-hint i {
    width: 16px;
    height: 1px;
    background: var(--color-border-strong);
  }

  .hero-stats {
    display: flex;
    gap: 26px;
    margin-top: 28px;
  }

  .hero-stats > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid var(--color-border-strong);
    padding-right: 26px;
  }

  .hero-stats > div:last-child {
    border: 0;
    padding: 0;
  }

  .hero-stats b {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
  }

  .hero-stats small {
    font: 12px var(--font-body);
    color: var(--color-fg-muted);
  }

  .hero-stats span {
    font-size: 9px;
    letter-spacing: 0.08em;
    color: var(--color-fg-muted);
  }

  .stop-number {
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    height: 26px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-accent);
    font: 12px var(--font-display);
    letter-spacing: 0;
  }

  .trophy-heading {
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .trophy-icon {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl);
    padding: 4px;
    background: rgb(16 18 15 / 35%);
  }

  .trophy-meta {
    min-width: 0;
    flex: 1;
  }

  .chapter h2 {
    font: 600 clamp(21px, 2.1vw, 30px) / 1.15 var(--font-display);
    letter-spacing: -0.035em;
    margin: 0 0 12px;
  }

  .trophy-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .tier-label {
    font-size: 10px;
    color: var(--color-trophy-bronze);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    background: rgb(16 18 15 / 40%);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
  }

  .tier-label img {
    width: 14px;
    height: 14px;
    object-fit: contain;
  }

  .silver .tier-label {
    color: var(--color-trophy-silver);
  }

  .platinum .tier-label {
    color: var(--color-trophy-platinum);
  }

  .rarity {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    color: var(--color-fg-soft);
    padding: 5px 7px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: rgb(16 18 15 / 28%);
  }

  .rarity b {
    display: none;
  }

  .intel {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--color-accent) 22%, var(--color-border));
    border-radius: var(--radius-2xl);
    background: rgb(22 32 15 / 30%);
  }

  .intel-tag,
  .chapter h2.intel-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-accent);
    font: 600 12px / 1.4 var(--font-body);
    letter-spacing: 0;
    margin: 0 0 12px;
  }

  .intel-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border: 1px solid currentColor;
    border-radius: 2px;
    transform: rotate(45deg);
  }

  .intel p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--color-fg-soft);
    margin: 0;
  }

  .perdivel .intel,
  .gate .intel,
  .aviso .intel {
    border-color: color-mix(in srgb, var(--color-highlight-warm) 28%, var(--color-border));
    background: rgb(58 37 37 / 30%);
  }

  .perdivel .intel-tag,
  .gate h2.intel-tag,
  .aviso .intel-tag {
    color: var(--color-highlight-warm);
  }

  .gate .intel {
    margin-top: 0;
  }

  .gate h2.intel-tag {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: -0.03em;
  }

  .honor-card {
    margin-top: 20px;
  }

  .honor-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-fg-soft);
    margin-bottom: 10px;
  }

  .honor-label b {
    color: var(--color-accent);
    font-weight: 500;
  }

  .honor-segments {
    display: flex;
    gap: 5px;
  }

  .honor-segments i {
    flex: 1;
    height: 7px;
    background: var(--color-border);
    border-radius: var(--radius-xs);
  }

  .honor-segments .on {
    background: var(--color-accent);
  }

  .guide-order {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--color-fg-subtle);
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .next-link {
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--color-fg-soft);
    align-self: flex-start;
  }

  .next-link:hover {
    color: var(--color-accent);
  }

  .finale .copy {
    border-color: color-mix(in srgb, var(--color-trophy-platinum) 40%, var(--color-border));
  }

  .finale .intel {
    border-color: var(--color-border-strong);
    background: rgb(16 18 15 / 30%);
  }

  .finale .intel-tag {
    color: var(--color-trophy-platinum);
  }

  .final-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-top: 24px;
  }

  .replay {
    border: 0;
    background: none;
    padding: 6px 0;
    font-size: 12px;
    color: var(--color-fg-muted);
  }

  .replay:hover {
    color: var(--color-accent);
  }

  .chapter-title {
    position: fixed;
    z-index: 2;
    top: 26%;
    left: 50%;
    width: 30%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 3px 24px #10120f;
  }

  .chapter-title span {
    display: block;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--color-fg-soft);
  }

  .chapter-title strong {
    display: block;
    font: 400 32px / 1.2 var(--font-display);
    letter-spacing: -0.04em;
    margin-top: 12px;
  }

  .chapter-title i {
    display: block;
    width: 32px;
    height: 1px;
    margin: 14px auto;
    background: var(--color-accent);
  }

  .chapter-title.arriving {
    animation: title-arrive 3.9s both;
  }

  .journey-hud {
    position: fixed;
    bottom: 112px;
    right: var(--ride-gutter);
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: end;
    gap: 12px;
    width: 220px;
    pointer-events: none;
  }

  .unlock {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .minimap-panel {
    width: 208px;
    padding: 10px;
    background: #1b211ce8;
    border: 1px solid #b4a77b55;
    border-radius: 12px;
    box-shadow:
      0 6px 24px #080e1250,
      inset 0 0 0 3px #c4b58c08;
  }

  .map-heading,
  .map-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    letter-spacing: 0.08em;
    color: #ded3b8;
  }

  .map-live {
    color: #c2d392;
    font-size: 6px;
  }

  #minimap {
    width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
  }

  .map-contour {
    fill: none;
    stroke: #c8bc8b;
    stroke-opacity: 0.2;
    stroke-width: 0.7;
  }

  .map-border {
    fill: none;
    stroke: #ccb98c35;
    stroke-width: 0.8;
    stroke-dasharray: 2 3;
  }

  .map-river-bank {
    fill: none;
    stroke: #172b2b;
    stroke-width: 6;
  }

  .map-river {
    fill: none;
    stroke: #799e9b;
    stroke-opacity: 0.65;
    stroke-width: 2.4;
  }

  .map-mountains {
    fill: none;
    stroke: #d4cba477;
    stroke-width: 1;
  }

  .map-island ellipse {
    fill: #294347;
    stroke: #799e9b66;
    stroke-width: 0.6;
  }

  .map-island path {
    fill: #555941;
    stroke: #c8bc8b88;
    stroke-width: 0.7;
  }

  .map-regions {
    fill: #e1d3ad;
    font:
      500 11px Georgia,
      serif;
    letter-spacing: 0.6px;
    text-anchor: middle;
    paint-order: stroke;
    stroke: #2c332b;
    stroke-width: 2px;
    stroke-linejoin: round;
  }

  .map-region-small {
    font-size: 9px;
    letter-spacing: 0.3px;
  }

  .map-road-shadow {
    fill: none;
    stroke: #19221b;
    stroke-width: 3;
  }

  .map-road {
    fill: none;
    stroke: #e4d4ac;
    stroke-width: 1.3;
    stroke-dasharray: 3 3;
    stroke-linecap: round;
  }

  #map-trail {
    fill: none;
    stroke: #c2f366;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.85;
  }

  .map-milestone path {
    fill: var(--pin-color);
    stroke: #20281f;
    stroke-width: 1.2;
  }

  .map-milestone.passed path {
    stroke: #e3edbb;
    stroke-width: 1;
  }

  .map-player-core {
    fill: #e1ffad;
    stroke: #24321e;
    stroke-width: 1.4;
  }

  .map-player-heading {
    fill: #e1ffad;
  }

  .map-pulse {
    fill: #c2f36615;
    stroke: #c2f366;
    stroke-width: 1;
    transform-box: fill-box;
    transform-origin: center;
    animation: map-pulse 2.6s ease-out infinite;
  }

  .map-compass {
    fill: #cdbf96;
    stroke: #d2c69e;
    stroke-width: 0.6;
  }

  .map-compass circle {
    fill: #232b27bb;
    stroke: #d2c69e66;
  }

  .map-compass .map-north {
    fill: #f0e6c7;
  }

  .map-compass text {
    stroke: none;
    fill: #f0e6c7;
    font:
      9px Georgia,
      serif;
    text-anchor: middle;
  }

  .map-frame {
    fill: none;
    stroke: #c5b68655;
    stroke-width: 1;
  }

  .map-caption {
    font-size: 6px;
    letter-spacing: 0.04em;
  }

  .map-caption i {
    font-style: normal;
    color: #b6c494;
  }

  .route-summary {
    display: flex;
    align-items: baseline;
    gap: 16px;
  }

  #trophy-progress {
    font-size: 10px;
    letter-spacing: 0;
    color: var(--color-fg-soft);
  }

  #percent {
    color: var(--color-accent);
  }

  .route {
    position: fixed;
    bottom: 24px;
    left: var(--ride-gutter);
    right: var(--ride-gutter);
    z-index: 10;
  }

  .route-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: var(--color-fg-soft);
    margin-bottom: 9px;
  }

  .route-top b {
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 500;
  }

  .route-top > span:last-child {
    white-space: nowrap;
    color: var(--color-fg-muted);
  }

  .route-track {
    display: flex;
    justify-content: space-between;
    position: relative;
    height: 24px;
    align-items: center;
  }

  .route-track::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    background: #c3cbb933;
  }

  .route-track a {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
  }

  .route-track a::before {
    content: "";
    width: 4px;
    height: 4px;
    transform: rotate(45deg);
    background: var(--color-fg-subtle);
  }

  .route-track a.passed::before,
  .route-track a[aria-current]::before {
    background: var(--color-accent);
  }

  .route-track a[aria-current]::before {
    transform: rotate(45deg) scale(2);
  }

  .route-track a[aria-current]::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid #c2f36666;
    border-radius: 50%;
  }

  .route-track .gate-dot::before {
    background: var(--color-highlight-warm);
    width: 6px;
    height: 6px;
  }

  .loading,
  .load-error {
    padding: 140px 7%;
    color: var(--color-accent);
    position: relative;
    z-index: 4;
  }

  .load-error button {
    background: var(--color-accent);
    color: var(--color-on-accent);
    border: 0;
    border-radius: var(--radius-lg);
    padding: 14px 22px;
    margin-top: 15px;
    display: block;
  }

  .scene-fallback {
    position: fixed;
    top: 78px;
    left: 4%;
    font-size: 10px;
    z-index: 6;
    color: var(--color-accent);
  }

  @media (min-width: 1600px) {
    .copy {
      width: 520px;
    }

    .ride-hero-copy {
      width: 650px;
    }

    .intel p {
      font-size: 16px;
    }
  }

  @media (max-height: 760px) and (min-width: 701px) {
    .copy {
      max-height: calc(100svh - 190px);
    }

    .ride-title {
      font-size: 52px;
    }

    .hero-line {
      font-size: 20px;
    }

    .hero-stats {
      margin-top: 18px;
    }

    .chapter .copy {
      padding: 22px;
    }

    .chapter .ride-eyebrow {
      margin-bottom: 18px;
    }

    .intel {
      margin-top: 18px;
      padding: 16px;
    }

    .guide-order {
      margin-top: 16px;
      padding-top: 12px;
    }
  }

  @media (min-width: 701px) and (max-width: 1100px) {
    .copy {
      left: var(--ride-gutter);
      width: 45vw;
    }

    .chapter .copy {
      padding: 20px;
    }

    .trophy-heading {
      gap: 12px;
    }

    .trophy-icon {
      width: 58px;
      height: 58px;
      flex-basis: 58px;
    }
  }

  @media (max-width: 700px) {
    /* On a phone the opening copy sits under the map lane; the map joins at the first stop. */
    :scope:has(.ride-hero.is-current) .journey-hud {
      opacity: 0;
    }
  }

  @media (max-width: 700px) {
    .header {
      top: 16px;
      left: 5%;
      right: 5%;
    }

    .edition {
      display: none;
    }

    .ride-skip,
    .motion-toggle {
      font-size: 10px;
      padding: 0 10px;
    }

    .location-panel {
      top: 77px;
      right: 5%;
      gap: 8px;
    }

    .compass-mark {
      font-size: 22px;
    }

    .location-panel small {
      font-size: 7px;
    }

    #location {
      font-size: 15px;
    }

    #weather {
      font-size: 7px;
    }

    .world-shade {
      background: linear-gradient(0deg, #10120ff5 8%, #10120fb3 39%, transparent 64%, #10120f50);
    }

    .beat {
      min-height: 115svh;
    }

    .copy,
    .ride-hero-copy {
      top: 39svh;
      bottom: 157px;
      left: 5%;
      width: 90%;
      max-height: none;
      transform: none;
    }

    /* A stop's card hugs what it says and sits right above the route, leaving the scene in view
       above it, instead of stretching down with empty space inside. */
    .chapter .copy {
      top: auto;
      bottom: 150px;
      max-height: calc(100svh - 260px);
      overflow-y: auto;
      padding: 18px;
      border-radius: var(--radius-3xl);
    }

    /* The start sits right above the route, leaving the scene in view above it. */
    .ride-hero-copy {
      top: auto;
      bottom: 150px;
      padding: 6px 0;
    }

    .ride-hero .ride-eyebrow {
      font-size: 9px;
      margin-bottom: 16px;
    }

    .ride-title {
      font-size: clamp(42px, 12vw, 65px);
      letter-spacing: -0.06em;
      margin-bottom: 16px;
    }

    .hero-line {
      font-size: 19px;
      margin-bottom: 12px;
    }

    .intro {
      font-size: 12px;
      line-height: 1.7;
      margin-bottom: 18px;
    }

    .start {
      font-size: 11px;
      padding: 14px 16px;
    }

    .scroll-hint {
      font-size: 7px;
      gap: 6px;
    }

    .hero-stats {
      gap: 22px;
      margin-top: 20px;
    }

    .hero-stats > div {
      padding-right: 22px;
    }

    .hero-stats b {
      font-size: 22px;
    }

    .hero-stats span {
      font-size: 8px;
    }

    .ride-eyebrow {
      font-size: 9px;
      letter-spacing: 0.05em;
      margin-bottom: 18px;
      gap: 9px;
    }

    .stop-number {
      flex-basis: 22px;
      height: 22px;
      font-size: 10px;
    }

    .trophy-heading {
      gap: 12px;
    }

    .trophy-icon {
      flex-basis: 44px;
      width: 44px;
      height: 44px;
    }

    .chapter h2 {
      font-size: 23px;
      margin-bottom: 10px;
    }

    .trophy-chips {
      gap: 5px;
    }

    .tier-label,
    .rarity {
      font-size: 9px;
      padding: 4px 6px;
    }

    .intel {
      margin-top: 20px;
      padding: 16px;
    }

    .intel p {
      font-size: 13px;
      line-height: 1.75;
    }

    .intel-tag {
      font-size: 12px;
      margin-bottom: 10px;
    }

    .guide-order {
      margin-top: 18px;
      padding-top: 14px;
      font-size: 8px;
    }

    .next-link {
      font-size: 12px;
    }

    .honor-card {
      margin-top: 18px;
    }

    .chapter-title {
      top: 24%;
      left: 5%;
      width: 90%;
    }

    .chapter-title strong {
      font-size: 24px;
    }

    .chapter-title span {
      font-size: 9px;
    }

    /* The map stays out of the scene until asked for, then opens under the top buttons. */
    .journey-hud {
      top: 77px;
      bottom: auto;
      right: 5%;
      width: min(240px, 70vw);
      display: none;
    }

    :scope.map-open .journey-hud {
      display: block;
      z-index: 6;
    }

    :scope.map-open .location-panel {
      visibility: hidden;
    }

    .map-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 32px;
      padding: 0 10px;
      border: 1px solid var(--color-border-strong);
      border-radius: var(--radius-control, 10px);
      background: rgb(16 18 15 / 55%);
      color: var(--color-fg);
      font: inherit;
      font-size: 10px;
      backdrop-filter: blur(8px);
    }

    .map-toggle[aria-pressed="true"] {
      border-color: var(--color-accent);
      color: var(--color-accent);
    }

    .minimap-panel {
      width: 100%;
      padding: 9px;
    }

    .map-heading {
      font-size: 7px;
      letter-spacing: 0.03em;
    }

    .map-live {
      font-size: 5px;
    }

    #minimap {
      margin: 6px 0;
    }

    .map-caption {
      font-size: 5px;
    }

    .route {
      bottom: 16px;
      left: 5%;
      right: 5%;
    }

    .route-top {
      font-size: 8px;
      letter-spacing: 0;
      margin-bottom: 5px;
      flex-wrap: wrap;
      gap: 5px;
    }

    .route-summary {
      width: 100%;
      justify-content: space-between;
    }

    #trophy-progress {
      font-size: 9px;
    }

    #stage-label {
      max-width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .route-track {
      height: 24px;
    }

    .route-track a {
      width: 27px;
      height: 32px;
    }

    .route-track a[aria-current]::after {
      inset: 5px 2px;
    }

    :scope.celebrating .chapter-title {
      display: none;
    }

    .final-actions {
      margin-top: 18px;
      gap: 12px;
    }

    .replay {
      font-size: 11px;
    }

    .scene-fallback {
      top: 61px;
      font-size: 8px;
    }
  }

  @media (max-width: 700px) and (max-height: 740px) {
    .copy {
      top: 35svh;
    }

    .ride-hero-copy {
      top: 23svh;
    }

    .chapter .copy {
      padding: 16px;
    }

    .chapter h2 {
      font-size: 21px;
    }

    .intel {
      margin-top: 16px;
      padding: 14px;
    }
  }

  :scope.scene-static *,
  :scope.scene-static *::before,
  :scope.scene-static *::after {
    /* biome-ignore lint/complexity/noImportantStyles: The pause control and reduced motion override all animation. */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: The pause control and reduced motion override all transitions. */
    transition: none !important;
  }

  :scope.scene-static .chapter-title {
    display: none;
  }

  :scope.no-webgl #landscape {
    display: none;
  }

  :scope.no-webgl .world {
    opacity: 0.45;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      /* biome-ignore lint/complexity/noImportantStyles: The pause control and reduced motion override all animation. */
      animation: none !important;
      /* biome-ignore lint/complexity/noImportantStyles: The pause control and reduced motion override all transitions. */
      transition: none !important;
    }

    .chapter-title {
      display: none;
    }
  }

  @media (max-width: 700px) {
    .guide-order {
      display: none;
    }
  }

  .platinum-moment {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: none;
    pointer-events: none;
  }

  :scope.celebrating .chapter-title {
    display: none;
  }

  :scope.celebrating .platinum-moment {
    display: block;
  }

  .pm-flash {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(circle at 68% 46%, #f4ffdcd9, #c2f36647 32%, transparent 68%);
  }

  .platinum-moment.play .pm-flash {
    animation: pm-flash 1.8s ease-out both;
  }

  .pm-banner {
    position: absolute;
    top: 13%;
    left: 50%;
    width: min(560px, 90vw);
    text-align: center;
    opacity: 0;
    transform: translateX(-50%);
    text-shadow: 0 4px 30px #10120fcc;
  }

  .platinum-moment.play .pm-banner {
    animation: pm-banner 1.1s 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
  }

  .pm-banner small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.34em;
    color: var(--color-accent);
    text-shadow:
      0 1px 2px #10120f,
      0 0 18px #10120f;
  }

  .pm-banner strong {
    display: block;
    margin: 8px 0 6px;
    font: 600 46px / 1.1 var(--font-display);
    color: transparent;
    background:
      linear-gradient(100deg, #d9dee6 30%, #ffffff 45%, #e5ffae 50%, #d9dee6 62%) 0 0 / 260% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    animation: pm-shine 3.4s 1.2s linear infinite;
    filter: drop-shadow(0 2px 3px #10120f) drop-shadow(0 6px 22px #10120fcc);
  }

  .pm-banner span {
    font-size: 13px;
    color: var(--color-fg);
    text-shadow:
      0 1px 2px #10120f,
      0 0 16px #10120f;
  }

  @media (max-width: 700px) {
    .pm-banner {
      top: 9%;
    }

    .pm-banner strong {
      font-size: 28px;
    }

    .pm-banner small {
      font-size: 9px;
    }
  }

  :scope.scene-static .pm-banner {
    opacity: 1;
  }

  @media (prefers-reduced-motion: reduce) {
    .pm-banner {
      opacity: 1;
    }
  }
}

@keyframes map-pulse {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes title-arrive {
  0%,
  100% {
    opacity: 0;
  }

  20%,
  65% {
    opacity: 1;
  }
}

@keyframes pm-flash {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes pm-banner {
  from {
    opacity: 0;
    transform: translate(-50%, 22px) scale(0.84);
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%);
    filter: none;
  }
}

@keyframes pm-shine {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -160% 0;
  }
}
