/* mapshelters.css — the storm shelter layer's paint (2026-08-23).
   TOKEN-ONLY like map.css: every colour is a theme token, so the layer reads
   correctly on every owner's palette. The two hex values in mapshelters.js
   are SVG-attribute fallbacks; these rules outrank presentation attributes
   by the cascade, so the tokens always win where the sheet is loaded. */

/* the zone polygons (Leaflet SVG paths carry the class) */
.shelter-zone {
  stroke: var(--ok);
  fill: var(--ok);
  stroke-dasharray: 5 4;
  transition: fill-opacity .4s ease;
}
body.storm-live .shelter-zone {
  stroke-dasharray: none;
  fill-opacity: .24;
  animation: shelter-pulse 2.2s ease-in-out infinite;
}
@keyframes shelter-pulse {
  0%, 100% { stroke-width: 1.6; stroke-opacity: .9; }
  50%      { stroke-width: 3;   stroke-opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body.storm-live .shelter-zone { animation: none; }
}

/* the legend swatch (the POI rows paint theirs inline from config colours;
   the shelter row is theme-owned, so its swatch is a token too) */
.legend-swatch-shelter { --c: var(--ok); }

/* (2026-10-31) the owner's weather areas (the Owner Hub's "Show storms on
   players' map"): a calm fill under the shelters, no outline */
.weather-area {
  stroke: none;
  fill: var(--accent, #7aa2ff);
  fill-opacity: .14;
}
.legend-swatch-wxarea { --c: var(--accent, #7aa2ff); }

/* the storm card in the layer panel */
.storm-card {
  margin-top: .6rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--r-s, 8px);
  background: var(--surface);
}
.storm-card .storm-head {
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .02em;
  color: var(--fg);
}
.storm-card .panel-note { margin: .25rem 0 0; }
.storm-card[data-state="warn"]   { border-color: var(--warn); }
.storm-card[data-state="warn"] .storm-head   { color: var(--warn); }
.storm-card[data-state="active"] { border-color: var(--bad); }
.storm-card[data-state="active"] .storm-head { color: var(--bad); }
.storm-card[data-state="warn"],
.storm-card[data-state="active"] { animation: storm-card-breathe 2.4s ease-in-out infinite; }
@keyframes storm-card-breathe {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: 0 0 14px -6px currentColor; }
}
@media (prefers-reduced-motion: reduce) {
  .storm-card[data-state="warn"],
  .storm-card[data-state="active"] { animation: none; }
}

/* the "you" line under the players note */
#storm-you[data-state="in"]  { color: var(--ok); }
#storm-you[data-state="out"] { color: var(--fg-dim); }

/* THE WASH: the whole tile pane takes the storm's cast while one is live.
   Filter on the TILE PANE only — pins, zones and labels stay full-contrast
   above it, which is exactly the read we want: the world dims, the safety
   layer does not. Cheap: one composited filter, no repaint per frame. */
body.storm-sand .leaflet-tile-pane {
  filter: sepia(.55) saturate(1.15) brightness(.9) contrast(1.05);
}
body.storm-snow .leaflet-tile-pane {
  filter: saturate(.45) brightness(1.08) contrast(.95);
}
