/* AUS Live — dark glass passenger display. Designed at 1920×1080; everything scales with viewport height. */
:root {
  --arr: #32d74b;
  --arr-soft: rgba(50, 215, 75, 0.16);
  --arr-glow: rgba(50, 215, 75, 0.55);
  --dep: #3e9bff;
  --dep-soft: rgba(62, 155, 255, 0.16);
  --dep-glow: rgba(62, 155, 255, 0.55);
  --text: #f5f7fa;
  --text-2: rgba(235, 240, 248, 0.62);
  --text-3: rgba(235, 240, 248, 0.38);
  --glass: rgba(18, 21, 28, 0.58);
  --glass-strong: rgba(18, 21, 28, 0.74);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-2: rgba(255, 255, 255, 0.14);
  --radius: 1.6rem;
  --gap: 2rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", "InterVariable", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
@supports (font-variation-settings: normal) {
  :root { --font: "InterVariable", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; }
}

html { font-size: calc(100vh / 67.5); } /* 16px @1080p, 32px @4K */
@media (max-aspect-ratio: 4/3) { html { font-size: calc(100vw / 120); } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070b; }
body {
  font-family: var(--font);
  color: var(--text);
  font-feature-settings: "cv11", "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
body.idle, body.idle * { cursor: none !important; }

#map { position: fixed; inset: 0; z-index: 0; }
#sky { position: fixed; inset: 0; z-index: 1; pointer-events: none; width: 100%; height: 100%; }
#vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,7,11,0.55) 0%, rgba(5,7,11,0) 26%, rgba(5,7,11,0) 74%, rgba(5,7,11,0.55) 100%),
    linear-gradient(180deg, rgba(5,7,11,0.5) 0%, rgba(5,7,11,0) 18%, rgba(5,7,11,0) 80%, rgba(5,7,11,0.55) 100%);
}

#ui { position: fixed; inset: 0; z-index: 3; pointer-events: none; transition: transform 30s linear; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- Brand ---------- */
.brand {
  position: absolute; top: var(--gap); left: var(--gap);
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1.6rem 0.9rem 0.9rem;
  border-radius: 1.4rem;
}
.brand-mark {
  width: 3.2rem; height: 3.2rem; border-radius: 0.95rem;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--arr) -20%, var(--dep) 120%);
  box-shadow: 0 0.4rem 1.6rem rgba(62, 155, 255, 0.35);
}
.brand-mark svg { width: 1.9rem; height: 1.9rem; fill: #fff; transform: rotate(45deg); }
.brand-text h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.brand-text p { font-size: 0.95rem; color: var(--text-2); font-weight: 500; margin-top: 0.15rem; }

/* ---------- Clock ---------- */
.clock {
  position: absolute; top: var(--gap); right: var(--gap);
  padding: 0.85rem 1.6rem 0.95rem; text-align: right;
  border-radius: 1.4rem;
}
.clock-time { font-size: 3.1rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
#clk-ampm { font-size: 1.25rem; font-weight: 600; color: var(--text-2); margin-left: 0.4rem; letter-spacing: 0; }
.clock-date { font-size: 1rem; color: var(--text-2); font-weight: 500; margin-top: 0.35rem; }

/* ---------- Boards ---------- */
.board {
  position: absolute; width: 33rem;
  padding: 1.4rem 1.4rem 1rem;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 21rem);
}
.board.arr { left: var(--gap); top: 8.6rem; }
.board.dep { right: var(--gap); top: 9.6rem; }
.board-head { display: flex; align-items: center; gap: 0.95rem; padding: 0 0.3rem 1rem; }
.board-icon {
  width: 2.9rem; height: 2.9rem; border-radius: 0.85rem; display: grid; place-items: center;
}
.board-icon svg { width: 1.7rem; height: 1.7rem; }
.arr .board-icon { background: var(--arr-soft); } .arr .board-icon svg { fill: var(--arr); }
.dep .board-icon { background: var(--dep-soft); } .dep .board-icon svg { fill: var(--dep); }
.board-head h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.board-head p { font-size: 0.9rem; color: var(--text-2); font-weight: 500; }
.board-count {
  margin-left: auto; min-width: 2.6rem; height: 2.6rem; padding: 0 0.8rem; border-radius: 1.3rem;
  display: grid; place-items: center; font-size: 1.25rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke);
}
.arr .board-count { color: var(--arr); } .dep .board-count { color: var(--dep); }

