/* Вариант C: чёрный фон, моноширинный шрифт, схема маршрутов.
   Схема нарисована рамками CSS, а не картинкой, — так она тянется по ширине
   и одинаково работает на десктопе и на телефоне. */

:root {
  --bg: #0c0f0e;
  --ink: #d6e2dc;
  --ink-dim: #9db0a7;
  --muted: #5e7168;
  --faint: #3f5349;
  --line: #2c3b34;
  --rule: #1e2a24;
  --accent: #7ce0a3;
  --warn: #e8c06a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 34px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── шапка ─────────────────────────────────────────────────────── */

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.brand { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; }

.head-right { display: flex; align-items: center; gap: 14px; }

.stamp { font-size: 12px; color: var(--muted); }

.refresh {
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--line);
  padding: 8px 14px;
  min-height: 36px;
  cursor: pointer;
}

.refresh:hover { border-color: var(--faint); }
.refresh:disabled { color: var(--faint); cursor: default; }

.title {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── схема ─────────────────────────────────────────────────────── */

.you {
  display: inline-block;
  border: 1px solid var(--faint);
  padding: 10px 16px;
  min-width: 170px;
}

.you-name { font-size: 15px; font-weight: 700; }
.you-sub { font-size: 12px; color: var(--muted); min-height: 17px; }

.branches { list-style: none; margin: 16px 0 0; padding: 0; }

.branch {
  position: relative;
  padding: 0 0 26px 78px;
}

/* вертикальный ствол, растущий из блока «ТЫ» */
.branch::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--line);
}

/* Ствол дотягивается вверх до блока «ТЫ» — воздух между ними добавлен
   отступом списка, а линия не должна из-за этого рваться. */
.branch:first-child::before { top: -16px; }

.branch:last-child::before { bottom: auto; height: 22px; }

/* отвод в сторону ветки */
.branch::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 22px;
  width: 42px;
  border-top: 1px solid var(--line);
}

.branch .tip {
  position: absolute;
  left: 66px;
  top: 17px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left-color: var(--faint);
}

.branch .label {
  font-size: 12px;
  color: var(--muted);
  min-height: 17px;
}

.branch .ip {
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  word-break: break-all;
}

.branch .meta { font-size: 11px; color: var(--muted); }

/* главная ветка — крупнее и ярче остальных */
.branch--primary .label {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.branch--primary .ip { font-size: 34px; letter-spacing: -0.02em; }

/* У главной ветки адрес крупнее, поэтому отвод и стрелка опускаются ниже —
   чтобы стрелка указывала на сам адрес, а не на подпись над ним. */
.branch--primary::after { top: 34px; }
.branch--primary .tip { top: 29px; }
.branch--primary .meta { font-size: 12px; }

.branch.is-pending .ip { color: var(--faint); }
.branch.is-failed .ip { color: var(--warn); font-size: 17px; }
.branch--primary.is-failed .ip { font-size: 22px; }

.note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 62ch;
}

/* ── подвал ────────────────────────────────────────────────────── */

.foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}

.sep { color: var(--faint); }

/* ── телефон ───────────────────────────────────────────────────── */

@media (max-width: 620px) {
  .page { padding: 28px 20px 24px; gap: 20px; }
  .you { min-width: 0; }
  .branch { padding-left: 44px; }
  .branch::after { width: 20px; }
  .branch .tip { left: 44px; }
  .branch--primary .ip { font-size: 26px; }
  .branch .ip { font-size: 19px; }
}

/* Ветка, которую из браузера не проверить: вместо адреса — ссылка. */
.branch .manual {
  font-size: 17px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  display: inline-block;
  min-height: 24px;
}

.branch .manual:hover {
  color: var(--ink);
  border-bottom-color: var(--faint);
}

/* Пока ветка проверяется — точки перемигиваются по очереди. Статичные «···»
   не отличить от зависшей страницы. */
.branch .dots span {
  opacity: 0.25;
  animation: dot-blink 1.2s ease-in-out infinite;
}

.branch .dots span:nth-child(2) { animation-delay: 0.2s; }
.branch .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* Часть людей отключает анимацию в системе — уважаем настройку. */
@media (prefers-reduced-motion: reduce) {
  .branch .dots span { animation: none; opacity: 0.5; }
}
