/* ============================================================
   Sons of the Forest map — what is SOTF-only on /sons-of-the-forest-map/.
   The app shell (rail, stage, layer rows, drawer, the text strip below) is
   map-app.css, and so is the app furniture — the find box, tool toggles,
   filter presets, grouped layer rail and the on-map HUD.

   ⭐ 2026-09-18: those blocks were written here first and were PROMOTED into
   map-app.css when the Icarus maps took the same furniture. They carry both
   prefixes there, so this page's markup did not have to change. What is left
   below is genuinely SOTF's: the Surface/Underground control, the base image,
   the pin popup and the row/dot sizing the 252-category rail needs.
   Behaviour: assets/js/sotf-map.js.
   ============================================================ */

/* ⭐ THE ONE KNOB — map-app.css defaults every control to --orange-ink; this map's
   controls have always been blue and the map art is green, so it stays blue here. */
.oly-app { --map-accent: var(--blue); }

/* ── Surface / Underground — a primary control, so it gets real weight ── */
.sotf-seg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.sotf-seg button { flex: 1 1 0; min-width: 0; background: none; border: 0; border-right: 1px solid var(--border); color: var(--text-muted); font: 700 0.76rem 'Manrope', sans-serif; padding: 0.45rem 0.3rem; cursor: pointer; white-space: nowrap; }
.sotf-seg button:last-child { border-right: 0; }
.sotf-seg button:hover { color: var(--text); }
.sotf-seg button.is-on { background: var(--blue); color: var(--on-blue, #fff); }

/* ── layers header ──
   Own class on purpose: map-app.css's .oly-layers-all targets a button INSIDE
   itself and .oly-layers-off is an unrelated notice block, so reusing either
   leaves the All on / All off pair as raw browser buttons. */
.sotf-layers-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font: 700 0.72rem 'Manrope', sans-serif; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); padding: 0.7rem 0.85rem 0.45rem; }

/* ── rows in the grouped rail: 252 categories, so they run tighter than the
      Icarus rail's and the dot is a size down ── */
.sotf-row { padding-left: 1.5rem; }
.sotf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0, 0, 0, 0.5); flex: 0 0 auto; }

