:root {
  --bg: #000000;
  --panel: rgba(28, 30, 33, 0.9);
  --panel-soft: rgba(28, 30, 33, 0.68);
  --text: #ffffff;
  --secondary: #e4e6eb;
  --muted: #b0b3b8;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --warn: #fde68a;
  --good: #bbf7d0;
  --danger: #ff8a8a;
  --focus: rgba(0, 212, 255, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

button {
  font: inherit;
}

#app {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 8px;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 72px;
  padding: 14px 16px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  background: linear-gradient(to bottom, rgba(28, 30, 33, 0.92), rgba(28, 30, 33, 0.35));
}

h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 31px;
  height: 31px;
}

#app-version {
  color: var(--muted);
  font-size: 14px;
}

#status {
  width: 330px;
  margin-top: 7px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heading {
  position: absolute;
  top: 16px;
  right: 82px;
  min-width: 78px;
  color: var(--warn);
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  text-align: right;
}

.icon-button,
.pill-button {
  min-height: 56px;
  border: 2px solid rgba(125, 211, 252, 0.55);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.icon-button {
  width: 56px;
  font-size: 30px;
  line-height: 1;
}

.pill-button {
  min-width: 104px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 700;
}

.focusable {
  transition: transform 300ms cubic-bezier(0.6, 0, 0.4, 1), box-shadow 220ms ease, border-color 220ms ease;
}

.focusable:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--focus);
  transform: scale(0.95);
}

.sky {
  position: relative;
  height: 438px;
  overflow: hidden;
}

.compass {
  position: absolute;
  left: 68px;
  right: 68px;
  top: 22px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.56);
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  pointer-events: none;
}

.reticle {
  position: absolute;
  inset: 72px 0 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.reticle span {
  position: relative;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.34);
}

.reticle span::before,
.reticle span::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.58);
}

.reticle span::before {
  left: 50%;
  top: 18px;
  bottom: 18px;
  width: 2px;
  transform: translateX(-50%);
}

.reticle span::after {
  left: 18px;
  right: 18px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.plane-tag {
  position: absolute;
  width: 152px;
  min-height: 72px;
  color: var(--text);
  text-align: center;
  transform: translate(-50%, -50%);
  transition: left 120ms linear, top 120ms linear, opacity 120ms linear, transform 120ms linear;
}

.plane-tag.selected {
  transform: translate(-50%, -50%) scale(1.08);
}

.plane-tag.offscreen {
  opacity: 0.46;
}

.tag-text {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 152px;
  padding: 0 4px;
  transform: translateX(-50%);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.95),
    0 0 8px rgba(0, 0, 0, 0.9);
}

.tag-name {
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-meta {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.2;
}

.tag-target {
  position: absolute;
  left: 50%;
  top: 42px;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(125, 211, 252, 0.78);
  border-radius: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.tag-target::before,
.tag-target::after {
  content: "";
  position: absolute;
  background: rgba(125, 211, 252, 0.86);
}

.tag-target::before {
  left: 50%;
  top: -8px;
  bottom: -8px;
  width: 2px;
  transform: translateX(-50%);
}

.tag-target::after {
  left: -8px;
  right: -8px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
}

.tag-target span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000000;
  transform: translate(-50%, -50%);
}

.plane-tag.selected .tag-target {
  border-color: var(--warn);
  box-shadow: 0 0 0 4px rgba(253, 230, 138, 0.18), 0 0 14px rgba(253, 230, 138, 0.24);
}

.plane-tag.selected .tag-target::before,
.plane-tag.selected .tag-target::after {
  background: rgba(253, 230, 138, 0.92);
}

.plane-tag.selected .tag-name {
  color: var(--warn);
}

.selected-plane {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 7;
  min-height: 84px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border: 1px solid rgba(253, 230, 138, 0.72);
  border-radius: 8px;
  background: rgba(28, 30, 33, 0.92);
}

.selected-name {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.selected-meta {
  margin-top: 7px;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.25;
}

.selected-bearing {
  min-width: 84px;
  align-self: center;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  text-align: right;
}

.state-panel {
  position: absolute;
  left: 62px;
  right: 62px;
  top: 142px;
  min-height: 172px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.state-icon {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
}

.state-panel h2 {
  font-size: 24px;
  line-height: 1.1;
}

.state-panel p {
  margin-top: 8px;
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.25;
}

#error .state-icon {
  color: var(--danger);
}

.bottom-actions {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
