:root {
  --fons: #0d0d12;
  --panell: rgba(18, 18, 26, .92);
  --vora: #2a2a38;
  --text: #e8e8f0;
  --suau: #9a9ab0;
  --viu: #3ddc84;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fons); color: var(--text);
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#map { position: fixed; inset: 0; background: var(--fons); }

#hud { position: fixed; top: 10px; left: 10px; z-index: 1000; display: flex; align-items: flex-start;
  max-width: calc(100vw - 20px); }
#hud-toggle { background: var(--panell); color: var(--text); border: 1px solid var(--vora); border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; margin-right: 6px; flex: none; }
#hud-body { background: var(--panell); border: 1px solid var(--vora); border-radius: 10px; padding: 10px 12px;
  width: 250px; max-height: calc(100vh - 60px); overflow-y: auto; }
#hud.tancat #hud-body { display: none; }
.titulo { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.marca { font-weight: 800; letter-spacing: .08em; font-size: 18px; }
.sub-marca { color: var(--suau); font-size: 12px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--viu); display: inline-block;
  box-shadow: 0 0 6px var(--viu); align-self: center; }
.dot-live.vell { background: #e0a030; box-shadow: 0 0 6px #e0a030; }
#stats { color: var(--suau); font-size: 12px; margin-bottom: 6px; }
#avis { background: #3a2a10; color: #f0c070; border-radius: 6px; padding: 4px 6px; font-size: 12px; margin-bottom: 6px; }
.tog { display: block; font-size: 13px; margin: 3px 0; cursor: pointer; }
#parades-hint { color: var(--suau); font-size: 11px; margin: -2px 0 4px 22px; }
.ley-tit { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-weight: 600; }
.ley-tit button { background: none; border: 1px solid var(--vora); color: var(--text); border-radius: 6px;
  font-size: 11px; padding: 1px 6px; cursor: pointer; }
#ley-hint { color: var(--suau); font-size: 11px; margin-bottom: 4px; }
#leyenda { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; min-width: 34px; text-align: center; border-radius: 4px; padding: 1px 5px;
  font-weight: 700; font-size: 12px; cursor: pointer; user-select: none; }
.chip.off { opacity: .25; }
.chip .n { font-weight: 400; opacity: .85; margin-left: 3px; }
.chip.sense { text-decoration: line-through; opacity: .55; }
.chip.sense.off { opacity: .2; }
#ley-nota { color: var(--suau); font-size: 11px; margin-top: 4px; }

#font { position: fixed; right: 6px; bottom: 4px; z-index: 1000; font-size: 11px; color: var(--suau);
  background: var(--panell); border-radius: 6px; padding: 2px 7px; }
#font a { color: var(--text); }
.leaflet-bottom.leaflet-right { margin-bottom: 22px; }   /* que el peu no tape el zoom */

/* trens */
.tren { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 4px rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; }
.tren i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-bottom: 6px solid #fff; transform-origin: 50% 60%; }
.tren.quiet i { display: none; }
.tren.quiet { width: 12px; height: 12px; }

/* popups */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #16161f; color: var(--text); border: 1px solid var(--vora); }
.leaflet-popup-content { margin: 10px 12px; min-width: 200px; }
.pop-tit { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pop-sub { color: var(--suau); font-size: 12px; margin-bottom: 6px; }
.fila { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.fila .desti { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .min { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.fila .min small { color: var(--suau); }
.buit { color: var(--suau); font-style: italic; }
.leaflet-container a.leaflet-popup-close-button { color: var(--suau); }

@media (max-width: 600px) {
  #hud-body { width: 210px; }
}
