/* ==========================================================================
   Podlets tool — Nova-inspired Dark Glassmorphic Design
   Inspired by nova-app.eu: Deep slate background, amethyst & sapphire accents,
   frosted glass surfaces, glowing borders, and modern typography.
   ========================================================================== */

@font-face {
  font-family: 'Twemoji Country Flags';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/TwemojiCountryFlags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-color: #0d1117;
  --text-color: #e6edf3;
  --text-muted: #8b949e;
  --primary: #1e60d4;
  --accent-amethyst: #a371f7;
  --accent-sapphire: #58a6ff;
  --accent-emerald: #10b981;
  
  --card-bg: rgba(18, 22, 29, 0.65);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-hover: rgba(88, 166, 255, 0.35);
  --glass-header: rgba(13, 17, 23, 0.75);

  --font-stack: 'Twemoji Country Flags', 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Motion tokens: custom curves make animation feel intentional.
     Built-in ease/ease-out are too weak (Emil / animations.dev). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 140ms;
  --dur-ui: 180ms;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  color-scheme: dark;
  -webkit-tap-highlight-color: rgba(88, 166, 255, 0.25);
}

body {
  font-family: var(--font-stack);
  font-weight: 600;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Background interactive Vanta.js Topology canvas (ambient and quiet) */
#vanta-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--bg-color);
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#vanta-bg.vanta-loaded {
  opacity: 0.35;
}

#vanta-bg canvas,
#vanta-bg .vanta-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent-sapphire);
  outline-offset: 3px;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem min(5%, 72px);
  background: var(--glass-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(30, 96, 212, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.2);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-decoration: none;
  background: linear-gradient(135deg, #79c0ff 0%, #388bfd 55%, #1e60d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #58a6ff;
}

.header-donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.header-donate-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.header-donate-btn svg {
  color: var(--text-muted);
  transition: color 150ms var(--ease-out);
}

.header-donate-btn:hover svg {
  color: #f59e0b;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 min(5%, 72px);
}

/* Hero Section */
.hero {
  text-align: center;
  margin: 2rem 0;
  position: relative;
}

.hero-title {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.4px;
  width: 100%;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #ffffff 15%, #79c0ff 55%, #388bfd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #79c0ff;
  text-wrap: balance;
}

.hero-desc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: min(820px, 94%);
  margin: 0 auto;
  background: rgba(18, 22, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 2.2rem 1.4rem;
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  line-height: 1.45;
  text-align: center;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 90px;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.hero-desc > * {
  position: relative;
  z-index: 2;
}

.hero-desc-lead {
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.hero-desc-sub {
  font-size: clamp(0.78rem, 1.25vw, 0.92rem);
  color: var(--text-muted);
  line-height: 1.45;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hero-btn {
  padding: 0.65rem 1.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.2px;
  min-width: 170px;
}

.hero-btn svg {
  width: 18px;
  height: 18px;
}

.hero-btn.secondary {
  box-shadow: none;
}

/* Products Cards Grid */
.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.6rem 1.5rem;
  scroll-margin-top: 100px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card > * {
  position: relative;
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    border-color: var(--card-border-hover);
  }
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.card-badge {
  background: rgba(30, 96, 212, 0.12);
  color: #79c0ff;
  border: 1px solid rgba(88, 166, 255, 0.25);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: none;
  white-space: nowrap;
  max-width: calc(100% - 70px);
  text-align: center;
  line-height: 1.25;
}

@media (max-width: 480px) {
  .card-badge {
    white-space: normal;
  }
}

.card-badge.amethyst,
.card-badge.badge-amethyst {
  background: rgba(163, 113, 247, 0.12);
  color: #d2a8ff;
  border: 1px solid rgba(163, 113, 247, 0.3);
  box-shadow: none;
}

.card-badge.emerald,
.card-badge.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #7ee787;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: none;
}

.card-badge.badge-sapphire {
  background: rgba(30, 96, 212, 0.12);
  color: #79c0ff;
  border: 1px solid rgba(88, 166, 255, 0.25);
  box-shadow: none;
}

.card-badge.badge-ruby {
  background: rgba(244, 63, 94, 0.12);
  color: #ff7b72;
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: none;
}

.card-badge.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: none;
}

.card-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(30, 96, 212, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.25);
  display: grid;
  place-items: center;
  color: var(--accent-sapphire);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card[data-prog="vless"] .card-icon-wrap {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.card[data-prog="tg"] .card-icon-wrap {
  background: rgba(163, 113, 247, 0.12);
  border-color: rgba(163, 113, 247, 0.3);
  color: var(--accent-amethyst);
}

.card[data-prog="tgproxy"] .card-icon-wrap {
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.28);
  color: var(--accent-sapphire);
}

.card-icon-wrap svg {
  width: 30px;
  height: 30px;
}

.card h2 {
  font-size: clamp(1.4rem, 1.8vw, 1.65rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: #ffffff;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  text-wrap: balance;
}

.card-subtitle {
  color: var(--accent-sapphire);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  min-height: 2.8rem;
  line-height: 1.4;
}

.card[data-prog="vless"] .card-subtitle {
  color: var(--accent-emerald);
}

.card[data-prog="tg"] .card-subtitle {
  color: var(--accent-amethyst);
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 1.2rem;
  min-height: 4.8rem;
  flex: 1;
  display: flex;
  align-items: flex-start;
}

/* Buttons (Nova Style) */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.2rem;
  width: 100%;
  min-height: 102px;
}

.card-actions .btn-row {
  display: flex;
  gap: 0.65rem;
  width: 100%;
}

.card-actions .btn-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.card-actions .btn-row .btn,
.card-actions .btn-row-3 .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 4px;
  font-size: 0.82rem;
  gap: 5px;
}

.card-actions .btn-full {
  width: 100%;
  padding: 0.78rem 1rem;
  font-size: 0.92rem;
}

.card-actions .btn {
  height: 48px;
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.78rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform var(--dur-press) var(--ease-out), box-shadow 200ms var(--ease-out),
    background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), color 200ms var(--ease-out);
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

/* Click Ripple Burst */
.ripple-burst {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 60%, transparent 100%);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  z-index: 5;
}

