/* Leonida Waypoint — interactive map styles (map.html only).
   Carried over from the approved preview build, including the phone
   scroll-off behaviour shipped at the user's direction. */
.map-shell {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); background: var(--bg-2);
}
/* isolation confines every Leaflet pane, badge and overlay z-index
   inside the stage, so nothing from the map can ever paint over the
   sticky site header (header z-index 120) again. */
.map-stage { position: relative; min-width: 0; isolation: isolate; z-index: 0; }
#leonida-map { height: 560px; width: 100%; background: #2e7d8c; z-index: 0; }
/* Locked (default on touch): a one-finger swipe starting on the map
   scrolls the page as normal. Pin details pop up on the map itself,
   so there is no detail card below to scroll off the map for.
   Unlock to pan / pinch the map. */
#leonida-map.is-locked { touch-action: pan-y !important; }
#leonida-map.is-locked .leaflet-pane,
#leonida-map.is-locked .leaflet-map-pane,
#leonida-map.is-locked .leaflet-marker-icon { touch-action: pan-y !important; }
#leonida-map.is-unlocked { touch-action: none; }
/* The Move map button lives in the underbar, in page flow directly
   under the map (Nick, Nov 11, 2026: "it's gotta be right under the
   map"), never floating on the map where it can be covered or lost. */
