/* Observation practice and the final arrival share the existing transit UI. */
.tutorial-coach strong,
.tutorial-coach p { word-break: keep-all; overflow-wrap: break-word; }
.transit-console__move span { white-space: nowrap; }
.extended-result__header h2 { word-break: keep-all; overflow-wrap: break-word; text-wrap: balance; }
.extended-leaderboard [role="tab"] { min-width: 82px; min-height: 44px; white-space: nowrap; }
#extended-story-origin {
  display: inline;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
}
.extended-story.is-standing-origin .extended-story__character--seated {
  background-position: 0 100%;
  transform: rotate(-3deg);
}
/* Every atlas cell is square. A tall CSS box distorts the original drawing. */
.extended-story .extended-story__character {
  width: 310px;
  height: auto;
  aspect-ratio: 1;
}
.extended-story .extended-story__character--seated { left: 8%; bottom: 5%; }
.extended-story.is-standing-origin .extended-story__character--seated { left: 35%; }
.extended-story .extended-story__sleep-mark { top: auto; bottom: calc(5% + 235px); left: 41%; }
.extended-story.is-standing-origin .extended-story__sleep-mark { left: 66%; }
.extended-story .extended-story__panel[data-story-panel="2"] .extended-story__rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at 74% 26%, rgba(255, 241, 202, .1), transparent 60%),
    linear-gradient(168deg, #20362d, #101e19);
}
.extended-story .extended-story__panel[data-story-panel="2"] .extended-story__note {
  position: relative;
  width: min(100%, 440px);
  gap: 13px;
  padding: 24px;
  transform: rotate(-1deg);
}
.extended-story .extended-story__panel[data-story-panel="2"] .extended-story__note strong {
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.5;
  word-break: keep-all;
}
.result-card-status { margin: 20px auto; max-width: 32ch; color: var(--soft-ink); line-height: 1.6; text-align: center; word-break: keep-all; }
.extended-story__intercar-door { overflow: hidden; background: #273f33; }
.extended-story__intercar-door::before,
.extended-story__intercar-door::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 1px solid #8a9b91;
  background: linear-gradient(180deg, #fbfcf7, #e3eadf);
  content: "";
}
.extended-story__intercar-door::before { left: 0; right: auto; --story-door-open: -86%; }
.extended-story__intercar-door::after { left: auto; right: 0; --story-door-open: 86%; }
.extended-story__panel.is-current .extended-story__intercar-door::before,
.extended-story__panel.is-current .extended-story__intercar-door::after {
  animation: story-door-open 1000ms cubic-bezier(.25, .7, .2, 1) 650ms both;
}
@keyframes story-door-open { from { transform: translateX(0); } to { transform: translateX(var(--story-door-open)); } }
.arrival-caption {
  position: absolute;
  z-index: 18;
  top: max(100px, 13%);
  left: 50%;
  width: min(520px, calc(100% - 40px));
  padding: 18px 24px;
  transform: translateX(-50%);
  border: 1px solid rgba(230, 221, 198, .75);
  border-radius: 20px;
  color: #263d35;
  background: rgba(255, 252, 241, .95);
  box-shadow: 0 12px 44px rgba(38, 61, 53, .08);
  text-align: center;
  word-break: keep-all;
  animation: arrival-in 600ms ease both;
  pointer-events: none;
}
.arrival-caption > span { color: var(--line-deep); font-size: 12px; font-weight: 750; letter-spacing: .05em; }
.arrival-caption strong { display: block; margin-top: 8px; font-size: clamp(21px, 2.5vw, 30px); letter-spacing: -.05em; }
.arrival-caption p { margin: 7px 0 0; color: #62716a; font-size: 13px; line-height: 1.5; }
body.is-arriving .transit-console,
body.is-arriving .view-zoom,
body.is-arriving .game-footer { opacity: .16; pointer-events: none; transition: opacity 500ms; }
body.is-arriving .game-scene::after { opacity: 0; transition: opacity 1200ms; }
@keyframes arrival-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .arrival-caption { top: 22%; padding: 16px; }
  .extended-story .extended-story__panel[data-story-panel="2"] .extended-story__note {
    padding: clamp(16px, 5vw, 24px);
  }
  .extended-story .extended-story__panel[data-story-panel="2"] .extended-story__rule { padding: 24px 18px; }
  .extended-story .extended-story__character--walking { right: 0; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .tutorial-coach { min-height: 64px; padding-right: 96px; }
  .tutorial-coach button {
    top: 50%;
    min-width: 76px;
    min-height: 44px;
    transform: translateY(-50%);
    white-space: nowrap;
  }
  .extended-story .extended-story__character { width: 250px; }
  .extended-story .extended-story__sleep-mark { bottom: calc(5% + 185px); font-size: 20px; }
  .extended-story .extended-story__panel[data-story-panel="2"] .extended-story__rule { padding: 16px 22px; }
  .extended-story .extended-story__panel[data-story-panel="2"] .extended-story__note { padding: 14px 20px; gap: 8px; }
  .extended-story .extended-story__panel[data-story-panel="2"] .extended-story__note strong { font-size: 13px; line-height: 1.4; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .arrival-caption { top: 72px; padding: 10px 18px; width: min(420px, calc(100% - 40px)); }
  .arrival-caption strong { font-size: 20px; margin-top: 4px; }
  .arrival-caption p { font-size: 11px; margin-top: 4px; }
}
body.is-reduced-motion .arrival-caption { animation: none; }
body.is-reduced-motion .extended-story__panel.is-current .extended-story__intercar-door::before,
body.is-reduced-motion .extended-story__panel.is-current .extended-story__intercar-door::after { animation: none; transform: translateX(var(--story-door-open)); }
@media (prefers-reduced-motion: reduce) {
  .arrival-caption { animation: none; }
  body.is-arriving .game-scene::after { transition: none; }
  .extended-story__panel.is-current .extended-story__intercar-door::before,
  .extended-story__panel.is-current .extended-story__intercar-door::after { animation: none; transform: translateX(var(--story-door-open)); }
}