@media (prefers-reduced-motion: no-preference) {
  .ripple-burst {
    animation: rippleExpand 520ms cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
  }
}

@keyframes rippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: #1e60d4;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover {
    background: #1a52b8;
    box-shadow: 0 4px 12px rgba(30, 96, 212, 0.35);
    transform: translateY(-1px);
    color: #fff;
  }
}

.btn.secondary {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6edf3;
}

@media (hover: hover) and (pointer: fine) {
  .btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
    color: #fff;
  }
}

/* Press feedback must survive the hover lift */
.btn.primary:hover:active,
.btn.secondary:hover:active {
  transform: translateY(-1px) scale(0.97);
}

.card[data-prog="vless"] .btn.primary {
  background: #059669;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .card[data-prog="vless"] .btn.primary:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
  }
}

.card[data-prog="vless"] .btn.secondary {
  border-color: rgba(255, 255, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  .card[data-prog="vless"] .btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
  }
}

.btn.copied {
  background: #059669 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
  color: #fff !important;
  border: none !important;
}

.btn.failed {
  background: rgba(248, 113, 113, 0.25) !important;
  color: #fca5a5 !important;
  border-color: #f87171 !important;
}

/* ========================================================================
   Карточка «Telegram Прокси» (Вариант 1 из test.html)
   ======================================================================== */
.tv-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.6rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  margin-bottom: 2.8rem;
  scroll-margin-top: 100px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 650px;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.45);
  }
}

.tv-card h2 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  color: #fff;
  min-height: auto;
  margin-bottom: 0.25rem;
}

.tv-card .card-subtitle {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-sapphire);
  line-height: 1.4;
  min-height: auto;
  margin-bottom: 0.65rem;
}

.tv-card .tv-card-desc,
.tv-card .card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.15rem;
  font-weight: 600;
  min-height: auto;
}

/* Кнопка «Показать все / Скрыть» для прокси свыше 9 */
.tv-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.85rem;
}

.tv-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c9d1d9;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out),
    color 180ms var(--ease-out), transform var(--dur-press) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tv-more-btn:hover {
    background: rgba(88, 166, 255, 0.12);
    border-color: rgba(88, 166, 255, 0.4);
    color: #fff;
  }
}

.tv-more-btn:active {
  transform: scale(0.97);
}

.tv-more-icon {
  flex: 0 0 auto;
  transition: transform 220ms var(--ease-out);
}

.tv-more-btn.is-expanded .tv-more-icon {
  transform: rotate(180deg);
}

@media (max-width: 560px) {
  .tv-more-btn {
    width: 100%;
  }
}

.tv-bar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(88, 166, 255, 0.05);
  border: 1px solid rgba(88, 166, 255, 0.14);
  padding: 0.6rem 0.95rem;
  border-radius: 12px;
}

.tv-bar-tip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(0.74rem, 0.9vw, 0.82rem);
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1 1 auto;
  min-width: 0;
}

.tv-bar-tip span {
  white-space: nowrap;
}

