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

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  --bg-image: url("https://i.postimg.cc/Wb4zqm4j/image.png");
  background-image:
    linear-gradient(rgba(10, 15, 29, 0.74), rgba(10, 15, 29, 0.9)),
    var(--bg-image, none);
  background-size: cover;
  background-position: center;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg.i { width: 1em; height: 1em; flex: none; }
svg.i-dynmap { overflow: visible; }
.num { font-family: var(--font-title); font-weight: 400; letter-spacing: 0.01em; }

:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; border-radius: 6px; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Заглавие ---------- */
.title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 6px 28px rgba(0, 0, 0, 0.85);
}
.title > span { display: block; }
.title .w { color: var(--flag-white); }
.title .g { color: var(--flag-green); }
.title .r { color: var(--flag-red); }
.title-sm { font-size: clamp(30px, 9vw, 44px); }
.title-xs { font-size: 22px; }

/* ---------- Горна част ---------- */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 0;
  pointer-events: none;
}
.top::before {
  content: '';
  position: absolute;
  inset: 0 0 -56px 0;
  background:
    radial-gradient(ellipse 460px 140px at 50% 35%, rgba(6, 10, 22, 0.92), rgba(6, 10, 22, 0.65) 55%, transparent 80%),
    linear-gradient(rgba(6, 10, 22, 0.88), rgba(6, 10, 22, 0.55) 55%, transparent);
  z-index: -1;
}
.subtitle {
  margin-top: 8px;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 18px rgba(6, 10, 22, 0.9);
}
.search, .load-state, .load-state button { pointer-events: auto; }

