/* Whips HUD pieces: frames, stat bars, chips. Plain CSS, no images.
   They read two tokens, so they match whichever palette the page uses:
   --hud-accent (falls back to the Whips --hazard yellow, then --accent) and --hud-line (falls back to --rule). */
.hud-frame {
  --a: var(--hud-accent, var(--hazard, var(--accent, #ffc400)));
  --l: var(--hud-line, var(--rule, #3a3f44));
  --c: 14px; /* corner size */
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--l);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  background:
    linear-gradient(var(--a), var(--a)) top left / 28px 2px no-repeat,
    linear-gradient(var(--a), var(--a)) top left / 2px 28px no-repeat,
    linear-gradient(var(--a), var(--a)) bottom right / 28px 2px no-repeat,
    linear-gradient(var(--a), var(--a)) bottom right / 2px 28px no-repeat;
}
.hud-frame > .hud-label {
  display: block;
  margin: -6px 0 12px;
  font: 600 11px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .12em; text-transform: uppercase; color: var(--a);
}

/* Hazard stripe for warnings and recall panels. */
.hud-hazard {
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--hud-accent, var(--hazard, var(--accent, #ffc400))) 0 8px, transparent 8px 16px);
}

/* Stat bar: <div class="stat" style="--value:72; --delta:6"><span>Handling</span><b>72</b></div>
   --delta is the change from a mod (negative is fine); it draws as a lighter extension or a cut-out. */
.stat {
  --a: var(--hud-accent, var(--hazard, var(--accent, #ffc400)));
  display: grid; grid-template-columns: 10ch 1fr 3ch; align-items: center; gap: 10px;
  font: 500 12px/1 var(--font-mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .08em;
}
.stat::after {
  content: ""; grid-column: 2; grid-row: 1; height: 10px;
  background:
    linear-gradient(90deg, var(--a) calc(var(--value) * 1%), transparent 0),
    repeating-linear-gradient(90deg, var(--hud-line, var(--rule, #3a3f44)) 0 calc(10% - 2px), transparent 0 10%);
  transition: background .25s ease;
}
.stat > b { grid-column: 3; text-align: right; font-weight: 600; }
.stat[style*="--delta"] > b::after { content: ""; }
.stat .delta-up { color: var(--hud-good, #5fc27a); }
.stat .delta-down { color: var(--hud-bad, #e2645a); }

/* Chip for categories and filters. */
.hud-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--hud-line, var(--rule, #3a3f44));
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  font: 500 12px/1 var(--font-mono, ui-monospace, monospace); text-transform: uppercase; letter-spacing: .08em;
}
.hud-chip[aria-pressed="true"] { border-color: var(--hud-accent, var(--hazard, var(--accent, #ffc400))); color: var(--hud-accent, var(--hazard, var(--accent, #ffc400))); }
.icon { width: 20px; height: 20px; flex: none; }

@media (prefers-reduced-motion: reduce) { .stat::after { transition: none; } }