.tv-bar-tip svg {
  flex: 0 0 auto;
  color: var(--accent-sapphire);
}

.tv-bar .tv-copy-all-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 36px;
  padding: 0 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 6px;
  border-radius: 8px;
}

.tv-bar .tv-copy-all-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 820px) {
  .tv-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .tv-bar-tip span {
    white-space: normal;
    font-size: 0.82rem;
  }
  .tv-bar .tv-copy-all-btn {
    width: 100%;
    height: 42px;
  }
}

.tv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.tv-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-emerald);
}

.tv-foot-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-foot-bot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e6edf3;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.28);
  text-decoration: none;
  transition: background-color var(--duration-fast, 0.15s) var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color var(--duration-fast, 0.15s) var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)),
    color var(--duration-fast, 0.15s) var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)),
    transform var(--duration-fast, 0.15s) var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1));
}

@media (hover: hover) and (pointer: fine) {
  .tv-foot-bot-btn:hover {
    background: rgba(88, 166, 255, 0.22);
    border-color: rgba(88, 166, 255, 0.55);
    color: #fff;
    transform: translateY(-1px);
  }
  .tv-foot-bot-btn:hover svg {
    transform: rotate(-10deg) scale(1.1);
    color: #79b8ff;
  }
}

.tv-foot-bot-btn:active {
  transform: translateY(0) scale(0.97);
}

.tv-foot-bot-btn svg {
  color: #58a6ff;
  transition: transform var(--duration-fast, 0.15s) var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)),
    color var(--duration-fast, 0.15s) var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1));
}

@media (max-width: 540px) {
  .tv-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .tv-foot-right {
    width: 100%;
    justify-content: space-between;
  }
}

.tv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: no-preference) {
  .tv-dot {
    animation: tvPulse 2.4s var(--ease-in-out) infinite;
  }
}

@keyframes tvPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* --- Пинг-бейдж --- */
.tv-ping {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.46rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
  white-space: nowrap;
}

.tv-ping.is-mid {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.tv-ping.is-slow {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

.tv-ping-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
  flex: 0 0 auto;
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .tv-ping-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.75;
    animation: tvPingRadar 2.2s cubic-bezier(0.1, 0.7, 0.3, 1) infinite;
    pointer-events: none;
  }
}

@keyframes tvPingRadar {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

.tv-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out),
    color 160ms var(--ease-out), transform 160ms var(--ease-out);
  position: relative;
  z-index: 2;
}

.tv-copy-btn svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tv-copy-btn:hover {
    background: rgba(88, 166, 255, 0.22);
    border-color: rgba(88, 166, 255, 0.5);
    color: #e6edf3;
    transform: scale(1.08);
  }
}

.tv-copy-btn:active {
  transform: scale(0.97);
}

.tv-copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.tv-copy-btn.copied svg {
  transform: scale(1.1);
}

/* Сетка карточек-прокси (Плитка) */
.tv-v1-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

/* Скрытие плиток свыше 9, если список не раскрыт */
.tv-v1-grid:not(.is-expanded) .tv-tile:nth-child(n+10) {
  display: none !important;
}

/* Анимация плавного появления при раскрытии */
.tv-v1-grid.is-expanded .tv-tile:nth-child(n+10) {
  animation: tvTileIn 200ms var(--ease-out) both;
}

@keyframes tvTileIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tv-tile {
  --tile-color: var(--accent-sapphire);
  --tile-rgb: 88, 166, 255;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  text-decoration: none;
  background: rgba(var(--tile-rgb), 0.08);
  border: 1px solid rgba(var(--tile-rgb), 0.24);
  color: #e6edf3;
  min-width: 0;
  transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out),
    border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

/* Шахматная расцветка: Сапфир (синий) и Аметист (фиолетовый) */
/* 1. Десктоп (3 колонки): чередование нечётный / чётный */
@media (min-width: 901px) {
  .tv-tile:nth-child(even) {
    --tile-color: var(--accent-amethyst);
    --tile-rgb: 163, 113, 247;
  }
}

/* 2. Планшет (2 колонки): шахматная диагональ */
@media (max-width: 900px) and (min-width: 561px) {
  .tv-tile:nth-child(4n+2),
  .tv-tile:nth-child(4n+3) {
    --tile-color: var(--accent-amethyst);
    --tile-rgb: 163, 113, 247;
  }
}

/* 3. Мобильный (1 колонка): поочередное чередование строк */
@media (max-width: 560px) {
  .tv-tile:nth-child(even) {
    --tile-color: var(--accent-amethyst);
    --tile-rgb: 163, 113, 247;
  }
}

