/* ===== Базовые переменные ===== */
:root {
  --bg: #07080d;
  --maj: #7c3aed;      /* фиолетовый Majestic */
  --maj-2: #c026d3;
  --gta: #f97316;      /* оранжевый GTA5RP */
  --gta-2: #ef4444;
  --text: #f4f5fb;
  --muted: #9aa0b4;
  --line: rgba(255, 255, 255, 0.08);
  --speed: 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body { height: 100%; }

body {
  font-family: "Montserrat", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Шапка ===== */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 38px;
}

.topbar__logo {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar__logo .accent { color: var(--gta); }
.topbar__logo .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gta);
  margin-right: 8px;
  box-shadow: 0 0 14px var(--gta);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.topbar__nav { display: flex; gap: 26px; }
.topbar__nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.topbar__nav a:hover, .topbar__nav a.is-active { color: var(--text); }

/* ===== Вопрос ===== */
.prompt {
  position: relative;
  z-index: 30;
  text-align: center;
  padding: 6px 20px 18px;
}
.prompt__small {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.prompt__title {
  font-size: clamp(26px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.12;
  /* обе фразы лежат в одной grid-ячейке -> без скачка высоты */
  display: grid;
  justify-items: center;
}
.prompt__title .ph {
  grid-area: 1 / 1;
  width: 100%;
  white-space: nowrap;   /* десктоп: одна строка, ровный штрих (мобилка переносит) */
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}
@media (max-width: 760px) {
  .prompt__title .ph { white-space: normal; }
}
/* Фраза 2 (GTA) скрыта до смены */
.prompt__title .ph--2 {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
}
/* Смена: фраза 1 уходит вверх, фраза 2 проявляется */
.prompt.swap .ph--1 {
  opacity: 0;
  transform: translateY(-14px);
  filter: blur(4px);
}
.prompt.swap .ph--2 {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.prompt__title .gta {
  background: linear-gradient(90deg, var(--maj-2), var(--gta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.prompt__title .tw { color: var(--muted); }

/* Зачёркивание Twix-фразы: горизонтальный градиентный штрих по ширине текста */
.prompt__title .ph__txt { position: relative; display: inline; }
.ph__strike {
  position: absolute;
  left: -8px; right: -8px; top: 0; bottom: 0;
  pointer-events: none;
}
.ph__strike svg {
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 0.72em;
  transform: translateY(-50%);
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.85));
}
.ph__slash {
  fill: none;
  stroke: url(#strikeGrad);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* ===== Арена ===== */
.arena {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 540px;
  overflow: hidden;
}

.side {
  position: relative;
  flex: 1 1 50%;
  overflow: hidden;
  cursor: pointer;
  transition: flex var(--speed);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Расширение наведённой половины */
.arena:hover .side { flex-grow: 0.85; }
.arena .side:hover { flex-grow: 1.5; }

.side__bg {
  position: absolute;
  inset: 0;
  transition: transform var(--speed), opacity var(--speed);
}
/* Фоновая картинка (assets/*-bg.jpg) лежит поверх градиента.
   Если файла нет — 404 просто игнорируется, остаётся градиент. */
.side--left .side__bg {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(124,58,237,0.45), transparent 60%),
    linear-gradient(135deg, #160a2e 0%, #0b0716 100%);
}
.side--left .side__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: url("../assets/majestic-bg.jpg") center center / cover no-repeat;
  opacity: 0.16;
  mix-blend-mode: luminosity;
}
.side--right .side__bg {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(249,115,22,0.45), transparent 60%),
    linear-gradient(225deg, #2e1505 0%, #160a08 100%);
}
.side--right .side__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: url("../assets/gta5rp-bg.jpg") center center / cover no-repeat;
  opacity: 0.16;
  mix-blend-mode: luminosity;
}

/* Тёмный скрим поверх фонов — гарантирует читаемость текста */
.side__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(120% 80% at 50% 45%, rgba(7,8,13,0.15) 0%, rgba(7,8,13,0.72) 100%);
}
.side:hover .side__bg { transform: scale(1.06); }

/* Светящаяся линия-граница */
.side__glow {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  opacity: 0.7;
}
.side--left .side__glow { right: 0; background: linear-gradient(var(--maj), transparent); }
.side--right .side__glow { left: 0; background: linear-gradient(var(--gta), transparent); }

/* Контент стороны */
.side__content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 30px;
  max-width: 460px;
  transition: transform var(--speed);
}
.side:hover .side__content { transform: translateY(-4px); }

.side__badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-bottom: 18px;
}

.side__logo {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Оригинальный логотип (assets/*-logo.svg|png) */
.side__logo .logo-img {
  max-height: 84px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}
.side--left .side__logo .logo-img { filter: drop-shadow(0 0 24px rgba(124,58,237,0.55)); }
.side--right .side__logo .logo-img { filter: drop-shadow(0 0 24px rgba(249,115,22,0.55)); }
/* Текстовый фолбэк, если файла лого ещё нет */
.side__logo .logo-text i { font-style: normal; }
.side--left .side__logo .logo-text i { color: var(--maj-2); }
.side--right .side__logo .logo-text i { color: var(--gta); }
.side--left .side__logo .logo-text { text-shadow: 0 0 40px rgba(124,58,237,0.5); }
.side--right .side__logo .logo-text { text-shadow: 0 0 40px rgba(249,115,22,0.5); }

.side__tag {
  color: var(--muted);
  margin: 14px auto 26px;
  font-size: 15px;
  max-width: 340px;
}

/* Статистика */
.stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  backdrop-filter: blur(6px);
}
.stat__num {
  font-family: "Oswald", sans-serif;
  font-size: 26px;
  font-weight: 700;
}
.side--left .stat__num { color: #d6b8ff; }
.side--right .stat__num { color: #ffd0a3; }
.stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 4px;
}

/* Список серверов */
.servers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  max-height: 148px;
  overflow-y: auto;
  padding-right: 6px;
  text-align: left;
  transition: max-height var(--speed);
  scrollbar-width: thin;
}
.side:hover .servers { max-height: 260px; }
.servers::-webkit-scrollbar { width: 6px; }
.servers::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }

.srv {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
}
.srv__dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.srv__dot.is-online { background: #39d98a; box-shadow: 0 0 8px #39d98a; }
.srv__dot.is-busy   { background: #ffb020; box-shadow: 0 0 8px #ffb020; }
.srv__dot.is-queue  { background: #ff5a5a; box-shadow: 0 0 8px #ff5a5a; }

.srv__main { min-width: 0; }
.srv__name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srv__bar {
  height: 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  margin-top: 5px;
  overflow: hidden;
}
.srv__fill { height: 100%; border-radius: 3px; width: 0; transition: width 0.9s ease; }
.side--left .srv__fill { background: linear-gradient(90deg, var(--maj), var(--maj-2)); }
.side--right .srv__fill { background: linear-gradient(90deg, var(--gta), var(--gta-2)); }

.srv__count {
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.srv__count b { color: var(--text); }
.srv__count span { color: var(--muted); font-weight: 400; }

/* Кнопка выбора */
.choose-btn {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s, filter 0.2s;
}
.side--left .choose-btn {
  background: linear-gradient(135deg, var(--maj), var(--maj-2));
  box-shadow: 0 10px 30px rgba(124,58,237,0.4);
}
.side--right .choose-btn {
  background: linear-gradient(135deg, var(--gta), var(--gta-2));
  box-shadow: 0 10px 30px rgba(249,115,22,0.4);
}
.choose-btn:hover { transform: translateY(-3px); filter: brightness(1.1); }
.choose-btn:active { transform: translateY(0); }

/* ===== VS центр ===== */
.vs {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.vs__text {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--maj-2), var(--gta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 2;
}
.vs__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line);
  box-shadow: 0 0 0 8px rgba(7,8,13,0.6), 0 0 40px rgba(192,38,211,0.3);
}
.vs::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--maj-2);
  border-bottom-color: var(--gta);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Нижняя плашка ===== */
.compare {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  padding: 18px 20px 26px;
  border-top: 1px solid var(--line);
  background: rgba(7,8,13,0.6);
  backdrop-filter: blur(8px);
}
.compare__item { text-align: center; }
.compare__k {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
.compare__v {
  font-family: "Oswald", sans-serif;
  font-size: 22px;
  font-weight: 700;
}

/* ===== Тост ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 120px);
  padding: 14px 26px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff;
  z-index: 100;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.4s;
  pointer-events: none;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Адаптив ===== */
@media (max-width: 760px) {
  body { display: block; }
  .arena {
    flex-direction: column;
    min-height: auto;
    flex: none;
    overflow: visible;   /* иначе вторая половина обрезается */
  }
  .side {
    flex: none;          /* не даём flex зажимать высоту */
    width: 100%;
    min-height: auto;
    padding: 40px 16px;
  }
  .arena:hover .side, .arena .side:hover { flex: none; }

  /* На тач-экранах нет :hover — раскрываем сразу */
  .side__content { transform: none; }
  .servers { max-height: none; }        /* показываем весь список */
  .side__bg { transform: none !important; }

  /* Фоны под мобилку: держим по центру, ещё тише, чуть сильнее скрим */
  .side__bg::after { opacity: 0.12; background-position: center center !important; }
  .side__bg::before {
    background: radial-gradient(140% 70% at 50% 40%, rgba(7,8,13,0.25) 0%, rgba(7,8,13,0.8) 100%);
  }

  /* Граница между половинами по горизонтали */
  .side--left .side__glow { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 2px;
    background: linear-gradient(90deg, transparent, var(--maj)); }
  .side--right .side__glow { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gta)); }

  /* VS ставим ровно на стык половин: выводим из absolute в поток,
     чтобы он сел между секциями независимо от их высоты */
  .vs {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: -32px auto;   /* половина высоты (64px) — обе секции «наезжают» на VS */
    width: 64px;
    height: 64px;
  }
  .vs__text { font-size: 24px; }

  .topbar { padding: 16px 18px; }
  .topbar__nav { display: none; }
  .compare { gap: 26px; }
}

/* ============================================================
   Заголовок-превращение: reduced-motion и мобильный вариант
   ============================================================ */

/* Если анимация отключена в системе — показываем сразу финальную фразу */
@media (prefers-reduced-motion: reduce) {
  .prompt__title .ph { transition: none !important; }
  .prompt__title .ph--1 { opacity: 0; }
  .prompt__title .ph--2 { opacity: 1; transform: none; filter: none; }
}

/* На мобилке заголовок переносится по словам -> SVG-штрих не годится,
   используем настоящий line-through, аккуратно ложится на каждую строку */
@media (max-width: 760px) {
  .ph__strike { display: none; }
  .prompt__title .ph--1 .ph__txt {
    text-decoration-line: line-through;
    text-decoration-color: transparent;
    text-decoration-thickness: 4px;
    transition: text-decoration-color 0.45s ease;
  }
  .prompt.struck .ph--1 .ph__txt { text-decoration-color: var(--gta); }
}
