/* Seed Wheel map: wheel ground, rim, trails, nodes, gems, seeds, portals, motion. Token colours only. */
#map { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  background: linear-gradient(180deg, #f6e7c4 0%, #ecd6a6 38%, #5a5a6e 62%, #3f4052 100%); }
[data-theme="dusk"] #map { background: linear-gradient(180deg, #34354a 0%, #2a2b3d 40%, #1d1e2c 62%, #14151f 100%); }
/* cursor is inherited: changing it on #map would restyle every element on the map. #world pins its own
 * value (below), and the drag cursor comes from an overlay that exists only while dragging. */
#map.dragging::before { content: ""; position: absolute; inset: 0; z-index: 30; cursor: grabbing; }
/* While the camera moves (js/map.js adds .moving), the main-thread dash animation holds still.
 * The pulses run on the compositor and keep going: pausing hundreds of them costs more than it saves. */
#map.moving .arc-flow { animation-play-state: paused; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; --s: 1; cursor: grab; }
#ground { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
#nodes { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#nodes img { pointer-events: none; -webkit-user-drag: none; image-rendering: auto; }

/* ---------- Ground (smooth, warm, painted) ---------- */
.wheel-shadow { fill: #2a1a0a; opacity: .18; filter: url(#soft); }
.wedge-dim { fill: #1d2030; opacity: .18; }
[data-theme="dusk"] .wedge-dim { opacity: .3; }
.lane { fill: none; stroke-linecap: round; stroke-width: 18; opacity: .9; }
.lane.white { stroke: #f4f2ea; }
.lane.yellow { stroke: #f0c040; stroke-width: 16; opacity: .85; }
.lane.thin { stroke-width: 14; }
.curb-line { fill: none; stroke: #d9d6c8; stroke-width: 14; stroke-linecap: round; opacity: .85; }
.seam { fill: none; stroke: #000; stroke-opacity: .10; stroke-width: 6; stroke-linecap: round; }
.riser { fill: #9a948a; }
.rail-under { fill: none; stroke: #4a5866; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.rail-hi { fill: none; stroke: #cfe3ef; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.rail-post { fill: #4a5866; }
.ledge-side { fill: #9c968a; }
.ledge-top { fill: #e2ddd2; }
.grate { fill: #3a3f45; }
.grate-bar { stroke: #8a9096; stroke-width: 4; stroke-linecap: round; }
.grain { fill: none; stroke: #8a5a28; stroke-opacity: .28; stroke-width: 6; stroke-linecap: round; }
.coping { fill: none; stroke: #9aa6b0; stroke-width: 26; stroke-linecap: round; }
.qp { stroke: #a8743c; stroke-width: 4; stroke-linejoin: round; }
.bowl-rim { fill: #e6e3d8; }
.coping-ring { fill: none; stroke: #8fa3b5; stroke-width: 26; stroke-linejoin: round; }
.coping-hi { fill: none; stroke: #e8f0f6; stroke-opacity: .85; stroke-width: 10; stroke-linecap: round; }
.drain { fill: #5f6159; }
.cul-curb { fill: #d6d3c8; }
.paint-red { fill: none; stroke: #c9473a; stroke-width: 60; stroke-linecap: round; opacity: .9; }
.paint-white { fill: none; stroke: #f4f2ea; stroke-width: 22; stroke-linecap: round; opacity: .92; }
.divider-under { fill: none; stroke: #5b3a14; stroke-opacity: .35; stroke-width: calc(7px * var(--inv, 1)); stroke-linecap: round; }
.divider { fill: none; stroke: var(--gold); stroke-width: calc(3px * var(--inv, 1)); stroke-linecap: round; }
.hub { fill: var(--gold); stroke: #5b3a14; stroke-opacity: .5; stroke-width: 2; }
.rim-wood { fill: none; }
.rim-hi { fill: none; stroke: #f2c58a; stroke-opacity: .6; }
.rim-edge { fill: none; stroke: #5b3a14; }
.rim-in { fill: none; stroke: var(--ink); stroke-opacity: .35; }
[data-theme="dusk"] .rim-wood { opacity: .85; }
.switch-tint { fill: #19b7b5; opacity: .4; pointer-events: none; }
[data-theme="dusk"] .switch-tint { opacity: .45; }
body.world-switch #map { background: linear-gradient(180deg, #d9efe9 0%, #a9d3cc 38%, #4f6f72 62%, #3e5a5e 100%); }
[data-theme="dusk"] body.world-switch #map, body.world-switch[data-theme="dusk"] #map { background: linear-gradient(180deg, #243a41 0%, #1f3238 40%, #172a2f 62%, #10201f 100%); }

/* ---------- Trails, fog, portal arcs ---------- */
.trail .t-under { fill: none; stroke: #2a1a0a; stroke-opacity: .3; stroke-width: 7; stroke-linecap: round; }
.trail .t-top { fill: none; stroke-width: max(3.5px, calc(3.5px * var(--inv, 1))); stroke-linecap: round; }
.trail.gold .t-top, .trail.go .t-top { stroke: var(--gold); }
.trail.gold .t-under, .trail.go .t-under { stroke: var(--glow); stroke-opacity: .45; stroke-width: max(9px, calc(9px * var(--inv, 1))); filter: blur(calc(2px * var(--inv, 1))); }
.trail.locked .t-top { stroke: #8a6a3a; stroke-opacity: .8; }
.trail.locked .t-under { stroke: #2a1a0a; stroke-opacity: .18; }
.trail.fog .t-top { stroke: #7a6446; stroke-opacity: .55; stroke-width: max(2.5px, calc(2.5px * var(--inv, 1))); }
.trail.fog .t-under { display: none; }
.trail.hl .t-top { stroke-width: max(6px, calc(6px * var(--inv, 1))); }
.trail.route .t-top, .trail.fog.route .t-top { stroke: var(--gold); stroke-opacity: 1; stroke-dasharray: none; stroke-width: max(5px, calc(5px * var(--inv, 1))); }
.trail.route .t-under, .trail.fog.route .t-under { display: inline; stroke: var(--glow); stroke-opacity: .55; stroke-width: max(11px, calc(11px * var(--inv, 1))); filter: blur(calc(2px * var(--inv, 1))); }
#world.overview .trails { display: none; }
#world:not(.overview) .ov-trails, #world.ov-real .ov-trails { display: none; }
#world.overview.ov-real .trails { display: block; }
.fog-k { transform: scale(max(1, calc(var(--inv, 1) * var(--fkr, 1)))); }
.fog-disc { fill: #56524b; }
.fog-ring { fill: none; stroke: #8a6a3a; stroke-width: 2.5; }
.fog-lock { fill: #c9c2b4; opacity: .8; }
.fog-coin { opacity: .78; }
[data-theme="dusk"] .fog-disc { fill: #3c3b46; }
.fog-layer { pointer-events: none; }
/* Fog theming lives here only (the SVG carries no colours). The fog layer is absent in ?paths=all. */
.fog-wash { fill: #efe2c2; fill-opacity: .62; }
.fog-stop { stop-color: #fffaf0; }
.fog-shade { stop-color: #d8c7a2; }
.fog-hint-k { transform: scale(clamp(.7, var(--inv, 1), 2.5)); transform-box: fill-box; transform-origin: 0 0; }
.fog-hint-disc { fill: #6b6152; fill-opacity: .25; }
.fog-hint-q { fill: #6b6152; fill-opacity: .6; }
.fog-ghost { fill: #8a7d66; fill-opacity: .22; }
.fog-ghost-ring { fill: none; stroke: #8a7d66; stroke-opacity: .35; stroke-width: 2; stroke-dasharray: 3 4; }
[data-theme="dusk"] .fog-wash { fill: #34354a; fill-opacity: .6; }
[data-theme="dusk"] .fog-stop { stop-color: #6a6c8a; }
[data-theme="dusk"] .fog-shade { stop-color: #2a2b3c; }
[data-theme="dusk"] .fog-ghost, [data-theme="dusk"] .fog-ghost-ring { fill: #c9bfae; stroke: #c9bfae; }
[data-theme="dusk"] .fog-ghost-ring { fill: none; }
[data-theme="dusk"] .fog-hint-disc, [data-theme="dusk"] .fog-hint-q { fill: #c9bfae; }
body.world-switch .fog-wash { fill: #d8ece6; }
.portal-arc .arc-glow { fill: none; stroke: var(--glow); stroke-linecap: round; opacity: .35; stroke-width: max(18px, calc(14px * var(--inv, 1))); }
.portal-arc .arc-line { fill: none; stroke: var(--gold-light); stroke-linecap: round; opacity: .85; stroke-width: max(3px, calc(3px * var(--inv, 1))); }
.portal-arc .arc-flow { fill: none; stroke: #fff; stroke-linecap: round; stroke-width: max(2px, calc(2px * var(--inv, 1))); stroke-dasharray: calc(4px * var(--inv, 1)) calc(22px * var(--inv, 1)); opacity: .8; }
.portal-arc.locked .arc-glow { opacity: .25; }
.portal-arc.available .arc-glow, .portal-arc.learning .arc-glow { stroke: color-mix(in srgb, var(--go) 45%, var(--glow)); opacity: .55; }
.portal-arc.landed .arc-glow { opacity: .7; }
/* steps(): a dash offset is a main-thread repaint, so step it ~8×/s instead of every frame */
.portal-arc .arc-flow.flow { animation: map-flow 1.6s steps(13) infinite; }
@keyframes map-flow { to { stroke-dashoffset: calc(-26px * var(--inv, 1)); } }

/* ---------- Nodes, gems, seeds: disc centre sits on the point ----------
 * State comes from the design-system classes (sw-node-<state>, sw-cross-<state>: glow, pulse, lock ring, grey gem);
 * only what the map adds is here: the learning ring, the shape cues and the selected, goal, next and path marks.
 * #world sets --s (the zoom): hit areas and labels counter-scale so they stay usable when zoomed out. */
#nodes .map-node, #nodes .map-cross, #nodes .map-seed { position: absolute; display: block; padding: 0; margin: 0; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink); -webkit-tap-highlight-color: transparent; }
#nodes .map-node { width: var(--size-node, 48px); height: var(--size-node, 48px); transform: translate(-50%, -24px); }
#nodes .map-cross { width: var(--size-crossover, 56px); height: var(--size-crossover, 56px); transform: translate(-50%, -28px); }
#nodes .map-seed { width: var(--size-seed, 88px); height: var(--size-seed, 88px); transform: translate(-50%, -44px); }
/* Invisible hit area: at least 44 screen px (capped at 60 world px so neighbours do not overlap much). */
#nodes .map-node::before, #nodes .map-cross::before { content: ""; position: absolute; inset: calc(-1 * max(0px, (min(44px / var(--s), 60px) - 100%) / 2)); }
#nodes .sw-node-disc { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; transition: box-shadow .2s, transform .15s; }
#nodes .sw-node-disc .coin { width: 100%; height: 100%; border-radius: 50%; display: block; }
/* The available pulse: a glow layer that fades in and out (opacity runs on the compositor; animating
 * box-shadow repainted every available node on every frame). */
#nodes .sw-node-available .sw-node-disc { animation: none; }
#nodes .sw-node-disc > .pulse { display: none; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 3px var(--mint-deep), 0 0 22px 8px var(--mint-glow); }
#nodes .sw-node-available .sw-node-disc > .pulse, #nodes .sw-cross-available .sw-node-disc > .pulse { display: block; animation: map-pulse 1.8s ease-in-out infinite; }
@keyframes map-pulse { 50% { opacity: 1; } }
#nodes .sw-node-disc .lock { display: none; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); }
#nodes .sw-node-check, #nodes .sw-node-flag { display: none; position: absolute; z-index: 1; }
#nodes .sw-node-check { right: -6px; bottom: -6px; width: var(--size-marker, 20px); height: var(--size-marker, 20px); }
#nodes .sw-node-flag { top: -20px; right: -12px; width: 30px; height: 30px; }
#nodes .sw-node-landed .sw-node-check, #nodes .sw-cross-landed .sw-node-check, #nodes .sw-cross-landed .sw-node-disc .sw-node-check, #nodes .map-node.goal .sw-node-flag, #nodes .map-cross.goal .sw-node-flag { display: block; }
#world.overview .sw-node-check { transform: scale(var(--ck, 1)); transform-origin: bottom right; }
.sw-node-locked .coin { filter: grayscale(.9) brightness(.8); }
#nodes .sw-node-locked .sw-node-disc .lock { display: block; }
#nodes .sw-cross-gem .lock { display: none; }
#nodes .sw-cross-locked .sw-cross-gem .lock { display: block; }
/* Available and learning: mint medallion face (static overlay) inside a gold ring. */
.sw-node-available .sw-node-disc::after, .sw-node-learning .sw-node-disc::after, .sw-cross-available .sw-node-disc::after, .sw-cross-learning .sw-node-disc::after {
  content: ""; position: absolute; inset: 15%; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 40% 35%, var(--mint-light), var(--mint) 70%); opacity: .6; }
.sw-node-available .sw-node-disc, .sw-cross-available .sw-node-disc { box-shadow: 0 0 0 3px var(--gold), 0 0 12px 3px var(--mint-glow); }
.sw-node-learning .sw-node-disc, .sw-cross-learning .sw-node-disc { box-shadow: 0 0 0 3px var(--gold-deep), 0 0 14px 4px var(--mint-glow); }
.sw-node-available .sw-node-disc::before, .sw-cross-available .sw-node-disc::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none; border: 3px dashed var(--gold-deep); }
.sw-node-learning .sw-node-disc::before, .sw-cross-learning .sw-node-disc::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none; border: 3px solid var(--mint); }
.sw-node-landed .sw-node-disc, .sw-cross-landed .sw-node-disc { box-shadow: 0 0 0 4px var(--gold), 0 0 0 6px var(--gold-deep), 0 0 16px 5px rgba(255, 211, 107, .75); }
#nodes .sw-node-landed .sw-node-check, #nodes .sw-cross-landed .sw-node-disc .sw-node-check { width: 26px; height: 26px; right: -8px; bottom: -8px; }
.map-node.on-path .sw-node-disc, .map-cross.on-path .sw-node-disc { box-shadow: 0 0 0 3px var(--go-deep), 0 0 18px 6px rgba(255, 211, 107, .8); }
.map-node.selected .sw-node-disc, .map-cross.selected .sw-node-disc, .map-cross.selected .sw-cross-gem { transform: scale(1.14); }
.map-node.next .sw-node-disc, .map-cross.next .sw-node-disc { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--mint-light), 0 0 20px 6px var(--mint-glow); }
#nodes .sw-gem-pip { position: absolute; left: -6px; top: -6px; width: 22px; height: 22px; z-index: 1; pointer-events: none; }
#world.overview .sw-gem-pip { transform: scale(var(--ck, 1)); transform-origin: top left; }
/* NEXT UP ribbon: static banner across the bottom rim of the disc. */
#nodes .sw-next-ribbon { display: none; position: absolute; left: 50%; top: calc(100% - 9px); z-index: 3; pointer-events: none; white-space: nowrap;
  padding: 2px 14px; font: 700 11px/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: #0b3d2e;
  background: linear-gradient(var(--mint-light), var(--mint));
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%, 6px 50%);
  transform: translateX(-50%) scale(clamp(1, var(--inv, 1), 2)); transform-origin: 50% 0; }
#world.overview #nodes .sw-next-ribbon { transform: translateX(-50%) scale(max(1, calc(var(--inv, 1) / var(--k, 1)))); }
#nodes .next > .sw-next-ribbon { display: block; }
#nodes .next { z-index: 6; }
#nodes .map-node.next .sw-node-label, #nodes .map-cross.next .sw-cross-text { margin-top: 12px; }
#nodes .map-node.next:is(.lbl-right, .lbl-left, .lbl-ar, .lbl-al, .lbl-above) .sw-node-label, #nodes .map-cross.next:is(.lbl-right, .lbl-left, .lbl-ar, .lbl-al, .lbl-above) .sw-cross-text { margin-top: 0; }

/* Gems: painted crossover art; grey with a lock when locked, glowing when available or landed */
#nodes .sw-cross-gem { display: block; position: relative; width: 100%; height: 100%; transition: transform .15s; }
#nodes .sw-cross-gem .gem { width: 100%; height: 100%; display: block; }
#nodes .sw-cross-lock { width: 26px; height: 26px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#nodes .sw-cross-gem .sw-node-check { right: -4px; bottom: -4px; }
#nodes .sw-cross-locked .sw-cross-gem > .gem { filter: grayscale(.85) brightness(.9); }
#nodes .sw-cross-available .sw-cross-gem > .gem { filter: drop-shadow(0 0 10px rgba(255, 211, 107, .95)); }
/* Gem pulse: a soft halo fading in and out on the compositor, instead of animating the drop-shadow filter. */
#nodes .sw-cross-available .sw-cross-gem::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 211, 107, .7), rgba(255, 211, 107, 0)); animation: map-pulse 1.8s ease-in-out infinite; }
#nodes .sw-cross-landed .sw-cross-gem > .gem { filter: drop-shadow(0 0 9px rgba(255, 211, 107, .95)); }
#nodes .sw-cross-learning .sw-cross-gem > .gem { filter: drop-shadow(0 0 8px rgba(92, 200, 74, .9)); }
.map-cross.portal .sw-cross-gem::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 211, 107, .55), rgba(255, 211, 107, 0) 70%); pointer-events: none; }
.map-cross.portal.sw-cross-locked .sw-cross-gem::before { opacity: .35; }

/* Labels: all show from the label zoom on; below it only nodes that matter show one (available, next, goal, selected).
 * Font sizes are world pixels: counter-scaled so a label stays about 14 screen px (12 for the gem tag) while zoomed out. */
#nodes .sw-node-label { font-family: var(--font-body); font-weight: 800; font-size: clamp(14px, calc(14px / var(--s)), 28px); line-height: 1.3; text-align: center; color: var(--ink); max-width: 14ch; }
#nodes .map-node .sw-node-label { display: none; position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(calc(-50% + var(--lx, 0px))); width: max-content; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(30, 20, 10, .18); pointer-events: none; z-index: 2; }
#world.labels-on .map-node .sw-node-label, #nodes .map-node.sw-node-available .sw-node-label, #nodes .map-node.selected .sw-node-label, #nodes .map-node.goal .sw-node-label, #nodes .map-node.next .sw-node-label, #nodes .map-node.sw-node-landed .sw-node-label, #nodes .map-node.sw-node-learning .sw-node-label { display: block; }
#nodes .map-node.sw-node-locked .sw-node-label { color: var(--ink-muted); }
#nodes .map-cross .sw-cross-text { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); width: max-content; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(30, 20, 10, .18); pointer-events: none; z-index: 2; }
#nodes .map-cross .sw-cross-tag { display: none; font-size: clamp(12px, calc(12px / var(--s)), 24px); line-height: 1.3; }
#world.labels-on .map-cross .sw-cross-tag, .map-cross.selected .sw-cross-tag { display: block; }
/* Seeds sit on the rim: half over the wood ring; owned seeds glow gold. */
#nodes .map-seed { z-index: 3; }
#nodes .map-seed .sw-seed-art { display: block; width: 100%; height: 100%; border-radius: 50%; }
#nodes .map-seed .sw-seed-label { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(calc(-50% + var(--lx, 0px))); white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; color: #fff; -webkit-text-stroke: 4px #2a1a0a; paint-order: stroke fill; pointer-events: none; z-index: 4; }
#nodes .map-seed.lbl-top .sw-seed-label { top: auto; bottom: calc(100% + 2px); }
#nodes .map-seed:not(.is-active) .sw-seed-art { filter: saturate(.85); }
#nodes .map-seed.is-active .sw-seed-art { box-shadow: 0 0 0 4px var(--glow), 0 0 22px 8px rgba(255, 211, 107, .85); }
/* Label anchors, tried in order by the overview label pass: below (default), above, right, left. */
#nodes .lbl-above .sw-node-label, #nodes .lbl-above .sw-cross-text, #nodes .lbl-above .sw-seed-label { top: auto; bottom: calc(100% + 4px); }
#nodes .lbl-right .sw-node-label, #nodes .lbl-right .sw-cross-text, #nodes .lbl-right .sw-seed-label { top: 50%; bottom: auto; left: calc(100% + 4px); right: auto; transform: translateY(-50%); }
#nodes .lbl-left .sw-node-label, #nodes .lbl-left .sw-cross-text, #nodes .lbl-left .sw-seed-label { top: 50%; bottom: auto; left: auto; right: calc(100% + 4px); transform: translateY(-50%); }
.map-node:focus-visible, .map-cross:focus-visible, .map-seed:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 50%; }
.flipx { transform: scaleX(-1); }

/* ---------- Motion ---------- */
#map.flip-out { animation: map-flip-out .22s ease-in forwards; }
#map.flip-in { animation: map-flip-in .26s ease-out; }
@keyframes map-flip-out { from { transform: scaleX(1); filter: brightness(1); } to { transform: scaleX(0); filter: brightness(1.3); } }
@keyframes map-flip-in { from { transform: scaleX(0); filter: brightness(1.3); } to { transform: scaleX(1); filter: brightness(1); } }
.map-node.just-landed .sw-node-disc, .map-cross.just-landed .sw-cross-gem { animation: map-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.map-node.just-unlocked .sw-node-disc, .map-cross.just-unlocked .sw-cross-gem { animation: map-burst .7s ease-out; }
.map-cross.just-warped .sw-cross-gem { animation: map-burst .8s ease-out; }
@keyframes map-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes map-burst { 0% { transform: scale(.7); filter: brightness(1.8); } 50% { transform: scale(1.25); } 100% { transform: scale(1); filter: none; } }
#map::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 15;
  background: conic-gradient(from 0deg at 50% 50%, rgba(255, 211, 107, .0), rgba(255, 211, 107, .45), rgba(138, 213, 213, .0) 35%, rgba(138, 213, 213, .45) 55%, rgba(255, 211, 107, 0) 80%, rgba(255, 211, 107, .45));
  mask-image: radial-gradient(circle at 50% 50%, transparent 8%, #000 70%); -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 8%, #000 70%); }
#map.warping::after { opacity: 1; animation: map-swirl .7s ease-in-out forwards; }
@keyframes map-swirl { 0% { opacity: 0; transform: rotate(0deg) scale(1.2); } 40% { opacity: 1; } 100% { opacity: 0; transform: rotate(200deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .portal-arc .arc-flow.flow, #map.flip-out, #map.flip-in, #map.warping::after, #nodes .sw-cross-available .sw-cross-gem::after, #nodes .sw-node-disc > .pulse, #nodes .sw-cross-available .sw-node-disc > .pulse,
  .map-node.just-landed .sw-node-disc, .map-cross.just-landed .sw-cross-gem, .map-node.just-unlocked .sw-node-disc,
  .map-cross.just-unlocked .sw-cross-gem, .map-cross.just-warped .sw-cross-gem { animation: none; }
  #nodes .sw-node-disc, #nodes .sw-cross-gem { transition: none; }
  #world { transition: none !important; }
}

/* ---------- Overview (whole wheel, zoomed out) ----------
 * #world.overview is set below the label zoom. js/map.js sets --k on each seed, gem and node (the scale that
 * brings it to a readable screen size) and --inv (1 / zoom) on #world; the pieces below use them.
 * Boxes that would collide get .ov-hide, labels that would collide move to another side or get .lbl-cull. */
#world.overview .map-node, #world.overview .map-cross, #world.overview .map-seed { transform-origin: 50% 50%; }
#world.overview .map-node { transform: translate(-50%, -24px) scale(var(--k, 1)); }
#world.overview .map-cross { transform: translate(-50%, -28px) scale(var(--k, 1)); }
#world.overview .map-seed { transform: translate(calc(-50% + var(--ox, 0px)), calc(-44px + var(--oy, 0px))) scale(var(--k, 1)); }
#world.overview .ov-hide { opacity: 0; pointer-events: none; }
#world.overview .map-node::before, #world.overview .map-cross::before, #world.overview .map-seed::before {
  content: ""; position: absolute; inset: calc(-1 * max(0px, (44px * var(--inv) / var(--k, 1) - 100%) / 2)); }
/* Overview labels: white text with a dark outline, no chip. */
#world.overview #nodes .sw-node-label, #world.overview #nodes .map-cross .sw-node-label {
  font-size: calc(14px * var(--inv) / var(--k, 1)); font-weight: 800; color: #fff; -webkit-text-stroke: calc(3.5px * var(--inv) / var(--k, 1)) #2a1a0a; paint-order: stroke fill; }
#world.overview #nodes .map-node .sw-node-label, #world.overview #nodes .map-cross .sw-cross-text { background: none; border: 0; box-shadow: none; padding: 0; }
#world.overview #nodes .map-node.sw-node-locked .sw-node-label { color: #fff; }
#world.overview #nodes .map-seed .sw-seed-label { font-size: calc(17px * var(--inv) / var(--k, 1)); -webkit-text-stroke: calc(4px * var(--inv) / var(--k, 1)) #2a1a0a; }
#world.overview #nodes .map-seed.is-active .sw-seed-art { box-shadow: 0 0 0 calc(4px * var(--inv) / var(--k, 1)) var(--glow), 0 0 calc(22px * var(--inv) / var(--k, 1)) calc(8px * var(--inv) / var(--k, 1)) rgba(255, 211, 107, .85); }
#world.overview .lbl-cull { display: none !important; }
#world.overview .map-seed { z-index: 3; }
#world.overview #nodes .map-node .sw-node-label { white-space: nowrap; max-width: none; }
#nodes .lbl-right .sw-node-label, #nodes .lbl-left .sw-node-label { transform: translate(var(--lx, 0px), -50%); }
#nodes .lbl-br .sw-node-label { top: calc(100% - 2px); bottom: auto; left: 75%; right: auto; transform: translateX(var(--lx, 0px)); }
#nodes .lbl-bl .sw-node-label { top: calc(100% - 2px); bottom: auto; left: auto; right: 75%; transform: translateX(var(--lx, 0px)); }
#nodes .lbl-ar .sw-node-label { top: auto; bottom: calc(100% - 2px); left: 75%; right: auto; transform: translateX(var(--lx, 0px)); }
#nodes .lbl-al .sw-node-label { top: auto; bottom: calc(100% - 2px); left: auto; right: 75%; transform: translateX(var(--lx, 0px)); }
#world.overview.ov-real .trail .t-top { stroke-width: max(1.5px, calc(1.5px * var(--inv, 1))); stroke-opacity: .4; }
#world.overview.ov-real .trail .t-under { display: none; }
