/* =============================================================
   The Lobby — Amsterdam Zuid · refined design system
   One cohesive dark-glass language: a living diorama hero, a crisp
   departures board, glance cards, a story strip, and a status ticker.
   ============================================================= */
:root {
  /* brand */
  --ns-yellow: #ffc917;
  --ns-blue: #1d4ed8;
  /* product categories */
  --ic: #2156d6;
  --spr: #1ea05a;
  --icd: #c0492f;
  --sng: #2f86c4;
  /* surfaces & ink */
  --bg: #070a11;
  --bg-2: #0b1018;
  --glass: rgba(20, 27, 40, 0.72);
  --glass-2: rgba(28, 37, 54, 0.66);
  --ink: #eef2f8;
  --muted: #93a0b4;
  --faint: #5d6b80;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  /* signal */
  --led: #ffd23f;
  --ok: #41c98a;
  --warn: #ffb020;
  --bad: #ff6a6a;
  /* shape */
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 1px var(--line);
  --ui: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;
  --comic: "Comic Neue", "Comic Sans MS", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background:
    radial-gradient(120% 80% at 80% -10%, #16213b 0%, transparent 55%),
    radial-gradient(100% 70% at 0% 110%, #131a2c 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.app {
  display: grid;
  grid-template-columns: 1fr 384px;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 16px 16px 10px;
}

/* ---------- stage ---------- */
.stage-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.nameplate {
  display: flex; align-items: baseline; gap: 11px;
  padding: 2px 4px 11px;
  border-bottom: 1px solid var(--line);
}
.np-name { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.np-sub { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.4px; }
.np-live {
  margin-left: auto; align-self: center; color: var(--muted);
  font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px;
}
.np-live::first-letter { color: var(--ok); }

.stage {
  position: relative; flex: 1; min-height: 0;
  border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line-2);
  background: #0a0f24;
  box-shadow: var(--shadow), inset 0 0 70px rgba(0, 0, 0, 0.45);
}
#scene { display: block; width: 100%; height: 100%; }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctrl {
  background: var(--glass-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 7px 14px;
  font: 600 13px var(--ui);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.ctrl:hover { border-color: #44557a; transform: translateY(-1px); }
.ctrl.on { background: var(--ns-blue); border-color: #3b6ae6; color: #fff; }
.sky-phase { margin-left: auto; color: var(--muted); font-size: 13px; }
.sky-phase b { color: var(--ink); font-weight: 600; }
.music-now { color: var(--muted); font-size: 12px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- glance cards (cohesive glass) ---------- */
.info-panels {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  display: flex; flex-direction: column; align-items: flex-start; gap: 11px;
  width: 208px; pointer-events: none;
}
.info-panel {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(1.2);
}
.ip-hdr {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--ns-yellow);
  padding: 8px 12px 7px;
  border-bottom: 1px solid var(--line);
}
.ip-body { padding: 10px 12px 12px; color: var(--ink); }

.ip-weather-top { display: flex; align-items: center; gap: 9px; }
.ip-weather-top .wx { font-size: 30px; line-height: 1; }
.ip-weather-top .tmp { font-size: 30px; font-weight: 700; line-height: 1; }
.ip-cond { font-size: 12.5px; font-weight: 500; margin-top: 5px; color: var(--muted); }
.ip-rain { margin-top: 7px; font-size: 12.5px; font-weight: 700; }
.ip-rain.wet { color: #7fb6ff; }
.ip-rain.dry { color: var(--ok); }

.ip-delay-row { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 0; }
.ip-delay-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-delay-row .mn { font-variant-numeric: tabular-nums; font-weight: 700; }
.ip-delay-row.minor .mn { color: var(--warn); }
.ip-delay-row.major .mn { color: var(--bad); }
.ip-delay-row.cancel .mn { color: #c79bff; }
.ip-allgood { font-size: 13px; font-weight: 600; color: var(--ok); }

/* ---------- departures board ---------- */
.board {
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 24, 37, 0.92), rgba(11, 16, 25, 0.92));
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.board-head {
  position: relative;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.16), transparent);
}
.board-head::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--ns-yellow), rgba(255, 201, 23, 0));
}
.clock {
  font-family: var(--mono); font-size: 40px; font-weight: 600; line-height: 1;
  letter-spacing: 1px; font-variant-numeric: tabular-nums;
  color: var(--led); text-shadow: 0 0 22px rgba(255, 210, 63, 0.3);
}
.clock-date { color: var(--muted); font-size: 12.5px; margin-top: 6px; letter-spacing: 0.2px; }
.board-title { margin-top: 10px; font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--ns-yellow); font-weight: 700; }

