:root {
  --bg: #0b1020;
  --bg-panel: #141a2e;
  --bg-panel-2: #1a2238;
  --line: #2a3350;
  --text: #eef2ff;
  --text-dim: #93a0c4;
  --accent: #4ea1ff;
  --ok: #36d399;
  --warn: #fbbd23;
  --bad: #f87272;
  --gap: clamp(8px, 1.4vmin, 18px);
  --radius: clamp(10px, 1.6vmin, 20px);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { cursor: none; }

.dashboard {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "left quote"
    "left ns";
  gap: var(--gap);
  padding: var(--gap);
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 2.6vmin, 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left  { grid-area: left; justify-content: space-between; }
.quote { grid-area: quote; }
.ns    { grid-area: ns; }

.panel-label {
  font-size: clamp(13px, 1.7vmin, 20px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: .6em;
  margin-bottom: clamp(8px, 1.4vmin, 16px);
}

.tag {
  font-size: .75em;
  letter-spacing: .05em;
  text-transform: none;
  background: var(--warn);
  color: #1a1300;
  padding: .15em .6em;
  border-radius: 999px;
  font-weight: 700;
}
.tag.live { background: var(--ok); }

.ns-anchor {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 600;
}

.ns-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(5px, 1vmin, 10px);
  margin-bottom: clamp(8px, 1.4vmin, 14px);
}
.chip {
  font: inherit;
  font-size: clamp(12px, 1.7vmin, 18px);
  color: var(--text);
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: clamp(5px, 1vmin, 9px) clamp(10px, 1.6vmin, 16px);
  cursor: pointer;
  min-height: 38px;
}
.chip:active { background: var(--accent); color: #06121f; }
.chip-reset { margin-left: auto; }
.ns-input {
  font: inherit;
  font-size: clamp(12px, 1.7vmin, 18px);
  color: var(--text);
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * .5);
  padding: clamp(4px, .9vmin, 8px) clamp(6px, 1.1vmin, 10px);
  min-height: 38px;
  color-scheme: dark;
}

/* ---------- Left: clock + weather ---------- */
.clock {
  display: flex;
  align-items: baseline;
  gap: .15em;
}
.time {
  font-size: clamp(56px, 13vmin, 150px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.seconds {
  font-size: clamp(20px, 4vmin, 46px);
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.date {
  font-size: clamp(16px, 2.6vmin, 30px);
  color: var(--text-dim);
  margin-top: .2em;
}
.date::first-letter { text-transform: uppercase; }

.weather {
  background: var(--bg-panel-2);
  border-radius: var(--radius);
  padding: clamp(12px, 2.2vmin, 26px);
}
.weather-now {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vmin, 22px);
}
.wx-icon { font-size: clamp(40px, 9vmin, 92px); line-height: 1; }
.wx-temp {
  font-size: clamp(34px, 7vmin, 76px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wx-desc { font-size: clamp(15px, 2.4vmin, 26px); color: var(--text-dim); }
.weather-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.8vmin, 20px);
  margin-top: clamp(8px, 1.6vmin, 16px);
  font-size: clamp(13px, 1.9vmin, 20px);
  color: var(--text-dim);
}
.forecast {
  display: flex;
  justify-content: space-between;
  gap: clamp(6px, 1.2vmin, 14px);
  margin-top: clamp(10px, 2vmin, 20px);
  border-top: 1px solid var(--line);
  padding-top: clamp(8px, 1.6vmin, 16px);
}
.fc-day {
  text-align: center;
  flex: 1;
  font-size: clamp(12px, 1.7vmin, 18px);
  color: var(--text-dim);
}
.fc-day .fc-ico { font-size: clamp(20px, 3.6vmin, 36px); margin: .15em 0; }
.fc-day .fc-temp { color: var(--text); font-weight: 600; }

.loc-switcher {
  display: flex;
  gap: clamp(4px, .8vmin, 8px);
  margin-bottom: clamp(6px, 1.2vmin, 12px);
}
.loc-btn {
  font: inherit;
  font-size: clamp(14px, 2.1vmin, 22px);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: clamp(6px, 1.1vmin, 12px) clamp(14px, 2.2vmin, 24px);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.loc-btn.active {
  background: var(--accent);
  color: #06121f;
  border-color: var(--accent);
  font-weight: 700;
}

.buienradar {
  display: flex;
  gap: clamp(4px, 1vmin, 10px);
  margin-top: clamp(8px, 1.6vmin, 16px);
  padding: clamp(8px, 1.4vmin, 14px);
  background: rgba(78,161,255,.06);
  border: 1px solid rgba(78,161,255,.18);
  border-radius: calc(var(--radius) * .7);
}
.br-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, .5vmin, 5px);
  font-size: clamp(10px, 1.4vmin, 15px);
}
.br-time { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.br-bar-wrap {
  width: clamp(14px, 2.5vmin, 28px);
  height: clamp(22px, 4vmin, 44px);
  background: var(--line);
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.br-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px;
  min-height: 2px;
  transition: height .4s ease;
}
.br-prob { font-weight: 700; color: var(--text); }
.br-mm   { color: var(--text-dim); font-size: .9em; }

.place {
  font-size: clamp(16px, 2.6vmin, 30px);
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .04em;
  align-self: flex-start;
}

/* ---------- Quote ---------- */
.quote { justify-content: center; }
.quote-text {
  font-size: clamp(22px, 4.4vmin, 52px);
  font-weight: 600;
  line-height: 1.28;
  font-style: italic;
}
.quote-text::before { content: "“"; color: var(--accent); }
.quote-text::after  { content: "”"; color: var(--accent); }
.quote-author {
  margin-top: clamp(12px, 2.4vmin, 26px);
  font-size: clamp(15px, 2.2vmin, 26px);
  color: var(--text-dim);
}
.quote-author::before { content: "— "; }

/* ---------- NS ---------- */
.ns-disruption {
  font-size: clamp(14px, 2.1vmin, 22px);
  padding: clamp(8px, 1.4vmin, 14px) clamp(10px, 1.8vmin, 18px);
  border-radius: calc(var(--radius) * .7);
  margin-bottom: clamp(8px, 1.6vmin, 16px);
}
.ns-disruption.ok  { background: rgba(54,211,153,.12); color: var(--ok); }
.ns-disruption.bad { background: rgba(248,114,114,.14); color: var(--bad); }

.departures {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vmin, 10px);
  overflow: hidden;
}
.dep {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: clamp(8px, 1.6vmin, 18px);
  padding: clamp(7px, 1.5vmin, 14px) clamp(8px, 1.4vmin, 14px);
  background: var(--bg-panel-2);
  border-radius: calc(var(--radius) * .6);
  font-size: clamp(14px, 2vmin, 24px);
}
.dep-route {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dep-type { margin-right: .4em; }
.dep-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.15em;
}
.dep-time .late { color: var(--warn); }
.dep-type {
  color: var(--text-dim);
  font-size: .85em;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dep-dest { font-weight: 600; }
.dep-meta { color: var(--text-dim); font-size: .85em; }
.dep-track {
  color: var(--text-dim);
  font-size: .85em;
  white-space: nowrap;
}
.dep-status { font-size: .85em; font-weight: 700; text-align: right; }
.dep-status.on   { color: var(--ok); }
.dep-status.late { color: var(--warn); }
.dep-status.cancel { color: var(--bad); text-decoration: line-through; }

.updated {
  margin-top: clamp(8px, 1.4vmin, 14px);
  font-size: clamp(11px, 1.5vmin, 16px);
  color: var(--text-dim);
  text-align: right;
}

/* ---------- Dimknop ---------- */
#dim-btn {
  position: fixed;
  bottom: clamp(10px, 1.8vmin, 20px);
  left: clamp(10px, 1.8vmin, 20px);
  z-index: 998;
  font-size: clamp(18px, 3vmin, 32px);
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: clamp(6px, 1.2vmin, 14px);
  cursor: pointer;
  opacity: .45;
  transition: opacity .2s;
  line-height: 1;
}
#dim-btn:hover,
#dim-btn:active { opacity: 1; }

/* ---------- Dimmer ---------- */
#dimmer {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
  z-index: 999;
}
body.is-dimmed #dimmer { opacity: .96; pointer-events: all; }

/* Klok drijft boven de overlay */
body.is-dimmed .clock {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

/* Dimknop blijft zichtbaar */
body.is-dimmed #dim-btn { z-index: 1000; opacity: .5; }

/* Portrait fallback (if the panel rotation changes) */
@media (orientation: portrait) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: 1.1fr .9fr 1.2fr;
    grid-template-areas:
      "left"
      "quote"
      "ns";
  }
}
