/* ============ Slash Angeles ============ */
:root {
  --ink: #0c0a09;
  --panel: #16120f;
  --panel-2: #1e1815;
  --edge: #372a22;
  --blood: #c8102e;
  --blood-hot: #ff2e44;
  --gold: #d9a441;
  --gold-dim: #9c7930;
  --bone: #e8ddc9;
  --smoke: #a99f8c;
  --ash: #6e6557;
  --font-display: 'Metal Mania', cursive;
  --font-ui: 'Oswald', sans-serif;
  --font-type: 'Special Elite', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-ui);
  overflow: hidden;
}

/* ---------- Top bar ---------- */
#topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background:
    linear-gradient(180deg, rgba(200,16,46,.08), rgba(0,0,0,0) 55%),
    var(--panel);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 2px 14px rgba(0,0,0,.7);
  position: relative;
  z-index: 1200;
}
#topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blood) 30%, var(--gold) 50%, var(--blood) 70%, transparent);
  opacity: .65;
}

#sidebar-toggle {
  background: none;
  border: 1px solid var(--edge);
  color: var(--gold);
  font-size: 18px;
  width: 38px; height: 38px;
  border-radius: 4px;
  cursor: pointer;
  flex: 0 0 auto;
}
#sidebar-toggle:hover { border-color: var(--gold-dim); }

.brand h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--bone);
  text-shadow: 0 0 18px rgba(200,16,46,.55), 2px 2px 0 #000;
  white-space: nowrap;
}
.brand h1 .amp { color: var(--blood-hot); text-shadow: 0 0 14px rgba(255,46,68,.9); }
.brand .tagline {
  font-family: var(--font-type);
  font-size: 11px;
  color: var(--smoke);
  letter-spacing: .4px;
  margin-top: 2px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.stat-num { font-size: 20px; font-weight: 600; color: var(--gold); }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--ash); }

#random-btn, #about-btn {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: var(--bone);
  background: linear-gradient(180deg, #2a1013, #1c0b0d);
  border: 1px solid #59202a;
  border-radius: 4px;
  padding: 9px 14px;
  cursor: pointer;
  transition: all .15s;
}
#random-btn:hover, #about-btn:hover {
  border-color: var(--blood);
  color: #fff;
  box-shadow: 0 0 12px rgba(200,16,46,.4);
}
#about-btn { width: 38px; padding: 9px 0; text-align: center; font-weight: 600; }

/* ---------- Layout ---------- */
#layout {
  display: flex;
  height: calc(100% - 64px);
  position: relative;
}

/* ---------- Sidebar ---------- */
#sidebar {
  width: 360px;
  flex: 0 0 auto;
  background: var(--panel);
  border-right: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  z-index: 1100;
  transition: margin-left .25s ease;
}
#sidebar.collapsed { margin-left: -360px; }

.sidebar-controls {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

#search {
  width: 100%;
  background: #0e0b09;
  border: 1px solid var(--edge);
  border-radius: 4px;
  color: var(--bone);
  font-family: var(--font-type);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
}
#search::placeholder { color: var(--ash); }
#search:focus { border-color: var(--gold-dim); box-shadow: 0 0 8px rgba(217,164,65,.25); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: #0e0b09;
  color: var(--smoke);
  cursor: pointer;
  user-select: none;
  transition: all .12s;
}
.chip .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--ash));
  box-shadow: 0 0 6px var(--dot, transparent);
}
.chip .n { color: var(--ash); font-size: 10px; }
.chip:hover { border-color: var(--gold-dim); color: var(--bone); }
.chip.active {
  color: var(--bone);
  border-color: var(--dot, var(--gold));
  background: #1a1310;
  box-shadow: inset 0 0 10px rgba(0,0,0,.6), 0 0 8px color-mix(in srgb, var(--dot, var(--gold)) 35%, transparent);
}

.chapter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.chapter-row label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ash);
}
#chapter-select {
  flex: 1;
  background: #0e0b09;
  color: var(--bone);
  border: 1px solid var(--edge);
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 7px 8px;
  outline: none;
}
#chapter-select:focus { border-color: var(--gold-dim); }

.result-count {
  margin-top: 10px;
  font-family: var(--font-type);
  font-size: 11px;
  color: var(--ash);
}
.result-count b { color: var(--gold); font-weight: 400; }

