table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table th {
  text-align: left;
  color: var(--c-magenta);
}

td {
  padding: 8px;
  border-bottom: 1px solid var(--c-grey-111);
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
}

table th:nth-child(1), table td:nth-child(1) { width: 35% !important; }
table th:nth-child(2), table td:nth-child(2) { width: 22% !important; }
table th:nth-child(3), table td:nth-child(3) { width: 17% !important; }
table th:nth-child(4), table td:nth-child(4) { width: 12% !important; }
table th:nth-child(5), table td:nth-child(5) { width: 8% !important; }
table th:nth-child(6), table td:nth-child(6) { width: 6% !important; }

.orig-col {
  color: var(--c-pink);
  font-weight: bold;
}

.dest-col {
  color: var(--c-aqua);
  font-weight: bold;
}

.dist-col {
  color: var(--c-green) !important;
  font-weight: bold;
}

.f-id {
  color: var(--c-yellow);
  font-weight: bold;
  font-size: 1.1em;
}

/* The original .f-sub colour value was invalid CSS that browsers discard, so the line inherits. */
.f-sub {
  font-size: 0.75em;
  display: block;
}

.alt-climb {
  color: var(--c-green);
  font-weight: bold;
}

.alt-descend {
  color: var(--c-red-pure);
  font-weight: bold;
}

.alt-level {
  color: var(--c-cyan);
  font-weight: bold;
}

.zero-dist {
  opacity: 0.6;
  cursor: pointer;
}

.row-emergency {
  background: rgba(255, 0, 60, 0.12) !important;
  animation: pulse-emergency 1.5s infinite alternate;
  box-shadow: inset 5px 0 0 var(--c-red) !important;
}

@keyframes pulse-emergency {
  from { background: rgba(255, 0, 60, 0.08); }
  to { background: rgba(255, 0, 60, 0.20); }
}

.row-military {
  background: rgba(255, 196, 0, 0.06) !important;
  box-shadow: inset 5px 0 0 var(--c-gold) !important;
}

.row-helicopter {
  background: rgba(226, 4, 255, 0.06) !important;
  box-shadow: inset 5px 0 0 var(--c-magenta) !important;
}

.row-emergency-plane {
  background: rgba(255, 102, 0, 0.08) !important;
  box-shadow: inset 5px 0 0 var(--c-orange) !important;
}

.row-light-aircraft {
  background: rgba(85, 255, 0, 0.06) !important;
  box-shadow: inset 5px 0 0 var(--c-green) !important;
}

.row-private-jet {
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 5px 0 0 var(--c-white) !important;
}

.locate-btn {
  background: var(--c-grey-1a1a1a);
  border: 1px solid var(--c-cyan);
  color: var(--c-cyan);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s;
}

.locate-btn:hover {
  background: var(--c-cyan);
  color: var(--c-black);
  box-shadow: 0 0 10px var(--c-cyan);
}

/* Phones: the columns fit the screen with no sideways scrolling. Only the squawk is left out — "7001" can't fit in
   the width left over — while the 🌍 button stays, or the board looks as though it stops after DIST. */
@media (max-width: 640px) {
  #radar th:nth-child(5), #radar td:nth-child(5) {
    display: none;
  }

  #radar th:nth-child(1), #radar td:nth-child(1) { width: 36% !important; }
  #radar th:nth-child(2), #radar td:nth-child(2) { width: 24% !important; }
  #radar th:nth-child(3), #radar td:nth-child(3) { width: 18% !important; }
  #radar th:nth-child(4), #radar td:nth-child(4) { width: 13% !important; }
  #radar th:nth-child(6), #radar td:nth-child(6) { width: 9% !important; }
  /* "Location" doesn't fit in that width and clips to "Locat"; the 🌍 buttons under it say what it is. */
  #radar th:nth-child(6) { font-size: 0 !important; }

  #radar th,
  #radar td {
    padding: 8px 4px;
    text-overflow: ellipsis;
  }
}

/* Sortable headings: the heading itself is the button, with an arrow while it's the one in use. */
.board-sort {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.board-sort:hover {
  color: var(--c-cyan);
}

.board-sort--active {
  color: var(--c-amber);
}

.board-sort--active::after {
  content: " " attr(data-direction);
}

/* 👀 MOST WATCHED: what people are opening right now, above the board. */
.watched-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 8px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--c-magenta);
  background: var(--c-grey-050505);
  font-size: 0.78rem;
}

.watched-strip[hidden] {
  display: none;
}

.watched-title {
  color: var(--c-magenta);
  font-weight: bold;
  letter-spacing: 0.5px;
}

.watched-strip ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.watched-strip a {
  color: var(--c-white);
  text-decoration: none;
}

.watched-strip a:hover strong {
  text-decoration: underline;
}

.watched-rank {
  color: var(--c-magenta);
}

.watched-what,
.watched-count {
  color: var(--c-grey-aaa);
}

/* 🌤️ RIGHT NOW: the furthest, highest, fastest, nearest and any military, above the board. */
.right-now {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 8px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--c-cyan);
  background: var(--c-grey-050505);
  font-size: 0.78rem;
}

.right-now[hidden] {
  display: none;
}

.right-now-title {
  color: var(--c-cyan);
  font-weight: bold;
  letter-spacing: 0.5px;
}

.right-now ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.right-now a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--c-white);
  text-decoration: none;
}

.right-now a:hover strong {
  text-decoration: underline;
}

.right-now-label,
.right-now-value {
  color: var(--c-grey-aaa);
}