.rows { list-style: none; position: relative; display: flex; flex-direction: column; gap: 0.55rem; }
.row {
  position: relative;
  display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem 0.85rem 0.85rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  transition: transform 0.9s var(--ease), opacity 0.7s var(--ease), filter 0.7s var(--ease),
              background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
  will-change: transform, opacity;
}
.row.enter { opacity: 0; transform: translateY(0.8rem) scale(0.97); filter: blur(8px); }
.row.leave { opacity: 0; transform: scale(0.96); filter: blur(8px); }
.row.focus { background: rgba(255, 255, 255, 0.075); border-color: var(--stroke-2); }
.arr .row.focus { box-shadow: inset 0.22rem 0 0 var(--arr); }
.dep .row.focus { box-shadow: inset 0.22rem 0 0 var(--dep); }

.logo {
  width: 3.4rem; height: 3.4rem; border-radius: 0.9rem; overflow: hidden;
  background: #fff; display: grid; place-items: center; position: relative;
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3);
}
.logo img { width: 86%; height: 86%; object-fit: contain; }
.logo.mono { background: linear-gradient(145deg, #2b3140, #1a1e27); border: 1px solid var(--stroke-2); }
.logo.mono span { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; color: var(--text); }
.logo.ga svg { width: 1.8rem; height: 1.8rem; fill: var(--text-2); }

.flight { min-width: 0; }
.flight-no { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; white-space: nowrap; }
.flight-airline { font-size: 0.95rem; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.where { text-align: right; min-width: 0; max-width: 14rem; }
.where-city { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where-city .code { color: var(--text-3); font-weight: 600; margin-left: 0.4rem; font-size: 1rem; }
.where-city.none { color: var(--text-3); font-weight: 500; }

.status { margin-top: 0.4rem; display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.82rem; font-weight: 650; letter-spacing: 0.01em;
  padding: 0.28rem 0.7rem 0.3rem; border-radius: 1rem; white-space: nowrap;
}
.arr .pill { background: var(--arr-soft); color: var(--arr); }
.dep .pill { background: var(--dep-soft); color: var(--dep); }
.pill i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.pill.live i { animation: pulse 1.6s ease-in-out infinite; }
.pill.done { color: #04130a; background: var(--arr); }
.dep .pill.done { color: #020b18; background: var(--dep); }
.pill.done i { display: none; }
.pill svg { width: 0.85rem; height: 0.85rem; fill: currentColor; }
.when { font-size: 0.82rem; color: var(--text-2); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty {
  display: none; padding: 1.6rem 0.4rem 1.2rem; text-align: center;
  color: var(--text-3); font-size: 1rem; font-weight: 500;
}
.board.is-empty .empty { display: block; }
.board { overflow: hidden; }

/* Paging: when a board has more flights than fit, it rotates through pages */
.pager { display: none; align-items: center; justify-content: space-between; padding: 0.85rem 0.45rem 0.15rem; }
.board.paged .pager { display: flex; }
.pager-range { font-size: 0.85rem; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.dots { display: flex; align-items: center; gap: 0.4rem; }
.dots span {
  position: relative; overflow: hidden; width: 0.5rem; height: 0.5rem; border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.18); transition: width 0.6s var(--ease);
}
.dots span.on { width: 2.2rem; }
.dots span.on i { position: absolute; inset: 0; border-radius: inherit; transform-origin: left; transform: scaleX(0); animation: pagefill var(--page-ms, 12s) linear forwards; }
.arr .dots span.on i { background: var(--arr); }
.dep .dots span.on i { background: var(--dep); }
.rows.turning .row { opacity: 0; transform: translateX(-1.2rem); filter: blur(6px); transition-duration: 0.45s; transition-delay: 0s; }
@keyframes pagefill { to { transform: scaleX(1); } }

/* ---------- Stats bar ---------- */
.stats {
  position: absolute; bottom: var(--gap); left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; padding: 0.9rem 0.6rem; border-radius: 1.5rem;
  white-space: nowrap;
}
.stat { display: flex; flex-direction: column; justify-content: center; padding: 0 1.6rem; position: relative; }
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 15%; bottom: 15%; width: 1px; background: var(--stroke-2);
}
.stat-label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 0.5rem; }
.sw { width: 0.55rem; height: 0.55rem; border-radius: 50%; display: inline-block; }
.sw.arr { background: var(--arr); box-shadow: 0 0 0.6rem var(--arr-glow); }
.sw.dep { background: var(--dep); box-shadow: 0 0 0.6rem var(--dep-glow); }
.sw.air { background: #e5e9f0; box-shadow: 0 0 0.6rem rgba(255,255,255,0.5); }
.stat-value { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value.small { font-size: 1.25rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.6rem; margin-top: 0.35rem; min-height: 2.15rem; }
.stat-value .muted { color: var(--text-3); }
.busy-logo { width: 2rem; height: 2rem; border-radius: 0.55rem; background: #fff; display: grid; place-items: center; overflow: hidden; }
.busy-logo img { width: 86%; height: 86%; object-fit: contain; }
.busy-count { color: var(--text-2); font-weight: 600; font-size: 1rem; }

.stat-status { align-items: flex-start; gap: 0.35rem; }
.live { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; font-weight: 650; color: var(--arr); }
.live i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0.7rem currentColor; animation: pulse 2s ease-in-out infinite; }
.live.stale { color: #ffd60a; }
.live.down { color: #ff453a; }
.credit { font-size: 0.75rem; color: var(--text-3); font-weight: 500; }

/* ---------- Toasts ---------- */
#toasts {
  position: absolute; top: var(--gap); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
}
.toast {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1rem 2rem 1rem 1rem; border-radius: 1.6rem;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--stroke-2);
  box-shadow: 0 1.5rem 4rem rgba(0,0,0,0.5);
  transform: translateY(-140%) scale(0.92); opacity: 0; filter: blur(10px);
  transition: transform 0.9s var(--ease), opacity 0.6s var(--ease), filter 0.6s var(--ease);
}
.toast.show { transform: none; opacity: 1; filter: none; }
.toast-icon { width: 4.2rem; height: 4.2rem; border-radius: 1.2rem; display: grid; place-items: center; position: relative; }
.toast-icon svg { width: 2.3rem; height: 2.3rem; fill: #fff; position: relative; }
.toast.landed .toast-icon { background: var(--arr); box-shadow: 0 0 2.5rem var(--arr-glow); }
.toast.departed .toast-icon { background: var(--dep); box-shadow: 0 0 2.5rem var(--dep-glow); }
.toast-icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid currentColor; opacity: 0; }
.toast.landed .toast-icon::after { color: var(--arr); animation: ring 2s var(--ease) infinite; }
.toast.departed .toast-icon::after { color: var(--dep); animation: ring 2s var(--ease) infinite; }
.toast-kicker { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.toast.landed .toast-kicker { color: var(--arr); } .toast.departed .toast-kicker { color: var(--dep); }
.toast-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 0.1rem; white-space: nowrap; }
.toast-title .air { color: var(--text-2); font-weight: 600; margin-left: 0.5rem; }
.toast-sub { font-size: 1.05rem; color: var(--text-2); font-weight: 500; margin-top: 0.15rem; white-space: nowrap; }

/* ---------- Banner (setup hints) ---------- */
.banner {
  position: absolute; bottom: 9.6rem; left: 50%; transform: translateX(-50%);
  padding: 0.6rem 1.2rem; border-radius: 1rem; font-size: 0.9rem; color: var(--text-2); font-weight: 500;
  white-space: nowrap;
}
.banner b { color: var(--text); font-weight: 650; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ring { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.45); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .row, .toast { transition-duration: 0.01s; }
  .pill.live i, .live i, .toast-icon::after { animation: none; }
}

/* Narrow screens (desktop windows, tablets): stack the boards */
@media (max-aspect-ratio: 4/3) {
  .board { width: calc(50vw - 3rem); }
  .stats { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 4rem); }
}