.map-underbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--bg-2); border-top: 1px solid var(--line);
}
.map-move-btn {
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; flex: none;
  background: var(--pink); color: #fff; border: 2px solid #fff;
  padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4); min-height: 44px;
}
.map-move-btn[aria-pressed="true"] { background: var(--teal); }
.map-hint {
  font-size: 13px; font-weight: 600; color: var(--ink-soft); min-width: 0;
}
.map-hint[hidden] { display: none; }
.map-badge {
  position: absolute; top: 12px; right: 12px; z-index: 600;
  background: var(--gold); color: #2a1503; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 10px; border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); pointer-events: none;
}
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 600;
  background: rgba(22,10,36,0.88); color: #fdf0e9; border-radius: 6px;
  padding: 8px 12px; font-size: 12.5px; line-height: 1.5; pointer-events: none;
}
.map-legend .dot { margin-right: 6px; }
.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #fff; vertical-align: -1px; flex: none;
}
.dot-collectible { background: #0e7d86; }
.dot-stunt { background: #e8316f; }
.dot-package { background: #f26d21; }
.dot-store { background: #ffb43a; }
.dot-activity { background: #7a4fd0; }
.pin-marker { background: none; border: none; }
.pin {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg); border: 2px solid #fff; color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.45); cursor: pointer;
}
.pin svg { transform: rotate(45deg); width: 14px; height: 14px; }
.pin-collectible { background: #0e7d86; }
.pin-stunt { background: #e8316f; }
.pin-package { background: #f26d21; }
.pin-store { background: #ffb43a; color: #2a1503; }
.pin-activity { background: #7a4fd0; }
.pin.is-found { background: #4c4453; opacity: 0.55; }
.pin.is-selected { box-shadow: 0 0 0 3px #ffb43a, 0 3px 8px rgba(0,0,0,0.45); }
/* Pin detail card, docked ON the map (Nick, Nov 11, 2026): selecting
   a pin pops this panel up at the bottom of the map and the page
   never scrolls. touch-action pan-y and default overscroll chaining
   mean a swipe starting on the panel can still scroll the page, so
   the panel can never trap movement. */
.pin-detail {
  position: absolute; left: 12px; bottom: 12px; z-index: 660;
  width: min(400px, calc(100% - 24px)); max-height: calc(100% - 84px);
  overflow-y: auto; touch-action: pan-y;
  border: 1.5px solid var(--teal); border-radius: 10px; padding: 14px 38px 14px 16px;
  background: var(--teal-soft); box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  animation: pd-rise 160ms ease-out;
}
@keyframes pd-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pin-detail { animation: none; } }
.pd-close {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px;
  display: grid; place-items: center; font: inherit; font-size: 20px; font-weight: 700;
  line-height: 1; color: var(--ink); background: none; border: none; border-radius: 50%;
  cursor: pointer;
}
.pd-close:hover { background: rgba(0,0,0,0.08); }
.pin-detail[hidden] { display: none; }
.pop-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pink-deep); }
.pop-title { font-family: "Barlow Condensed", sans-serif; font-size: 24px; font-weight: 700; line-height: 1.05; margin: 2px 0 4px; color: var(--ink); text-transform: uppercase; }
.pop-area { font-size: 13px; font-weight: 700; color: var(--teal); margin-bottom: 5px; }
.pop-desc { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 12px; }
.pop-found {
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--pink); color: #fff; border: none; border-radius: 5px; padding: 9px 14px; width: 100%; min-height: 44px;
}
.pop-found[aria-pressed="true"] { background: var(--teal); }
.pd-guide {
  display: block; font-weight: 700; font-size: 14.5px; margin: 0 0 12px;
  color: var(--teal);
}
.pd-guide[hidden] { display: none; }
.map-side { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.map-progress-num { font-family: "Barlow Condensed", sans-serif; font-size: 44px; font-weight: 700; line-height: 1; color: var(--pink); }
.map-progress-num small { font-size: 20px; color: var(--ink-soft); }
.map-search {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.map-search:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
/* Filter bar above the map (Nov 11, 2026): the category chips and the
   pin search used to live in the side panel below the map, where phone
   visitors never found them. The bar spans the top of the map shell,
   directly above the map, on every screen size. Chips scroll sideways
   on narrow screens. This also follows the house rule that the tools
   a visitor filters with sit at the top, not buried below content. */
.map-filterbar {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.map-filter-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.map-filter-label {
  flex: none; font-size: 12.5px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-soft);
}
.map-cats {
  display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; padding-bottom: 2px; min-width: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.map-cats::-webkit-scrollbar { display: none; }
.cat-row {
  display: flex; align-items: center; gap: 9px; width: auto; flex: none; font: inherit; text-align: left;
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; cursor: pointer; color: var(--ink); min-height: 44px;
  white-space: nowrap;
}
.cat-row .cat-name { font-weight: 600; font-size: 15px; }
.cat-row .cat-count { margin-left: auto; font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cat-row[aria-pressed="false"] { opacity: 0.45; }
.cat-row[aria-pressed="false"] .cat-name { text-decoration: line-through; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  background: var(--bg-2); color: var(--ink); border: 1.5px solid var(--line);
  padding: 6px 12px; border-radius: 999px; min-height: 38px;
}
.tool-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pin-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 300px; border-top: 1px solid var(--line); }
.pin-list li { border-bottom: 1px solid var(--line); }
.pin-row {
  display: flex; align-items: center; gap: 9px; width: 100%; font: inherit; text-align: left;
  background: none; border: none; padding: 9px 4px; cursor: pointer; color: var(--ink); min-height: 44px;
}
.pin-row .pin-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.pin-row .pin-area { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-soft); }
.pin-row .pin-state { margin-left: auto; flex: none; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); }
.pin-row.is-found .pin-name { color: var(--ink-soft); text-decoration: line-through; }
.pin-list-empty { padding: 14px 4px; font-size: 14px; color: var(--ink-soft); }
.map-note { font-size: 14px; color: var(--ink-soft); margin-top: 14px; max-width: 62em; }
.map-note b { color: var(--ink); }
@media (max-width: 860px) {
  .map-shell { grid-template-columns: 1fr; }
  #leonida-map { height: 480px; }
  .pin-list { max-height: 260px; }
}
@media (min-width: 861px) {
  /* Desktop (Nick, Nov 11, 2026): the map is huge and on top, the
     collectible tools and pin list sit underneath it, full width. */
  #leonida-map { height: 700px; }
  .map-cats { flex-wrap: wrap; overflow-x: visible; }
  .pin-list { max-height: 360px; }
}
@media (max-width: 560px) {
  #leonida-map { height: 400px; }
  .map-legend { display: none; }
}

/* Confirmed places (added Nov 10, 2026): Rockstar-named places get a
   blue marker, distinct from the five gameplay demo categories. */
.dot-place{background:#3b82f6}
.pin-place{background:#2563eb;color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.45),inset 0 0 0 2px rgba(255,255,255,.22)}
.pin-detail .pop-source{color:var(--ink-soft);font-size:.86rem;margin-top:8px}

/* Category icons (filters, legend, pin list): the same SVG set the
   pins themselves carry in map.js, in a coloured disc matching each
   pin colour, so a visitor can match filter -> legend -> pin by icon. */
.cat-ico{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;color:#fff;flex:none;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.35)}
.cat-ico svg{width:13px;height:13px}
.cat-ico-collectible{background:#0e7d86}
.cat-ico-stunt{background:#e8316f}
.cat-ico-package{background:#f26d21}
.cat-ico-store{background:#ffb43a;color:#2a1503}
.cat-ico-activity{background:#7a4fd0}
.cat-ico-place{background:#2563eb}
.map-legend .cat-ico{width:20px;height:20px;vertical-align:-6px;margin-right:6px}
.map-legend .cat-ico svg{width:11px;height:11px}
/* Pin-name label on the map (Leaflet tooltip opened on selection).
   Non-interactive by design: it never takes pointer events, has no
   close control and does not pan the map, so it cannot trap page
   scrolling the way the removed popups did. Name only, pill shaped. */
.leaflet-tooltip.pin-tip{background:#160a24;color:#fdf0e9;border:2px solid #ffb43a;border-radius:999px;box-shadow:0 4px 14px rgba(0,0,0,.45);font-family:"Barlow",sans-serif;font-weight:700;font-size:13px;padding:5px 11px;pointer-events:none;white-space:nowrap}
.leaflet-tooltip.pin-tip:before{border-top-color:#ffb43a}

/* Desktop rail layout (Nick, Nov 11, 2026, modeled on the ARC Raiders
   Hub map pages): filters live in a left sidebar, the collectible
   panel stacks under them in the same rail, and the map fills the
   rest of the space so it stays in view while filtering. The shell
   also breaks out wider than the text column on desktop. */
@media (min-width: 1024px) {
  .map-shell {
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-areas: "filter stage" "side stage" "side under";
    width: min(1560px, calc(100vw - 40px));
    margin-left: calc(50% - min(780px, 50vw - 20px));
  }
  .map-filterbar { grid-area: filter; border-right: 1px solid var(--line); padding: 16px; }
  .map-filter-row { flex-direction: column; align-items: stretch; }
  .map-cats { flex-direction: column; flex-wrap: nowrap; overflow-x: visible; }
  .map-cats .cat-chip { width: 100%; justify-content: flex-start; }
  .map-side { grid-area: side; border-right: 1px solid var(--line); background: var(--bg-2); }
  .map-stage { grid-area: stage; }
  .map-underbar { grid-area: under; }
  #leonida-map { height: 720px; }
  .pin-list { max-height: 320px; }
}

/* App view (Nick, Nov 11, 2026: "u need to be able to always see the
   map"): on desktop the map tool owns the full screen height under
   the header. The map never scrolls away while you work: filters stay
   pinned at the top of the rail, the collectible panel scrolls inside
   the rail, and the page itself does not move. */
@media (min-width: 1024px) {
  .map-shell {
    height: calc(100vh - 62px);
    height: calc(100dvh - 62px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .map-stage { display: flex; min-height: 0; }
  #leonida-map { height: 100%; flex: 1; }
  .map-side { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
  .pin-list { max-height: none; }
}

/* Overlay app layout (Nov 11, 2026): the map tool rebuilt to the ARC
   Raiders Hub map layout, studied from that site's own stylesheet.
   Their model: the app is one screen tall, the map fills it entirely,
   and the filters live in a translucent panel floating OVER the map
   that slides away with a toggle. The grid rail and stacked layouts
   from earlier today are superseded; the rules below override them. */
.map-shell {
  display: flex; flex-direction: column;
  width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw);
  height: calc(100vh - 60px); height: calc(100dvh - 60px);
  border: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-radius: 0; background: var(--bg-2);
}
.map-stage { flex: 1; min-height: 0; }
#leonida-map { height: 100%; }
.map-underbar { flex: none; }
.map-sidebar {
  position: absolute; top: 14px; left: 14px; bottom: 14px; z-index: 1200;
  width: 400px; max-width: calc(100% - 28px);
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(22, 10, 36, 0.93);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-left: 3px solid var(--pink); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.map-sidebar.hidden { transform: translateX(calc(-100% - 20px)); }
.map-sidebar-scroll {
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 16px;
}
.map-sidebar .map-filterbar {
  position: static; padding: 0; background: none; border: none;
  display: flex; flex-direction: column; gap: 10px;
}
.map-sidebar .map-filter-row { flex-direction: column; align-items: stretch; }
.map-sidebar .map-cats { flex-direction: column; flex-wrap: nowrap; overflow-x: visible; }
.map-sidebar .map-cats .cat-row { width: 100%; justify-content: flex-start; }
.map-sidebar .map-side { padding: 0; background: none; border: none; }
.map-sidebar .pin-list { max-height: none; }
.map-side-toggle {
  position: absolute; top: 14px; left: 428px; z-index: 1201;
  display: flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink);
  background: rgba(22, 10, 36, 0.92); border: 1.5px solid var(--pink);
  border-radius: 999px; padding: 9px 14px; min-height: 40px; cursor: pointer;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.map-shell.lw-filters-hidden .map-side-toggle { left: 14px; }
.mst-chev { font-size: 16px; line-height: 1; transition: transform 0.3s; }
.map-shell.lw-filters-hidden .mst-chev { transform: rotate(180deg); }
.map-legend { left: auto; right: 12px; }
@media (min-width: 1024px) {
  .pin-detail { left: 428px; }
  .map-shell.lw-filters-hidden .pin-detail { left: 12px; }
}
@media (max-width: 1023px) {
  .map-side-toggle { left: auto; right: 14px; }
  .map-shell.lw-filters-hidden .map-side-toggle { left: auto; right: 14px; }
  .map-badge { right: auto; left: 12px; }
  /* Zoom buttons (top-right) drop below the Filters pill on phones. */
  .leaflet-top.leaflet-right { margin-top: 56px; }
}

/* Sidebar scroll fix + condense pass (Nick, Nov 11, 2026: the panel
   did not scroll and everything in it was too big). The scroll area
   is a flex child: without flex:1 and min-height:0 it grows with its
   content instead of scrolling inside the panel frame. Sizing below
   is the panel's compact scale; tap targets stay >= 36px tall. */
.map-sidebar-scroll { flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; padding: 12px 14px 14px; gap: 12px; }
.map-sidebar .map-filterbar { gap: 8px; }
.map-sidebar .map-filter-label { font-size: 11.5px; }
.map-sidebar .map-cats { gap: 6px; }
.map-sidebar .cat-row { padding: 7px 10px; border-radius: 8px; }
.map-sidebar .cat-row .cat-name { font-size: 14px; }
.map-sidebar .cat-row .cat-count { font-size: 12.5px; }
.map-sidebar .map-search { padding: 8px 10px; font-size: 14px; }
.map-sidebar .map-side { gap: 10px; }
.map-sidebar .map-progress-num { font-size: 30px; }
.map-sidebar .map-progress-num small { font-size: 15px; }
.map-sidebar .progress-bar { height: 8px; }
.map-sidebar .map-prog-block p { font-size: 13.5px; line-height: 1.45; margin: 6px 0 0; }
.map-sidebar .map-tools { gap: 8px; }
.map-sidebar .tool-btn { padding: 6px 11px; font-size: 13px; min-height: 36px; }
.map-sidebar .pin-list { gap: 2px; }
.map-sidebar .pin-row { padding: 7px 8px; gap: 10px; }
.map-sidebar .pin-row .pin-name { font-size: 14.5px; }
.map-sidebar .pin-row .pin-area { font-size: 12px; }

/* Progress sits at the bottom of the panel (Nick, Nov 11, 2026: the
   % found block is less important than filters and the pin list). */
.map-prog-block { border-top: 1px solid var(--line); padding-top: 10px; }


/* Show all / Hide all + search on top, two-column filter grid (Nick's
   reference layout, Nov 11): compact rows, two per line, to save space. */
.map-cat-controls{display:flex;gap:6px;margin-bottom:6px}
.cat-ctl-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:5px 6px;border-radius:8px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.06);color:#efe9ff;font:600 12px/1 "Barlow",sans-serif;letter-spacing:.06em;text-transform:uppercase;cursor:pointer}
.cat-ctl-btn:hover{background:rgba(255,255,255,.12);border-color:rgba(62,198,207,.55)}
.cat-ctl-btn svg{flex:none}
.map-sidebar .map-search{width:100%;box-sizing:border-box;margin:0 0 8px}
.map-sidebar .map-cats{display:grid;grid-template-columns:1fr 1fr;gap:5px;width:100%}
.map-sidebar .cat-row{min-height:38px;padding:5px 8px;gap:7px;border-radius:8px}
.map-sidebar .cat-ico{width:22px;height:22px}
.map-sidebar .cat-ico svg{width:13px;height:13px}
.map-sidebar .cat-name{font-size:12.5px}
.map-sidebar .cat-count{font-size:11px}
/* Landmarks layer controls + map labels/outlines (Nick, Nov 12). */
.map-layers{margin-top:12px}
.layer-label{display:block;font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-soft);margin-bottom:6px}
.layer-toggles{display:flex;gap:8px}
.layer-toggle{flex:1;min-height:38px;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.03);color:var(--ink);font:600 13px/1 inherit;cursor:pointer}
.layer-toggle[aria-pressed="true"]{background:rgba(255,92,138,.18);border-color:var(--pink);color:#fff}
.leaflet-div-icon.area-label{background:transparent;border:none;pointer-events:none}
.area-label span{display:block;transform:translate(-50%,-200%);font-family:"Barlow Condensed",sans-serif;font-weight:700;font-size:15px;letter-spacing:.22em;text-transform:uppercase;color:rgba(253,240,233,.95);text-shadow:0 1px 8px rgba(10,4,18,.95),0 0 3px rgba(10,4,18,.95);white-space:nowrap}
.area-outline{stroke-linejoin:round}