@media (hover: hover) and (pointer: fine) {
  .tv-tile:hover {
    transform: translateY(-2px);
    background: rgba(var(--tile-rgb), 0.16);
    border-color: rgba(var(--tile-rgb), 0.55);
    box-shadow: 0 6px 18px rgba(var(--tile-rgb), 0.22);
  }
}

.tv-tile:active {
  transform: scale(0.97);
}

.tv-tile:hover:active {
  transform: translateY(-2px) scale(0.97);
}

.tv-tile.is-tried {
  background: rgba(var(--tile-rgb), 0.13);
  border-color: rgba(var(--tile-rgb), 0.45);
}

.tv-tile.is-tried .tv-tile-icon {
  background: rgba(var(--tile-rgb), 0.22);
  border-color: rgba(var(--tile-rgb), 0.55);
  box-shadow: 0 0 10px rgba(var(--tile-rgb), 0.35);
  position: relative;
}

.tv-tile.is-tried .tv-tile-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tile-color);
  border: 1px solid #0d1117;
  box-shadow: 0 0 6px var(--tile-color);
}

.tv-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(var(--tile-rgb), 0.14);
  border: 1px solid rgba(var(--tile-rgb), 0.25);
  color: var(--tile-color);
}

.tv-tile-icon svg {
  width: 17px;
  height: 17px;
}

.tv-tile-body {
  flex: 1 1 auto;
  min-width: 0;
}

.tv-tile-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-tile-meta {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-proxy-empty {
  padding: 1.8rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .tv-v1-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tv-v1-grid {
    grid-template-columns: 1fr;
  }
}

/* Skip link: скрыт визуально до фокуса (Tab) — доступ для клавиатуры/скринридеров */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 0.7rem 1rem;
  background: #0d1117;
  color: var(--accent-sapphire);
  border: 1px solid var(--accent-sapphire);
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

/* Key box for subscription URL */
.key-box-wrapper {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.key-box {
  position: relative;
  overflow: hidden;
  background: rgba(13, 17, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 70px;
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-ui) var(--ease-out),
    background-color var(--dur-ui) var(--ease-out);
  cursor: pointer;
  /* Reset встроенного вида <button> — контент остаётся нашим */
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.key-box:active {
  transform: scale(0.97);
}

/* Статичная заметка (не кликается): снимаем pointer-семантику и hover */
.key-box.is-note {
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .key-box.is-note:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(13, 17, 23, 0.75);
  }
}

@media (hover: hover) and (pointer: fine) {
  .key-box:hover {
    border-color: rgba(88, 166, 255, 0.4);
    background: rgba(13, 17, 23, 0.95);
  }

  .card[data-prog="vless"] .key-box:hover {
    border-color: rgba(16, 185, 129, 0.4);
  }

  .card[data-prog="tg"] .key-box:hover {
    border-color: rgba(163, 113, 247, 0.4);
  }
}

.key-text-wrap {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.key-label {
  font-size: 0.72rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.key-text {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #86efac;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.card[data-prog="tg"] .key-text {
  font-family: inherit;
  font-size: clamp(0.7rem, 3.6vw, 0.88rem);
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

/* Collapsible interactive guide panel.
   grid-template-rows: 0fr → 1fr вместо max-height: больше нет magic-number
   обрезки контента; анимируется layout-высота, но это единственный чистый
   vanilla-способ. Выход (150ms) быстрее входа (250ms). */
.guide-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  margin-top: 0;
  transition: grid-template-rows 150ms var(--ease-out), opacity 150ms var(--ease-out),
    margin-top 150ms var(--ease-out), visibility 0s linear 150ms;
}

.guide-panel.open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-top: 1.4rem;
  transition: grid-template-rows 250ms var(--ease-out), opacity 200ms var(--ease-out),
    margin-top 250ms var(--ease-out), visibility 0s linear 0s;
}

.guide-panel > * {
  min-height: 0;
  overflow: hidden;
}

.guide-panel:not(.open) .guide-content {
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
}

.guide-content {
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  font-size: 0.92rem;
  color: #c9d1d9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: padding 150ms var(--ease-out), border-width 150ms var(--ease-out);
}

.guide-panel.open .guide-content {
  transition: padding 250ms var(--ease-out), border-width 250ms var(--ease-out);
}

/* Tabs for OS in Guide Drawer */
.tabs-os-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.tab-os-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0.45rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .tab-os-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
  }
}

.tab-os-btn.active {
  color: #fff;
  background: rgba(88, 166, 255, 0.25);
  border: 1px solid rgba(88, 166, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tab-os-panel {
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}

.tab-os-panel.active {
  display: flex;
}

@media (max-width: 480px) {
  .card-actions .btn-row-3 {
    grid-template-columns: 1fr 1fr;
  }
  .card-actions .btn-row-3 #toggleQwdttGuide {
    grid-column: span 2;
    order: 3;
    font-size: 0.88rem;
  }
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.guide-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(30, 96, 212, 0.25);
  border: 1px solid rgba(88, 166, 255, 0.4);
  color: var(--accent-sapphire);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.guide-tip {
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}

.guide-tip a {
  color: var(--accent-sapphire);
  text-decoration: none;
  font-weight: 700;
}
.guide-tip a:hover {
  text-decoration: underline;
}

.btn.secondary.active {
  background: rgba(163, 113, 247, 0.22);
  border-color: var(--accent-amethyst);
  color: #fff;
}

.card[data-prog="tg"] .guide-content {
  border-color: rgba(163, 113, 247, 0.25);
}

.card[data-prog="tg"] .guide-step-num {
  background: rgba(163, 113, 247, 0.22);
  border-color: rgba(163, 113, 247, 0.4);
  color: var(--accent-amethyst);
}

.card[data-prog="tg"] .guide-tip a {
  color: var(--accent-amethyst);
}

/* Внутрикарточные мини-окна инструкций поверх контента (qWDTT, VLESS и Podlets TG Proxy):
   инструкция раскрывается внутри карточки, не меняя её высоту. */
.card-swap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.card[data-prog="tg"] .guide-panel,
.card[data-prog="qwdtt"] .guide-panel,
.card[data-prog="vless"] .guide-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out),
    visibility 0s linear 180ms;
}

.card[data-prog="tg"].is-guide-open .guide-panel,
.card[data-prog="qwdtt"].is-guide-open .guide-panel,
.card[data-prog="vless"].is-guide-open .guide-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out),
    visibility 0s linear 0s;
}

