:root {
  --bg: #070b12;
  --panel-bg: #0e1624;
  --panel-border: #223049;
  --text: #f1f5f9;
  --muted: #9fb0c7;
  --accent: #38bdf8;
  --arriving: #34d399;
  --amber-bg: #78350f;
  --amber-border: #f59e0b;
  --amber-text: #fef3c7;
  --live-bg: #064e3b;
  --live-border: #10b981;
  --live-text: #d1fae5;
  --emg-bg: #991b1b;
  --emg-text: #fee2e2;
  --mil-bg: #1e3a8a;
  --mil-text: #dbeafe;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
  font-size: clamp(21px, 1.6vw, 64px);
  line-height: 1.25;
  cursor: none;
  user-select: none;
}

@keyframes oled-drift {
  0%   { transform: translate(0px, 0px); }
  25%  { transform: translate(4px, 2px); }
  50%  { transform: translate(0px, 4px); }
  75%  { transform: translate(-4px, 2px); }
  100% { transform: translate(0px, 0px); }
}

.wall {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  padding: 1.2vh 1.6vw;
  gap: 1.2vh;
  animation: oled-drift 180s ease-in-out infinite;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5vw;
  padding: 0.8vh 1.2vw;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 0.45rem;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 1.2vw;
}

.title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.location {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.pill {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 0.3rem;
  background: #17253b;
  border: 1px solid var(--panel-border);
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.2vw;
}

.status-banner {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 0.35rem;
  letter-spacing: 0.03em;
}

.status-sample {
  background: var(--amber-bg);
  border: 2px solid var(--amber-border);
  color: var(--amber-text);
}

.status-live {
  background: var(--live-bg);
  border: 2px solid var(--live-border);
  color: var(--live-text);
}

.clock {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.2vw;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 0.45rem;
  padding: 0.9vh 1vw;
  min-height: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8vw;
  border-bottom: 2px solid var(--panel-border);
  padding-bottom: 0.5vh;
  margin-bottom: 0.7vh;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.panel-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.aircraft-list {
  display: flex;
  flex-direction: column;
  gap: 0.55vh;
  overflow: hidden;
}

.ac-row {
  display: grid;
  grid-template-columns: 3.9fr 0.85fr 1.15fr 0.8fr 1.15fr 1.3fr 1.3fr;
  align-items: center;
  gap: 0.5vw;
  padding: 0.55vh 0.6vw;
  background: #121d30;
  border-left: 4px solid var(--accent);
  border-radius: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.ac-row.ac-emergency {
  border-left-color: #ef4444;
  background: #28131a;
}

.ac-row.ac-military {
  border-left-color: #60a5fa;
}

.ac-row.ac-arriving {
  border-left-color: var(--arriving);
}

.ac-id {
  display: flex;
  align-items: center;
  gap: 0.45vw;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
}

.badge {
  display: inline-block;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.38rem;
  border-radius: 0.25rem;
  letter-spacing: 0.04em;
}

.badge-emg {
  background: var(--emg-bg);
  color: var(--emg-text);
  border: 1px solid #f87171;
}

.badge-mil {
  background: var(--mil-bg);
  color: var(--mil-text);
  border: 1px solid #93c5fd;
}

.badge-arr {
  background: #064e3b;
  color: #a7f3d0;
  border: 1px solid #34d399;
}

.ac-type {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.ac-cell {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.ac-vrate-up {
  color: #38bdf8;
}

.ac-vrate-down {
  color: #fbbf24;
}

.ac-vrate-flat {
  color: var(--muted);
}

.panel-scope {
  flex: 1.25 1 0;
}

.scope-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#scope-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}

.panel-arriving {
  flex: 1 1 0;
}

.arriving-list {
  display: flex;
  flex-direction: column;
  gap: 0.55vh;
  overflow: hidden;
}

.arr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8vw;
  padding: 0.55vh 0.7vw;
  background: #0e2421;
  border-left: 4px solid var(--arriving);
  border-radius: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.arr-main {
  font-weight: 800;
  font-size: 0.92rem;
}

.arr-detail {
  font-size: 0.82rem;
  color: #d1fae5;
  font-weight: 600;
}

.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1vh 0.5vw;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4vh 0.4vw 0;
}

.footer a {
  color: var(--accent);
  text-decoration: underline;
}
