:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #171a1f;
  --panel-strong: #20242a;
  --text: #f6f3ea;
  --muted: #b5b1a6;
  --line: rgba(246, 243, 234, 0.14);
  --accent: #f3c64d;
  --accent-strong: #ffdf6d;
  --ok: #52d273;
  --warn: #ffb23e;
  --bad: #ff6961;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(260px, 34vh) 1fr;
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(28px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(16, 18, 20, 0.92), rgba(16, 18, 20, 0.5)),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Bahnhof%20G%C3%B6rlitz.jpg?width=1800")
      center 42% / cover;
}

.hero__shade {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, var(--bg), transparent);
}

.hero__content,
.status {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: clamp(18px, 1.8vw, 28px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(54px, 8vw, 128px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero__meta {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(22px, 2.4vw, 38px);
  font-weight: 700;
}

#clock {
  color: var(--text);
  font-size: clamp(42px, 5vw, 82px);
  font-variant-numeric: tabular-nums;
}

.status {
  max-width: 460px;
  align-self: end;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 18, 20, 0.72);
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 700;
}

.status--ok {
  color: var(--ok);
}

.status--error {
  color: var(--bad);
}

.departures {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 40px) clamp(22px, 4vw, 56px) clamp(24px, 4vw, 52px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 130px),
    var(--bg);
}

.departures__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.departures__updated {
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: 700;
  white-space: nowrap;
}

.board {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.board__row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(120px, 1fr) minmax(280px, 3.2fr) minmax(90px, 0.8fr) minmax(170px, 1.4fr);
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  min-height: 76px;
  padding: 12px clamp(16px, 2.6vw, 34px);
  border-bottom: 1px solid var(--line);
}

.board__row--header {
  min-height: 54px;
  background: var(--panel-strong);
  color: var(--accent);
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 900;
  text-transform: uppercase;
}

.board__body {
  min-height: 0;
  overflow: hidden;
}

.departure {
  font-size: clamp(22px, 2.2vw, 38px);
  font-weight: 800;
}

.departure:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.departure__time {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.departure__line {
  display: inline-flex;
  width: fit-content;
  min-width: 86px;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #141414;
  font-weight: 950;
}

.departure__destination {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.departure__platform {
  color: var(--text);
  text-align: center;
}

.departure__status {
  color: var(--ok);
  font-size: clamp(18px, 1.7vw, 28px);
}

.departure__status--warn {
  color: var(--warn);
}

.departure__status--bad {
  color: var(--bad);
}

.empty {
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: 32px;
  color: var(--muted);
  font-size: clamp(22px, 2.2vw, 36px);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 840px) {
  body {
    overflow: auto;
  }

  .screen {
    grid-template-rows: auto 1fr;
  }

  .hero {
    min-height: 320px;
    align-items: start;
    flex-direction: column;
  }

  .departures__head {
    align-items: start;
    flex-direction: column;
  }

  .departures__updated {
    white-space: normal;
  }

  .board {
    overflow-x: auto;
  }

  .board__row {
    grid-template-columns: 86px 100px minmax(220px, 1fr) 70px 140px;
    min-width: 720px;
  }
}
