/* ════════════════════════════════════════════════════════════════════
   CANVASS PRO · stormstream.css   (window.StormStream)
   The LIVE STORM STREAM: the real-time hail-size map overlay + the
   streaming "get there first" ticker. The 10x Stretch / headline Pro
   surface. Token-only, exactly like app.css.

   FIELD LANGUAGE: the hail-size color is the only raw-hex value, and it
   NEVER appears here. The JS delivers it per element as style="--c:#…";
   this file only ever reads var(--c). Everything else is a token from
   assets/tokens.css. One ambient motion (the radar sweep), reduced-motion
   gated. No em-dashes anywhere.
   ════════════════════════════════════════════════════════════════════ */

/* ── the live ticker strip · docked bottom-left over the map ─────────
   Mounts into #streamRoot, which the integrator places inside the
   positioned .map-stage frame. The root docks itself over the map; the
   sibling .fieldmap has isolation:isolate, so z-index 640 here sits above
   the Leaflet panes but below the door sheet. The entrance animation lives
   on this persistent root (not the strip): the ticker rebuilds its inner
   markup every few seconds, and a strip-level animation would replay on
   every tick. display:none to shown restarts it once per reveal. */
.stormstream {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 640;
  pointer-events: none;
  animation: ssRise 240ms var(--ease-exit);
}
.stormstream[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .stormstream { animation: none; } }

.ss-strip {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: min(640px, calc(100% - 16px));
  padding: 8px 12px;
  background: color-mix(in srgb, var(--graphite-2) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line-hi);
  border-radius: var(--r-card);
  box-shadow: var(--e3), var(--e-inset);
}
@keyframes ssRise { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── the LIVE / DEMO badge · honest about the provider seam ──────── */
.ss-badge {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--r-chip);
  border: 1px solid var(--line);
}
.ss-badge.ss-live { color: var(--green); background: var(--tint-green); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.ss-badge.ss-demo { color: var(--plat-faint); }
.ss-badge .ss-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ss-badge.ss-live .ss-pulse { animation: ssBeat 1.6s var(--ease) infinite; }
@keyframes ssBeat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ss-badge.ss-live .ss-pulse { animation: none; } }

/* ── a single streaming tick · one-tap route the cell ───────────── */
.ss-tick {
  display: inline-flex; align-items: baseline; gap: 7px; min-width: 0;
  min-height: 38px;
  background: none; border: none; padding: 4px 6px;
  border-radius: var(--r-control);
  color: var(--platinum); font-family: var(--body); font-size: 13.5px;
  text-align: left; cursor: pointer;
  transition: background var(--m-fast) var(--ease), transform var(--m-press) var(--ease-press);
}
.ss-tick:hover { background: var(--tint-hover); }
.ss-tick:focus-visible { outline: none; box-shadow: var(--ring-ember); }
@media (prefers-reduced-motion: no-preference) {
  .ss-tick:not(.ss-quiet):active { transform: translateY(1px) scale(.99); }
}
.ss-tick.ss-quiet { color: var(--plat-faint); cursor: default; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }

.ss-sz {
  font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--c); white-space: nowrap;
}
.ss-where { font-weight: 600; color: var(--platinum); white-space: nowrap; }
.ss-when, .ss-homes { font-size: 11px; color: var(--plat-dim); font-variant-numeric: tabular-nums; }
.ss-dot-sep { color: var(--plat-faint); }
.ss-go {
  margin-left: 4px; font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ember);
  white-space: nowrap;
}
.ss-tick:hover .ss-go { color: var(--ember-hi); }

.ss-meta { flex-shrink: 0; margin-left: auto; }
.ss-stamp { flex-shrink: 0; margin-left: auto; }

/* ── the map overlay glyphs · cell head, size tag, radar sweep ──────
   These render through Leaflet divIcons; the color arrives as --c inline. */

/* the cell head dot · pulses on the active (lead) cell */
.ss-cell .ss-cell-dot {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--obsidian);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 32%, transparent);
}
.ss-cell.ss-lead .ss-cell-dot { animation: ssCellPulse 2s var(--ease) infinite; }
@keyframes ssCellPulse {
  0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 40%, transparent); }
  70% { box-shadow: 0 0 0 11px transparent; }
  100% { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) { .ss-cell.ss-lead .ss-cell-dot { animation: none; } }

/* the crisp hail-size label, e.g. 1.25" / 2.0" */
.ss-tag .ss-tag-l {
  display: inline-block; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: var(--c);
  background: var(--obsidian);
  border: 1px solid var(--c);
  border-radius: var(--r-chip);
  padding: 2px 6px; opacity: .96;
}
@media (prefers-color-scheme: light) { .ss-tag .ss-tag-l { background: var(--graphite-2); } }

/* the ONE permitted ambient motion: a slow radar sweep on the active cell.
   A conic gradient arm rotating once every 4s. Reduced-motion swaps it for
   a static ring so the cell is still legibly "the one to chase". */
.ss-sweep .ss-sweep-arm {
  display: block; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, color-mix(in srgb, var(--c) 30%, transparent) 26deg, transparent 60deg);
  animation: ssSweep 4s linear infinite;
  will-change: transform;
}
@keyframes ssSweep { to { transform: rotate(360deg); } }
/* the CSS fallback is self-sufficient: stopping the animation alone would
   freeze the conic arm as a random wedge, so swap in the static ring here
   too (matches .ss-static below for when the preference flips live) */
@media (prefers-reduced-motion: reduce) {
  .ss-sweep .ss-sweep-arm {
    animation: none;
    background: none;
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  }
}
.ss-sweep.ss-static .ss-sweep-arm {
  background: none;
  animation: none;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}

/* ── the toolbar / storm-finder toggle states (app.js emits .stream-on
      and the .ss-led dot on the live-hail buttons) ──────────────────── */
.btn.stream-on {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line-hi));
  color: var(--green);
}
.btn.stream-on .ss-led {
  display: inline-block; width: 7px; height: 7px; margin-right: 7px;
  border-radius: 50%; background: var(--green); vertical-align: middle;
  animation: ssBeat 1.6s var(--ease) infinite;
}
@media (prefers-reduced-motion: reduce) { .btn.stream-on .ss-led { animation: none; } }

/* ── responsive · the strip never crowds the map on a phone ─────── */
@media (max-width: 640px) {
  .ss-strip { gap: 8px 10px; padding: 7px 10px; }
  .ss-meta, .ss-stamp { width: 100%; margin-left: 0; }
}
