/* The World's captions and pickers, in the page over the World frame (which only draws, copy=0).
   The look is the World's own, moved out of the frame unchanged. Without JavaScript the five
   chapters read as one plain document; with it they sit over the pinned planet, one at a time,
   driven by sections/world.js in step with the frame's chapter director. */
#world { --w-accent: #9fd08a; --w-glass: rgba(11, 18, 33, .82); --w-hair: rgba(197, 160, 89, .38); --w-out: cubic-bezier(.22, .9, .3, 1); }
#world .anchor { position: absolute; left: 0; top: calc(var(--at) * (100% - 100vh)); width: 1px; height: 0; pointer-events: none; }

#world .wcap { color: var(--parch); font: 400 16px/1.5 var(--sans); }
/* (zero specificity, so every rule below wins over it) */
:where(#world .wcap) :where(p, ul, h2, h3, h4) { margin: 0; }
:where(#world .wcap) :where(ul) { padding: 0; list-style: none; }

/* buttons: the game's gold primary and a navy-glass secondary. No tilt, no outline, no overshoot. */
#world .primary, #world .second { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 10px 16px; border-radius: 8px; font: 600 14px/1 var(--sans); letter-spacing: -0.005em; text-decoration: none; cursor: pointer; white-space: nowrap; transition: filter .2s var(--w-out), background-color .2s var(--w-out), border-color .2s var(--w-out), transform .2s var(--w-out); }
#world .primary { color: var(--deep); background: linear-gradient(180deg, #F0D27A, #C5A059); border: 1px solid rgba(255, 236, 170, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
#world .primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
#world .second { color: var(--parch); background: var(--w-glass); border: 1px solid var(--w-hair); }
#world .second:hover { border-color: var(--gold); background: rgba(197, 160, 89, .12); }
#world .primary:focus-visible, #world .second:focus-visible, #world .opt:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; }
#world .primary .arr, #world .second .arr { width: 14px; height: 14px; flex: none; }
#world .big { min-height: 48px; padding: 14px 22px; font-size: 16px; }

/* chapter text */
#world .kick { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mist); display: flex; gap: 10px; align-items: center; margin: 0 0 18px; }
#world .kick b { color: var(--parch); font-weight: 500; }
#world .kick::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--w-accent); transition: background-color .3s var(--w-out); }
#world .wcap h2, #world .wcap h3 { font: 600 clamp(38px, 4.2vw, 76px)/0.92 var(--sans); letter-spacing: -0.052em; text-wrap: balance; color: var(--parch); }
#world .wcap [data-panel="intro"] h2 { font-size: clamp(46px, 6.4vw, 116px); }
#world .wcap h2 em, #world .wcap h3 em { font-style: normal; color: var(--w-accent); transition: color .3s var(--w-out); }
#world .sub { font: 400 clamp(15px, 1.15vw, 18px)/1.5 var(--sans); color: var(--mist); margin: 18px 0 0; max-width: 32em; letter-spacing: -0.005em; }
/* a word at a time: each word slides up inside its own line-high mask (as wide as its ink, which the
   tight tracking pushes past the word's box; the margins give back exactly what the padding takes) */
#world .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .12em .08em; margin: 0 -.12em -.08em; }
#world .w > span { display: inline-block; }
#world .sunline { margin: 22px 0 1em; display: flex; gap: 9px; align-items: center; font: 500 14px/1.45 var(--sans); color: var(--mist); opacity: 0; transition: opacity .3s var(--w-out); }
#world .sunline.on { opacity: 1; }
#world .sunline i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #f2b84b; box-shadow: 0 0 10px #f2b84b; }
#world .ask { margin: 18px 0 0; display: flex; gap: 9px; align-items: center; font: 500 14px/1.4 var(--sans); color: var(--parch); }
#world .ask svg { flex: none; width: 16px; height: 16px; color: var(--gold-hi); }

/* option lists: one glass panel, flat options; the pick gets a gold hairline */
#world .list { margin-top: 16px; display: grid; gap: 3px; padding: 5px; background: var(--w-glass); border: 1px solid var(--line); border-radius: 6px; }
#world .list.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#world .list.cols3 > li { display: flex; min-width: 0; }
#world .list.cols3 > li > .opt { flex: 1; min-width: 0; }
#world .list.tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
#world .list.tabs .opt { white-space: nowrap; padding: 7px 12px; }
#world .opt { display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 7px 10px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--mist); font: 500 13px/1.18 var(--sans); letter-spacing: -0.005em; text-align: left; cursor: pointer; transition: color .2s var(--w-out), background-color .2s var(--w-out), border-color .2s var(--w-out); }
#world .opt:hover { color: var(--parch); background: rgba(243, 229, 171, .05); }
#world .opt.on { color: var(--parch); border-color: var(--gold); background: rgba(197, 160, 89, .12); }
#world .opt i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }

/* landmarks */
#world .list.lms { grid-template-columns: 1fr; gap: 2px; }
#world .list.lms > li { display: flex; }
#world .list.lms > li > .opt { flex: 1; }
#world .opt.lm { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 14px; padding: 9px 12px; min-height: 52px; }
#world .opt.lm b { font: 600 clamp(22px, 2vw, 30px)/1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--slate); transition: color .2s var(--w-out); }
#world .opt.lm.on b, #world .opt.lm:hover b { color: var(--parch); }
#world .opt.lm span { font: 400 13px/1.35 var(--sans); color: var(--mist); }
#world .opt.lm span em { display: flex; align-items: center; gap: 7px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; font-style: normal; color: var(--parch); margin-bottom: 2px; }
#world .opt.lm span em::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
#world .lm-desc { display: none; }
#world .go { margin-top: 14px; }

/* island cards */
#world .card h4 { font: 600 clamp(34px, 3.4vw, 58px)/0.95 var(--sans); letter-spacing: -0.045em; color: var(--parch); }
#world #w-visit-card h4 { font-size: clamp(42px, 4.6vw, 84px); letter-spacing: -0.052em; }
#world .card .place { margin: 12px 0 0; font: 400 clamp(14px, 1.1vw, 17px)/1.4 var(--sans); color: var(--mist); }
#world .card .place b { color: var(--parch); font-weight: 600; }
#world .card .coords { margin: 6px 0 0; font: 500 12px/1.3 var(--mono); letter-spacing: .02em; color: var(--slate); }
#world .roster { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 470px; }
#world .roster li { font: 500 12.5px/1 var(--sans); padding: 7px 10px; border-radius: 6px; background: var(--w-glass); border: 1px solid var(--line); color: var(--parch); letter-spacing: -0.005em; }
#world .roster li.rare { border-color: var(--w-hair); }
#world .roster li.boss { border-color: var(--gold); background: rgba(197, 160, 89, .12); }
/* (a flex row, so the space before the tag, there for reading without styles, takes no room) */
#world .roster li.rare, #world .roster li.boss { display: flex; align-items: baseline; }
#world .roster small { margin-left: 7px; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-hi); }
#world .roster li.boss small { text-transform: none; }
#world .card .row { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#world .esc { font: 500 12px/1 var(--sans); color: var(--slate); }
#world .esc kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line-hi); border-radius: 4px; color: var(--mist); }
#world .islands { margin-top: 26px; }
#world .islands > .island + .island { margin-top: 28px; }
#world .foot > .list.tabs { margin-top: 22px; }
#world .foot > .list.lms { margin-top: 16px; }
#world [data-panel="near"] .foot .row { margin-top: 22px; }

#world .hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); font: 500 13px/1.2 var(--sans); color: var(--mist); white-space: nowrap; display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none; transition: opacity .3s var(--w-out); }
#world .hint i { width: 1px; height: 24px; background: linear-gradient(var(--slate), transparent); animation: w-drip 1.8s ease-in-out infinite; }
@keyframes w-drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ── without JavaScript: the chapters as one document (no planet, no pickers to drive it) ── */
html:not(.js) #world { height: auto; }
html:not(.js) #world .pin { position: static; height: auto; overflow: visible; }
html:not(.js) #world .poster, html:not(.js) #world .js-only { display: none; }
html:not(.js) #world .wcap { position: relative; display: grid; gap: 14vh; padding: 16vh clamp(24px, 4.2vw, 64px); max-width: 760px; }
/* (the pickers have nothing to drive; the island tabs would do nothing, every island is there) */
html:not(.js) #world .opt { cursor: default; }
html:not(.js) #world .list.tabs { display: none; }

/* ── with JavaScript: captions over the pinned planet, one chapter at a time ── */
.js #world .wcap { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.js #world .wcap a, .js #world .wcap button { pointer-events: auto; touch-action: pan-y; }
.js #world .wpanel { position: absolute; left: clamp(24px, 4.2vw, 64px); top: 50%; transform: translateY(-50%); width: min(560px, 40vw); opacity: 0; visibility: hidden; }
/* until sections/world.js takes over, the chapter the start poster shows */
.js #world:not(.w-on) .wpanel[data-panel="intro"] { opacity: 1; visibility: visible; }
/* the four islands share one place, so switching never moves the tabs below them */
.js #world .islands { display: grid; }
.js #world .islands > .island { grid-area: 1 / 1; margin: 0; }
/* each card fades in with its island as it rises (sections/world.js) */
.js #world .islands > .island, .js #world #w-near-card, .js #world #w-visit-card { opacity: 0; visibility: hidden; }

/* coarse pointers get thumb-sized targets */
.coarse #world .opt { min-height: 44px; }
.coarse #world .primary, .coarse #world .second { min-height: 46px; }

@media (max-width: 760px) {
  .js #world .wpanel { left: 14px; right: 14px; width: auto; top: calc(72px + env(safe-area-inset-top)); bottom: calc(12px + env(safe-area-inset-bottom)); transform: none; display: flex; flex-direction: column; }
  .js #world .wpanel > .foot { margin-top: auto; }
  #world .wcap h3, #world .wcap h2 { font-size: clamp(30px, 8.6vw, 40px); }
  #world .wcap [data-panel="intro"] h2 { font-size: clamp(40px, 11.6vw, 56px); }
  #world .kick { margin-bottom: 12px; }
  #world .sub { font-size: 14.5px; margin-top: 10px; }
  #world .ask { margin-top: 10px; font-size: 13.5px; }
  #world .list { margin-top: 0; }
  #world .opt { min-height: 44px; padding: 6px 8px; gap: 7px; font-size: 12px; line-height: 1.12; }
  #world .list.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: auto; }
  #world .list.tabs .opt { white-space: normal; justify-content: center; text-align: center; flex-direction: column; gap: 4px; padding: 6px 4px; }
  /* a compact grid of counts, the picked one's line above it (without JavaScript, the full rows) */
  .js #world .opt.lm { grid-template-columns: 1fr; gap: 3px; min-height: 52px; padding: 7px 9px; }
  .js #world .list.lms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .js #world .opt.lm b { font-size: 19px; }
  .js #world .opt.lm .ln { display: none; }
  .js #world .opt.lm span em { font-size: 9.5px; letter-spacing: .08em; margin: 0; }
  /* three lines kept for the picked landmark's line, so a longer one never pushes the list */
  .js #world .lm-desc { display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(3 * 1.4em); margin: 0 2px 10px; font: 400 13.5px/1.4 var(--sans); color: var(--mist); }
  #world .lm-desc b { color: var(--parch); font-weight: 600; }
  #world .card h4 { font-size: clamp(30px, 8.4vw, 38px); }
  #world .card .place { margin-top: 8px; font-size: 13.5px; }
  .js #world .card .coords { display: none; }
  #world .roster { margin-top: 10px; gap: 5px; }
  #world .roster li { font-size: 11.5px; padding: 6px 8px; }
  #world .card .row { margin-top: 0; }
  #world .card .row .second, #world .card .row .primary { flex: 1; }
  #world .esc { display: none; }
  #world .hint { bottom: calc(14px + env(safe-area-inset-bottom)); font-size: 12.5px; }
  .js #world .hide-sm { display: none; }
  html:not(.js) #world .wcap { padding: 12vh 18px; gap: 10vh; }
}
@media (prefers-reduced-motion: reduce) { #world .hint i { animation: none; } }

/* ── the World's notes, after its pin: a closed <details> like the FAQ's, and each biome with its
   real place in a glass list like the dungeons' ── */
.w-notes { padding: 7vh clamp(18px, 4.2vw, 64px) 0; color: var(--parch); }
.w-notes summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 2px; border-top: 1px solid rgba(66, 84, 115, .6); border-bottom: 1px solid rgba(66, 84, 115, .6); font: 650 17px/1.3 var(--sans); color: var(--parch); }
.w-notes summary::-webkit-details-marker { display: none; }
.w-notes summary::after { content: "+"; flex: none; font: 400 22px/1 var(--sans); color: var(--gold); transition: transform .25s var(--ease); }
.w-notes details[open] summary::after { transform: rotate(45deg); }
.w-notes summary:hover { color: var(--gold-hi); }
.w-notes summary:focus-visible { outline: 2px solid var(--gold-hot); outline-offset: 2px; border-radius: 4px; }
.w-notes-in { display: grid; grid-template-columns: .8fr 1.2fr; gap: 5vw; align-items: start; padding: 30px 0 6px; }
.w-notes h3 { margin: 0; font: 850 clamp(30px, 2.8vw, 46px)/.95 var(--sans); letter-spacing: -.04em; text-wrap: balance; }
.w-notes h3 em { font-style: normal; color: var(--gold-hot); }
.w-notes-copy p { margin: 16px 0 0; max-width: 34em; font-size: 15px; line-height: 1.6; color: var(--mist); }
.w-notes-copy h3 + p { margin-top: 20px; }
.w-places { margin: 0; padding: 10px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; border-radius: 12px; background: rgba(11, 18, 33, .78); border: 1px solid rgba(197, 160, 89, .3); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .9); }
.w-places li { display: grid; grid-template-columns: 10px 1fr; align-content: start; column-gap: 11px; padding: 9px 6px; border-top: 1px solid rgba(42, 56, 85, .7); font-size: 13.5px; line-height: 1.35; color: var(--mist); }
.w-places li:nth-child(-n + 2) { border-top: 0; }
.w-places li::before { content: ""; grid-row: 1 / 3; width: 10px; height: 10px; margin-top: 4px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.w-places b { color: var(--parch); font: 650 14.5px/1.3 var(--sans); }
@media (max-width: 760px) {
  .w-notes { padding: 5vh 16px 0; }
  .w-notes summary { font-size: 16px; }
  .w-notes-in { grid-template-columns: 1fr; gap: 24px; padding-top: 22px; }
  .w-places { grid-template-columns: 1fr; }
  .w-places li:nth-child(2) { border-top: 1px solid rgba(42, 56, 85, .7); }
}
/* without JavaScript the notes read open, like the rest of the World */
html:not(.js) .w-notes details::details-content { content-visibility: visible; }
html:not(.js) .w-notes summary { pointer-events: none; }
html:not(.js) .w-notes summary::after { content: none; }
