/* RwyRadar. One sheet for every page: dark, quiet chrome around a full-bleed 3D stage. */
:root {
  color-scheme: dark;
  --bg: #0b1220; --bg2: #0f1829; --panel: rgba(12, 19, 33, 0.8); --panel-solid: #111b2e; --line: rgba(148, 163, 184, 0.18);
  --text: #e6edf3; --muted: #9aa7b8; --accent: #5eead4; --arr: #60a5fa; --dep: #fbbf24; --park: #a5b4fc; --bad: #f87171;
  --radius: 14px; --top: 52px;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the attribute must win over display rules such as .lbl and .stage-cams */
html, body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---- header ---- */
.top { height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { font-weight: 750; font-size: 19px; letter-spacing: 0.01em; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.hubnav { display: flex; gap: 6px; }
.hubnav a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 650; font-size: 13px; letter-spacing: 0.04em; }
.hubnav a:hover { border-color: var(--accent); }
.hubnav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #062a26; }

/* ---- the 3D stage ---- */
.stage { position: relative; height: clamp(440px, calc(100svh - var(--top)), 1100px); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, #20344a 0%, #0f1b2c 55%, #0b1220 100%); }
.stage-canvas, .stage-labels { position: absolute; inset: 0; }
.stage-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.stage-labels { pointer-events: none; overflow: hidden; }
.stage-hud { position: absolute; top: 16px; left: 18px; z-index: 3; pointer-events: none; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); }
.stage-hud h1 { font-size: 22px; font-weight: 750; }
.stage-hud h1 span { display: block; font-size: 13px; font-weight: 550; color: var(--muted); letter-spacing: 0.02em; margin-top: 2px; }
.hud-live { margin: 8px 0 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 9px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; backdrop-filter: blur(8px); text-shadow: none; }
.hud-live time { color: var(--muted); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 2s infinite; }
.dot.wait { background: var(--muted); animation: none; }
.dot.late { background: var(--dep); animation: none; }
.dot.off { background: var(--bad); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.stage-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, 80vw); text-align: center; z-index: 4; color: var(--muted); font-size: 13px; }
.stage-loading .bar { height: 4px; border-radius: 4px; background: rgba(148, 163, 184, 0.2); overflow: hidden; margin-bottom: 10px; }
.stage-loading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }

.stage-cams { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 4; display: flex; gap: 4px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none; }
.stage-cams button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; min-height: 34px; }
.stage-cams button:hover { color: var(--text); }
.stage-cams button[aria-pressed="true"] { background: rgba(94, 234, 212, 0.16); color: var(--accent); }
.stage-cams .sep { margin-left: 6px; position: relative; }
.stage-cams .sep::before { content: ""; position: absolute; left: -5px; top: 9px; bottom: 9px; width: 1px; background: var(--line); }

.stage-card { position: absolute; left: 16px; bottom: 74px; width: 290px; z-index: 4; padding: 14px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.stage-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.stage-card h3 { font-size: 19px; }
.stage-card .role { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.stage-card .route { margin: 10px 0 0; font-size: 15px; font-weight: 650; letter-spacing: 0.03em; }
.stage-card dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.stage-card dt { font-size: 11px; color: var(--muted); }
.stage-card dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.stage-card .x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.stage-card .follow { margin-top: 12px; width: 100%; border: 1px solid var(--accent); background: rgba(94, 234, 212, 0.12); color: var(--accent); border-radius: 10px; padding: 8px; font-weight: 650; cursor: pointer; }
.stage-note { position: absolute; left: 18px; bottom: 18px; margin: 0; color: var(--muted); }

/* labels drawn over the 3D view */
.lbl { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: block; text-align: left; border: 0; padding: 3px 7px 3px 6px;
  background: rgba(9, 15, 27, 0.72); border-left: 3px solid var(--muted); border-radius: 4px; font-size: 10.5px; line-height: 1.25; white-space: nowrap; color: var(--text); will-change: transform; }
.lbl b { display: block; font-size: 12px; font-weight: 700; }
.lbl span { color: var(--muted); }
.lbl.arr { border-left-color: var(--arr); }
.lbl.dep { border-left-color: var(--dep); }
.lbl.park { border-left-color: var(--park); background: rgba(9, 15, 27, 0.6); }
.lbl.sel { background: rgba(94, 234, 212, 0.92); color: #062a26; border-left-color: #062a26; z-index: 2; }
.lbl.sel span { color: #0b3b35; }

/* ---- right now, boards, about ---- */
.now { padding-top: 22px; }
.tiles { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tiles > div { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.tiles dt { font-size: 12px; color: var(--muted); }
.tiles dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 22px; }
.board { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.board.wide { grid-column: 1 / -1; }
.board h2, .about h2 { font-size: 17px; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid rgba(148, 163, 184, 0.08); vertical-align: top; }
td.fl b { font-weight: 700; }
td.gate { font-weight: 650; color: var(--accent); }
tr.empty td { color: var(--muted); }
.about { padding-top: 26px; padding-bottom: 10px; color: #c7d0db; max-width: 860px; }
.about p { margin: 0 0 14px; }
table.facts { max-width: 460px; }
.foot { max-width: 1240px; margin: 30px auto 0; padding: 18px 20px 28px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }

/* ---- home and plain pages ---- */
.home main, .plain main { padding-top: 48px; }
.home h1, .plain h1 { font-size: clamp(28px, 5vw, 46px); }
.lede { color: var(--muted); font-size: 17px; max-width: 42em; }
.hubcards { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.hubcards a { display: block; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); color: var(--text); text-decoration: none; }
.hubcards a:hover, .hubcards a:focus-visible { border-color: var(--accent); }
.hubcards .code { display: block; font-size: 28px; font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }
.hubcards .name { display: block; font-weight: 650; font-size: 16px; }
.hubcards .counts { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }

@media (max-width: 760px) {
  .top { padding: 0 14px; }
  .stage { height: clamp(420px, 74svh, 760px); }
  .stage-hud { top: 12px; left: 14px; }
  .stage-hud h1 { font-size: 18px; }
  .stage-card { left: 10px; right: 10px; width: auto; bottom: 68px; }
  .boards { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 0 14px; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } .stage-loading .bar i { transition: none; } }
