/* ═══════════════════════════════════════════════════════════════════════════
   Z3STATUS — the one status language of the platform (26.10.2026)
   ═══════════════════════════════════════════════════════════════════════════

   WHY. Until now "is it up?" was answered with text dots (● ○ ◌), raw emoji
   (🔴 🟢 ⚪) and a dozen differently-styled LEDs. Three vocabularies for one
   question, and on a phone the glyphs sat on the baseline at the wrong size.
   This file is the single answer:

     on        green   — it is up / connected / active
     warn      amber   — coming up, waiting for a decision, degraded
     off       red     — down / blocked / inactive
     unknown   grey    — nobody has told us yet (the old "white dot")

   Two shapes, both inline SVG from lib/status.php:

     z3_status_icon()   a bare badge — for table cells, player heads, chips
     z3_status_pill()   badge + word inside a tinted pill — for lists

   The legacy LED classes (.status-led, .el-led, .elw-led, .oled-dot,
   .crn-dot, .sys-dot, .mm-dot, .map-dot, .rec-dot, .audio-dock-led) keep
   their names — every script that toggles them keeps working — and get the
   same bezel + gloss here, so one CSS import modernises all of them.

   Loaded AFTER the theme deliberately: the themes set flat `background` on
   those LEDs, and this file only adds a bezel ring, gloss and glow, so the
   theme's colour still decides and only the finish changes.
   ═══════════════════════════════════════════════════════════════════════════ */

:root{
  --z3st-on:#2fe08a;
  --z3st-warn:#f0a83c;
  --z3st-off:#ff5f5f;
  --z3st-unk:#93a8a2;
}

/* ---------- the badge ---------- */
.z3st{
  --c:var(--z3st-unk);
  --bg:rgba(147,168,162,.14);
  --glow:rgba(147,168,162,.30);
  display:inline-flex;align-items:center;gap:.4em;
  vertical-align:-.22em;line-height:1;font:inherit;white-space:nowrap;
}
.z3st-b{
  width:1.32em;height:1.32em;flex:none;
  display:inline-grid;place-items:center;border-radius:50%;
  border:1.5px solid var(--c);
  background:var(--bg);
  box-shadow:0 0 0 1px rgba(0,0,0,.45), 0 0 8px var(--glow),
             inset 0 0 5px var(--glow);
  color:var(--c);
  transition:border-color .2s, color .2s, box-shadow .2s;
}
.z3st-b svg{width:74%;height:74%;display:block;overflow:visible}
.z3st-t{font-weight:600;color:var(--c);letter-spacing:.01em}
.z3st-lg{font-size:1.06rem}
.z3st-lg .z3st-b{width:1.5em}

.z3st-on {--c:var(--z3st-on);  --bg:rgba(47,224,138,.15); --glow:rgba(47,224,138,.38)}
.z3st-warn{--c:var(--z3st-warn);--bg:rgba(240,168,60,.15); --glow:rgba(240,168,60,.34)}
.z3st-off {--c:var(--z3st-off); --bg:rgba(255,95,95,.14);  --glow:rgba(255,95,95,.34)}
.z3st-unk {--c:var(--z3st-unk); --bg:rgba(147,168,162,.12);--glow:rgba(147,168,162,.22)}
/* transmitting: amber, and it breathes — the one state that is an event.
   19.11.2026 — it was red, the same red as "offline"; the owner's rule is
   online green · offline red · TX amber · RX red on every LED. */
.z3st-tx  {--c:var(--z3st-warn); --bg:rgba(240,168,60,.18); --glow:rgba(240,168,60,.50)}
.z3st-tx .z3st-b{animation:z3st-breathe 1.4s ease-in-out infinite}

/* a live indicator breathes; a dead one is still */
.z3st-warn .z3st-b{animation:z3st-breathe 1.9s ease-in-out infinite}
.z3st-on.is-live .z3st-b{animation:z3st-breathe 2.6s ease-in-out infinite}
@keyframes z3st-breathe{
  0%,100%{box-shadow:0 0 0 1px rgba(0,0,0,.45),0 0 6px var(--glow),inset 0 0 5px var(--glow)}
  50%    {box-shadow:0 0 0 1px rgba(0,0,0,.45),0 0 13px var(--glow),inset 0 0 7px var(--glow)}
}

/* the pill form — the same badge, on a tinted background */
.z3st-pill{
  padding:.16em .55em .16em .3em;border-radius:999px;
  border:1px solid var(--c);background:var(--bg);
  font-size:.78rem;font-weight:600;letter-spacing:.02em;
}
.z3st-pill .z3st-b{width:1.1em;height:1.1em;border-width:0;background:transparent;
  box-shadow:none;box-shadow:none}
.z3st-pill .z3st-b svg{width:100%;height:100%}
.z3st-pill.z3st-unk{border-style:dashed}

/* ---------- legacy LEDs get the same bezel and gloss ---------- */
.status-led,.el-led,.elw-led,.oled-dot,.crn-dot,.sys-dot,.mm-dot,.map-dot,
.rec-dot,.audio-dock-led,.op-tx-dot,.ptt-local-dot,.imp-dot{
  background-image:radial-gradient(circle at 34% 28%,
    rgba(255,255,255,.55), rgba(255,255,255,0) 58%) !important;
  box-shadow:0 0 0 1.5px rgba(255,255,255,.17),
             0 0 0 3px rgba(0,0,0,.30),
             0 0 9px rgba(0,0,0,.35) !important;
}
/* an LED that is lit glows in its own colour: the classes that already carry a
   state keep painting `background`, so the glow is added, never replaced */
.status-led.online,.el-led.on,.elw-led.on,
.oled-dot.on,.crn-dot-ok,.mm-dot,.map-dot{
  box-shadow:0 0 0 1.5px rgba(255,255,255,.20),
             0 0 0 3px rgba(0,0,0,.28),
             0 0 11px var(--z3st-on) !important;
}
.status-led.rx,.status-led.off,.crn-dot-err,.el-led.tx,.elw-led.err{
  box-shadow:0 0 0 1.5px rgba(255,255,255,.20),
             0 0 0 3px rgba(0,0,0,.28),
             0 0 11px var(--z3st-off) !important;
}
.status-led.tx{
  box-shadow:0 0 0 1.5px rgba(255,255,255,.20),
             0 0 0 3px rgba(0,0,0,.28),
             0 0 11px var(--z3st-warn) !important;
}
.status-led.connecting,.el-led.connecting,.elw-led.connecting,.oled-dot.warn{
  box-shadow:0 0 0 1.5px rgba(255,255,255,.20),
             0 0 0 3px rgba(0,0,0,.28),
             0 0 11px var(--z3st-warn) !important;
}

/* phones: one step larger, because a 6px dot is not a status there */
@media (max-width:560px){
  .z3st-b{width:1.45em;height:1.45em}
  .status-led,.el-led,.elw-led,.oled-dot,.crn-dot,.sys-dot,.mm-dot,.map-dot{
    min-width:8px;min-height:8px;
  }
}
@media (prefers-reduced-motion:reduce){
  .z3st-b{animation:none !important}
}
