/* Valwood's atlas and lore sit within the studio's existing green and gold palette. */
.realm-content .valwood-title span { display: block; font: 34px/1.15 var(--serif); letter-spacing: -1px; margin-bottom: 6px; }
.realm-content .valwood-title em { display: block; font-size: clamp(58px, 5.4vw, 84px); }
.realm-actions { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; }
.concept-link { background: none; padding: 8px 0; min-height: 44px; color: #b9c1ad; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.concept-link:hover { color: var(--cream); }
.world-section, .prophecy-section, .faction-section { padding-block: 64px; scroll-margin-top: 24px; }
.prophecy-section, .faction-section { border-top: 1px solid #c6a26c30; }
.valwood-section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.valwood-section-heading h3 { font: clamp(30px, 3.1vw, 44px)/1.15 var(--serif); letter-spacing: -1px; color: #ebd29a; }
.valwood-section-heading p { color: #bac5b2; font-size: 14px; line-height: 1.75; margin-top: 12px; }
.guide-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 44px; color: var(--sun); font-size: 12px; line-height: 1.5; border-bottom: 1px solid #c6a26c55; }
.guide-link span { font-size: 20px; }
.guide-link:hover { color: var(--cream); border-color: var(--cream); }
.atlas-heading { align-items: center; margin-bottom: 26px; }
.atlas-tools { display: flex; align-items: center; gap: 28px; }
.atlas-tools > a { display: inline-flex; align-items: center; min-height: 44px; color: #c8cbb7; font-size: 12px; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: #c6a26c65; }
.atlas-tools > a:hover { color: var(--cream); }
.atlas-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.atlas-figure { margin: 0; min-width: 0; }
.atlas-image { position: relative; background: #b4a578; }
.atlas-image > img { width: 100%; height: auto; }
.map-open { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; background: none; color: var(--sun); padding: 8px 0; font-size: 12px; }
.map-open > span { font-size: 20px; }
.map-pin { position: absolute; left: var(--pin-x); top: var(--pin-y); transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: none; border-radius: 50%; }
.map-pin > span { width: 14px; height: 14px; border: 2px solid #f0d89b; border-radius: 50%; background: #183a30; box-shadow: 0 2px 5px #0008, 0 0 0 3px #17352eb3; pointer-events: none; }
.map-pin[aria-pressed=true] > span { background: #eed29a; border-color: #173a30; box-shadow: 0 0 0 3px #f1daa0b3, 0 2px 7px #0009; }
.map-pin:hover > span { background: #f1daa0; }
.atlas-details { display: grid; grid-template-columns: 1fr; gap: 24px; min-width: 0; }
.location-list { display: flex; align-items: flex-start; flex-direction: column; }
.location-list button { min-height: 44px; padding: 7px 0; text-align: left; color: #aebca7; background: none; font: 19px/1.4 var(--serif); }
.location-list button[aria-pressed=true] { color: var(--sun); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; text-decoration-color: #c6a26c90; }
.location-list button:hover { color: var(--cream); }
.location-story { max-width: 680px; }
.location-story h4 { margin: 2px 0 12px; font: 29px/1.2 var(--serif); color: var(--cream); letter-spacing: -.5px; }
.location-story > p { font-size: 14px; line-height: 1.8; color: #bdc7b4; }
.atlas-story-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 12px; color: var(--sun); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: #c6a26c65; }
.atlas-story-link:hover { color: var(--cream); }
.lore-tablist { display: grid; gap: 12px; border-bottom: 1px solid #c6a26c35; }
.path-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.faction-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lore-tablist button { min-width: 0; min-height: 54px; padding: 12px 6px; background: none; color: #b3c0ac; border-bottom: 2px solid transparent; font: 17px/1.4 var(--serif); }
.lore-tablist button[aria-selected=true] { color: var(--sun); border-bottom-color: var(--gold); }
.lore-tablist button:hover { color: var(--cream); }
.lore-tabs [role=tabpanel] { margin-top: 32px; }
.path-panel { display: flex; align-items: center; gap: 42px; min-height: 200px; max-width: 900px; }
.path-symbol { display: grid; place-items: center; width: 120px; height: 140px; flex-shrink: 0; color: #d4b779; }
.path-symbol svg { width: 96px; height: 96px; }
.path-copy { min-width: 0; }
.path-copy h4, .faction-panel h4 { font: 32px/1.2 var(--serif); color: var(--cream); letter-spacing: -.6px; margin: 0 0 16px; }
.path-copy > p, .faction-panel p { font-size: 14px; line-height: 1.85; color: #bdc7b4; max-width: 670px; }
.path-traits { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 22px 0 0; list-style: none; color: #d9c694; font-size: 12px; line-height: 1.6; }
.path-traits li { display: flex; align-items: center; gap: 8px; }
.path-traits li::before { content: ''; width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); }
.faction-panel { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 64px; min-height: 225px; align-items: start; }
.faction-panel .guide-link { margin-top: 20px; }
.faction-panel dl { margin: 0; padding-left: 28px; border-left: 1px solid #c6a26c35; }
.faction-panel dl > div + div { margin-top: 20px; }
.faction-panel dt { font-size: 11px; color: #9fac98; margin-bottom: 7px; }
.faction-panel dd { margin: 0; font: 19px/1.5 var(--serif); color: #d5d5bc; }
.guide-invitation { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid #c6a26c30; padding-top: 24px; margin-top: 40px; }
.guide-invitation p { font: italic 22px/1.4 var(--serif); color: #bfc8b0; }

/* A full map fits first; explicit controls reveal its detail without stretching it. */
.map-dialog { width: min(1400px, calc(100% - 40px)); max-width: none; height: min(900px, calc(100dvh - 32px)); max-height: none; padding: 20px; border: 1px solid #c6a26c70; color: var(--cream); background: #0b201d; }
.map-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.map-dialog::backdrop { background: #03100eeb; backdrop-filter: blur(5px); }
.map-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; }
.map-dialog-header h2 { font: 27px/1.2 var(--serif); margin: 0; color: #ebd29a; }
.map-close { display: inline-flex; align-items: center; gap: 12px; padding: 4px 0 4px 12px; min-height: 44px; background: none; font-size: 12px; }
.map-close span { font-size: 24px; }
.map-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; flex-shrink: 0; }
.map-zoom-controls { display: flex; align-items: center; gap: 6px; }
.map-zoom-controls button { min-width: 44px; min-height: 44px; padding: 8px 12px; font-size: 13px; border: 1px solid #c6a26c50; background: #c6a26c09; }
.map-zoom-controls button:disabled { color: #677b6a; border-color: #c6a26c20; cursor: default; }
.map-zoom-controls output { min-width: 45px; text-align: center; font-size: 12px; color: #c8cebc; }
.map-location-control { display: flex; align-items: center; gap: 12px; color: #bdc7b4; font-size: 12px; }
.map-location-control select { min-height: 44px; min-width: 0; padding: 8px 32px 8px 12px; border: 1px solid #c6a26c50; background: #102b24; color: var(--cream); font: 13px var(--sans); }
.map-viewport { flex: 1; min-height: 100px; display: flex; overflow: auto; overscroll-behavior: contain; background: #061713; border: 1px solid #c6a26c30; cursor: grab; }
.map-viewport.is-dragging { cursor: grabbing; user-select: none; }
.map-canvas { position: relative; flex-shrink: 0; margin: auto; aspect-ratio: 5009 / 2818; }
.map-canvas > img { display: block; width: 100%; height: 100%; max-width: none; user-select: none; }
.map-dialog-caption { font-size: 12px; line-height: 1.5; color: #bec7b3; min-height: 18px; flex-shrink: 0; }

/* The public guide uses short, readable entries, with deeper quest material kept out. */
.world-guide-page { background: var(--mist); }
.guide-main { padding-top: 168px; padding-bottom: 80px; }
.guide-intro { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
.guide-kicker { font-size: 12px; color: #b6c1ac; margin-bottom: 16px; }
.guide-intro h1 { font: clamp(38px, 4.6vw, 64px)/1.1 var(--serif); color: #ebd29a; letter-spacing: -1.8px; }
.guide-intro p:not(.guide-kicker) { color: #bdc7b4; font-size: 15px; line-height: 1.8; margin-top: 24px; }
.guide-intro .guide-link { margin-top: 18px; }
.guide-map { margin: 0; }
.guide-map img { width: 100%; height: auto; border: 1px solid #c6a26c60; }
.guide-map figcaption { font: italic 14px/1.5 var(--serif); color: #bdc7b4; margin-top: 10px; }
.guide-contents { display: flex; gap: 28px; flex-wrap: wrap; padding: 22px 0; margin: 44px 0 0; border-top: 1px solid #c6a26c40; border-bottom: 1px solid #c6a26c40; }
.guide-contents a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sun); font-size: 13px; }
.guide-chapter { padding-top: 64px; }
.guide-chapter > h2 { font: 38px/1.2 var(--serif); color: #ebd29a; letter-spacing: -1px; }
.guide-entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 64px; margin-top: 30px; }
.guide-entries article { padding-top: 22px; border-top: 1px solid #c6a26c30; scroll-margin-top: 24px; }
.guide-entries h3 { font: 27px/1.2 var(--serif); color: var(--cream); margin-bottom: 14px; letter-spacing: -.4px; }
.guide-entries p { font-size: 14px; line-height: 1.85; color: #bdc7b4; }
.guide-entries p + p { margin-top: 12px; }
.guide-entries .guide-link { margin-top: 14px; }
.guide-return { margin-top: 56px; }

@media (max-width: 1100px) {
  .atlas-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
  .faction-panel { gap: 36px; }
  .guide-intro { gap: 36px; }
}
@media (max-width: 760px) {
  .realm-content .valwood-title span { font-size: 25px; margin-bottom: 8px; }
  .realm-content .valwood-title em { font-size: clamp(43px, 12vw, 54px); }
  .realm-actions { gap: 2px; }
  .world-section, .prophecy-section, .faction-section { padding-block: 40px; }
  .valwood-section-heading { display: block; margin-bottom: 24px; }
  .valwood-section-heading h3 { font-size: clamp(26px, 7vw, 32px); letter-spacing: -.6px; }
  .valwood-section-heading p { font-size: 13px; margin-top: 10px; }
  .valwood-section-heading > .guide-link { margin-top: 12px; }
  .atlas-heading { margin-bottom: 16px; }
  .atlas-tools { gap: 24px; margin-top: 8px; }
  .atlas-image .map-pin { display: none; }
  .atlas-layout { grid-template-columns: 1fr; gap: 16px; }
  .atlas-details { grid-template-columns: 1fr; gap: 22px; }
  .location-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #c6a26c30; }
  .location-list button { padding: 4px 0; font-size: 14px; text-align: left; }
  .location-story h4 { font-size: 25px; margin: 0 0 12px; }
  .lore-tablist { gap: 4px; }
  .lore-tablist button { font-size: 14px; padding: 10px 5px; }
  .faction-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
  .lore-tabs [role=tabpanel] { margin-top: 24px; }
  .path-panel { align-items: flex-start; flex-direction: column; gap: 16px; min-height: 0; }
  .path-symbol { width: 64px; height: 64px; }
  .path-symbol svg { width: 60px; height: 60px; }
  .path-copy h4, .faction-panel h4 { font-size: 25px; margin-bottom: 12px; }
  .path-traits { gap: 10px 18px; margin-top: 18px; }
  .faction-panel { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .faction-panel dl { padding-left: 18px; }
  .faction-panel dd { font-size: 17px; }
  .guide-invitation { display: block; margin-top: 28px; padding-top: 20px; }
  .guide-invitation p { font-size: 20px; margin-bottom: 10px; }
  .map-dialog { width: calc(100% - 24px); height: calc(100dvh - 24px); padding: 12px; gap: 10px; }
  .map-dialog-header h2 { font-size: 21px; }
  .map-toolbar { gap: 8px; }
  .map-location-control { width: 100%; }
  .map-location-control select { flex: 1; }
  .map-dialog-caption { font-size: 11px; }
  .guide-main { padding-top: 112px; padding-bottom: 52px; }
  .guide-intro { grid-template-columns: 1fr; gap: 28px; }
  .guide-intro h1 { font-size: clamp(32px, 8.5vw, 40px); letter-spacing: -1px; }
  .guide-intro p:not(.guide-kicker) { font-size: 14px; margin-top: 18px; }
  .guide-kicker { font-size: 11px; margin-bottom: 12px; }
  .guide-contents { gap: 8px 24px; padding-block: 12px; margin-top: 28px; }
  .guide-chapter { padding-top: 40px; }
  .guide-chapter > h2 { font-size: 28px; }
  .guide-entries { grid-template-columns: 1fr; gap: 28px; margin-top: 24px; }
  .guide-entries h3 { font-size: 24px; }
}
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  .guide-main { padding-top: 100px; }
  .map-dialog { padding: 10px 14px; }
  .map-dialog-header h2 { font-size: 21px; }
  .map-location-control { width: auto; }
  .map-toolbar { flex-wrap: nowrap; }
  .map-location-control select { max-width: 190px; }
}