.load-state {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.load-state button {
  color: var(--blue-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-top-color: var(--blue-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ъгли ---------- */
.corner { position: fixed; z-index: 10; }
.tl { top: 18px; left: 18px; }
.tr { top: 18px; right: 18px; }
.bl { bottom: 18px; left: 18px; }
.br { bottom: 18px; right: 18px; }
.bc { bottom: 18px; left: 50%; transform: translateX(-50%); }

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(10, 15, 29, 0.72);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.pill b { color: var(--text); font-size: 15px; }

.pill-discord { border-color: rgba(88, 101, 242, 0.45); background: rgba(30, 36, 92, 0.55); color: #c7d2fe; }
.pill-discord svg { width: 18px; height: 18px; color: #a5b4fc; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot-on { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }

.top-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(10, 15, 29, 0.72);
  border: 1px solid rgba(59, 130, 246, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 600;
  transition: border-color var(--t), background var(--t);
}
.top-btn svg { width: 17px; height: 17px; color: var(--gold); }
.top-btn:hover { border-color: var(--blue-2); background: rgba(30, 58, 138, 0.45); }

.zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(10, 15, 29, 0.72);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.zoom button {
  display: grid;
  place-items: center;
  height: 36px;
  min-width: 36px;
  border-radius: 9px;
  color: var(--text);
  transition: background var(--t);
}
.zoom button svg { width: 18px; height: 18px; }
.zoom button:hover { background: rgba(148, 163, 184, 0.12); }
.zoom .zoom-center { display: flex; gap: 8px; padding: 0 12px; font-weight: 600; }
.zoom .zoom-center svg { color: var(--blue-2); }

.credit {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  background: rgba(10, 15, 29, 0.72);
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 13px;
}
.credit img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.credit strong { color: var(--text); font-weight: 700; }

/* ---------- Бутони ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.06);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--t), background var(--t), color var(--t), transform var(--t);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: rgba(148, 163, 184, 0.4); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.btn-gold:hover:not(:disabled) { background: #fbbf24; border-color: #fbbf24; }
.btn-discord { color: var(--blue-2); border-color: rgba(59, 130, 246, 0.55); background: rgba(59, 130, 246, 0.12); }
.btn-discord:hover { background: rgba(59, 130, 246, 0.22); border-color: var(--blue-2); }
.btn-lg { height: 48px; font-size: 16px; padding: 0 22px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  transition: color var(--t), background var(--t);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }
.icon-btn.ok { color: var(--green); }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast svg { width: 16px; height: 16px; color: var(--green); }
.toast-err svg { color: var(--red); }

/* ---------- Телефон ---------- */
.mobile-screen { display: none; }
@media (max-width: 900px), (pointer: coarse) {
  .app, .toasts { display: none; }
  .mobile-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 24px 16px 40px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 140, 255, 0.35) transparent;
  }
  .mobile-heading { width: min(100%, 560px); text-align: center; }
  .mobile-heading .title { margin: 4px auto 0; }
  .mobile-text { margin-top: 12px; color: #cbd5e1; font-size: 17px; font-weight: 600; }
  .mobile-catalog,
  .mobile-seo-content,
  .mobile-faq,
  #mobile-selected { width: min(100%, 560px); }
  .mobile-catalog > h2,
  .mobile-seo-content > h2,
  .mobile-faq > h2 {
    margin-bottom: 7px;
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.25;
  }
  .mobile-catalog-intro { margin-bottom: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .mobile-search { margin: 0 0 12px; }
  .mobile-search input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--search-border);
    border-radius: 10px;
    background: rgba(5, 15, 10, 0.82);
    color: var(--text);
    font: inherit;
  }
  .mobile-search input:focus { outline: 2px solid var(--blue-2); outline-offset: 2px; }
  .mobile-server-list { display: grid; gap: 12px; }
  .mobile-server-card,
  .mobile-selected-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(19, 27, 48, 0.92), rgba(11, 16, 30, 0.95));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  }
  .mobile-server-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .mobile-server-icon {
    width: 44px;
    height: 44px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--well);
    object-fit: cover;
    image-rendering: pixelated;
  }
  .mobile-server-monogram { display: grid; place-items: center; color: var(--blue-2); font-family: var(--font-title); }
  .mobile-server-heading { min-width: 0; flex: 1; }
  .mobile-server-heading h3 { overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-server-heading h3 a { color: inherit; text-decoration: none; }
  .mobile-server-heading p { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-server-status { flex: none; color: var(--muted); font-size: 11px; font-weight: 600; text-align: right; }
  .mobile-server-status.is-online { color: #4ade80; }
  .mobile-server-description { margin: 12px 0; color: #cbd5e1; font-size: 13px; line-height: 1.5; }
  .mobile-server-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
  .mobile-tag { padding: 3px 8px; border: 1px solid rgba(96, 165, 250, 0.24); border-radius: 999px; background: rgba(59, 130, 246, 0.08); color: #bfdbfe; font-size: 10px; font-weight: 700; }
  .mobile-server-ip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 9px 10px; border-radius: 9px; background: var(--well); }
  .mobile-server-ip code,
  .mobile-selected-address code { min-width: 0; overflow-wrap: anywhere; color: #e2e8f0; font: 12px var(--font-mono); }
  .mobile-bedrock-ip { margin-top: 7px; color: var(--muted); font-size: 11px; }
  .mobile-bedrock-ip code { color: #e2e8f0; font: 11px var(--font-mono); overflow-wrap: anywhere; }
  .mobile-copy-ip { flex: none; color: var(--blue-2); font-size: 11px; font-weight: 700; }
  .mobile-server-actions { display: flex; gap: 8px; margin-top: 10px; }
  .mobile-server-actions .btn { flex: 1; min-width: 0; height: 36px; padding: 0 7px; font-size: 11px; }
  .mobile-vote-link { justify-content: center; }
  .mobile-selected-card { border-color: rgba(96, 165, 250, 0.35); }
  .mobile-selected-kicker { color: var(--blue-2); font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
  .mobile-selected-card h2 { margin-top: 5px; font-family: var(--font-title); font-size: 22px; font-weight: 400; }
  .mobile-selected-summary { margin: 9px 0; color: #cbd5e1; font-size: 14px; }
  .mobile-selected-address,
  .mobile-selected-version { margin-top: 8px; color: var(--muted); font-size: 12px; }
  .mobile-selected-description { margin-top: 14px; color: #cbd5e1; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
  .mobile-selected-description > :first-child { margin-top: 0; }
  .mobile-selected-description > :last-child { margin-bottom: 0; }
  .mobile-selected-description p,
  .mobile-selected-description ul,
  .mobile-selected-description ol { margin: 8px 0; }
  .mobile-selected-description ul,
  .mobile-selected-description ol { padding-left: 20px; }
  .mobile-selected-vote { width: 100%; margin-top: 14px; justify-content: center; }
  .mobile-vote-hint,
  .mobile-not-found,
  .mobile-empty,
  .mobile-load-state,
  .mobile-nojs { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .mobile-seo-content p { margin: 8px 0; color: #cbd5e1; font-size: 13px; line-height: 1.65; }
  .mobile-faq details { padding: 11px 0; border-top: 1px solid var(--line); }
  .mobile-faq summary { color: #e2e8f0; font-size: 13px; font-weight: 650; cursor: pointer; }
  .mobile-faq details p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
}

.noscript { position: fixed; inset: auto 0 50% 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