/* Пока открыта инструкция, текст и кнопки скрыты (но остаются в разметке). */
.card[data-prog="tg"].is-guide-open .card-swap > :not(.guide-panel),
.card[data-prog="qwdtt"].is-guide-open .card-swap > :not(.guide-panel),
.card[data-prog="vless"].is-guide-open .card-swap > :not(.guide-panel) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.card[data-prog="tg"] .guide-panel > .guide-content,
.card[data-prog="qwdtt"] .guide-panel > .guide-content,
.card[data-prog="vless"] .guide-panel > .guide-content {
  width: 100%;
  max-height: 100%;
  padding: 0.85rem;
  gap: 0.45rem;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-color);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Компактная верстка панели, чтобы инструкция помещалась без роста карточки */
.card[data-prog="tg"] .guide-panel .guide-head,
.card[data-prog="qwdtt"] .guide-panel .guide-head,
.card[data-prog="vless"] .guide-panel .guide-head {
  margin-bottom: 0;
}

.card[data-prog="tg"] .guide-panel .guide-step,
.card[data-prog="qwdtt"] .guide-panel .guide-step {
  line-height: 1.4;
}

.card[data-prog="tg"] .guide-panel .guide-step-num,
.card[data-prog="qwdtt"] .guide-panel .guide-step-num {
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
}

.card[data-prog="tg"] .guide-panel .guide-tip,
.card[data-prog="qwdtt"] .guide-panel .guide-tip,
.card[data-prog="vless"] .guide-panel .guide-tip {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  font-size: 0.8rem;
}

/* Компактные табы операционных систем внутри мини-окна qWDTT */
.card[data-prog="qwdtt"] .guide-panel .tabs-os-nav {
  margin-bottom: 0.35rem;
  padding: 3px;
  gap: 4px;
}

.card[data-prog="qwdtt"] .guide-panel .tab-os-btn {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.card[data-prog="qwdtt"] .guide-panel .tab-os-panel {
  gap: 0.45rem;
}

#toggleQwdttGuide.active {
  background: rgba(30, 96, 212, 0.22);
  border-color: var(--accent-sapphire);
  color: #fff;
}

#toggleVlessClients.active {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  color: #fff;
}

.card[data-prog="vless"] .guide-panel .clients-list {
  gap: 6px;
}

.card[data-prog="vless"] .guide-panel .client-platform {
  padding: 6px 10px;
}

/* Шапка панели инструкции */
.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.guide-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
}

.guide-close {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #c9d1d9;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--dur-ui) var(--ease-out),
    border-color var(--dur-ui) var(--ease-out), transform var(--dur-press) var(--ease-out);
}

