:root {
  color-scheme: dark;
  --bg: oklch(13% 0.005 260);
  --panel: oklch(18% 0.01 260);
  --panel-hover: oklch(21% 0.01 260);
  --panel-selected: oklch(23% 0.03 75);
  --text: oklch(92% 0.005 260);
  --muted: oklch(60% 0.01 260);
  --muted-dim: oklch(45% 0.005 260);
  --amber: oklch(78% 0.15 75);
  --blue: oklch(78% 0.15 230);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Off-screen holding pen for live-status probe players — not display:none, so the
   embedded player still loads and plays long enough to report real state. */
.probe-pool {
  position: absolute;
  width: 2px;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  top: 0;
  left: 0;
}

/* ---------- sticky "now showing" video pane ---------- */

.video-pane {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 20px 32px 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.video-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

.master-clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
}

.master-clock #master-time {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
}

.master-tz {
  font-size: 12px;
  color: var(--muted);
}

.video-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 58vh;
  border-radius: 10px;
  overflow: hidden;
  background: #050403;
}

.video-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  background: oklch(9% 0 0);
}

.video-placeholder.hidden { display: none; }

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0px, rgba(255, 255, 255, .025) 1px, transparent 1px, transparent 3px);
}

.placeholder-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted-dim);
}

.placeholder-msg span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sits directly over the iframe and absorbs every mouse event, so YouTube's own player
   never receives a hover/click and its own title bar, controls, and branding link can
   never activate — controls=0 alone still leaves a minimal branding affordance active. */
.click-guard {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

/* Never shown, in any state (live, connecting, or offline) — the airport's identity is
   already on the flight board below. This used to be conditional on ".live", which left a
   gap during the brief "Connecting…" phase before playback is confirmed; unconditional is
   the only way to guarantee it never appears. */
.video-overlay {
  display: none;
}

.video-code {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.video-meta { display: flex; flex-direction: column; gap: 2px; }
.video-name { font-size: 15px; font-weight: 600; color: #fff; }
.video-city { font-size: 11px; color: rgba(255, 255, 255, 0.7); text-transform: uppercase; letter-spacing: 0.06em; }

.status-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
}

.status-chip.live { background: oklch(30% 0.06 75 / .5); color: oklch(90% 0.13 75); }
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .6; }
.status-chip.live .dot { background: oklch(85% 0.15 75); box-shadow: 0 0 8px oklch(78% 0.15 75 / .8); animation: pulse 1.6s ease-in-out infinite; }

/* ---------- flight board ---------- */

.board {
  padding: 24px 32px 56px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board-loading { color: var(--muted); text-align: center; padding: 40px 0; }

.row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.row:hover { background: var(--panel-hover); }
.row.selected { background: var(--panel-selected); border-color: oklch(78% 0.15 75 / .5); }

.flap { display: flex; gap: 3px; flex: none; }

.flap-char {
  width: 34px;
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  position: relative;
  background: linear-gradient(180deg, #191919, #101010);
  color: var(--muted-dim);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .6);
}

.flap-char::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(0, 0, 0, .55);
}

.row.live .flap-char {
  background: linear-gradient(180deg, #1c1408, #0f0b04);
  color: var(--amber);
}

.row-meta { display: flex; flex-direction: column; gap: 3px; min-width: 220px; flex: 1; }
.row-name { font-size: 15px; font-weight: 600; color: var(--text); }
.row-city { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.row-time { display: flex; flex-direction: column; gap: 2px; min-width: 80px; flex: none; }
.row-time-label { font-size: 9px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.row-time-value { font-family: var(--mono); font-size: 18px; font-weight: 600; color: var(--blue); }

.row-status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  min-width: 120px;
  justify-content: center;
  background: oklch(22% 0.005 260);
  color: var(--muted);
}

.row-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-dim); }
.row.live .row-status { background: oklch(30% 0.06 75 / .4); color: oklch(88% 0.13 75); }
.row.live .row-status .dot { background: var(--amber); box-shadow: 0 0 7px oklch(78% 0.15 75 / .8); animation: pulse 1.6s ease-in-out infinite; }

.row-action {
  flex: none;
  width: 90px;
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted-dim);
}

.row.selected .row-action { color: var(--amber); }

footer {
  text-align: center;
  color: var(--muted);
  padding: 0 1rem 3rem;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .video-screen { max-height: 40vh; }
  .video-code { font-size: 24px; }
  .row { flex-wrap: wrap; gap: 10px; }
  .row-meta { min-width: 140px; }
}
