/* Base tweaks not easily expressed via Tailwind utility classes alone */

html {
  color-scheme: dark;
}

body {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------- */
/* Background: faint HUD grid + radial vignette                            */
/* ---------------------------------------------------------------------- */

.hud-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 50% 20%, rgba(34, 211, 238, 0.08), transparent 60%),
    linear-gradient(rgba(34, 211, 238, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.06) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}

/* ---------------------------------------------------------------------- */
/* HUD panel chrome: glowing border + corner brackets                      */
/* ---------------------------------------------------------------------- */

.hud-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(11, 21, 38, 0.9), rgba(8, 14, 26, 0.9));
  border: 1px solid #173049;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #22D3EE;
  opacity: 0.85;
  pointer-events: none;
}
.hud-corner.tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.hud-corner.tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.hud-corner.bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.hud-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.hud-panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7FDBF5;
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.35);
}

.hud-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  background: linear-gradient(180deg, #EAFBFF 0%, #67D9F3 60%, #1B9FC4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}

.hud-hero-number {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #EAFBFF;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.55), 0 0 2px rgba(255, 255, 255, 0.6);
  line-height: 1.1;
}

.hud-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6E8CA6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.hud-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 2px;
  background: #0A1220;
  border: 1px solid #173049;
  color: #DCEFFB;
  font-size: 14px;
}
.hud-input:focus {
  outline: none;
  border-color: #22D3EE;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35);
}
.hud-input::placeholder {
  color: #47607A;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  border: 1px solid #173049;
  background: #0A1220;
  color: #DCEFFB;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.hud-btn:hover {
  border-color: #22D3EE;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}
.hud-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.5);
}
.hud-btn-primary {
  background: rgba(34, 211, 238, 0.12);
  border-color: #22D3EE;
  color: #7FDBF5;
}
.hud-btn-primary:hover {
  background: rgba(34, 211, 238, 0.2);
}

/* Corner-chip badges in the header */
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7FDBF5;
  border: 1px solid #173049;
  background: rgba(34, 211, 238, 0.06);
  border-radius: 2px;
  padding: 4px 10px;
}

/* Inline SVG charts: let glow filters and axis labels overflow their viewBox */
#radarChart,
#lineChart,
#donutStatus,
#donutShare {
  overflow: visible;
}

/* ---------------------------------------------------------------------- */
/* Ring visualization: rotating rings + station pills                      */
/* ---------------------------------------------------------------------- */

.hud-ring-wrap {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
}

.hud-ring-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: rgba(34, 211, 238, 0.12);
  stroke-width: 3;
}

.ring-progress {
  fill: none;
  stroke: #22D3EE;
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 150px 150px;
  transform: rotate(-90deg);
  transition: stroke-dasharray 0.6s ease;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.7));
}

.ring-outer {
  fill: none;
  stroke: rgba(34, 211, 238, 0.35);
  stroke-width: 1;
  stroke-dasharray: 2 10;
  transform-origin: 150px 150px;
}

.ring-spin-slow { animation: ring-spin 40s linear infinite; }
.ring-spin-fast { animation: ring-spin 22s linear infinite reverse; }

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hud-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.hud-ring-number {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: #EAFBFF;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
}

.ring-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #DCEFFB;
  background: rgba(10, 18, 32, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 999px;
  padding: 3px 8px 3px 6px;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.15);
}

.ring-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ring-connector {
  stroke: rgba(34, 211, 238, 0.3);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  fill: none;
}

/* ---------------------------------------------------------------------- */
/* Roster / activity rows                                                  */
/* ---------------------------------------------------------------------- */

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(23, 48, 73, 0.6);
  font-size: 12px;
}
.hud-row:last-child { border-bottom: none; }

/* Interactive roster row: plain CSS (not Tailwind utilities) so a
   dynamically created <button> always gets full-width flex layout even if
   the CDN JIT scanner hasn't picked up its classes yet. */
.roster-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.15s ease;
  font-family: inherit;
  color: inherit;
}
.roster-row:hover,
.roster-row:focus-visible {
  background: rgba(34, 211, 238, 0.08);
}
.roster-row:focus-visible {
  outline: 2px solid #22D3EE;
  outline-offset: -2px;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* Bar chart rows */
.hud-bar-track {
  height: 8px;
  border-radius: 2px;
  background: rgba(34, 211, 238, 0.08);
  overflow: hidden;
}
.hud-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Funnel chart segments */
.hud-funnel-seg {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #05121b;
  font-weight: 700;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ---------------------------------------------------------------------- */
/* Live beacon pulse                                                        */
/* ---------------------------------------------------------------------- */

.live-dot {
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
  animation: live-pulse 2s ease-out infinite;
}

.live-dot.paused {
  animation: none;
  background-color: #3A5068 !important;
  box-shadow: none;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

/* ---------------------------------------------------------------------- */
/* Digit tumble on increment (mechanical counter feel)                     */
/* ---------------------------------------------------------------------- */

.tumble {
  animation: digit-tumble 0.4s cubic-bezier(0.3, 0, 0.2, 1);
}

@keyframes digit-tumble {
  0% { transform: translateY(-6px); opacity: 0.4; filter: blur(1px); }
  60% { transform: translateY(2px); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0); }
}

/* Modal visibility toggle (Tailwind handles layout, this handles show/hide) */
#stationModal.open {
  display: flex;
}

/* Toast */
.toast {
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .tumble,
  .toast,
  .ring-spin-slow,
  .ring-spin-fast {
    animation: none !important;
  }
}

/* Scrollbar (webkit) - subtle, matches the HUD theme */
.hud-scroll::-webkit-scrollbar,
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #050810;
}
::-webkit-scrollbar-thumb {
  background: #173049;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: #22D3EE;
}

/* Color swatch tags in modal */
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.color-swatch:hover {
  transform: scale(1.1);
}
.color-swatch.selected {
  border-color: #EAFBFF;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

