.world-stage { position: absolute; inset: 0; z-index: 6; background: var(--ink); overflow: clip; }
.world-stage::before { content: ''; position: absolute; inset: -30px; background: url('assets/world-tail-v03.webp') center / cover; filter: blur(28px) brightness(.32); opacity: .6; pointer-events: none; }
.world-window { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(100%, 175svh); aspect-ratio: 7 / 4; overflow: hidden; background: var(--ink); }
.world-shot, .world-shot > *, .fort-arrival { position: absolute; inset: 0; width: 100%; height: 100%; }
.world-shot > *, .fort-arrival { object-fit: contain; display: block; }
.world-shot, .fort-arrival { will-change: transform, opacity; }
/* Keep the opening in the same full-bleed frame as its poster. The complete
   map keeps its own aspect ratio once its location entrances are available. */
body:is([data-world-phase='ready'], [data-world-phase='playing'], [data-world-phase='paused'], [data-world-phase='settling'], [data-world-phase='error']) .world-window { inset: 0; transform: none; width: 100%; height: 100%; aspect-ratio: auto; }
#opening { object-fit: cover; object-position: 56% center; }
.intro-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 56% center; pointer-events: none; opacity: 0; transition: opacity 900ms ease; }
body[data-world-phase='ready'] .intro-backdrop, body[data-world-phase='error'] .intro-backdrop { opacity: 1; }
.world-stage::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #08111530, transparent 28%, #08111508 50%, #081115a6); pointer-events: none; opacity: 0; transition: opacity .6s; }
body[data-world-phase='ready'] .world-stage::after, body[data-world-phase='error'] .world-stage::after { opacity: 1; }
.world-entry { position: absolute; inset: 0; z-index: 4; pointer-events: none; text-shadow: 0 2px 18px #0008; }
.world-entry h1 { position: absolute; left: 7%; bottom: 12%; margin: 0; font-size: clamp(30px, 3vw, 46px); line-height: 1.65; font-weight: 400; letter-spacing: .12em; color: #fff0d9; }
.intro-play { position: absolute; left: 50%; top: 51%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 17px; min-width: 112px; min-height: 132px; padding: 12px; border: 0; background: transparent; color: #fff4de; font: inherit; font-size: 17px; letter-spacing: .3em; text-indent: .3em; text-shadow: 0 2px 12px #000; pointer-events: auto; }
.intro-play-circle { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid #fff1d9b3; border-radius: 50%; background: #0b1e242e; box-shadow: 0 2px 24px #06171d26; transition: background .3s, border-color .3s, transform .3s; }
.intro-play-circle svg { width: 26px; height: 26px; fill: currentColor; }
.intro-play:hover .intro-play-circle, .intro-play:focus-visible .intro-play-circle { background: #0b1e2480; border-color: #fff1d9; transform: scale(1.06); }
.intro-play:disabled { opacity: .45; }
body[data-view='world'] .topbar .wordmark, body[data-view='entering'] .topbar .wordmark { display: none; }
body[data-view='world'] .topbar .sound-controls { gap: 16px; }
body[data-view='world'] .topbar #sound { justify-content: center; width: 44px; padding: 8px; background: transparent; opacity: .8; }
body[data-view='world'] #sound-label { display: none; }
.topbar .sound-symbol svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
body[data-view='world'] .topbar .sound-symbol { display: inline-flex; color: #eee5d4; filter: drop-shadow(0 1px 4px #0009); }
#sound[aria-pressed='true'] .sound-muted, #sound[aria-pressed='false'] .sound-waves { display: none; }
.topbar #opening-direct { background: transparent; color: #eee5d4; letter-spacing: .08em; text-shadow: 0 1px 5px #000b, 0 2px 12px #0006; }
.topbar #opening-direct:hover, .topbar #opening-direct:focus-visible { background: transparent; color: #fff5df; }
body[data-world-phase='ready'] #opening-direct, body[data-world-phase='error'] #opening-direct { background: transparent; font-size: 13px; color: #e6dfd2; opacity: .7; letter-spacing: .08em; }
body[data-world-phase='ready'] #opening-direct:hover, body[data-world-phase='ready'] #opening-direct:focus-visible { opacity: 1; }
.world-locations { position: absolute; inset: 0; z-index: 3; animation: places-appear 900ms ease both; }
.world-place { position: absolute; border: 0; background: transparent; display: grid; place-items: center; min-height: 44px; min-width: 44px; padding: 0; }
.place-label { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 7px 10px; font-size: clamp(13px, 1.25vw, 18px); letter-spacing: .08em; white-space: nowrap; color: #fff1d6; text-shadow: 0 1px 5px #000, 0 2px 16px #000; background: #1323299e; border-bottom: 1px solid #e5c99188; border-radius: 2px; transition: background .25s, transform .25s; }
.place-label::before { content: ''; width: 5px; height: 5px; border: 1px solid #e5c991; border-radius: 50%; }
.world-place:hover .place-label, .world-place:focus-visible .place-label { background: #10242be6; transform: translateY(-3px); }
.world-place:focus-visible { outline-offset: -4px; }
.world-footer { position: absolute; z-index: 4; left: 5%; right: 5%; bottom: 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; pointer-events: none; }
.world-footer p { margin: 0; font-size: 14px; line-height: 1.8; letter-spacing: .08em; text-shadow: 0 2px 8px #000; }
.world-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; pointer-events: auto; }
.world-controls .quiet-button { background: transparent; color: #eee5d4; letter-spacing: .08em; text-shadow: 0 1px 5px #000b, 0 2px 12px #0006; transition: color .2s; }
.world-controls .quiet-button:hover, .world-controls .quiet-button:focus-visible { background: transparent; color: #fff5df; }
body[data-world-phase='playing'] #opening-pause { display: none; }
.world-status { position: absolute; z-index: 5; left: 5%; bottom: 100px; max-width: 90%; background: #111a1ded; padding: 12px 16px; font-size: 14px; line-height: 1.8; }
.place-dialog { padding: 0; width: min(620px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto; border: 1px solid var(--line); color: var(--paper); background: #16242a; }
.place-dialog::backdrop { background: #071117cc; backdrop-filter: blur(5px); }
.place-dialog > img { display: block; width: 100%; height: auto; aspect-ratio: 7 / 4; object-fit: cover; }
.place-copy { padding: 24px 28px; }
.place-copy h2 { font-size: 28px; font-weight: 400; margin: 12px 0 18px; }
.place-copy > p:not(.eyebrow) { font-size: 17px; line-height: 1.9; }
.place-copy .place-note { color: var(--muted); font-size: 12px !important; margin-top: 24px; }
.place-copy button { margin-top: 12px; }
.topbar .quiet-button, .topbar .wordmark-sub { white-space: nowrap; }
.topbar .quiet-button, .topbar .sound-controls { flex-shrink: 0; }
.topbar .wordmark { flex: 1; min-width: 0; }
@keyframes places-appear { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .world-window { top: 15%; transform: translateX(-50%); width: 100%; }
  .world-entry h1 { bottom: 17%; font-size: clamp(27px, 6.5vw, 38px); }
  .intro-play { top: 44%; }
  .world-footer { left: 7%; right: 7%; bottom: 28px; }
  body[data-world-phase='world'] .world-footer { top: calc(15svh + 100vw * 4 / 7 + 26px); bottom: auto; flex-direction: column; }
  .world-controls { margin: 0; }
  body:is([data-world-phase='ready'], [data-world-phase='error'], [data-world-phase='playing'], [data-world-phase='paused']) .world-controls { margin-left: auto; }
  .world-footer p { font-size: 13px; }
  .place-label { gap: 4px; padding: 5px 7px; font-size: 13px; letter-spacing: .02em; }
  .world-status { bottom: 8%; }
  .place-copy { padding: 20px; }
}
@media (max-width: 760px) and (max-height: 730px) {
  .world-window { top: 13%; }
  .world-entry h1 { bottom: 16%; font-size: 27px; }
}
@media (max-width: 360px) {
  .topbar { padding: 12px; gap: 8px; }
  .topbar .wordmark { font-size: 12px; letter-spacing: .04em; }
  .topbar .wordmark-sub { font-size: 5px; letter-spacing: .02em; }
  .topbar .quiet-button { padding: 6px; font-size: 10px; }
  .topbar .sound-controls { gap: 0; }
  #world { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .world-locations { animation: none; } .intro-backdrop, .intro-play-circle { transition: none; } }

/* The language switch belongs with the two unobtrusive world controls. */
.topbar #language { min-width: 44px; background: transparent; color: #eee5d4; font-size: 12px; text-shadow: 0 1px 5px #000b; }
.topbar #language:hover, .topbar #language:focus-visible { background: transparent; color: #fff5df; }
html[lang='en'] .world-entry h1 { max-width: 86%; letter-spacing: .025em; }
@media (max-width: 760px) {
  .topbar .wordmark { display: none; }
  body[data-view='world'] .topbar .sound-controls { gap: 8px; }
  .topbar #sound-label { display: none; }
  .topbar #sound { min-width: 44px; justify-content: center; background: transparent; }
  .topbar .sound-symbol { display: inline-flex; }
  html[lang='en'] .world-entry h1 { font-size: clamp(22px, 6vw, 32px); line-height: 1.6; }
}
