:root {
  --bg-0: #060b18;
  --bg-1: #0a1330;
  --card: rgba(18, 28, 56, 0.55);
  --card-brd: rgba(120, 160, 255, 0.16);
  --txt: #eaf0ff;
  --txt-dim: #9fb2df;
  --blue-1: #4f8bff;
  --blue-2: #2f6bff;
  --blue-deep: #1b3a8f;
  --orange-1: #ff8a3c;
  --orange-2: #f2600d;
  --radius: 22px;
  --radius-lg: 30px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.75);
}

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

html, body { height: 100%; }

body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--txt);
  background: var(--bg-0);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ===== Фон ===== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 800px at 80% -10%, #12224f 0%, transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, #10173a 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0));
  overflow: hidden;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: float 18s ease-in-out infinite;
}
.aurora--1 { width: 460px; height: 460px; top: -120px; left: -80px; background: #2f6bff; }
.aurora--2 { width: 420px; height: 420px; bottom: -140px; right: -100px; background: #7a3cff; animation-delay: -6s; }
.aurora--3 { width: 360px; height: 360px; top: 40%; left: 50%; background: #0fa4ff; animation-delay: -11s; opacity: 0.35; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.12); }
  66% { transform: translate(-30px, 25px) scale(0.94); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
}

/* ===== Карточка ===== */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--card-brd);
  border-radius: var(--radius-lg);
  padding: 28px 22px 22px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Шапка ===== */
.hero { text-align: center; margin-bottom: 20px; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bcd0ff;
  background: rgba(79, 139, 255, 0.12);
  border: 1px solid rgba(79, 139, 255, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34e08b;
  box-shadow: 0 0 0 0 rgba(52, 224, 139, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 224, 139, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 224, 139, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 224, 139, 0); }
}

.hero__title {
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.title-line {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  white-space: nowrap;
}
.tg-mark {
  display: inline-flex;
  font-size: 0.92em;
  filter: drop-shadow(0 6px 14px rgba(0, 125, 187, 0.55));
  animation: tgPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}
@keyframes tgPop {
  from { opacity: 0; transform: scale(0.4) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
.grad-text {
  background: linear-gradient(120deg, #6ea8ff, #a98bff 55%, #4ecbff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtitle {
  margin-top: 8px;
  color: var(--txt-dim);
  font-size: 15px;
  font-weight: 500;
}
.hero__free {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #b6f6d4;
  background: linear-gradient(135deg, rgba(52, 224, 139, 0.16), rgba(52, 224, 139, 0.05));
  border: 1px solid rgba(52, 224, 139, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 22px -12px rgba(52, 224, 139, 0.6);
}

/* ===== Предупреждение ===== */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(255, 176, 32, 0.10), rgba(255, 176, 32, 0.03));
  border: 1px solid rgba(255, 191, 71, 0.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.notice__icon { flex: 0 0 auto; margin-top: 1px; }
.notice__text { font-size: 13.5px; line-height: 1.5; color: #dfe7ff; }
.notice__text b { color: #ffd77a; font-weight: 700; }

/* ===== Кнопки (общее) ===== */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.2s ease;
}
.btn:active { transform: scale(0.975); }
.btn__icon { display: inline-flex; }
.btn__label { position: relative; z-index: 2; }

/* Спонсор */
.btn--sponsor {
  background: linear-gradient(135deg, var(--orange-1), var(--orange-2));
  box-shadow: 0 12px 30px -8px rgba(242, 96, 13, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  margin-bottom: 18px;
  min-height: 64px;
  font-size: 18px;
}
.btn--sponsor:hover { box-shadow: 0 16px 40px -8px rgba(242, 96, 13, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3); filter: brightness(1.05); }
.btn__glow {
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine {
  0% { left: -60%; }
  55%, 100% { left: 140%; }
}

/* Строка прокси */
.proxies { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.proxy-row { display: flex; gap: 10px; }

.btn--proxy {
  flex: 1;
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  box-shadow: 0 10px 26px -10px rgba(47, 107, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn--proxy:hover { filter: brightness(1.07); box-shadow: 0 14px 34px -10px rgba(47, 107, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

.chip {
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  border-radius: var(--radius);
  background: rgba(24, 38, 74, 0.7);
  border: 1px solid rgba(120, 160, 255, 0.2);
  color: var(--txt-dim);
  font-weight: 700;
  font-size: 14px;
}
.chip small { font-size: 10px; font-weight: 600; color: #7f93c4; text-transform: uppercase; letter-spacing: 0.06em; }
.chip b { color: #cfe0ff; font-size: 15px; }

/* Ghost / поддержка */
.btn--ghost {
  background: rgba(20, 32, 66, 0.5);
  border: 1px solid rgba(120, 160, 255, 0.25);
  color: #d6e2ff;
  min-height: 56px;
  font-size: 16px;
}
.btn--ghost:hover { background: rgba(30, 46, 92, 0.7); border-color: rgba(120, 160, 255, 0.45); }

/* ===== Footer ===== */
.foot { text-align: center; margin-top: 16px; }
.foot__status {
  font-size: 12px;
  color: #6f83b4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.foot__status::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: #34e08b;
}
.foot__status.is-error::before { background: #ff5c5c; }

/* ===== Скелетоны ===== */
.skeleton {
  background: rgba(30, 46, 92, 0.5);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: sweep 1.3s infinite;
}
@keyframes sweep { 100% { transform: translateX(100%); } }
.skeleton.row { height: 60px; margin-bottom: 12px; }

/* ===== Тост ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 26, 54, 0.95);
  border: 1px solid rgba(120, 160, 255, 0.3);
  color: #eaf0ff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Появление строк */
.reveal { animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.reveal:nth-child(1) { animation-delay: 0.04s; }
.reveal:nth-child(2) { animation-delay: 0.10s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.22s; }

/* Планшет и меньше: карточка на всю ширину */
@media (max-width: 480px) {
  body { padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); }
  .card { padding: 24px 18px 20px; border-radius: 26px; }
  .btn { min-height: 58px; font-size: 16px; }
  .btn--sponsor { min-height: 60px; font-size: 17px; }
}

/* Узкие телефоны (iPhone SE и т.п.) */
@media (max-width: 380px) {
  .card { padding: 20px 14px 18px; }
  .hero__title { font-size: 28px; }
  .chip { flex-basis: 80px; font-size: 13px; min-height: 56px; }
  .chip b { font-size: 14px; }
  .btn { min-height: 54px; font-size: 15px; gap: 8px; }
  .btn--proxy { font-size: 15px; }
  .proxies { gap: 10px; }
  .proxy-row { gap: 8px; }
}

/* Совсем маленькие / узкие */
@media (max-width: 340px) {
  .btn__icon { display: none; }
  .chip { flex-basis: 72px; }
}

/* Низкие экраны в альбомной — убираем лишние отступы */
@media (max-height: 720px) {
  .card { animation-duration: 0.4s; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .btn__glow, .dot, .skeleton::after { animation: none; }
  .card, .reveal { animation: none; }
}
