:root {
  --bg: #0e1014;
  --panel: rgba(14, 16, 20, 0.78);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: #f2f1ec;
  --muted: rgba(242, 241, 236, 0.58);
  --bus: #3ec6c9;
  --trolley: #e85d8a;
  --marsh: #e7c15a;
  --fly: #c8f17a;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

#map, #overlay {
  position: fixed;
  inset: 0;
}

#overlay {
  z-index: 500;
  pointer-events: none;
}

.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(0.35) brightness(0.88);
}

.leaflet-control-attribution {
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 11px !important;
}

.leaflet-attribution-flag,
.leaflet-control-attribution svg {
  display: none !important;
}

.hud {
  position: fixed;
  z-index: 600;
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.hud-top {
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  pointer-events: none;
}

.hud-top .toggles,
.hud-top .day-pick { pointer-events: auto; }

.day-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.day-pick select {
  appearance: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  max-width: 220px;
}

.mood {
  font-size: 14px;
  color: var(--fly);
  margin-bottom: 6px;
}

.kicker {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1 {
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.sub { color: var(--muted); margin-top: 2px; }

.toggles { display: flex; gap: 6px; }

.toggle {
  appearance: none;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 100ms ease-out, background 160ms var(--ease), color 160ms var(--ease);
}

.toggle:active { transform: scale(0.97); }
a.toggle { text-decoration: none; display: inline-block; }
.toggle.is-on {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.hud-brain {
  top: 118px;
  left: 16px;
  width: 268px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  display: grid;
  gap: 8px;
  pointer-events: auto;
}

#brain {
  width: 100%;
  height: 210px;
  display: block;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  cursor: grab;
  touch-action: none;
}

#brain:active { cursor: grabbing; }

.brain-legend {
  list-style: none;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.hud-side {
  top: 118px;
  right: 16px;
  width: 280px;
  padding: 16px;
  border-radius: 16px;
  display: grid;
  gap: 18px;
}

.hud-brain h2,
.hud-side h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.stats { list-style: none; display: grid; gap: 6px; color: var(--text); }
.stats span { font-variant-numeric: tabular-nums; margin-right: 6px; }
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.dot.bus { background: var(--bus); }
.dot.trolley { background: var(--trolley); }
.dot.marsh { background: var(--marsh); }

.lead {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.hint { color: var(--muted); font-size: 12px; }

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 6px;
}

input[type="range"] {
  width: 100%;
  accent-color: #d9d4c7;
}

.meter { margin-top: 10px; font-size: 12px; color: var(--muted); }
.bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: 6px;
}
.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--fly);
  transform-origin: left center;
}
.bar.jump i { background: var(--trolley); }

.jump-msg {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fly);
}

.hud-bottom {
  left: 16px;
  right: 312px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
}

.play {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f2f1ec;
  color: #111;
  cursor: pointer;
  font-size: 13px;
  transition: transform 100ms ease-out;
}
.play:active { transform: scale(0.96); }

#timeline { flex: 1; }
#clock {
  font-variant-numeric: tabular-nums;
  min-width: 72px;
  text-align: right;
}

.speed { color: var(--muted); font-size: 13px; }
.speed select {
  background: transparent;
  color: var(--text);
  border: 0;
  font: inherit;
}

.osm-credit {
  color: var(--muted);
  font-size: 11px;
  margin-left: 4px;
}

.leaflet-control-attribution {
  display: none !important;
}

#status {
  position: fixed;
  z-index: 700;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
}

@media (max-width: 720px) {
  .hud-side { display: none; }
  .hud-brain {
    top: 108px;
    width: 168px;
    padding: 10px;
  }
  #brain { height: 120px; }
  .hud-brain .hint,
  .brain-legend { display: none; }
  .hud-bottom { right: 16px; }
  h1 { font-size: 18px; }
}