.board-cols, .row {
  display: grid;
  grid-template-columns: 64px 46px 1fr 38px 62px;
  gap: 8px; align-items: center;
}
.board-cols {
  padding: 10px 18px; font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--faint); border-bottom: 1px solid var(--line);
}
.board-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.board-rows::-webkit-scrollbar { width: 8px; }
.board-rows::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.row {
  padding: 11px 18px; font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  animation: rowin 0.3s ease both;
}
.board-rows .row:first-child { background: linear-gradient(90deg, rgba(255, 201, 23, 0.08), transparent 70%); }
@keyframes rowin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.c-time { font-family: var(--mono); font-weight: 600; display: flex; flex-direction: column; line-height: 1.12; font-variant-numeric: tabular-nums; }
.t-on { color: var(--ink); }
.t-planned { color: var(--faint); text-decoration: line-through; font-size: 11px; }
.t-delay { color: var(--bad); font-weight: 700; }

.badge { font-size: 10.5px; font-weight: 700; color: #fff; padding: 2.5px 6px; border-radius: 5px; letter-spacing: 0.3px; }
.badge-ic { background: var(--ic); }
.badge-spr { background: var(--spr); }
.badge-icd { background: var(--icd); }
.badge-sng { background: var(--sng); }

.c-dest { font-weight: 600; display: flex; align-items: center; min-width: 0; }
.c-dest .dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cx { color: var(--bad); font-size: 11px; font-weight: 700; margin-left: 6px; }
.crowd { font-weight: 800; font-size: 11px; margin-left: 5px; vertical-align: 1px; flex: 0 0 auto; }
.crowd-quiet { color: #4f9d6b; }
.crowd-busy { color: var(--warn); }
.crowd-packed { color: var(--bad); }

.c-track { text-align: center; }
.trk {
  display: inline-block; min-width: 24px; padding: 2.5px 5px;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
.trk.changed { background: #3a1f55; border-color: #8b3fd0; color: #e6c8ff; animation: trkflash 1.1s ease-in-out infinite; }
@keyframes trkflash { 50% { background: #8b3fd0; color: #fff; } }

.c-eta { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); transition: color 0.3s ease; }
.eta-soon { color: var(--ns-yellow); text-shadow: 0 0 12px rgba(255, 201, 23, 0.25); }
.eta-now { color: var(--ok); text-shadow: 0 0 14px rgba(65, 201, 138, 0.45); animation: etapulse 1.6s ease-in-out infinite; }
@keyframes etapulse { 50% { opacity: 0.55; } }
.eta-gone { color: var(--faint); font-size: 12px; font-weight: 600; }

.row.cancelled .c-dest, .row.cancelled .c-time { opacity: 0.55; }
.board-empty { padding: 32px 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* board extras: heading-home + today */
.board-extra { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.board-extra .info-panel { background: var(--glass-2); box-shadow: none; backdrop-filter: none; }
.ip-home-row { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 3px 0; align-items: baseline; }
.ip-home-row .hd-dest { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-home-row .hd-mins { font-size: 13px; font-weight: 700; color: #7fb6ff; font-variant-numeric: tabular-nums; }
.ip-home-row .hd-meta { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.ip-home-row .hd-meta b { color: var(--bad); }
.ip-home-row.last .hd-dest { color: #ffac6b; }
.ip-stat { display: inline-flex; flex-direction: column; align-items: center; margin: 0 12px 4px 0; }
.ip-stat .st-n { font-size: 22px; font-weight: 700; line-height: 1; }
.ip-stat .st-n.good { color: var(--ok); } .ip-stat .st-n.warn { color: var(--warn); } .ip-stat .st-n.bad { color: var(--bad); }
.ip-stat .st-l { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 3px; }
.ip-stat-row { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.ip-stat-row.cx { color: #c79bff; }

.board-foot { padding: 10px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- story strip (cohesive cards with a playful caption) ---------- */
.comic-strip {
  position: absolute; left: 230px; right: 0; bottom: 0;
  display: flex; gap: 12px; padding: 14px 16px; align-items: flex-end;
  pointer-events: none; flex-wrap: wrap;
}
.comic-panel {
  width: 244px;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(12px);
  transform-origin: bottom center; animation: panelIn 0.5s cubic-bezier(.2, 1.2, .35, 1);
}
.comic-panel.out { animation: panelOut 0.4s forwards; }
.comic-panel .hdr {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
  color: var(--ink); border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden;
}
.comic-panel .hdr .pl { background: var(--ns-yellow); color: #11161f; border-radius: 4px; padding: 1px 5px; font-weight: 800; }
.comic-panel .hdr .badge { font-size: 10px; padding: 1px 5px; }
.comic-panel .hdr .late { margin-left: auto; color: var(--bad); }
.comic-panel .pic { position: relative; line-height: 0; }
.comic-panel .pic canvas { display: block; width: 100%; height: 132px; background: #0a0f24; }
.comic-stamp {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  font: 800 14px var(--comic); letter-spacing: 0.3px; color: #fff; text-transform: uppercase;
  padding: 2px 9px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.85);
  white-space: nowrap; transform: rotate(-7deg);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.55); animation: stampPop 0.34s cubic-bezier(.2, 1.7, .4, 1);
}
.comic-stamp.aboard { background: #1f9d52; }
.comic-stamp.late { background: #d3322a; }
.comic-stamp.arrive { background: #2f6fd0; }
.comic-stamp.depart { background: #c98a1a; }
.comic-stamp.track { background: #8b3fd0; }
.comic-stamp.packed { background: #c0402a; }
@keyframes stampPop { from { transform: rotate(-7deg) scale(1.7); opacity: 0; } }
.comic-panel .cap { padding: 9px 12px 11px; color: var(--ink); font: 700 13.5px/1.32 var(--comic); }
@keyframes panelIn { from { transform: translateY(26px) scale(0.9); opacity: 0; } }
@keyframes panelOut { to { transform: translateY(26px) scale(0.9); opacity: 0; } }

/* ---------- ticker ---------- */
.ticker {
  display: flex; align-items: stretch; height: 44px; flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(10, 19, 48, 0.9), rgba(7, 11, 24, 0.95));
  border-top: 2px solid var(--ns-yellow);
}
.ticker-label {
  display: flex; align-items: center; padding: 0 16px; white-space: nowrap;
  font-size: 12.5px; font-weight: 800; letter-spacing: 1px;
  color: #0a0f1c; background: var(--ns-yellow);
}
.ticker-viewport { position: relative; flex: 1; overflow: hidden; }
.ticker-track {
  position: absolute; top: 0; left: 0; height: 100%;
  display: flex; align-items: center; white-space: nowrap;
  font-size: 14px; font-weight: 500; will-change: transform;
  animation: ticker-scroll 60s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { padding: 0 14px; }
.ticker-item .t-rail { color: var(--ns-yellow); }
.ticker-item .t-extra { color: #aab8cf; font-weight: 400; }
.ticker-item .t-road { color: #7fc4ff; }
.t-sep { color: #3a4a63; padding: 0 4px; }
.ticker-item b { color: #ff7a7a; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  body { height: auto; min-height: 100dvh; overflow-y: auto; }
  .app { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 4px; flex: none; }
  .stage-wrap { gap: 8px; }
  .np-name { font-size: 19px; }
  .stage { height: 40dvh; min-height: 250px; max-height: 360px; flex: none; }
  .sky-phase { width: 100%; margin-left: 0; order: 5; font-size: 12px; }

  .info-panels.below {
    position: static; width: auto; flex-direction: row; gap: 8px; pointer-events: auto;
  }
  .info-panel { flex: 1 1 0; min-width: 0; }
  .comic-strip { display: none; }

  .clock { font-size: 32px; }
  .board-cols, .row { grid-template-columns: 56px 42px 1fr 34px 58px; gap: 6px; padding-left: 14px; padding-right: 14px; }
  .ticker { position: sticky; bottom: 0; height: 40px; z-index: 5; }
}
@media (max-width: 380px) {
  .clock { font-size: 27px; }
  .board-cols, .row { grid-template-columns: 48px 36px 1fr 26px 50px; gap: 4px; }
  .row { font-size: 13px; }
}
