:root {
  --bg: #000000;
  --surface: #120101;
  --surface-strong: #1b0203;
  --line: rgba(255, 70, 70, 0.34);
  --line-strong: rgba(255, 94, 94, 0.66);
  --text: rgba(255, 225, 225, 0.92);
  --muted: rgba(255, 166, 166, 0.68);
  --dim: rgba(255, 112, 112, 0.48);
  --accent: #ff4b4b;
  --accent-soft: rgba(255, 45, 45, 0.2);
  --danger: #ff2a2a;
  --focus-glow: inset -2px -2px 12px 6px rgba(255, 55, 55, 0.28), inset 0 0 18px 12px rgba(255, 55, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  font-weight: 650;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.display-root {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 8px;
  overflow: hidden;
}

.sky-layer {
  position: relative;
  width: 100%;
  height: 100%;
}

.target-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 304px;
  min-height: 232px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(27, 2, 3, 0.94), rgba(10, 1, 1, 0.72));
  mix-blend-mode: plus-lighter;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  min-width: 74px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 45, 45, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.chip.dim {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(90, 5, 5, 0.18);
}

.target-name {
  min-height: 70px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.08;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.target-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 750;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.metric {
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 64, 64, 0.22);
  border-radius: 6px;
  background: rgba(40, 3, 4, 0.58);
}

.metric-label {
  display: block;
  color: var(--dim);
  font-size: 11px;
  line-height: 1;
}

.metric-value {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}

.sensor-panel {
  position: absolute;
  left: 24px;
  bottom: 124px;
  width: 164px;
  padding: 12px;
  border: 1px solid rgba(255, 64, 64, 0.22);
  border-radius: 8px;
  background: rgba(18, 1, 1, 0.72);
}

.sensor-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: var(--muted);
  font-size: 13px;
}

.sensor-line strong {
  color: var(--text);
  font-size: 15px;
}

.candidate-strip {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 92px;
  height: 28px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
}

.candidate-pill {
  max-width: 156px;
  min-width: 0;
  height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 80, 80, 0.24);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(30, 2, 2, 0.62);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reticle {
  position: absolute;
  left: 200px;
  top: 47%;
  width: 116px;
  height: 116px;
  transform: translate(-50%, -50%);
  color: var(--accent);
  opacity: 0.58;
}

.reticle.locked {
  opacity: 0.96;
}

.reticle-ring {
  position: absolute;
  inset: 18px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.reticle.locked .reticle-ring {
  box-shadow: 0 0 20px rgba(255, 35, 35, 0.45);
}

.nearest-pointer {
  position: absolute;
  inset: -10px;
  z-index: 2;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  opacity: 1;
  transition:
    opacity 180ms ease,
    transform 320ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.nearest-pointer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 18px solid rgba(255, 128, 128, 0.98);
  filter: drop-shadow(0 0 10px rgba(255, 35, 35, 0.78));
}

.nearest-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 2px;
  height: 16px;
  transform: translateX(-50%);
  background: rgba(255, 104, 104, 0.78);
  box-shadow: 0 0 10px rgba(255, 35, 35, 0.6);
}

.nearest-pointer.searching {
  opacity: 0.66;
}

.nearest-pointer.searching::before {
  border-bottom-color: rgba(255, 92, 92, 0.68);
}

.nearest-pointer.searching::after {
  background: rgba(255, 78, 78, 0.5);
}

.reticle.locked .nearest-pointer::before {
  border-bottom-color: rgba(255, 220, 220, 0.96);
}

.reticle-cross {
  position: absolute;
  background: var(--line-strong);
}

.reticle-cross.h {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
}

.reticle-cross.v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
}

.action-rail {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 76px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.action-button {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 72, 72, 0.28);
  border-radius: 8px;
  color: var(--text);
  background: rgba(18, 1, 1, 0.82);
  opacity: 0.86;
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    opacity 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.action-button.primary {
  background: rgba(70, 5, 5, 0.78);
  border-color: rgba(255, 96, 96, 0.54);
}

.action-button:focus {
  outline: none;
  transform: scale(0.91);
  opacity: 1;
  border-color: rgba(255, 126, 126, 0.92);
  box-shadow: var(--focus-glow);
}

.action-button:active {
  transform: scale(0.87);
}

.icon {
  width: 24px;
  text-align: center;
  color: var(--accent);
  font-size: 21px;
  line-height: 1;
}

.toast {
  position: absolute;
  top: 24px;
  left: 50%;
  max-width: 536px;
  transform: translateX(-50%);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--text);
  background: rgba(28, 2, 2, 0.96);
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  z-index: 10;
}

.hidden {
  display: none;
}

@media (max-width: 599px), (max-height: 599px) {
  html,
  body,
  .display-root {
    width: 100vw;
    height: 100vh;
  }

  .target-panel {
    right: 16px;
    width: min(304px, calc(100vw - 32px));
  }
}