.guide-close:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .guide-close:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.25);
  }
  .card[data-prog="qwdtt"] .guide-close:hover {
    border-color: rgba(88, 166, 255, 0.5);
  }
  .card[data-prog="vless"] .guide-close:hover {
    border-color: rgba(16, 185, 129, 0.5);
  }
  .card[data-prog="tg"] .guide-close:hover {
    border-color: rgba(163, 113, 247, 0.5);
  }
}

.card[data-prog="vless"] .guide-content {
  border-color: rgba(16, 185, 129, 0.25);
}

.card[data-prog="vless"] .guide-tip a {
  color: var(--accent-emerald);
}

/* Supported Clients Drawer Styles */
.clients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.client-platform {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 8px 12px;
}

.client-platform-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.client-names {
  font-size: 0.88rem;
  color: #e6edf3;
  line-height: 1.4;
}

/* Footer (Nova Style) */
footer {
  text-align: center;
  padding: 2rem 5% 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
  background: rgba(13, 17, 23, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  content-visibility: auto;
  contain-intrinsic-size: 1px 180px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  flex-wrap: wrap;
}

.footer-links a,
.footer-link-btn {
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  transition: color var(--dur-ui) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover,
  .footer-link-btn:hover {
    color: var(--accent-sapphire);
  }
}

.footer-links a:active,
.footer-link-btn:active {
  color: var(--accent-sapphire);
}

.footer-note {
  font-size: 0.85rem;
  color: #6e7681;
}

/* ==========================================================================
   Donate Modal (Nova Glassmorphism)
   ========================================================================== */
.donate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.2rem 1rem 3rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease-out), visibility 220ms var(--ease-out);
}

.donate-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.donate-modal-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: rgba(15, 20, 28, 0.96);
  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 22px;
  padding: 1.8rem 1.4rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(88, 166, 255, 0.14);
  text-align: center;
  margin: auto;
  flex-shrink: 0;
  transform: perspective(1000px) scale(0.92) translateY(10px);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms var(--ease-out), border-color 200ms ease;
  overflow: hidden;
}

.donate-modal-overlay.open .donate-modal-card {
  transform: perspective(1000px) scale(1) translateY(0);
}

/* Mouse Spotlight внутри окна */
.donate-modal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    360px circle at var(--modal-mouse-x, -999px) var(--modal-mouse-y, -999px),
    rgba(88, 166, 255, 0.12),
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .donate-modal-card:hover::before {
    opacity: 1;
  }
}

.donate-modal-card > * {
  position: relative;
  z-index: 2;
}

.donate-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform var(--dur-press) var(--ease-out);
  font-family: inherit;
  padding: 0;
  z-index: 3;
}

.donate-modal-close:active {
  transform: scale(0.97);
}

.donate-modal-close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  .donate-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

/* Иконка чашки */
.donate-cup-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.donate-cup-svg {
  color: #f59e0b;
}

.donate-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
}

.donate-modal-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 1.1rem 0;
}

/* ==========================================================================
   Telegram Stars & Crypto Bot Banner (Stars)
   ========================================================================== */
.donate-stars-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  text-decoration: none;
  text-align: left;
  transition: border-color var(--duration-fast, 0.18s) ease,
              background-color var(--duration-fast, 0.18s) ease;
  position: relative;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .donate-stars-card:hover {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.12);
  }
}

.donate-stars-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.donate-stars-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.donate-stars-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.donate-stars-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.donate-stars-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.donate-stars-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.donate-stars-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #8b949e);
  line-height: 1.35;
  margin: 0;
}

.donate-stars-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef3c7;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color var(--duration-fast, 0.18s) ease,
              border-color var(--duration-fast, 0.18s) ease,
              color var(--duration-fast, 0.18s) ease;
}

.donate-stars-action svg {
  transition: transform var(--duration-fast, 0.18s) ease;
}

@media (hover: hover) and (pointer: fine) {
  .donate-stars-card:hover .donate-stars-action {
    background: rgba(245, 158, 11, 0.35);
    border-color: rgba(245, 158, 11, 0.7);
    color: #fff;
  }

  .donate-stars-card:hover .donate-stars-action svg {
    transform: translateX(3px);
  }
}

@media (max-width: 540px) {
  .donate-stars-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .donate-stars-action {
    justify-content: center;
    width: 100%;
  }
}

/* ==========================================================================
   Crypto Wallets Stack (TON, TRON, BTC, ETH)
   ========================================================================== */