/* ---------- Location list ---------- */
#loc-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
#loc-list li {
  padding: 11px 14px;
  border-bottom: 1px solid #211a15;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: baseline;
  transition: background .1s;
}
#loc-list li:hover { background: #1d1612; }
#loc-list li.selected {
  background: linear-gradient(90deg, rgba(200,16,46,.18), transparent);
  border-left: 3px solid var(--blood);
  padding-left: 11px;
}
#loc-list .dot {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--dot, var(--ash));
  align-self: center;
  box-shadow: 0 0 5px var(--dot, transparent);
}
#loc-list .dot.approx {
  box-shadow: none;
  background: radial-gradient(circle,
    var(--dot, var(--ash)) 0 2px,
    rgba(10, 8, 7, .9) 2px 2.75px,
    color-mix(in srgb, var(--dot, var(--ash)) 35%, transparent) 2.75px 4.5px,
    transparent 5px);
}
#loc-list .li-main { flex: 1; min-width: 0; }
#loc-list .li-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--bone);
  letter-spacing: .3px;
}
#loc-list .li-sub {
  font-size: 11px;
  color: var(--ash);
  margin-top: 2px;
  font-family: var(--font-type);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#loc-list .li-count {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--gold-dim);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 1px 7px;
  align-self: center;
}
.empty-msg {
  padding: 30px 20px;
  text-align: center;
  font-family: var(--font-type);
  color: var(--ash);
  font-size: 13px;
}

/* ---------- Map ---------- */
#map-wrap { flex: 1; position: relative; }
#map { width: 100%; height: 100%; background: #0a0a0a; }
#map .leaflet-tile-pane {
  filter: grayscale(1) invert(1) brightness(.78) contrast(1.25) sepia(.12);
}
#map-grit {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 800;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
}

#map-legend {
  pointer-events: none;
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-type);
  font-size: 10.5px;
  letter-spacing: .5px;
  color: var(--smoke);
  background: rgba(12, 10, 9, .8);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 5px 10px;
}
#map-legend .lg-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
}
#map-legend .lg-dot.approx { margin-left: 8px; }
#map-legend .lg-dot.exact {
  width: 10px;
  height: 10px;
  background: var(--bone);
  border: 2px solid rgba(0, 0, 0, .85);
  box-shadow: 0 0 6px var(--bone);
}
#map-legend .lg-dot.approx {
  background: radial-gradient(circle,
    var(--bone) 0 2.5px,
    rgba(10, 8, 7, .9) 2.5px 3.25px,
    color-mix(in srgb, var(--bone) 35%, transparent) 3.25px 6px,
    transparent 6.5px);
}

.leaflet-container { font-family: var(--font-ui); }
.leaflet-control-attribution {
  background: rgba(12,10,9,.8) !important;
  color: var(--ash) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--gold-dim) !important; }
.leaflet-control-zoom a {
  background: var(--panel) !important;
  color: var(--gold) !important;
  border-color: var(--edge) !important;
}
.leaflet-control-zoom a:hover { background: var(--panel-2) !important; }

/* markers */
.pin {
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.85);
  box-shadow: 0 0 8px var(--pc), 0 1px 4px rgba(0,0,0,.8);
  background: var(--pc);
  width: 100%; height: 100%;
}
/* Approximate spots: solid core with a soft halo suggesting an area,
   instead of a hard pin claiming a precise address. */
.pin.approx {
  border: none;
  box-shadow: none;
  background: radial-gradient(circle,
    var(--pc) 0 3.5px,
    rgba(10, 8, 7, .9) 3.5px 4.5px,
    color-mix(in srgb, var(--pc) 34%, transparent) 4.5px 8.5px,
    color-mix(in srgb, var(--pc) 14%, transparent) 8.5px 10.5px,
    transparent 11px);
}
.pin-wrap.selected .pin {
  animation: pulse 1.4s ease-out infinite;
  border-color: #fff;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc) 70%, transparent), 0 0 8px var(--pc); }
  70%  { box-shadow: 0 0 0 14px transparent, 0 0 8px var(--pc); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 8px var(--pc); }
}

.leaflet-tooltip.slash-tip {
  background: #14100d;
  border: 1px solid var(--gold-dim);
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .5px;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,.8);
  padding: 5px 9px;
}
.leaflet-tooltip.slash-tip::before { display: none; }
.leaflet-tooltip.slash-tip.pinned {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,.85), 0 0 10px rgba(217,164,65,.35);
}
.slash-tip .tip-type {
  display: block;
  font-family: var(--font-type);
  font-size: 9px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ---------- Detail panel ---------- */
#detail {
  flex: 0 0 auto;
  width: 440px;
  background:
    linear-gradient(180deg, rgba(200,16,46,.05), transparent 200px),
    var(--panel);
  border-left: 1px solid var(--edge);
  box-shadow: -8px 0 30px rgba(0,0,0,.7);
  z-index: 1150;
  overflow-y: auto;
  margin-right: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--edge) transparent;
}
/* No transition on desktop: the panel changes the map's layout size, and
   centering math needs that size to update synchronously. */
#detail.hidden {
  margin-right: -440px;
  visibility: hidden;
}

#detail-grab { display: none; }

