:root {
  --bg: #1B1A1A;
  --bg_light: #2B2A2A;
  --bg_light_alt: #232222;
  --accent: #9D95FF;
  --accent_soft: rgba(157, 149, 255, 0.15);
  --text: #ffffff;
  --text_diamond: #F1F1F1;
  --muted: #888888;
  --muted_alt: #555555;
  --danger: #ff6b6b;
  --success: #4ade80;
  --border: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1200px;
  --pdgs: max(16px, calc((100% - var(--maxw)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

.h1 { font-size: 3rem; font-weight: 600; line-height: 1.15; margin: 0; }
.h1.big { font-size: 4rem; }
.h2 { font-size: 2rem; font-weight: 600; line-height: 1.2; margin: 0; }
.h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; margin: 0; }
.h4 { font-size: 1.125rem; font-weight: 500; line-height: 1.4; margin: 0; }
.h5 { font-size: 0.875rem; font-weight: 600; line-height: 1.4; margin: 0; }
.p { font-size: 1rem; font-weight: 500; line-height: 1.5; margin: 0; }
.p.m { font-size: 0.875rem; }
.p.s { font-size: 0.75rem; }

.muted { color: var(--muted); }
.accent { color: var(--accent); }
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; }

.container {
  padding-left: var(--pdgs);
  padding-right: var(--pdgs);
}

/* Header */
nav#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(27, 26, 26, 0.75);
  border-bottom: 1px solid var(--border);
}
nav#navbar .content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding-left: var(--pdgs);
  padding-right: var(--pdgs);
  gap: 32px;
}
nav#navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
nav#navbar .logo img { height: 34px; width: auto; }
nav#navbar .navigation { display: flex; align-items: center; gap: 32px; }
nav#navbar .navigation ul {
  display: flex;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}
nav#navbar .navigation ul a {
  color: var(--text_diamond);
  font-size: 1rem;
  font-weight: 500;
}