.donate-crypto-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.donate-crypto-card {
  background: linear-gradient(135deg, rgba(20, 26, 36, 0.9) 0%, rgba(13, 17, 24, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .donate-crypto-card:hover {
    transform: translateY(-2px);
  }
  .donate-crypto-card.ton-card:hover {
    border-color: rgba(0, 136, 204, 0.45);
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.18);
  }
  .donate-crypto-card.trx-card:hover {
    border-color: rgba(38, 161, 123, 0.45);
    box-shadow: 0 8px 24px rgba(38, 161, 123, 0.18);
  }
  .donate-crypto-card.btc-card:hover {
    border-color: rgba(247, 147, 26, 0.45);
    box-shadow: 0 8px 24px rgba(247, 147, 26, 0.18);
  }
  .donate-crypto-card.eth-card:hover {
    border-color: rgba(98, 126, 234, 0.45);
    box-shadow: 0 8px 24px rgba(98, 126, 234, 0.18);
  }
}

.donate-crypto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.donate-crypto-pill {
  display: inline-flex;
  gap: 4px;
}

.crypto-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  color: #fff;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.crypto-tag.ton {
  background: #0088cc;
}

.crypto-tag.usdt {
  background: #26a17b;
}

.crypto-tag.gram {
  background: #0098ea;
}

.crypto-tag.trx {
  background: #eb0029;
}

.crypto-tag.btc {
  background: #f7931a;
}

.crypto-tag.eth {
  background: #627eea;
}

.donate-crypto-net {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.donate-crypto-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  transition: background 180ms ease, border-color 180ms ease;
}

.donate-crypto-body:hover {
  background: rgba(0, 0, 0, 0.52);
  border-color: rgba(255, 255, 255, 0.16);
}