/* ── the map itself ── */
#oly-map[data-sotf] { background: #7a96be; }        /* the game's ocean, so pans off the edge do not flash white */
.sotf-base { image-rendering: auto; }
/* the winter-water layer (sotf-water.webp) and its key: the two colours water.py paints */
.sotf-wkey { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.sotf-wkey span { display: inline-flex; align-items: center; gap: 0.35rem; }
.sotf-wk { width: 14px; height: 10px; border: 1px solid; flex: 0 0 auto; }
.sotf-wk-ice { background: #b2deff; border-color: #4680ba; }
.sotf-wk-open { background: #1e88ff; border-color: #0a4696; }
/* the place names players use (sotf-map.js D.names): text on the map, a click opens its card; --s is set on the pane per zoom */
.sotf-name b {
  display: block; width: max-content; max-width: 14em; transform: translate(-50%, -50%); text-align: center; cursor: pointer;
  color: #fff; text-shadow: 0 0 3px #000, 0 0 7px rgba(0, 0, 0, 0.9);
  font: italic 800 calc(13px * var(--s, 1)) / 1.15 'Manrope', sans-serif; letter-spacing: 0.03em;
}
.sotf-name b:hover { text-decoration: underline; }

/* ── pin popup ──
   ⛔⛔ THE PANEL CHROME THAT USED TO LIVE HERE NEVER APPLIED, AND IT LOOKED LIKE IT DID.
   `.sotf-popup .leaflet-popup-content-wrapper` is specificity 0-2-0; map-app.css's
   `#oly-map .leaflet-popup-content-wrapper` is 1-1-0 and wins, and this page mounts its map on
   #oly-map like every other. So from the day it shipped, this map's popup was drawing the shared
   38%-transparent chrome while this file confidently declared an opaque one — four dead rules
   (wrapper, tip, content margin, close button) that read as the known-good example other maps
   were told to copy. Found 2026-09-18 by measuring the LIVE page instead of reading the CSS.
   ▶ They are deleted rather than given an id, because map-app.css now carries that same opaque
   panel for every map — so deleting them changes nothing on screen (they were never painting) and
   removes a rule that lied. What is left below is genuinely SOTF's: it styles .sotf-pop* elements
   that nothing else competes for. */
.sotf-pop b { display: block; font: 800 0.9rem 'Manrope', sans-serif; color: #fff; padding-right: 1rem; }
.sotf-pop-sub { display: block; font-size: 0.73rem; color: #a7b4c2; margin-top: 0.1rem; }
/* small and quiet — it is a confirm, not the point of the card */
.sotf-pop-btn { margin-top: 0.5rem; background: rgba(255, 255, 255, 0.10); color: #e8edf3;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 7px;
  font: 700 0.72rem 'Manrope', sans-serif; padding: 0.28rem 0.6rem; cursor: pointer; }
.sotf-pop-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.sotf-pop-btn.is-found { background: rgba(74, 222, 128, 0.16); border-color: rgba(74, 222, 128, 0.45); color: #4ade80; }

/* ── mobile: the rail becomes the drawer map-app.css already styles ── */
@media (max-width: 860px) {
  .sotf-seg button { font-size: 0.72rem; padding: 0.45rem 0.2rem; }
}

/* ══ .cvm — the cave locator mini map ═══════════════════════════════════════
   Used on /sons-of-the-forest-cave-locations/, one instance per interior drawer plus
   the overview in the hero. Built by sotf-cave-maps.js.
   ⚠ The pane needs a HEIGHT IN CSS, not from content: Leaflet measures its container,
   and a container sized by its (empty) children measures zero. */
.cvm { border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: #0d1117; position: relative; }
/* ⚠ SQUARE, not a banner. The base image is 4096x4096, so in a wide short pane
   fitBounds fits to the HEIGHT and the island sits in a narrow column with dead
   margins either side — it reads as a broken image rather than a small map. */
/* ⚠ Cap the CARD's width, never the pane's height. aspect-ratio makes the pane
   square only while width drives it — a max-height that bites turns the pane back
   into a wide box and the island goes back to sitting in a column of dead margin. */
.cvm { max-width: 460px; margin-inline: auto; }
.cvm-map { aspect-ratio: 1 / 1; background: #0d1117; }
.cvm-bar { position: absolute; top: 8px; right: 8px; z-index: 500; display: flex; gap: 5px; }
.cvm-btn { background: rgba(13, 17, 23, 0.86); color: #e8edf3;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 7px;
  font: 700 0.72rem 'Manrope', sans-serif; padding: 0.3rem 0.55rem; cursor: pointer;
  backdrop-filter: blur(4px); }
.cvm-btn:hover { background: rgba(28, 36, 48, 0.95); border-color: rgba(255, 255, 255, 0.4); }
.cvm-btn-i { width: 28px; padding: 0.3rem 0; text-align: center; font-size: 0.85rem; }
.cvm-foot { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center;
  padding: 0.5rem 0.7rem; border-top: 1px solid var(--border); background: var(--bg-card);
  font-size: 0.74rem; color: var(--text-muted); }
.cvm-foot .cvm-full { margin-left: auto; font-weight: 700; color: var(--blue);
  text-decoration: none; white-space: nowrap; }
.cvm-foot .cvm-full:hover { text-decoration: underline; }
.cvm-foot .cvm-tp-note { flex-basis: 100%; color: var(--text); }   /* a door teleport's landing line (sotf-cave-maps.js) */
.cvm-key { display: inline-flex; align-items: center; gap: 5px; }
.cvm-key i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #60a5fa);
  border: 1px solid rgba(8, 10, 14, 0.8); }
.cvm-key-only i { background: #f0a000; border-color: #f0a000; box-shadow: 0 0 0 2px rgba(240, 160, 0, 0.3); }

/* numbered overview markers — a divIcon, so this is the whole look */
.cvm-num { display: grid; place-items: center; background: var(--blue); color: #061018;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; cursor: pointer;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5); }
.cvm-num b { font: 800 0.72rem 'Manrope', sans-serif; }
/* ⚠ Four interiors ship no entrance object. A dashed ring says "positioned from the
   room, not from a door" without a footnote nobody reads. */
.cvm-num-approx { background: #7a8794; border-style: dashed; }
.cvm-door { display: grid; place-items: center; }
.cvm-door i { width: 13px; height: 13px; border-radius: 50%; background: #f0a000;
  border: 2px solid #fff; box-shadow: 0 0 0 5px rgba(240, 160, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.5); }
.cvm-door-approx i { background: #7a8794; border-style: dashed;
  box-shadow: 0 0 0 5px rgba(122, 135, 148, 0.25); }

/* the live "only in this cave" chips */
.cvm-only { display: flex; flex-wrap: wrap; gap: 5px; margin: 0.15rem 0 0; }
.cvm-chip { display: inline-block; background: rgba(240, 160, 0, 0.13);
  border: 1px solid rgba(240, 160, 0, 0.42); color: var(--text); border-radius: 999px;
  font: 700 0.76rem 'Manrope', sans-serif; padding: 0.18rem 0.55rem; }

@media (max-width: 860px) {
  .cvm { max-width: 100%; }
}

/* ?cave= arrival notice — sits over the stage, not in the rail, because the thing it
   explains is what the MAP is showing. */
.sotf-deeplink { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px;
  z-index: 620; max-width: min(520px, calc(100% - 28px)); margin: 0;
  background: rgba(13, 17, 23, 0.94); border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 10px; padding: 0.5rem 0.75rem; color: #e8edf3;
  font: 600 0.78rem 'Manrope', sans-serif; text-align: center; backdrop-filter: blur(5px); }
.sotf-deeplink button { background: none; border: none; padding: 0; margin-left: 0.25rem;
  color: #60a5fa; font: 700 0.78rem 'Manrope', sans-serif; cursor: pointer;
  text-decoration: underline; }
/* legend swatches that mirror the three marker looks above */
.cvm-key i { background: var(--blue); }
.cvm-key-door i { background: #f0a000; border-color: #f0a000; }
.cvm-key-only i { background: transparent; border: 2px solid #f0a000; }
.cvm-key-approx i { background: #7a8794; border-style: dashed; }
.cvm-lead { font: 700 0.8rem 'Manrope', sans-serif; color: var(--text-muted);
  margin: 1rem 0 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Live players — embed mode only, posted in by the GamesOMG Hosting console (sotf-map.js).
   Brand orange so a person reads apart from every loot-group colour on the map. */
/* ⚠ `#oly-map .leaflet-tooltip` (map-app.css) out-ranks a bare class pair and paints every tooltip
   dark — measured: the first cut rendered rgba(20,24,18,.88). Scoped the same way to win. */
#oly-map .leaflet-tooltip.sotf-live-tip { background: #f08000; color: #111; border: 0; border-radius: 6px;
  font: 700 12px 'Manrope', sans-serif; padding: 2px 7px; box-shadow: 0 1px 4px rgba(0,0,0,.55);
  white-space: nowrap; max-width: none; }
