/* A single map surface. HUD controls live at its edges and expand toward the center. */
.phase-map .atlas-main {
  --cream:#eee2ce; --brass:#e4bd79; --muted-map:#bfb8aa; --border:#ac9b7c70;
  flex:1; min-width:0; min-height:0; padding:0; overflow:hidden; background:#15191f;
}
.atlas-board {
  --inset:clamp(18px,2.7vw,48px);
  --glass:#24262bf5; --sky-ink:#13202224;
  position:relative; isolation:isolate; flex:1; width:100%; overflow:hidden;
  background:linear-gradient(var(--sky-ink),var(--sky-ink)),url('assets/woodcut-atlas-night.webp') 61% center/cover no-repeat,#181c23;
}
.atlas-board[data-tier="2"] { --sky-ink:#23334b2e; }
.atlas-board[data-tier="3"] { --sky-ink:#452d273d; }
.atlas-board::after {
  content:""; position:absolute; z-index:1; inset:0; pointer-events:none;
  background:linear-gradient(150deg,#10111755,transparent 23%),linear-gradient(0deg,#10111745,transparent 13%);
}
.atlas-location { position:absolute; z-index:3; top:max(var(--inset),env(safe-area-inset-top)); left:max(var(--inset),env(safe-area-inset-left));
  color:var(--cream); pointer-events:none; max-width:calc(100% - 95px); text-shadow:0 2px 9px #101014,0 1px 2px #101014; }
.atlas-location p { margin:0 0 4px; display:flex; align-items:center; gap:9px; color:#e6d4a5;
  font:600 clamp(9px,.75vw,12px)/1.2 "Segoe UI",system-ui,sans-serif; letter-spacing:.11em; text-transform:uppercase; }
.atlas-location i { width:13px; height:1px; background:#cfbc8eb0; }
.atlas-location h1 { margin:0; font:400 clamp(27px,3.1vw,56px)/1.08 var(--serif); letter-spacing:-.035em; }
.atlas-viewport { position:absolute; inset:0; overflow:hidden; }
.atlas-canvas,.atlas-chart,.atlas-pins { position:absolute; inset:0; width:100%; height:100%; }
.atlas-canvas { display:block; touch-action:none; cursor:grab; }
.atlas-canvas:active { cursor:grabbing; }
.atlas-chart,.atlas-pins { pointer-events:none; }
.has-relief .atlas-chart { display:none; }
.atlas-chart line { stroke:#c7bdaca8; stroke-width:2; stroke-dasharray:5 5; vector-effect:non-scaling-stroke; }
.atlas-chart line.closed { stroke:#9da4a375; }
.atlas-chart line.side-road.future { stroke:#d4ab71c9; stroke-dasharray:7 4; }
.atlas-chart line.open { stroke:#ffcf76; stroke-width:3; stroke-dasharray:none; }
.atlas-chart line.walked { stroke:#adc5b9; stroke-dasharray:none; }
.atlas-pin {
  --hit-size:38px; --low:.77; --high:.96; --bloom:3px;
  position:absolute; left:var(--chart-x); top:var(--chart-y); transform:translate(-50%,-50%); transition-property:none;
  display:grid; place-items:center; width:var(--hit-size); height:var(--hit-size); padding:0;
  border:0; border-radius:5px; background:transparent; color:var(--rune); pointer-events:auto; cursor:help;
}
.atlas-pin[hidden] { display:none; }
.atlas-pin.is-closed { --low:.59; --high:.77; --bloom:2px; }
.atlas-pin.was-here { --low:.48; --high:.65; --bloom:2px; }
.atlas-pin.kind-boss,.atlas-pin.is-here { --low:.85; --high:1; --bloom:5px; }
.atlas-pin.is-open { min-width:44px; min-height:44px; z-index:2; cursor:pointer; --low:.90; --high:1; --bloom:6px; --chevron-rise:clamp(9px,var(--hit-size) * .42,48px); }
.atlas-pin.is-open::after {
  content:""; position:absolute; left:50%; bottom:calc(50% + var(--chevron-rise));
  width:8px; height:8px; border:solid #ffda86; border-width:0 3px 3px 0;
  transform:translateX(-50%) rotate(45deg); filter:drop-shadow(0 1px 1px #141519);
}
.atlas-pin.is-open[aria-pressed="true"]::after { width:6px; height:12px; border-color:#fff2bc; }
.atlas-pin.has-vote { --low:.97; --high:1; --bloom:8px; }
.atlas-pin.has-vote[aria-pressed="false"]::after { border-color:#b5f2d3; }
.atlas-voters {
  position:absolute; left:50%; bottom:calc(50% + var(--chevron-rise) + 13px); transform:translateX(-50%);
  display:grid; width:max-content; max-width:clamp(52px,15vw,124px); padding:2px 5px; pointer-events:none;
  background:#172c25; color:#dcffed; border-bottom:2px solid #a9e6c5; border-radius:2px;
  font:700 13px/1.12 var(--font-body); text-align:center;
}
.atlas-voters bdi { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body:has(.atlas-pin[aria-describedby~="tip"]) #tip { pointer-events:none; }
.atlas-pin:focus-visible { outline:2px solid var(--rune); outline-offset:-2px; }
.has-relief .atlas-pin { width:clamp(18px,var(--hit-size),120px); height:clamp(18px,var(--hit-size),120px); }
.has-relief .atlas-pin.kind-boss { width:var(--site-width); height:var(--site-height); }
.has-relief .atlas-cathedral-print { display:none; }
.atlas-board:not(.has-relief) .atlas-pin.kind-boss { width:clamp(54px,6vw,70px); height:auto; aspect-ratio:64/72; }
.atlas-cathedral-print { width:100%; height:100%; overflow:visible; filter:drop-shadow(0 0 1px #cfba95) drop-shadow(0 2px 2px #11151c); }
.has-relief .atlas-pin>.icon { display:none; }
.atlas-board:not(.has-relief) .atlas-pin>.icon {
  width:32px; height:32px; fill:#202329; opacity:var(--high);
  filter:drop-shadow(0 1px 1px #101216) drop-shadow(0 0 var(--bloom) var(--rune));
}
.atlas-board:not(.has-relief) .atlas-pin.is-open>.icon,
.atlas-board:not(.has-relief) .atlas-pin.is-here>.icon,
.atlas-board:not(.has-relief) .atlas-pin.kind-boss>.icon { width:38px; height:38px; }
.atlas-board:not(.has-relief) .atlas-pin:is(.has-vote,:hover,:focus-visible) { color:color-mix(in srgb,var(--rune) 74%,white); }
.atlas-board:not(.has-relief) .atlas-pin.is-here::before {
  content:""; position:absolute; inset:-6px; border-radius:50%; pointer-events:none;
  border:2px solid #d4f9d1; outline:1px solid #8bd8a2b3; outline-offset:3px;
  box-shadow:0 0 0 1px #345944,inset 0 0 9px #80dca766,0 0 12px 3px #70d99a91;
}
@media (prefers-reduced-motion:no-preference) {
  .atlas-board:not(.has-relief) .atlas-pin>.icon { animation:atlas-inscription 5.6s ease-in-out infinite; }
  .atlas-board:not(.has-relief) .cathedral-seal { animation:atlas-inscription 5.6s ease-in-out infinite; }
  .atlas-board:not(.has-relief) .atlas-pin.is-here::before { animation:atlas-halo 4.8s ease-in-out infinite; }
  @keyframes atlas-halo {
    0%,100% { opacity:.84; transform:scale(.98); }
    50% { opacity:1; transform:scale(1.025); }
  }
  @keyframes atlas-inscription {
    0%,100% { opacity:var(--low); filter:drop-shadow(0 1px 1px #101216) drop-shadow(0 0 1px var(--rune)); }
    50% { opacity:var(--high); filter:drop-shadow(0 1px 1px #101216) drop-shadow(0 0 var(--bloom) var(--rune)); }
  }
}
.atlas-board details[name] { position:absolute; z-index:5; }
.atlas-board details[name][open] { z-index:6; }
.atlas-board summary { list-style:none; cursor:pointer; }
.atlas-board summary::-webkit-details-marker { display:none; }
.atlas-board details[name]>summary,.atlas-pop { border:1px solid var(--border); background:var(--glass); color:var(--cream);
  box-shadow:0 5px 20px #09231e44; }
.atlas-board details[name]>summary { display:flex; align-items:center; justify-content:center; gap:8px; min-width:44px; height:44px; padding:0 12px; border-radius:3px; }
.atlas-board details[name]>summary>.icon { width:19px; height:19px; color:var(--brass); }
.atlas-board details[name]>summary:hover,.atlas-board details[name][open]>summary { border-color:#d4b878c9; background:#343434f5; }
.atlas-board summary:focus-visible,.atlas-pop button:focus-visible { outline:2px solid #ffdc8a; outline-offset:3px; }
.atlas-expedition { right:max(var(--inset),env(safe-area-inset-right)); top:max(var(--inset),env(safe-area-inset-top)); }
.atlas-camera { right:max(var(--inset),env(safe-area-inset-right)); bottom:max(var(--inset),env(safe-area-inset-bottom)); }
.atlas-camera { display:none; } .has-relief .atlas-camera { display:block; }
.atlas-camera .rose-dial { transform-origin:12px 12px; }
.atlas-key>summary .icon { width:13px; height:13px; opacity:.8; }
.atlas-pop { position:absolute; border-radius:4px; }
.atlas-view-tools { display:flex; right:0; bottom:calc(100% + 8px); padding:4px; }
.atlas-view-tools button { border:0; background:none; color:var(--cream); width:40px; height:40px; cursor:pointer; }
.atlas-view-tools button:hover,.atlas-actions button:hover { background:#c6ba8724; }
.atlas-view-tools .icon { width:17px; height:17px; }
.atlas-notes { overflow:auto; overscroll-behavior:contain; right:0; top:calc(100% + 8px); width:min(315px,calc(100vw - var(--inset)*2)); max-height:calc(100dvh - var(--inset)*2 - 55px); padding:16px; scrollbar-width:thin; }
.atlas-warden,.atlas-member { display:flex; align-items:center; gap:9px; }
.atlas-warden { padding-bottom:11px; border-bottom:1px solid #aaad822f; }
.atlas-warden>.icon { width:24px; height:24px; color:var(--rune); }
.atlas-warden b,.atlas-member b { display:block; color:#eee2c5; font:400 17px/1.2 var(--serif); }
.atlas-warden small,.atlas-member small,.atlas-run-info { display:block; color:var(--muted-map); font-size:10px; }
.atlas-member { flex-wrap:wrap; padding:9px 0; border-bottom:1px solid #aaad822f; }
.atlas-portrait { width:28px; height:32px; border:1px solid #b4a67473; }
.atlas-totals { display:flex; align-items:center; gap:6px; margin-left:auto; }
.atlas-totals span,.atlas-key>div span { display:inline-flex; gap:3px; align-items:center; font-size:10px; color:#c7d1b9; }
.atlas-relics { display:flex; flex-wrap:wrap; gap:4px; width:100%; padding-left:37px; }
.atlas-totals .icon,.atlas-relics .icon { width:12px; height:12px; color:#cbb681; }
.atlas-key>summary { display:flex; gap:6px; align-items:center; justify-content:space-between; padding:9px 0; color:#c4ceb8; font:13px "Segoe UI",sans-serif; }
.atlas-key>summary .icon { transform:rotate(180deg); } .atlas-key[open]>summary .icon { transform:none; }
.atlas-key>div { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:0 0 12px; }
.atlas-key>div .icon { width:17px; height:17px; color:var(--rune); }
.atlas-actions { display:flex; flex-wrap:wrap; gap:4px; }
.atlas-actions button { display:flex; align-items:center; gap:5px; padding:6px 8px; color:#d8dec5; background:transparent; border:1px solid #a1a27c52; border-radius:2px; font:11px "Segoe UI",sans-serif; cursor:pointer; }
.atlas-actions .icon { width:14px; height:14px; color:var(--brass); }
.atlas-run-info { margin-top:12px; display:flex; align-items:center; justify-content:space-between; } .atlas-run-info .clock { font-size:10px; }
@media (max-width:600px) {
  .atlas-board { --inset:16px; }
  .atlas-location h1 { font-size:clamp(25px,6vw,34px); }
  .atlas-location p { font-size:9px; }
}
@media (orientation:portrait) {
  .atlas-board:not(.has-relief) .atlas-pin { left:var(--chart-y); top:var(--upright-y); }
  .atlas-chart g { transform:matrix(0,-.84,1,0,0,92); }
}
@media (max-height:450px) {
  .atlas-board { --inset:10px; } .atlas-location h1 { font-size:23px; }
}
