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

:root {
  --header-height: 56px;
  --blue: #1a56a0;
  --gold: #c8960c;
  --red: #b22234;
  --bg: #0d1b2a;
  --text: #f0f4f8;
  --text-muted: #a0b0c0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: var(--bg);
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.header-flag {
  font-size: 22px;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: var(--text);
}

.header-text p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

@media (min-width: 480px) {
  .header-text h1 { font-size: 18px; }
  .header-text p  { font-size: 12px; }
}

/* Map */
#map {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
}

/* Legend */
.legend {
  background: rgba(13, 27, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.8;
  backdrop-filter: blur(4px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
  margin-top: 2px;
}

.legend-divider {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 6px 0;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.4);
}

.legend-dot.fountain { background: var(--blue); }
.legend-dot.memorial { background: var(--gold); }

.legend-badge {
  width: 24px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid;
}

.legend-badge.rehab    { background: rgba(46,160,67,0.2);   border-color: rgba(46,160,67,0.5); }
.legend-badge.upgrade  { background: rgba(200,150,12,0.2);  border-color: rgba(200,150,12,0.4); }
.legend-badge.resurface{ background: rgba(26,86,160,0.3);   border-color: rgba(26,86,160,0.6); }

.legend-about {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  color: #7ab3f0;
  text-decoration: none;
  text-align: center;
}

.legend-about:hover {
  text-decoration: underline;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  color: var(--text);
  max-width: 260px;
}

.leaflet-popup-tip {
  background: var(--bg);
}

.leaflet-popup-content {
  margin: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
}

.popup-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.popup-type,
.popup-restoration {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.popup-type.fountain {
  background: rgba(26, 86, 160, 0.35);
  color: #7ab3f0;
  border: 1px solid rgba(26, 86, 160, 0.6);
}

.popup-type.memorial {
  background: rgba(200, 150, 12, 0.25);
  color: #f0c040;
  border: 1px solid rgba(200, 150, 12, 0.5);
}

.popup-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.popup-restoration {
  background: rgba(255,255,255,0.07);
  color: #c0d0e0;
  border: 1px solid rgba(255,255,255,0.2);
}

.popup-restoration.restoration-full-rehabilitation {
  background: rgba(46, 160, 67, 0.2);
  color: #7fda9a;
  border-color: rgba(46, 160, 67, 0.5);
}

.popup-restoration.restoration-maintenance---upgrades {
  background: rgba(200, 150, 12, 0.2);
  color: #f0c040;
  border-color: rgba(200, 150, 12, 0.4);
}

.popup-restoration.restoration-major-resurfacing {
  background: rgba(26, 86, 160, 0.3);
  color: #7ab3f0;
  border-color: rgba(26, 86, 160, 0.6);
}

.popup-location {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.popup-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Custom marker icons */
.marker-icon {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.marker-icon.fountain { background: var(--blue); }
.marker-icon.memorial { background: var(--gold); }

.marker-icon-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  font-size: 13px;
}

/* Leaflet attribution tweak */
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(13, 27, 42, 0.8) !important;
  color: var(--text-muted) !important;
}

.leaflet-control-attribution a {
  color: #7ab3f0 !important;
}