.btn, button.btn, button {
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--bg_light);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background-color .2s, color .2s, border-color .2s, transform .1s;
}
.btn.main, button.main {
  background: var(--accent);
  color: #1B1A1A;
}
.btn.main:hover, button.main:hover { background: #b3acff; }
.btn.ghost { background: transparent; border-color: var(--bg_light); color: var(--text); }
.btn.ghost:hover { background: var(--bg_light); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero {
  padding: 64px 0 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(157,149,255,0.25), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}
.hero .kicker {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent_soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  max-width: 820px;
  margin: 0 auto 16px;
}
.hero p.lead {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

/* Check form */
.check-form {
  max-width: 780px;
  margin: 36px auto 0;
  background: var(--bg_light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.check-form .row {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 10px;
}
.check-form input[type="text"],
.check-form select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, background .2s;
}
.check-form input[type="text"]:focus,
.check-form select:focus { border-color: var(--accent); }
.check-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239D95FF' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.check-form .error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 10px;
  min-height: 18px;
}
.check-form .btn.main {
  padding: 0 24px;
  height: 100%;
  min-height: 48px;
}

/* Map section — шире контейнера контента, чтобы карта занимала всё полотно */
.map-section {
  padding: 32px max(16px, calc((100% - 1440px) / 2)) 8px;
}

/* World map */
.worldmap-wrap {
  background: var(--bg_light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
}
.worldmap {
  width: 100%;
  height: auto;
  min-height: 420px;
  display: block;
  border-radius: var(--radius-sm);
}
@media (min-width: 1024px) {
  .worldmap { min-height: 560px; }
}
@media (min-width: 1440px) {
  .worldmap { min-height: 680px; }
}
/* Точки серверов — скрыты до прилёта кометы */
.worldmap .mp .mp-dot { transition: fill .5s ease, opacity .5s ease; opacity: 0; }
.worldmap .mp .mp-halo {
  fill: none;
  stroke-width: 1;
  opacity: 0;
  transform: scale(0);
  transform-origin: center;
  transform-box: fill-box;
}
/* Жёлтый — в процессе, тёплые волны */
.worldmap .mp.loading .mp-dot { fill: #fbbf24; opacity: 1; }
.worldmap .mp.loading .mp-halo {
  stroke: rgba(251, 191, 36, 0.8);
  animation: halo-water 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}
/* Зелёный — коннект, мягкие волны */
.worldmap .mp.ok .mp-dot { fill: var(--success); opacity: 1; }
.worldmap .mp.ok .mp-halo {
  stroke: rgba(74, 222, 128, 0.7);
  animation: halo-water 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}
/* Красный — нет коннекта */
.worldmap .mp.err .mp-dot { fill: var(--danger); opacity: 1; }
.worldmap .mp.err .mp-halo {
  stroke: rgba(255, 107, 107, 0.65);
  animation: halo-water 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}
@keyframes halo-water {
  0% { transform: scale(0); opacity: 0.9; stroke-width: 1.5; }
  15% { transform: scale(0.25); opacity: 0.7; }
  100% { transform: scale(1); opacity: 0; stroke-width: 0.2; }
}

/* Комета — голова + дуга-хвост */
.wm-comet-trail {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px var(--accent));
}
.wm-comet-trail.fading {
  opacity: 0;
  transition: opacity 1s ease-out;
}
/* Волны от приземления — как капля в воду */
.wm-ripple {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
  animation: ripple-out 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes ripple-out {
  0% { r: 3; opacity: 0.6; stroke-width: 1.5; }
  30% { opacity: 0.4; }
  100% { r: 20; opacity: 0; stroke-width: 0.2; }
}

/* User location dot */
.user-halo {
  fill: rgba(157, 149, 255, 0.2);
  transform-origin: center;
  transform-box: fill-box;
  animation: user-pulse 2s ease-in-out infinite;
}
@keyframes user-pulse {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.6); opacity: 0.35; }
}

.worldmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
}
.worldmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.worldmap-legend i.lg {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.worldmap-legend i.loading { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.worldmap-legend i.ok { background: var(--success); }
.worldmap-legend i.err { background: var(--danger); }

/* Results */
.results {
  padding: 48px 0 80px;
}
.results .summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg_light_alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.results .summary .stat { display: flex; gap: 16px; align-items: center; }
.results .summary .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.ok { background: rgba(74, 222, 128, 0.14); color: var(--success); }
.badge.err { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.badge.idle { background: rgba(255,255,255,0.06); color: var(--muted); }

.continent {
  margin-bottom: 36px;
}
.continent h3 {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.continent h3::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  background: var(--bg_light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .2s, background .2s;
  min-height: 110px;
}
.card.loading { border-color: var(--accent); }
.card.ok { border-color: rgba(74, 222, 128, 0.4); }
.card.err { border-color: rgba(255, 107, 107, 0.3); }

.card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card .who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card .flag { font-size: 1.25rem; line-height: 1; }
.card .name { font-weight: 600; font-size: 0.875rem; }
.card .sub { color: var(--muted); font-size: 0.7rem; }
.card .status { font-size: 1rem; }
.card .values {
  color: var(--text_diamond);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  line-height: 1.4;
  min-height: 18px;
}
.card .values .val { display: block; }
.card .meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 0.7rem;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(157,149,255,0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* About / Types */
.content-page {
  padding: 72px 0 112px;
  max-width: 880px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.65;
}
.content-page h1 {
  margin-bottom: 24px;
  font-size: 3.25rem;
  line-height: 1.1;
}
.content-page h2 {
  font-size: 1.75rem !important;
  margin: 36px 0 16px !important;
  line-height: 1.25;
}
.content-page p {
  margin-bottom: 20px;
  color: var(--text_diamond);
  font-size: 1.125rem;
  line-height: 1.7;
}
.content-page p.muted { font-size: 1.05rem; }
.content-page ul { color: var(--text_diamond); font-size: 1.125rem; }
.content-page .rtype {
  background: var(--bg_light);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  font-size: 1.05rem;
  line-height: 1.55;
}
.content-page .rtype b {
  color: var(--accent);
  font-size: 1.15rem;
  margin-right: 6px;
}
@media (max-width: 720px) {
  .content-page { font-size: 1rem; padding: 48px 0 64px; }
  .content-page h1 { font-size: 2.25rem; }
  .content-page h2 { font-size: 1.35rem !important; }
  .content-page p, .content-page ul { font-size: 1rem; }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--muted);
  font-size: 1rem;
}
footer .p.s { font-size: 0.95rem; }
footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer .footer-logo { height: 34px; width: auto; opacity: 0.9; }
footer .accent { color: var(--accent); }
@media (max-width: 600px) {
  footer .footer-inner { justify-content: center; text-align: center; }
}

/* 404 */
.nf {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  text-align: center;
}
.nf h1 {
  font-size: 6rem;
  margin: 0;
  background: linear-gradient(135deg, var(--accent), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 720px) {
  .h1 { font-size: 2.25rem; }
  .h1.big { font-size: 2.75rem; }
  .check-form .row {
    grid-template-columns: 1fr;
  }
  nav#navbar .navigation ul { display: none; }
  .hero { padding: 40px 0 24px; }
}