.donate-crypto-addr {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.4;
  color: #79c0ff;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  user-select: all;
  -webkit-user-select: all;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.trx-card .donate-crypto-addr {
  color: #34d399;
}

.btc-card .donate-crypto-addr {
  color: #ffc566;
}

.eth-card .donate-crypto-addr {
  color: #a5b4fc;
}

.donate-crypto-copy {
  flex: 0 0 auto !important;
  width: auto !important;
  height: 30px;
  padding: 0 10px;
  font-size: 0.74rem;
  border-radius: 6px;
  white-space: nowrap;
}

.donate-modal-footer {
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 540px) {
  .donate-modal-overlay {
    padding: 1.2rem 0.6rem 2.5rem;
    align-items: flex-start;
  }
  .donate-modal-card {
    padding: 1.8rem 0.95rem 1.2rem;
    border-radius: 18px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    transform: none !important;
  }
  .donate-modal-overlay.open .donate-modal-card {
    transform: none !important;
  }
  .donate-modal-close {
    top: 12px;
    right: 12px;
  }
  .donate-modal-title {
    font-size: 1.15rem;
  }
  .donate-modal-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 0.9rem;
  }
  .donate-crypto-head {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.5rem;
  }
  .donate-crypto-card {
    padding: 0.75rem 0.8rem;
  }
  .donate-crypto-body {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0.6rem 0.65rem;
  }
  .donate-crypto-addr {
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
    padding: 2px 0;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .donate-crypto-copy {
    width: 100% !important;
    height: 32px;
    font-size: 0.76rem;
    justify-content: center;
  }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .products {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .card h2,
  .card-subtitle,
  .card-desc,
  .key-box {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  header {
    padding: 0.75rem 4%;
  }
  .logo-text {
    font-size: 1.35rem;
  }
  .hero {
    margin: 1.5rem 0;
  }
  .products {
    margin-bottom: 1.5rem;
  }
  footer {
    padding: 1.5rem 5%;
  }
  .hero-desc {
    width: auto;
    max-width: 100%;
    padding: 1.1rem 1.2rem 1.2rem;
    border-radius: 18px;
  }
  .hero-desc-lead {
    font-size: 1.05rem;
  }
  .hero-title {
    font-size: 1.35rem;
  }
  .hero-desc-sub {
    font-size: 0.88rem;
  }
  .hero-actions {
    margin-top: 1rem;
    gap: 0.75rem;
  }
  .hero-btn {
    width: 100%;
    max-width: 300px;
    padding: 0.65rem 1.4rem;
  }
  .card {
    padding: 1.6rem;
  }
  .card-actions {
    flex-direction: column;
  }
  .card-actions .btn {
    width: 100%;
  }
}

/* Entrance stagger for product cards: simultaneous appearance reads as
   "dumped", a 60ms cascade reads as crafted. Transform/opacity only,
   never blocks interaction, and never runs under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .products .card {
    animation: cardIn 300ms var(--ease-out) both;
  }
  .products .card:nth-child(2) {
    animation-delay: 60ms;
  }
  .products .card:nth-child(3) {
    animation-delay: 120ms;
  }
  .tv-card {
    animation: cardIn 300ms var(--ease-out) 180ms both;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Reduced motion: fewer and gentler — keep color/opacity transitions that
   aid comprehension, remove travel and scale. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .card,
  .key-box,
  .guide-panel,
  .guide-close,
  .hero-btn,
  .footer-links a,
  .tv-tile,
  .tv-foot-bot-btn,
  .tv-more-btn,
  .tv-copy-btn,
  .donate-modal-close,
  .donate-stars-card,
  .donate-stars-action,
  .donate-stars-action svg,
  .donate-crypto-card {
    transition: none !important;
    animation: none !important;
  }
  .btn:hover,
  .btn.primary:hover,
  .btn.secondary:hover,
  .btn:active,
  .btn.primary:hover:active,
  .btn.secondary:hover:active,
  .card:hover,
  .key-box:hover,
  .key-box:active,
  .guide-close:active,
  .tv-tile:hover,
  .tv-tile:active,
  .tv-tile:hover:active,
  .tv-foot-bot-btn:hover,
  .tv-foot-bot-btn:active,
  .tv-more-btn:active,
  .tv-copy-btn:hover,
  .tv-copy-btn:active,
  .donate-modal-close:active,
  .donate-stars-card:hover .donate-stars-action svg,
  .donate-crypto-card:hover {
    transform: none !important;
  }
  .products .card {
    animation: none !important;
  }
  .hero-title,
  .hero-desc,
  .hero-desc::before,
  .hero-desc::after {
    animation: none !important;
  }
  .hero-desc:hover::before,
  .hero-desc:hover::after,
  .card:hover::before,
  .card:hover::after {
    animation: none !important;
    opacity: 0 !important;
  }
  .tv-ping-dot::after {
    animation: none !important;
    display: none !important;
  }
  .ripple-burst {
    display: none !important;
  }
  #vanta-bg {
    transition: none;
  }
}

/* ==========================================================================
   Подсветка карточки при переходе по якорю
   (https://podlets.top/#qwdtt, #vless, #tg-ws, #tg-proxy)

   Задача: открытие ссылки с якорем должно не просто прокрутить страницу,
   а явно показать, к какой карточке ведёт якорь. JS ставит класс
   .is-anchored на карточку (js/main.js), CSS рисует «sonar ping»:
   расходящееся кольцо (outline) + мягкое внутреннее свечение (::after).

   Почему не :target — селектор срабатывает и при history.replaceState
   из обработчика клика по карточке, то есть подсвечивал бы карточку
   при любом клике. Класс ставится только по hashchange/загрузке с якорем.

   Почему outline, а не box-shadow — box-shadow карточки занят ховером;
   outline не режется overflow:hidden самой карточки и наследует
   border-radius в современных браузерах. Внутреннее свечение вынесено
   в отдельный слой ::after, чтобы не конфликтовать с ховером.

   Расходящееся кольцо (outline) анимируется из JS через Web Animations
   API (pingCard в js/main.js), а НЕ через CSS-анимацию на .card.
   Причина: .products .card уже использует animation: cardIn, и любое
   переключение animation на самой карточке (например добавление/снятие
   .is-anchored) пересоздаёт cardIn заново — карточка мигает, исчезая
   на долю секунды. WAAPI не трогает свойство animation, поэтому
   конфликта нет. В CSS остались только базовые значения outline,
   с которых стартует анимация, и свечение ::after (анимация
   псевдолемента с cardIn не конфликтует).
   ========================================================================== */
.card.is-anchored,
.hero-desc.is-anchored {
  outline-width: 2px;
  outline-style: solid;
  outline-color: transparent;
  outline-offset: 3px;
}

.card.is-anchored::after,
.hero-desc.is-anchored::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(88, 166, 255, 0.85),
    inset 0 0 34px rgba(88, 166, 255, 0.22);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .card.is-anchored::after,
  .hero-desc.is-anchored::after {
    animation: anchorGlow 1900ms var(--ease-out) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Без движения: статичная подсветка, пока класс не снят */
  .card.is-anchored,
  .hero-desc.is-anchored {
    outline-color: rgba(88, 166, 255, 0.9);
  }
  .card.is-anchored::after,
  .hero-desc.is-anchored::after {
    opacity: 1;
  }
}

@keyframes anchorGlow {
  0% { opacity: 0; }
  10% { opacity: 1; }
  65% { opacity: 1; }
  100% { opacity: 0; }
}
