/* Wall dashboard — dark, high contrast, designed for 1920x1080.
   All sizing is in rem; root font-size scales with viewport width so the
   layout holds on other tablet sizes (16px at 1920px wide). */

:root {
  --bg: #121212;
  --panel: #1a1a1c;
  --panel-border: #2b2b2f;
  --text: #f1f1f1;
  --muted: #9aa0a6;
  --row-divider: #262629;

  --ok: #3fb950;
  --warn: #e3b341;
  --bad: #f85149;
  --unknown: #6e7681;

  --bus: #dc241f;        /* TfL bus red */
  --elizabeth: #7156a5;  /* Elizabeth line purple */
  --southeastern: #00a3df;

  --gap: 1.25rem;
  --radius: 0.75rem;
  --shift-x: 0px;
  --shift-y: 0px;
}

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

html {
  font-size: clamp(10px, 0.8333vw, 24px);
  background: var(--bg);
}

body {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  cursor: none;
  user-select: none;
}

.muted { color: var(--muted); }

/* ---------- Layout ---------- */

#app {
  height: 100vh;
  padding: 1.5rem;
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr 1.35fr;
  grid-template-rows: auto 1fr 0.8fr auto;
  grid-template-areas:
    "top      top"
    "buses    trains"
    "calendar weather"
    "strip    strip";
  transform: translate(var(--shift-x), var(--shift-y));
}

.topbar   { grid-area: top; }
.panel--buses    { grid-area: buses; }
.panel--trains   { grid-area: trains; }
.panel--calendar { grid-area: calendar; }
.panel--weather  { grid-area: weather; }
.strip    { grid-area: strip; }

/* ---------- Top bar ---------- */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  padding: 0 0.5rem;
}

.topbar__place { font-size: 1.5rem; color: var(--muted); }
.topbar__clock { font-size: 5rem; font-weight: 600; letter-spacing: 0.02em; }
.topbar__date  { font-size: 1.75rem; color: var(--muted); text-align: right; }

/* ---------- Panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.panel__head h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel__sub {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.5rem;
}

/* Sync indicator: hidden when OK, soft amber retry icon when a feed fails. */
.sync {
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  text-align: center;
  font-size: 1.25rem;
  color: var(--warn);
  visibility: hidden;
}
.sync::before { content: "\27F3"; } /* ⟳ */
[data-state="error"] .sync,
.strip[data-state="error"] .sync { visibility: visible; }

/* ---------- Lists / rows ---------- */

.rows { list-style: none; flex: 1; min-height: 0; overflow: hidden; }

.row {
  display: grid;
  align-items: center;
  column-gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--row-divider);
  font-size: 1.6rem;
}
.row:last-child { border-bottom: 0; }

.row__dest {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.placeholder { opacity: 0.35; }

/* Bus rows: [line badge] [destination] [minutes] */
.row--bus { grid-template-columns: 5.5rem 1fr 7rem; }
.row__time { text-align: right; font-weight: 600; font-size: 1.9rem; }
.row__time.due { color: var(--ok); }

.badge {
  display: inline-block;
  min-width: 4.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
}
.badge--bus { background: var(--bus); }

/* ---------- Trains ---------- */

.trains {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
}

.station { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.station + .station { border-left: 1px solid var(--row-divider); padding-left: 1.5rem; }

.station__name {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.crs { font-size: 0.95rem; font-weight: 400; color: var(--muted); margin-left: 0.4rem; }

/* Train rows: [time] [destination] [platform] [status] */
.row--train {
  grid-template-columns: 4.5rem 1fr 2.25rem 6.5rem;
  font-size: 1.4rem;
}
.row__sched { font-weight: 600; }
.row__plat {
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  border-radius: 0.4rem;
  font-size: 1.1rem;
  padding: 0.1rem 0;
}
.row__status { text-align: right; font-size: 1.1rem; font-weight: 600; color: var(--ok); white-space: nowrap; }
.row__status.late      { color: var(--warn); }
.row__status.cancelled { color: var(--bad); }

/* ---------- Calendar ---------- */

.empty {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.5rem;
}

/* ---------- Weather ---------- */

.weather {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  row-gap: 1rem;
}

.weather__now {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.weather__icon { font-size: 4.5rem; line-height: 1; }
.weather__temp { font-size: 5rem; font-weight: 600; }
.weather__meta { font-size: 1.5rem; display: grid; row-gap: 0.4rem; }
.weather__meta .muted { font-size: 1.2rem; }

.forecast {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-self: end;
}
.forecast__day {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name icon" "hi lo";
  align-items: center;
  background: #202023;
  border-radius: 0.6rem;
  padding: 0.7rem 1rem;
  row-gap: 0.3rem;
}
.forecast__name { grid-area: name; font-size: 1.25rem; color: var(--muted); }
.forecast__icon { grid-area: icon; font-size: 2rem; }
.forecast__hi   { grid-area: hi; font-size: 1.6rem; font-weight: 600; }
.forecast__lo   { grid-area: lo; font-size: 1.3rem; color: var(--muted); text-align: right; }

/* ---------- Service status strip ---------- */

.strip {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.5rem;
  min-height: 4.25rem;
}
.strip__label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.strip__items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  min-width: 0;
}
.strip__updated { font-size: 1rem; white-space: nowrap; }

/* Reason text for a disrupted service, on its own line under the pills. */
.strip__reason {
  flex: 1 1 100%;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 1.3rem;
  border: 1px solid var(--panel-border);
  background: #202023;
}
.pill::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--unknown);
}
.pill--ok::before      { background: var(--ok); }
.pill--warn            { border-color: var(--warn); }
.pill--warn::before    { background: var(--warn); }
.pill--bad             { border-color: var(--bad); }
.pill--bad::before     { background: var(--bad); }
.pill--unknown::before { background: var(--unknown); }

/* ---------- Reduced motion / burn-in ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Only the occasional pixel shift moves; keep it very gentle. */
  #app { transition: transform 60s linear; }
}
