/* Палитра мельбурнского PID-табло — общая для всех страниц. */
:root {
  --bg:        #0a0e14;
  --panel:     #0f141c;
  --row:       #121924;
  --row-alt:   #0e141d;
  --ink:       #f4f6f8;
  --ink-dim:   #8b98a8;
  --accent:    #ffd21e;   /* фирменный жёлтый мельбурнского PID */
  --accent-2:  #35c1e8;
  --now:       #3ddc84;
  --line:      #1e2836;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.tag {
  background: var(--accent);
  color: #10141a;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: clamp(13px, 1.6vw, 16px);
  text-transform: uppercase;
  text-decoration: none;
}
/* Жёлтая плашка «Электрички» — ссылка на главную. */
.tag:hover { filter: brightness(1.1); }
.tag:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.empty { text-align: center; color: var(--ink-dim); padding: 48px 0; font-size: 18px; }
.empty a { color: var(--accent-2); }

/* Табло станции. Палитра и общие классы (.tag, .empty) — в theme.css. */
body {
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}
/* Под табло — блок .about, его вписывает сервер (src/pages.cpp). */
#root { width: 100%; display: flex; justify-content: center; }
.board {
  width: 100%;
  max-width: 1100px;
  padding: 24px clamp(12px, 3vw, 32px);
}