#detail-close {
  position: sticky;
  top: 10px;
  margin-left: calc(100% - 46px);
  width: 34px; height: 34px;
  background: rgba(12,10,9,.85);
  border: 1px solid var(--edge);
  border-radius: 50%;
  color: var(--smoke);
  font-size: 14px;
  cursor: pointer;
  z-index: 5;
}
#detail-close:hover { color: var(--blood-hot); border-color: var(--blood); }

#detail-body { padding: 0 24px 40px; margin-top: -24px; }

.d-kicker {
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cat-c, var(--gold));
  display: flex;
  align-items: center;
  gap: 8px;
}
.d-kicker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cat-c, var(--gold)); box-shadow: 0 0 6px var(--cat-c, transparent); }
.d-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  margin: 8px 0 4px;
  color: var(--bone);
  text-shadow: 2px 2px 0 #000;
}
.d-date {
  font-family: var(--font-type);
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 12px;
}
.d-address {
  font-size: 12px;
  color: var(--smoke);
  border-left: 2px solid var(--edge);
  padding-left: 10px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.d-address .approx-note { color: var(--ash); font-family: var(--font-type); font-size: 11px; }

.d-synopsis { font-size: 15px; line-height: 1.55; font-weight: 300; color: var(--bone); margin-bottom: 14px; }

.d-section-h {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--blood-hot);
  margin: 22px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--edge);
}
.d-stories { list-style: none; }
.d-stories li {
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--bone);
  padding: 6px 0 6px 18px;
  position: relative;
}
.d-stories li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--gold);
}

.quote {
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--blood);
  border-radius: 3px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.quote p {
  font-family: var(--font-type);
  font-size: 13px;
  line-height: 1.65;
  color: var(--bone);
}
.quote p::before { content: "“"; color: var(--blood-hot); }
.quote p::after { content: "”"; color: var(--blood-hot); }
.quote .q-meta {
  margin-top: 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ash);
}
.quote .q-meta b { color: var(--gold-dim); font-weight: 500; }

.d-meta { margin-top: 22px; font-size: 12px; color: var(--smoke); line-height: 1.7; }
.d-meta .badge {
  display: inline-block;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px 4px 2px 0;
}
.d-meta .row { margin-bottom: 6px; }
.d-meta .lbl { color: var(--ash); text-transform: uppercase; font-size: 10px; letter-spacing: 1.5px; }
.d-sources a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-dim); }
.d-sources a:hover { color: var(--blood-hot); }
.d-sources li { font-size: 12px; margin: 4px 0 4px 16px; color: var(--smoke); }

/* ---------- About modal ---------- */
#about-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#about-modal.hidden { display: none; }
.about-card {
  position: relative;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-top: 3px solid var(--blood);
  border-radius: 6px;
  padding: 28px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.9);
}
.about-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  color: var(--bone);
  margin-bottom: 12px;
}
.about-card p { font-size: 13.5px; font-weight: 300; line-height: 1.6; color: var(--smoke); margin-bottom: 10px; }
.about-card p b { color: var(--gold); font-weight: 500; }
#about-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: 1px solid var(--edge);
  border-radius: 50%;
  width: 30px; height: 30px;
  color: var(--smoke);
  cursor: pointer;
}
#about-close:hover { color: var(--blood-hot); border-color: var(--blood); }

/* ---------- Scrollbars (WebKit) ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .brand h1 { font-size: 24px; }
  .brand .tagline { display: none; }
  .stat { display: none; }
  #random-btn { font-size: 14px; padding: 8px 11px; }
  #random-btn .dice-txt { display: none; }
  #sidebar {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: min(340px, 86vw);
    box-shadow: 8px 0 30px rgba(0,0,0,.7);
  }
  #sidebar.collapsed { margin-left: min(-340px, -86vw); }
  /* On small screens the detail panel is a bottom sheet: the map stays
     visible above it, and the sheet can be expanded or swiped away. */
  #detail {
    position: absolute;
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 46vh;
    height: 46dvh;
    margin-right: 0;
    border-left: none;
    border-top: 1px solid var(--gold-dim);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 32px rgba(0,0,0,.8);
    transform: translateY(0);
    transition: transform .25s ease, height .2s ease, visibility 0s linear 0s;
  }
  #detail.expanded { height: 88vh; height: 88dvh; }
  #detail.hidden {
    margin-right: 0;
    transform: translateY(110%);
    visibility: hidden;
    transition: transform .25s ease, height .2s ease, visibility 0s linear .25s;
  }
  #detail-grab {
    display: block;
    position: sticky;
    top: 0;
    z-index: 6;
    padding: 10px 0 8px;
    background: linear-gradient(180deg, var(--panel) 65%, transparent);
    cursor: grab;
    touch-action: none;
  }
  #detail-grab::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--gold-dim);
    opacity: .6;
  }
  #detail-close { top: 6px; width: 30px; height: 30px; }
  #detail-body { margin-top: -28px; padding: 0 18px 40px; }
}
