:root {
  color-scheme: dark;
  --bg: #071014;
  --panel: rgba(8, 15, 19, 0.58);
  --panel-border: rgba(164, 196, 196, 0.24);
  --text: #eef7f4;
  --muted: #9ab0ad;
  --accent: #ffb454;
  --blue: #5fb7ff;
  --red: #ff5f6d;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.radar {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 192px;
  height: 192px;
  border: 1px solid rgba(164, 196, 196, 0.26);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(11, 28, 29, 0.84) 0%, rgba(7, 16, 20, 0.76) 68%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.hud {
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(460px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.hud__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(164, 196, 196, 0.16);
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.hud__actions {
  display: flex;
  gap: 8px;
}

button {
  min-width: 66px;
  height: 34px;
  border: 1px solid rgba(238, 247, 244, 0.22);
  border-radius: 6px;
  background: rgba(238, 247, 244, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  border-color: rgba(238, 247, 244, 0.45);
  background: rgba(238, 247, 244, 0.14);
}

.threat-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  overflow-x: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.lamp-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border-color: rgba(154, 176, 173, 0.26);
  background: rgba(154, 176, 173, 0.07);
  color: rgba(238, 247, 244, 0.58);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}

.lamp-toggle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(154, 176, 173, 0.5);
  box-shadow: none;
}

.lamp-toggle.is-on {
  border-color: rgba(255, 180, 84, 0.46);
  background: rgba(255, 180, 84, 0.12);
  color: var(--text);
}

.lamp-toggle.is-on::before {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 180, 84, 0.65);
}

.camera-mode {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 16px 0 0;
}

.end-notice {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 180, 84, 0.42);
  border-radius: 8px;
  background: rgba(255, 180, 84, 0.12);
}

.end-notice strong,
.end-notice span {
  display: block;
}

.end-notice strong {
  color: var(--accent);
  font-size: 14px;
}

.end-notice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.metrics div {
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 650;
}

.metric-value {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) 86px;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.metric-value span {
  min-width: 0;
  white-space: nowrap;
}

.sparkline {
  width: 86px;
  height: 24px;
  display: block;
  opacity: 0.9;
}

@media (max-width: 720px) {
  .radar {
    top: 12px;
    left: 12px;
    width: 142px;
    height: 142px;
  }

  .hud {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    padding: 14px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  dd {
    font-size: 13px;
  }

  .metric-value {
    grid-template-columns: minmax(52px, 1fr) 64px;
  }

  .sparkline {
    width: 64px;
  }
}
