:root {
  --indigo: #0e00a3;
  --yellow: #ffe600;
  --red: #ff0000;
  --ink: #141414;

  --info: #c41212;
  --org: #0e00a3;
  --ballot: #6d28a8;
  --aid: #ff7a00;
  --data: #008577;

  --stage: #3d3a35;
  --art: #c2185b;
  --medic: #ffffff;
  --medic-cross: #d32f2f;
  --restrooms: #7c8a96;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--indigo);
  color: #fff;
  font: 18px/1.4 "Segoe UI", system-ui, sans-serif;
}

header .site-name {
  margin: 0;
  padding: 0.4rem 1.25rem 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow);
}

header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.15rem 1.25rem 0;
}

header .hint {
  margin: 0;
  padding: 0.05rem 1rem 0.35rem;
  text-align: center;
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.25;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.75rem;
  border-radius: 999px;
}

nav a[aria-current="page"] {
  background: var(--yellow);
  color: var(--ink);
}

nav a:hover { color: var(--yellow); }
nav a[aria-current="page"]:hover { color: var(--ink); text-decoration: none; }

.status {
  margin: 0;
  padding: 0.12rem 0.7rem 0.2rem;
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
  color: rgba(255, 255, 255, 0.72);
}

.status.backup { color: var(--yellow); font-weight: 700; }

a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

#map {
  flex: 1;
  background: #cfcbc2;
}

.leaflet-container { font: inherit; }

/* Labels on top of booths: drawn in map units so they scale with zoom, never block taps. */
.labels-pane, .labels-pane * { pointer-events: none; }
.labels text {
  font-family: system-ui, "Segoe UI", sans-serif;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  fill: #fff;
  paint-order: stroke fill;
  stroke: rgba(20, 16, 8, 0.55);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.labels .table-label { font-size: 20px; }
.labels .table-label.big { font-size: 26px; }
.labels .feat-label {
  font-size: 18px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.labels .feat-label.feat-restrooms { font-size: 10px; }
.labels .feat-label.feat-medic {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  fill: var(--medic-cross);
  stroke: var(--medic-cross);
  stroke-width: 7px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--indigo);
  color: #fff;
}

.leaflet-popup-content-wrapper {
  border-radius: 18px;
  box-shadow: inset 5px 0 0 var(--yellow), 0 10px 28px rgba(0, 0, 0, 0.38);
}

.leaflet-popup-tip { box-shadow: none; }

/* Opens under the spot when there is no room above it. The tip moves to the top. */
.leaflet-popup.pop-below {
  margin-bottom: 0;
  margin-top: 20px;
}
.leaflet-popup.pop-below .leaflet-popup-tip-container {
  top: 0;
  margin-top: -20px;
  transform: rotate(180deg);
}

.leaflet-popup-content {
  margin: 0.85rem 1.15rem 0.9rem 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #fff;
}

.leaflet-popup-content h2 {
  margin: 0 0.75rem 0.45rem 0;
  padding-bottom: 0.4rem;
  box-shadow: inset 0 -2px 0 rgba(255, 230, 0, 0.45);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}

.leaflet-popup-content p { margin: 0.35rem 0; }
.pop-desc { color: rgba(255, 255, 255, 0.92); }
.pop-site { margin-bottom: 0.15rem; }
.pop-more { margin-top: 0.15rem; }

.leaflet-popup-content a {
  color: var(--yellow);
  font-weight: 700;
  text-underline-offset: 0.14em;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #fff;
  width: 28px;
  height: 28px;
  font: 20px/28px Tahoma, Verdana, sans-serif;
}

.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
  color: var(--yellow);
}

.pop-meta {
  font-size: 0.8rem;
  color: #fff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 5px;
  flex: none;
}

.legend {
  background: var(--indigo);
  color: #fff;
  border-radius: 16px;
  box-shadow: inset 5px 0 0 var(--yellow), 0 8px 22px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  overflow: hidden;
}

.legend summary {
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
  box-shadow: inset 0 -2px 0 rgba(255, 230, 0, 0.4);
}

.legend ul {
  list-style: none;
  margin: 0;
  padding: 0 0.75rem 0.55rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.2rem 0;
}

/* Spot colors: one variable per category or feature, used by the map shapes and the legend chips.
   Map shapes are SVG (fill/stroke); chips are HTML (background). */
.cat-info { --c: var(--info); }
.cat-org { --c: var(--org); }
.cat-ballot { --c: var(--ballot); }
.cat-aid { --c: var(--aid); }
.cat-data { --c: var(--data); }
.feat-stage { --c: var(--stage); }
.feat-art { --c: var(--art); }
.feat-aid { --c: var(--aid); }
.feat-medic { --c: var(--medic); --edge: var(--medic-cross); }
.feat-restrooms { --c: var(--restrooms); }

.chip { background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(255, 250, 243, 0.92); }
.chip.feat-medic { border: 2px solid var(--edge); box-shadow: none; }

/* Map shapes. Leaflet writes its own default colors as SVG attributes; these rules override them. */
path.booth, path.feature {
  fill: var(--c);
  fill-opacity: 1;
  stroke: #fffaf3;
  stroke-opacity: 1;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 1.5px 0 rgba(28, 22, 12, 0.4));
}
path.feature { stroke: var(--yellow); stroke-width: 3.5; }
path.feat-medic { stroke: var(--edge); stroke-width: 2.5; }
/* The City Hall arrow is already drawn. This spot only catches the tap. */
path.feature.feat-speakers {
  fill: transparent;
  stroke: none;
  filter: none;
  pointer-events: all;
}

.leaflet-control-attribution {
  font-size: 10px;
  line-height: 1.2;
  padding: 0 4px 1px;
  max-width: 14em;
}
@media (max-width: 700px) {
  .leaflet-bottom.leaflet-left .legend { margin-bottom: 2.6rem; }
}