/* --- Шапка --- */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--accent);
  margin-bottom: 6px;
}
.station {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.station h1 {
  font-size: clamp(24px, 4.2vw, 44px);
  font-weight: 800;
  letter-spacing: .5px;
}
.clock {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

/* --- Заголовки колонок --- */
.cols {
  display: grid;
  grid-template-columns: var(--grid);
  gap: 0 12px;
  padding: 10px 12px;
  color: var(--ink-dim);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.cols .r { text-align: right; }
.cols .c { text-align: center; }

/* --- Строки рейсов --- */
/* Колонки общие у заголовков и строк; последняя — стрелка раскрытия. */
.board { --grid: 92px 1fr 96px 108px 28px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.dep {
  background: var(--row);
  border-left: 4px solid var(--accent-2);
  border-radius: 6px;
  animation: fadein .35s ease;
}
.dep .summary {
  display: grid;
  grid-template-columns: var(--grid);
  gap: 0 12px;
  align-items: center;
  padding: 14px 12px;
  cursor: pointer;
}
.dep .summary:hover { background: rgba(255, 255, 255, .03); }
.dep:nth-child(even) { background: var(--row-alt); }
.dep.soon { border-left-color: var(--now); }

.time {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: 1px;
}
/* Без min-width:0 колонка 1fr распирается длинным текстом: у grid-элемента
   min-width по умолчанию auto, и text-overflow в .stops не срабатывает.
   У Яндекса описание остановок бывает очень длинным («кроме: ...» со
   списком платформ) и ломало вёрстку в горизонтальный скролл. */
.dest { min-width: 0; }
.dest .name {
  font-size: clamp(19px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.1;
}
.dest .stops {
  color: var(--ink-dim);
  font-size: clamp(12px, 1.5vw, 15px);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dest .line-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 6px;
}
.platform {
  text-align: center;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  color: var(--accent);
}
/* Платформа, пришедшая словами ("2 путь"), в крупном кегле не помещается. */
.platform.wordy { font-size: clamp(15px, 1.6vw, 19px); line-height: 1.3; }
.platform .cap {
  display: block;
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 1.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.mins {
  text-align: right;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
}
.mins .u { font-size: 14px; color: var(--ink-dim); font-weight: 600; margin-left: 3px; }
.mins.now { color: var(--now); }
.mins.now .blink { animation: blink 1s steps(2, start) infinite; }

/* --- Показать ещё --- */
.more { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.more button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--row);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 22px;
  cursor: pointer;
}
.more button:hover:not(:disabled) { border-color: var(--accent); }
.more button:disabled { color: var(--ink-dim); cursor: default; }
.more button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.more .less { color: var(--ink-dim); }
.more .less:hover { color: var(--ink); border-color: var(--ink-dim); }

/* --- Раскрытие рейса --- */
.chevron {
  justify-self: end;
  width: 28px; height: 28px;
  border: 0; border-radius: 4px;
  background: none;
  color: var(--ink-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease;
}
.chevron:hover { color: var(--ink); }
.chevron:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.dep.open .chevron { transform: rotate(180deg); }
/* Раскрытый рейс показывает остановки полностью — строка их не дублирует. */
.dep.open .dest .stops { visibility: hidden; }

.details {
  border-top: 1px solid var(--line);
  margin: 0 12px;
  padding: 14px 0 18px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 16px 32px;
  animation: fadein .2s ease;
}
.facts {
  display: flex; flex-direction: column; gap: 10px;
  align-self: start;
  position: sticky; top: 12px;   /* длинный список остановок — сводка остаётся на виду */
}
.facts dt {
  color: var(--ink-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.facts dd { font-size: 17px; font-weight: 600; margin-top: 2px; }

/* Линия остановок: точка на каждой, наша и конечная — крупнее. */
.route { list-style: none; }
.route li {
  position: relative;
  padding: 0 0 10px 24px;
  font-size: 16px;
  line-height: 1.3;
}
.route li::before {
  content: "";
  position: absolute; left: 4px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--row); border: 2px solid var(--accent-2);
}
.route li:not(:last-child)::after {
  content: "";
  position: absolute; left: 9px; top: 15px; bottom: -3px;
  width: 2px; background: var(--accent-2); opacity: .5;
}
.route li.here, .route li.last { font-weight: 700; }
.route li.here::before, .route li.last::before {
  left: 2px; top: 3px; width: 12px; height: 12px;
  background: var(--accent-2);
}
.route li.here { display: flex; gap: 10px; align-items: baseline; }
.route li.here .t { color: var(--accent); font-size: 14px; }
.notes { list-style: none; color: var(--ink-dim); font-size: 15px; line-height: 1.5; }

/* Ссылка на табло другой станции (открывается в новом окне). */
.st-link {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--ink-dim);
  text-underline-offset: 3px;
}
.st-link:hover { color: var(--accent-2); text-decoration-style: solid; text-decoration-color: currentColor; }
.st-link:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 640px) {
  /* Колонки табло на телефоне: иначе строка шире экрана. */
  .board { --grid: 68px minmax(0, 1fr) 44px 64px 22px; }
  .cols, .dep .summary { gap: 0 8px; padding-left: 8px; padding-right: 8px; }
  .cols { font-size: 10px; letter-spacing: .5px; }
  .time { font-size: 22px; letter-spacing: 0; }
  .mins { font-size: 20px; }
  .mins .u { font-size: 11px; }
  header { flex-wrap: wrap; gap: 4px 12px; }
  .details { grid-template-columns: 1fr; margin: 0 8px; }
  .facts { flex-direction: row; flex-wrap: wrap; gap: 10px 24px; position: static; }
}

footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-dim);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.status .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--now); margin-right: 6px; vertical-align: middle;
}
.status.stale .dot { background: #e0533d; }

.attrib { display: inline-flex; align-items: center; gap: 6px; }
.attrib a { color: var(--ink-dim); text-decoration: underline; text-underline-offset: 2px; }
.attrib a:hover { color: var(--ink); }
.attrib img { height: 14px; vertical-align: middle; opacity: .8; }


footer .links { display: inline-flex; gap: 14px; }
footer .all { color: var(--ink-dim); text-decoration: none; }
footer .all:hover { color: var(--ink); text-decoration: underline; }

@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink  { 50% { opacity: .35; } }

/* --- О станции: текст и соседние станции от сервера --- */
.about {
  width: 100%;
  max-width: 1100px;
  padding: 8px clamp(12px, 3vw, 32px) 32px;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.5;
}
.about p { max-width: 70ch; }
.about h2 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.about ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.about a { color: var(--accent-2); text-decoration: none; }
.about a:hover { text-decoration: underline; }
.about .links { margin-top: 14px; }

