/* ================================================================
   XrayNet 
   ================================================================ */
:root {
  --bg:         #080d17;
  --bg2:        #0e1628;
  --bg3:        #151f35;
  --border:     #1e2d4a;
  --border2:    #2a3f66;
  --text:       #c8d6ef;
  --text2:      #7a93b8;
  --accent:     #2563eb;
  --accent-h:   #3b7cf6;
  --accent2:    #7c3aed;
  --green:      #10b981;
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --font-mono:  'Space Mono', monospace;
  --font-body:  'IBM Plex Sans', sans-serif;
  --radius:     8px;
  --sidebar-w:  240px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --topbar-h:   56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ================================================================
   МОБИЛЬНЫЙ ТОПБАР
   ================================================================ */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}
.mobile-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.mobile-topbar-brand .brand-icon-m {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px var(--accent));
}

/* Бургер */
.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.burger-btn:hover { background: var(--border); }
.burger-btn span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
  pointer-events: none;
}
.burger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================================
   ОВЕРЛЕЙ
   ================================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 150;
  /* По умолчанию полностью скрыт и не перехватывает клики */
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto; /* перехватывает клики только когда виден */
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 160;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-icon { font-size: 1.6rem; filter: drop-shadow(0 0 8px var(--accent)); }
.brand-name { font-family: var(--font-mono); font-size: .95rem; font-weight: 700; color: #fff; }

.nav-links {
  list-style: none;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-links li + li { margin-top: 2px; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 16px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text2);
  text-decoration: none;
  font-size: .88rem;
  border-radius: var(--radius);
  margin: 0 8px;
  transition: background .15s, color .15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.nav-link svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; flex-shrink: 0;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-link:hover  { background: var(--bg3); color: var(--text); }
.nav-link.active {
  background: rgba(37,99,235,.15);
  color: #60a5fa;
  border-left: 2px solid var(--accent);
  margin-left: 6px;
}
.nav-admin   { color: #f59e0b; }
.nav-support { color: var(--green); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.lang-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .8rem;
  color: var(--text2);
}
.lang-switcher a {
  color: var(--text2);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.lang-switcher a.active { color: var(--accent-h); font-weight: 600; }
.lang-switcher span { color: var(--border2); }
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(239,68,68,.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: .85rem;
  transition: background .15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.logout-btn:hover { background: rgba(239,68,68,.2); }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-wrap {
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
}
.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-family: var(--font-mono); font-size: 1.4rem; color: #fff; }
.page-header p  { color: var(--text2); margin-top: 4px; font-size: .9rem; }
.page-header.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* ================================================================
   AUTH
   ================================================================ */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(37,99,235,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(124,58,237,.06) 0%, transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 12px var(--accent)); }
.auth-logo h1 { font-family: var(--font-mono); font-size: 1.3rem; color: #fff; }
.auth-logo p  { color: var(--text2); font-size: .85rem; margin-top: 4px; }

/* ================================================================
   CARDS
   ================================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.blue::before   { background: var(--accent); }
.stat-card.purple::before { background: var(--accent2); }
.stat-card.green::before  { background: var(--green); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-label { font-size: .78rem; color: var(--text2); text-transform: uppercase; letter-spacing: .08em; }
.stat-value { font-family: var(--font-mono); font-size: 1.8rem; color: #fff; margin-top: 6px; line-height: 1; }
.stat-sub   { font-size: .78rem; color: var(--text2); margin-top: 4px; }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 8px;
  flex-wrap: wrap;
}
.card-title { font-family: var(--font-mono); font-size: .95rem; color: #fff; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .82rem; color: var(--text2); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: max(.9rem, 16px);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-control::placeholder { color: var(--text2); opacity: .6; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a93b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.captcha-row { display: flex; gap: 12px; align-items: flex-end; }
.captcha-img-wrap { flex-shrink: 0; cursor: pointer; touch-action: manipulation; }
.captcha-img-wrap img { border-radius: 6px; border: 1px solid var(--border2); display: block; height: 50px; }
.captcha-row .form-group { flex: 1; margin-bottom: 0; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover   { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--border); }
.btn-danger    { background: rgba(239,68,68,.15); color: var(--red);   border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover    { background: rgba(239,68,68,.25); }
.btn-success   { background: rgba(16,185,129,.15); color: var(--green); border: 1px solid rgba(16,185,129,.3); }
.btn-success:hover   { background: rgba(16,185,129,.25); }
.btn-sm   { padding: 6px 14px; font-size: .82rem; min-height: 36px; }
.btn-full { width: 100%; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-info    { background: rgba(37,99,235,.1);  border: 1px solid rgba(37,99,235,.3);  color: #93c5fd; }
.alert-warn    { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 480px; }
thead th {
  background: var(--bg3);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 12px 16px; font-size: .88rem; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.badge-green  { background: rgba(16,185,129,.15);  color: var(--green); }
.badge-red    { background: rgba(239,68,68,.15);   color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.15);  color: var(--yellow); }
.badge-blue   { background: rgba(37,99,235,.15);   color: #60a5fa; }
.badge-gray   { background: rgba(120,130,150,.15); color: var(--text2); }
.badge-purple { background: rgba(124,58,237,.15);  color: #a78bfa; }

/* ================================================================
   VLESS BLOCK
   ================================================================ */
.vless-block {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 14px 44px;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: #86efac;
  word-break: break-all;
  position: relative;
  line-height: 1.6;
}
.copy-btn {
  position: absolute;
  bottom: 8px; right: 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: .75rem;
  cursor: pointer;
  transition: all .15s;
  touch-action: manipulation;
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ================================================================
   PLAN CARDS
   ================================================================ */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  transition: border-color .2s, transform .2s;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.plan-card:hover    { border-color: var(--accent); transform: translateY(-3px); }
.plan-card.selected { border-color: var(--accent); background: rgba(37,99,235,.08); }
.plan-name  { font-family: var(--font-mono); font-size: 1rem; color: #fff; margin-bottom: 8px; }
.plan-price { font-family: var(--font-mono); font-size: 2rem; color: var(--accent); font-weight: 700; }
.plan-price-sub { font-size: .8rem; color: var(--text2); }
.plan-features { list-style: none; margin: 16px 0; font-size: .85rem; color: var(--text2); }
.plan-features li { padding: 4px 0; }
.plan-features li::before { content: '✓ '; color: var(--green); }

/* ================================================================
   TICKETS
   ================================================================ */
.ticket-msg { padding: 14px; border-radius: var(--radius); margin-bottom: 12px; }
.ticket-msg.user  { background: var(--bg3); border: 1px solid var(--border); }
.ticket-msg.staff { background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.2); }
.ticket-msg-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  font-size: .78rem;
  color: var(--text2);
}
.ticket-msg-body { font-size: .9rem; white-space: pre-wrap; word-break: break-word; }

/* ================================================================
   WHEEL
   ================================================================ */
.wheel-container { display: flex; flex-direction: column; align-items: center; gap: 24px; }
canvas#wheel { border-radius: 50%; box-shadow: 0 0 40px rgba(37,99,235,.3); max-width: 100%; height: auto; }
#spin-btn {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 14px 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff;
  border-radius: 30px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  touch-action: manipulation;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
#spin-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 8px 24px rgba(37,99,235,.4); }
#spin-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ================================================================
   QUICK LINKS
   ================================================================ */
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: .85rem;
  text-align: center;
  transition: border-color .15s, background .15s, transform .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.quick-link:hover     { border-color: var(--accent); background: rgba(37,99,235,.08); transform: translateY(-2px); }
.quick-link-icon      { font-size: 1.6rem; line-height: 1; }
.quick-link-val       { font-size: .78rem; font-family: var(--font-mono); }
.quick-link-disabled  { opacity: .45; pointer-events: none; }

/* ================================================================
   UTILS
   ================================================================ */
.text-muted  { color: var(--text2); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; }
.mono { font-family: var(--font-mono); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ================================================================
   RESPONSIVE — Tablet ≤ 900px
   ================================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .main-wrap { padding: 24px; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

/* ================================================================
   RESPONSIVE — Mobile ≤ 768px
   ================================================================ */
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    top: 0;
    height: 100dvh;
    width: min(var(--sidebar-w), 82vw);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .sidebar.is-open { transform: translateX(0); }

  .sidebar-brand { display: none; }

  .main-wrap {
    margin-left: 0;
    padding: 16px;
    padding-top: calc(var(--topbar-h) + 16px);
  }

  .auth-wrap { padding: 12px; }
  .auth-card { padding: 24px 18px; }

  .cards-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 1.4rem; }

  .plans-grid { grid-template-columns: 1fr; }

  .page-header h1 { font-size: 1.15rem; }
  .page-header.flex-between { flex-direction: column; align-items: flex-start; gap: 10px; }

  .card { padding: 14px; }
  .card-header { gap: 6px; }

  .flex-between { flex-wrap: wrap; gap: 8px; }

  thead th { padding: 10px 12px; font-size: .7rem; }
  tbody td { padding: 10px 12px; font-size: .82rem; }

  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-danger:hover,
  .btn-success:hover { transform: none; box-shadow: none; }
  .plan-card:hover  { transform: none; }
  .quick-link:hover { transform: none; }

  canvas#wheel { width: 280px !important; height: 280px !important; }
  #spin-btn { padding: 14px 32px; font-size: 1rem; }
}

/* ================================================================
   RESPONSIVE — Small phones ≤ 420px
   ================================================================ */
@media (max-width: 420px) {
  html { font-size: 14px; }
  .cards-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 20px 14px; }
  .captcha-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .captcha-img-wrap img { width: 100%; height: 52px; object-fit: cover; }
  canvas#wheel { width: 260px !important; height: 260px !important; }
  .vless-block { font-size: .68rem; }
}

/* QR Code Styles - простая версия */
.qr-section {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.qr-preview {
    background: white;
    padding: 8px;
    border-radius: 8px;
    display: inline-block;
    cursor: pointer;
}

.qr-preview img {
    display: block;
    margin: 0 auto;
    width: 120px;
    height: 120px;
}

/* Простая модалка без анимаций */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    max-width: 90%;
    width: 320px;
}

.modal-content h3 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 1.1rem;
}

.modal-qr-container {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

.modal-qr-container img {
    width: 240px;
    height: 240px;
    display: block;
    margin: 0 auto;
}

.qr-instruction {
    font-size: 0.7rem;
    color: var(--text2);
    margin: 10px 0;
}

.modal-close {
    margin-top: 10px;
    padding: 8px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .qr-preview img {
        width: 100px;
        height: 100px;
    }
    .modal-qr-container img {
        width: 200px;
        height: 200px;
    }
    .modal-content {
        width: 280px;
        padding: 16px;
    }
}

/* ================================================================
   Landing page styles — index.php
   ================================================================ */

.landing-body {
    background: var(--bg);
    overflow-x: hidden;
}

/* ----------------------------------------------------------------
   NAVBAR
   ---------------------------------------------------------------- */
.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(8, 13, 23, .85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}
.logo-hex {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--accent));
}
.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}
.landing-nav-links a:not(.btn) {
    color: var(--text2);
    text-decoration: none;
    font-size: .88rem;
    transition: color .15s;
}
.landing-nav-links a:not(.btn):hover {
    color: var(--text);
}

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text2);
    border-radius: 2px;
    transition: all .25s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
}
.mobile-menu.open { display: flex; }
.mobile-menu a:not(.btn) {
    color: var(--text2);
    text-decoration: none;
    font-size: .92rem;
}

@media (max-width: 700px) {
    .landing-nav-links { display: none; }
    .burger { display: flex; }
}

/* ----------------------------------------------------------------
   HERO
   ---------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .25;
}
.hero-glow-1 {
    width: 500px; height: 500px;
    background: var(--accent);
    top: -100px; left: -100px;
}
.hero-glow-2 {
    width: 400px; height: 400px;
    background: var(--accent2);
    bottom: -80px; right: -80px;
}
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(37,99,235,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,.04) 1px, transparent 1px);
    background-size: 48px 48px;
}
.hero-inner {
    position: relative;
    text-align: center;
    max-width: 720px;
    width: 100%;
}
.hero-badge {
    display: inline-block;
    padding: 5px 16px;
    background: rgba(37,99,235,.12);
    border: 1px solid rgba(37,99,235,.3);
    border-radius: 20px;
    color: #60a5fa;
    font-size: .78rem;
    font-family: var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.hero-title {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 20px;
}
.hero-title span {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.05rem;
    color: var(--text2);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.hero-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: .95rem;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(37,99,235,.35);
}
.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37,99,235,.45);
}
.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    padding: 14px 36px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border2);
    border-radius: 30px;
    font-size: .95rem;
    transition: border-color .15s, background .15s;
}
.btn-hero-secondary:hover {
    border-color: var(--accent);
    background: rgba(37,99,235,.06);
}

/* Hero stats */
.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    padding: 16px 32px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 40px;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-stat { text-align: center; }
.hero-stat-val {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}
.hero-stat-label {
    display: block;
    font-size: .75rem;
    color: var(--text2);
    margin-top: 2px;
}
.hero-stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ----------------------------------------------------------------
   SECTIONS
   ---------------------------------------------------------------- */
.section {
    padding: 80px 24px;
}
.section-dark {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.section-label {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--accent-h);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 12px;
}
.section-title {
    text-align: center;
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #fff;
    margin-bottom: 12px;
}
.section-sub {
    text-align: center;
    color: var(--text2);
    font-size: .95rem;
    max-width: 520px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

/* ----------------------------------------------------------------
   FEATURES GRID
   ---------------------------------------------------------------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.feature-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 24px;
    transition: border-color .2s, transform .2s;
}
.feature-card:hover {
    border-color: var(--border2);
    transform: translateY(-3px);
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 14px;
}
.feature-title {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}
.feature-desc {
    font-size: .85rem;
    color: var(--text2);
    line-height: 1.6;
}

/* ----------------------------------------------------------------
   PLANS (landing override)
   ---------------------------------------------------------------- */
.landing-plans {
    max-width: 900px;
    margin: 0 auto;
}
.rate-note {
    text-align: center;
    font-size: .82rem;
    color: var(--text2);
    margin-bottom: 24px;
    padding: 8px 20px;
    background: rgba(37,99,235,.06);
    border: 1px solid rgba(37,99,235,.15);
    border-radius: 20px;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}
.plan-card-popular {
    border-color: var(--accent) !important;
    background: rgba(37,99,235,.06) !important;
    position: relative;
}
.plan-popular-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 3px 14px;
    border-radius: 10px;
    white-space: nowrap;
}
.plan-price-rub {
    display: block;
    font-size: .9rem;
    color: var(--text2);
    font-family: var(--font-body);
    font-weight: 400;
    margin-top: 2px;
}
.plan-price-sub {
    font-size: .8rem;
    color: var(--text2);
    margin-bottom: 16px;
}

/* ----------------------------------------------------------------
   BONUS SECTION
   ---------------------------------------------------------------- */
.bonus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 40px;
}
.bonus-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.bonus-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.bonus-name {
    font-weight: 600;
    color: #fff;
    font-size: .92rem;
    margin-bottom: 4px;
}
.bonus-desc {
    font-size: .82rem;
    color: var(--text2);
    line-height: 1.5;
}

/* ----------------------------------------------------------------
   CTA
   ---------------------------------------------------------------- */
.cta-section {
    padding: 80px 24px;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(37,99,235,.12) 0%, transparent 70%);
    border-top: 1px solid var(--border);
}
.cta-inner {
    max-width: 600px;
    margin: 0 auto;
}
.cta-title {
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #fff;
    margin-bottom: 14px;
}
.cta-sub {
    color: var(--text2);
    font-size: .95rem;
    margin-bottom: 32px;
    line-height: 1.7;
}

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
.landing-footer {
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* ============================================================
   XrayNet Chat — Dark Theme
   ============================================================ */

:root {
    --chat-bg: #0b1120;
    --chat-surface: #1e293b;
    --chat-border: #334155;
    --chat-text: #f1f5f9;
    --chat-text-secondary: #94a3b8;
    --chat-accent: #3b82f6;
    --chat-danger: #f87171;
    --chat-warning: #fbbf24;
    --chat-success: #4ade80;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --transition: 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
}

/* ── Container ────────────────────────────────────────────────── */
.chat-container {
    display: flex;
    flex-direction: column;
    height: clamp(400px, calc(100vh - 220px), 800px);
    min-height: 400px;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ── Page Header ──────────────────────────────────────────────── */
.page-header {
    padding: 16px 20px 8px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--chat-text);
}

/* ── Staff Toolbar ────────────────────────────────────────────── */
.chat-staff-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: var(--chat-surface);
    border-bottom: 1px solid var(--chat-border);
}

.chat-staff-bar button {
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 8px;
    transition: var(--transition);
}

/* ── Muted Banner ─────────────────────────────────────────────── */
.chat-muted-banner {
    background: rgba(248, 113, 113, 0.15);
    border-bottom: 1px solid rgba(248, 113, 113, 0.3);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--chat-danger);
    text-align: center;
    display: none;
}

/* ── Messages Area ────────────────────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-text-secondary) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chat-text-secondary);
    border-radius: 3px;
}

/* ── Message Row ──────────────────────────────────────────────── */
.chat-msg {
    display: grid;
    grid-template-columns: 50px auto 1fr auto;
    align-items: baseline;
    padding: 8px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
    transition: background var(--transition);
    border-left: 3px solid transparent;
}

.chat-msg:hover {
    background: var(--chat-surface);
}

.chat-msg.highlight {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--chat-accent);
    animation: pulse-bg 1.5s ease-out;
}

@keyframes pulse-bg {
    0% { background: rgba(59, 130, 246, 0.3); }
    100% { background: rgba(59, 130, 246, 0.15); }
}

.chat-msg .msg-time {
    grid-column: 1;
    font-size: 0.7rem;
    color: var(--chat-text-secondary);
    opacity: 0.7;
    user-select: none;
    white-space: nowrap;
}

.chat-msg .msg-head {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-msg .msg-nick {
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    transition: opacity var(--transition);
    font-size: 0.9rem;
}

.chat-msg .msg-nick::before {
    content: '<';
    opacity: 0.4;
    font-weight: 400;
}

.chat-msg .msg-nick::after {
    content: '>';
    opacity: 0.4;
    font-weight: 400;
}

.chat-msg .msg-nick:hover {
    opacity: 0.8;
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.chat-msg .msg-nick.r-admin { color: var(--chat-danger); }
.chat-msg .msg-nick.r-support { color: var(--chat-warning); }
.chat-msg .msg-nick.r-paid_user { color: var(--chat-accent); }
.chat-msg .msg-nick.r-user { color: var(--chat-success); }

.msg-role-tag {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
}

.msg-role-tag.r-admin {
    background: rgba(248, 113, 113, 0.2);
    color: var(--chat-danger);
}

.msg-role-tag.r-support {
    background: rgba(251, 191, 36, 0.2);
    color: var(--chat-warning);
}

.chat-msg .msg-body {
    grid-column: 3;
    color: var(--chat-text);
    word-break: break-word;
    overflow-wrap: anywhere;
    padding-right: 8px;
}

.chat-msg .msg-body a {
    color: var(--chat-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-msg .msg-body a:hover {
    opacity: 0.8;
}

.chat-link-removed {
    color: var(--chat-text-secondary);
    font-style: italic;
    font-size: 0.85em;
    opacity: 0.6;
}

/* ── Message Actions ──────────────────────────────────────────── */
.msg-actions {
    grid-column: 4;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.chat-msg:hover .msg-actions {
    opacity: 1;
}

.msg-actions button {
    background: transparent;
    border: 1px solid var(--chat-border);
    border-radius: 6px;
    color: var(--chat-text-secondary);
    font-size: 0.7rem;
    padding: 3px 8px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.msg-actions button:hover {
    background: var(--chat-surface);
    color: var(--chat-text);
}

.msg-actions button.a-del:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--chat-danger);
    border-color: var(--chat-danger);
}

/* ── Reply Block ──────────────────────────────────────────────── */
.msg-reply-block {
    grid-column: 2 / 5;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--chat-text-secondary);
    border-radius: 0 6px 6px 0;
    padding: 6px 12px;
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    color: var(--chat-text-secondary);
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.8;
    transition: var(--transition);
}

.msg-reply-block:hover {
    opacity: 1;
    border-left-color: var(--chat-accent);
}

.msg-reply-block .reply-author {
    font-weight: 700;
}

/* ── Reply Bar ────────────────────────────────────────────────── */
.chat-reply-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
    font-size: 0.85rem;
    color: var(--chat-text-secondary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.chat-reply-bar.active {
    display: flex;
}

.chat-reply-bar .reply-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-reply-bar .reply-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 1rem;
}

.chat-reply-bar .reply-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--chat-text);
}

/* ── Input Row ────────────────────────────────────────────────── */
.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
}

.chat-input-row input {
    flex: 1;
    font-size: 0.9rem;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    color: var(--chat-text);
    outline: none;
    transition: border-color var(--transition);
}

.chat-input-row input:focus {
    border-color: var(--chat-accent);
}

.chat-input-row input::placeholder {
    color: var(--chat-text-secondary);
    opacity: 0.6;
}

.chat-input-row button {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 500;
}

/* ── Emoji ─────────────────────────────────────────────────────── */
img.chat-emoji {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: text-bottom;
    margin: 0 2px;
}

span.chat-emoji {
    font-size: 1.2em;
    vertical-align: text-bottom;
    margin: 0 2px;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.emoji-picker-wrap {
    position: relative;
}

.emoji-picker-btn {
    background: none;
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    color: var(--chat-text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 10px 14px;
    transition: var(--transition);
}

.emoji-picker-btn:hover {
    background: var(--chat-surface);
    color: var(--chat-text);
}

.emoji-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    padding: 10px;
    width: 280px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji-picker.active {
    display: flex;
}

.emoji-picker button {
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    font-size: 1.3rem;
    transition: var(--transition);
}

.emoji-picker button:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.1);
}

.emoji-picker button img {
    width: 24px;
    height: 24px;
    display: block;
}

/* ── Online Counter ────────────────────────────────────────────── */
.chat-online-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--chat-surface);
    border-bottom: 1px solid var(--chat-border);
    font-size: 0.8rem;
    color: var(--chat-text-secondary);
    user-select: none;
}

.chat-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-success);
    flex-shrink: 0;
    animation: online-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.chat-online-dot.offline {
    background: var(--chat-danger) !important;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5) !important;
}

@keyframes online-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.chat-online-count {
    font-weight: 700;
    color: var(--chat-text);
    font-variant-numeric: tabular-nums;
}

.chat-empty {
    color: var(--chat-text-secondary);
    text-align: center;
    padding: 48px 0;
    font-size: 0.9rem;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.chat-wrapper {
    display: flex;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
    height: calc(100vh - 200px);
    min-height: 500px;
    position: relative;
}

.chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-right 0.3s ease;
}

.chat-main.sidebar-open {
    margin-right: 280px;
}

.chat-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--chat-surface);
    border-radius: var(--radius);
    border: 1px solid var(--chat-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 10;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--chat-surface);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--chat-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-count {
    font-size: 12px;
    color: var(--chat-text-secondary);
    background: var(--chat-bg);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background: var(--chat-surface);
}

.participant-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-left: 3px solid transparent;
    background: var(--chat-surface);
}

.participant-item:hover {
    background: var(--chat-bg);
}

.participant-item.me {
    background: rgba(59, 130, 246, 0.12);
    border-left-color: var(--chat-accent);
}

.participant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.participant-info {
    flex: 1;
    min-width: 0;
}

.participant-nick {
    font-weight: 600;
    color: var(--chat-text);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    margin-bottom: 2px;
}

.participant-role {
    font-size: 10px;
    color: var(--chat-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.participant-role.admin { color: var(--chat-danger); }
.participant-role.support { color: var(--chat-warning); }
.participant-role.paid_user { color: var(--chat-accent); }

.participant-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-success);
    margin-left: 8px;
    flex-shrink: 0;
    animation: online-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 80px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--chat-accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
    backdrop-filter: blur(4px);
}

.sidebar-backdrop.active {
    display: block;
}

/* ── Modals ────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

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

.modal-box {
    background: var(--chat-surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 440px;
    padding: 28px;
    transform: scale(0.9) translateY(-10px);
    transition: all 0.25s ease;
    border: 1px solid var(--chat-border);
    position: relative;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-box h2,
.modal-box h3 {
    margin: 0 0 16px 0;
    color: var(--chat-text);
    padding-right: 30px;
}

.modal-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-box h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-box p {
    color: var(--chat-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--chat-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--chat-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close-btn:hover {
    background: var(--chat-border);
    color: var(--chat-text);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--chat-text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--chat-bg);
    border: 2px solid var(--chat-border);
    border-radius: 12px;
    color: var(--chat-text);
    font-size: 14px;
    transition: all var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

select.form-control {
    cursor: pointer;
}

.nick-hint {
    font-size: 13px;
    color: var(--chat-text-secondary);
    margin-top: 6px;
}

.nick-err {
    font-size: 13px;
    color: var(--chat-danger);
    margin-top: 6px;
    min-height: 24px;
}

/* ── Modal Actions & Buttons ──────────────────────────────────── */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--chat-accent);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--chat-bg);
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
}

.btn-secondary:hover {
    background: var(--chat-border);
}

.btn-danger {
    background: var(--chat-danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

#btnSetNick {
    width: 100%;
    margin-top: 12px;
}

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .page-header {
        padding: 12px 16px 4px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .chat-container {
        height: calc(100vh - 140px);
        border-radius: 0;
    }

    .chat-wrapper {
        flex-direction: column;
        height: auto;
        min-height: auto;
        padding: 0 12px 12px;
    }

    .chat-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 300px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 101;
    }

    .chat-sidebar.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-toggle {
        display: flex;
    }

    .chat-main {
        margin-right: 0 !important;
    }

    .chat-msg {
        grid-template-columns: 42px auto 1fr auto;
        padding: 8px 12px;
    }

    .chat-msg .msg-head {
        grid-column: 1 / 4;
        grid-row: 1;
    }

    .chat-msg .msg-body {
        grid-column: 1 / 5;
        grid-row: 2;
        padding-left: 0;
        margin-top: 4px;
    }

    .msg-reply-block {
        grid-column: 1 / 5;
        grid-row: 3;
        max-width: 100%;
        margin-left: 0;
    }

    .msg-actions {
        grid-column: 4;
        grid-row: 1;
        opacity: 0.7;
    }

    .emoji-picker {
        right: -10px;
        width: 250px;
    }

    .modal-box {
        padding: 24px 20px;
        max-width: 90%;
    }

    .chat-input-row {
        padding: 10px 12px;
    }

    .chat-input-row input {
        padding: 10px 12px;
    }

    .chat-input-row button {
        padding: 10px 16px;
    }
}

/* ================================================================
   THEME REFRESH 2026 — аудитория 20–25, conversion-focused
   Подключается ПОСЛЕДНИМ: переопределяет визуал, классы не меняются.
   ================================================================ */
:root {
  --bg:         #070a12;
  --bg2:        #0d1424;
  --bg3:        #141d33;
  --border:     #1c2942;
  --border2:    #2b3d63;
  --text:       #d7e2f5;
  --text2:      #8298bd;
  --accent:     #4f46e5;
  --accent-h:   #6366f1;
  --accent2:    #a855f7;
  --accent3:    #06b6d4;
  --green:      #22c55e;
  --red:        #f43f5e;
  --yellow:     #fbbf24;
  --radius:     14px;
  --grad:       linear-gradient(135deg, #4f46e5 0%, #a855f7 55%, #06b6d4 100%);
  --glow:       0 8px 32px rgba(99,102,241,.35);
  --shadow:     0 8px 32px rgba(0,0,0,.45);
}

body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(168,85,247,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(79,70,229,.08), transparent 55%),
    var(--bg);
}

::selection { background: rgba(99,102,241,.4); color: #fff; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: rgba(13,20,36,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
}
.nav-link { border-radius: 10px; font-weight: 500; }
.nav-link:hover { background: rgba(99,102,241,.10); color: var(--text); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(99,102,241,.22), rgba(168,85,247,.10));
  color: #c7d2fe;
  border-left: 3px solid var(--accent-h);
}

/* ---------- Cards / glass ---------- */
.card, .stat-card, .feature-card, .bonus-item {
  background: rgba(13,20,36,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card { box-shadow: 0 2px 16px rgba(0,0,0,.25); }
.stat-card { transition: transform .2s, box-shadow .2s, border-color .2s; }
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border2);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.stat-card.blue::before   { background: linear-gradient(90deg, var(--accent), var(--accent3)); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--accent2), #ec4899); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--green), var(--accent3)); }
.stat-card.yellow::before { background: linear-gradient(90deg, var(--yellow), #fb923c); }
.stat-value {
  background: linear-gradient(135deg, #fff, #b7c6ea);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Buttons: CTA с градиентом и свечением ---------- */
.btn { border-radius: 12px; font-weight: 600; letter-spacing: .01em; }
.btn-primary {
  background: var(--grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 4px 18px rgba(99,102,241,.35);
}
.btn-primary:hover {
  background-position: 90% 50%;
  transform: translateY(-2px);
  box-shadow: var(--glow);
}
.btn-success {
  background: linear-gradient(135deg, #16a34a, #06b6d4);
  color: #fff; border: none;
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(34,197,94,.35); background: linear-gradient(135deg, #22c55e, #0891b2); }
.btn-secondary { border-radius: 12px; }
.btn-secondary:hover { border-color: var(--accent-h); background: rgba(99,102,241,.10); }

/* ---------- Forms ---------- */
.form-control { border-radius: 12px; }
.form-control:focus { border-color: var(--accent-h); box-shadow: 0 0 0 4px rgba(99,102,241,.18); }

/* ---------- Plans: хочется купить ---------- */
.plan-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(13,20,36,.72);
  position: relative;
  overflow: hidden;
}
.plan-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(400px 140px at 50% -20%, rgba(99,102,241,.14), transparent 70%);
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.plan-card:hover { border-color: var(--accent-h); transform: translateY(-5px); box-shadow: var(--glow); }
.plan-card:hover::after { opacity: 1; }
.plan-card.selected {
  border-color: transparent;
  background:
    linear-gradient(rgba(13,20,36,.92), rgba(13,20,36,.92)) padding-box,
    var(--grad) border-box;
  box-shadow: var(--glow);
}
.plan-price {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.plan-card-popular {
  border: 2px solid transparent !important;
  background:
    linear-gradient(rgba(13,20,36,.9), rgba(13,20,36,.9)) padding-box,
    var(--grad) border-box !important;
  box-shadow: 0 10px 36px rgba(99,102,241,.30);
}
.plan-popular-badge {
  background: var(--grad);
  border-radius: 20px;
  padding: 4px 16px;
  box-shadow: 0 4px 14px rgba(168,85,247,.45);
}

/* ---------- Hero / landing ---------- */
.hero-glow-1 { background: var(--accent);  opacity: .3; }
.hero-glow-2 { background: var(--accent2); opacity: .3; }
.hero-badge {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.35);
  color: #a5b4fc;
}
.btn-hero-primary {
  background: var(--grad);
  background-size: 160% 160%;
  border-radius: 14px;
  box-shadow: var(--glow);
}
.btn-hero-primary:hover { background-position: 90% 50%; transform: translateY(-2px) scale(1.02); }
.btn-hero-secondary { border-radius: 14px; }
.btn-hero-secondary:hover { border-color: var(--accent-h); background: rgba(99,102,241,.08); }
.hero-stats { border-radius: 20px; }
.feature-card:hover { border-color: var(--accent-h); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.cta-section { background: radial-gradient(ellipse at center, rgba(99,102,241,.14) 0%, transparent 70%); }

/* ---------- Auth ---------- */
.auth-card {
  border-radius: 18px;
  background: rgba(13,20,36,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Badges ---------- */
.badge-blue   { background: rgba(99,102,241,.16); color: #a5b4fc; }
.badge-purple { background: rgba(168,85,247,.16); color: #d8b4fe; }

/* ---------- Tables ---------- */
.table-wrap { border-radius: var(--radius); }

/* ---------- Wheel ---------- */
#spin-btn { background: var(--grad); background-size: 160% 160%; border-radius: 14px; box-shadow: var(--glow); }
#spin-btn:hover:not(:disabled) { background-position: 90% 50%; }
canvas#wheel { box-shadow: 0 0 48px rgba(99,102,241,.35); }

/* ---------- Quick links ---------- */
.quick-link { border-radius: 12px; }
.quick-link:hover { border-color: var(--accent-h); background: rgba(99,102,241,.10); }

/* ---------- Mobile: без hover-эффектов ---------- */
@media (max-width: 768px) {
  .btn-primary:hover, .btn-success:hover { transform: none; box-shadow: 0 4px 18px rgba(99,102,241,.35); }
  .stat-card:hover { transform: none; }
}



/* ================================================================
   PAGE-SPECIFIC STYLES (вынос из inline <style>)
   ================================================================ */

/* --- public\pages\games.php --- */
.wheel-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.alert {
    text-align: center;
    justify-content: center;
}

.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
}

#wheel {
    display: block;
    margin: 0 auto;
}

#spin-btn {
    margin: 20px auto;
    display: block;
}

.prizes-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 480px;
    margin: 0 auto;
}

.card {
    width: 100%;
    max-width: 520px;
    margin: 24px auto 0;
}

.card-header {
    text-align: center;
}

.spin-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.spin-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,.02);
    border-radius: 8px;
    text-align: left;
}


/* --- public\pages\vpn.php --- */
.dl-card{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--bg3);border:1px solid var(--border);border-radius:var(--radius);text-decoration:none;color:var(--text);transition:border-color .2s,transform .15s}
.dl-card:hover{border-color:var(--accent);transform:translateY(-2px)}
.dl-icon{font-size:1.5rem;flex-shrink:0}
.dl-info{flex:1;min-width:0}
.dl-name{font-weight:600;font-size:.92rem}
.dl-desc{font-size:.75rem;color:var(--text2);margin-top:2px}
.dl-badge{font-size:.68rem;font-weight:600;padding:2px 8px;border-radius:4px;background:rgba(99,102,241,.15);color:var(--accent);flex-shrink:0}


/* --- admin\pages\payment_settings.php --- */
.merchant-toggle {
    display:flex; align-items:center; gap:10px;
    padding-bottom:14px; border-bottom:1px solid var(--border); margin-bottom:16px;
}
.toggle-wrap { position:relative; display:inline-block; width:40px; height:22px; flex-shrink:0; }
.toggle-wrap input { opacity:0; width:0; height:0; position:absolute; }
.toggle-slider {
    position:absolute; inset:0; background:var(--bg3);
    border-radius:22px; cursor:pointer; transition:.25s;
    border:1px solid var(--border);
}
.toggle-slider:before {
    content:''; position:absolute; width:16px; height:16px;
    left:2px; top:2px; background:#fff; border-radius:50%; transition:.25s;
}
.toggle-wrap input:checked + .toggle-slider { background:var(--accent); border-color:var(--accent); }
.toggle-wrap input:checked + .toggle-slider:before { transform:translateX(18px); }
.merchant-fields.disabled { opacity:.4; pointer-events:none; }
.webhook-box {
    background:var(--bg3); border:1px solid var(--border);
    border-radius:var(--radius); padding:10px 12px; margin-top:12px;
}
.webhook-box .wh-label { font-size:.73rem; color:var(--text2); margin-bottom:4px; }
.webhook-box .wh-row { display:flex; align-items:center; gap:8px; }
.webhook-box code { color:var(--accent-h); font-size:.73rem; word-break:break-all; flex:1; }
.field-hint { font-size:.75rem; color:var(--text2); margin-top:4px; }


/* --- public\pages\balance.php --- */
@keyframes pay-spin { to { transform:rotate(360deg); } }
@keyframes pay-dot  { 0%,100%{opacity:.2} 50%{opacity:1} }
.pay-dots { display:flex; gap:6px; }
.pay-dots span {
    display:inline-block; width:6px; height:6px;
    border-radius:50%; background:var(--accent); opacity:.3;
    animation:pay-dot 1.2s ease-in-out infinite;
}
.pay-dots span:nth-child(2) { animation-delay:.2s; }
.pay-dots span:nth-child(3) { animation-delay:.4s; }

/* Pay Now button */
.btn-pay-now {
    display:inline-flex; align-items:center; gap:6px;
    margin-top:6px;
    padding:5px 14px;
    background:linear-gradient(135deg, #6366f1, #8b5cf6);
    color:#fff;
    border:none;
    border-radius:8px;
    font-size:.75rem;
    font-weight:600;
    text-decoration:none;
    letter-spacing:.03em;
    box-shadow:0 2px 10px rgba(99,102,241,.3);
    transition:all .2s ease;
    cursor:pointer;
}
.btn-pay-now:hover {
    transform:translateY(-1px);
    box-shadow:0 4px 16px rgba(99,102,241,.45);
    filter:brightness(1.08);
}
.btn-pay-now:active {
    transform:translateY(0);
    box-shadow:0 1px 6px rgba(99,102,241,.25);
}
.btn-pay-now svg { flex-shrink:0; }

/* Center only deposit block */
.deposit-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.deposit-card {
    width: 100%;
    max-width: 440px;
    margin-bottom: 24px;
}

.deposit-card select {
    width: 100%;
    padding: 9px 12px;
    font-size: .88rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    color: var(--text);
    cursor: pointer;
}
.deposit-card select:focus {
    border-color: var(--accent);
    outline: none;
}

#deposit-msg {
    text-align: center;
}


/* --- index.php --- */
.discount-countdown {
    display: flex; justify-content: center; align-items: center; gap: 10px;
    margin: 18px auto 24px; padding: 12px 18px; max-width: 520px;
    border: 1px solid rgba(239,68,68,.35); border-radius: 12px;
    background: rgba(239,68,68,.08); font-size: .9rem;
}
.discount-countdown strong {
    font-family: 'Space Mono', monospace; color: #f87171;
}
.plan-card { position: relative; }
.plan-discount-badge {
    position: absolute; top: 12px; right: 12px; padding: 4px 8px;
    border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700;
}
.plan-old-price {
    text-decoration: line-through; color: var(--text2,#8892a4); font-size: .84rem; margin-top: 8px;
}


.hero-discount-wrap {
    display: flex; justify-content: center; margin-top: 28px;
    animation: hero-fade-in .6s ease .2s both;
}
@keyframes hero-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-discount-wrap .discount-countdown {
    margin: 0; max-width: 560px; width: 100%;
    background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(239,68,68,.04));
    border: 1px solid rgba(239,68,68,.45);
    box-shadow: 0 0 24px rgba(239,68,68,.18), inset 0 0 0 1px rgba(255,255,255,.02);
    padding: 14px 22px; border-radius: 14px; font-size: .95rem; color: #fff;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-discount-wrap .discount-countdown strong {
    color: #fca5a5; font-size: 1.05rem; letter-spacing: .02em;
    text-shadow: 0 0 12px rgba(248,113,113,.5);
}
.hero-discount-wrap .discount-countdown span {
    color: rgba(255,255,255,.85); font-weight: 500;
}

/* ── Server Cards ── */
.srv-region { margin-bottom: 24px; }
.srv-region-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text2, #8892a4); margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 8px;
}
.srv-region-icon { font-size: 1rem; }
.srv-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
}
.srv-card {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px; transition: border-color .2s, transform .15s, background .2s;
    opacity: 0; transform: translateY(12px); animation: srv-appear .4s ease forwards;
}
.srv-card:hover {
    border-color: rgba(99,102,241,.35); background: rgba(255,255,255,.04); transform: translateY(-2px);
}
@keyframes srv-appear { to { opacity: 1; transform: translateY(0); } }
.srv-flag { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.srv-info { flex: 1; min-width: 0; }
.srv-name {
    font-size: .88rem; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.srv-meta {
    display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: .75rem;
    color: var(--text2, #8892a4);
}
.srv-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.srv-status-dot.on { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
.srv-status-dot.off { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.4); }
.srv-users {
    display: flex; align-items: center; gap: 4px; font-size: .78rem;
    color: var(--text2, #8892a4); flex-shrink: 0; font-family: 'Space Mono', monospace;
}
.servers-summary {
    text-align: center; margin-top: 20px; padding: 16px;
    background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px; font-size: .88rem; color: var(--text2, #8892a4);
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
}
.srv-stat-item { display: flex; align-items: center; gap: 6px; }
.srv-stat-val { font-weight: 700; color: #22c55e; font-family: 'Space Mono', monospace; font-size: 1rem; }
.ln-spinner {
    width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.08);
    border-top-color: var(--accent, #6366f1); border-radius: 50%;
    animation: ln-spin .7s linear infinite; margin: 0 auto;
}
@keyframes ln-spin { to { transform: rotate(360deg); } }


/* --- public\pages\status.php --- */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.node-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg, var(--bg2));
    padding: 20px;
    transition: border-color .2s, box-shadow .2s;
}
.node-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(0,0,0,.15);
}
.node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.node-country {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.node-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.node-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.node-status-dot.online    { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.5); }
.node-status-dot.offline   { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.4); }
.node-status-dot.connecting { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.4); animation: pulse-dot 1.5s ease-in-out infinite; }
.node-status-dot.disabled  { background: #6b7280; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.node-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.node-stat {
    background: rgba(255,255,255,.03);
    border-radius: 8px;
    padding: 10px 12px;
}
.node-stat-label {
    font-size: .72rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.node-stat-value {
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'Space Mono', monospace;
}
.node-stat-value.text-green { color: #22c55e; }
.node-stat-value.text-red   { color: #ef4444; }
.node-stat-value.text-yellow { color: #f59e0b; }

.status-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    color: var(--text2);
}
.summary-item .num {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Space Mono', monospace;
}

#status-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text2);
}
#status-loading .spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#status-error { display: none; }

.auto-refresh {
    font-size: .78rem;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.auto-refresh .dot {
    width: 6px; height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}


/* --- public\pages\buy.php --- */
.plan-card-disabled {
    opacity: .45;
    pointer-events: none;
    filter: grayscale(.3);
}
.plan-card { position: relative; }

.plan-upgrade-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 0 12px 0 8px;
    letter-spacing: .03em;
    text-transform: uppercase;
    z-index: 2;
}

.plan-discount-badge {
    position: absolute;
    top: -1px;
    left: -1px;
    background: #ef4444;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px 0 8px 0;
    letter-spacing: .03em;
    text-transform: uppercase;
    z-index: 2;
}

.plan-old-price {
    text-decoration: line-through;
    color: var(--text2);
    font-size: .8rem;
    margin-top: 8px;
    line-height: 1;
}

.discount-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 18px auto 24px;
    padding: 12px 18px;
    max-width: 520px;
    border: 1px solid rgba(239,68,68,.35);
    border-radius: 12px;
    background: rgba(239,68,68,.08);
    font-size: .9rem;
}
.discount-countdown strong {
    font-family: 'Space Mono', monospace;
    color: #f87171;
}



/* --- Landing news (SEO) --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.news-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: rgba(13,20,36,.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.news-card:hover {
  border-color: var(--accent-h);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}
.news-date {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.news-title {
  font-weight: 600;
  font-size: .98rem;
  color: #fff;
  line-height: 1.4;
}
.news-excerpt {
  font-size: .84rem;
  color: var(--text2);
  line-height: 1.6;
  flex: 1;
}
.news-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-h);
}
.public-news-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(20px, 5vh, 48px) 20px 60px;
  min-height: 70vh;
}
.public-news-wrap a { color: var(--accent-h); text-decoration: none; }
.public-news-wrap a:hover { text-decoration: underline; }
/* --- Home: карта серверов --- */
.servers-map-card { padding-bottom: 12px; }
.servers-map-wrap { position: relative; }
#servers-map { width: 100%; height: auto; display: block; }
#servers-map-grid line { stroke: rgba(122,147,184,.08); stroke-width: 1; }
#servers-map-land path {
  fill: rgba(99,102,241,.10);
  stroke: rgba(99,102,241,.35);
  stroke-width: 1.2;
}
.map-dot { cursor: pointer; }
.map-dot.online {
  fill: #22c55e;
  filter: drop-shadow(0 0 6px rgba(34,197,94,.8));
  animation: map-dot-pulse 2s ease-in-out infinite;
}
.map-dot.offline { fill: #5b6b8c; }
@keyframes map-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.servers-map-tooltip {
  position: absolute;
  z-index: 10;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .8rem;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
/* --- Home map CTA layout --- */
.servers-map-flex {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
}
.servers-map-cta { padding: 8px 4px; }
@media (max-width: 900px) {
  .servers-map-flex { grid-template-columns: 1fr; }
  .servers-map-cta { text-align: center; padding-bottom: 16px; }
}
/* --- Legal modal --- */
.legal-modal { position: fixed; inset: 0; z-index: 1000; }
.legal-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4,7,14,.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.legal-modal-dialog {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 24px));
  max-height: min(84vh, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.legal-modal-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
.legal-modal-close:hover { color: #fff; border-color: var(--accent-h); }
.legal-modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.legal-doc h3 { color: #fff; font-size: .95rem; margin: 18px 0 8px; }
.legal-doc h3:first-child { margin-top: 0; }
.legal-doc p { color: var(--text2); font-size: .88rem; line-height: 1.7; margin-bottom: 8px; }
.legal-doc .legal-footer { margin-top: 18px; color: var(--text); font-weight: 500; }
.legal-loading {
  width: 32px; height: 32px; margin: 40px auto;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent-h);
  border-radius: 50%;
  animation: legal-spin .7s linear infinite;
}
@keyframes legal-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .legal-modal-dialog {
    top: auto; bottom: 0; left: 0; right: 0;
    transform: none;
    width: 100%;
    max-height: 88dvh;
    border-radius: 16px 16px 0 0;
  }
}
/* --- Компактная пагинация --- */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
  max-width: 100%;
}
.pagination .btn-sm { min-width: 34px; padding: 6px 10px; }
.pagination-dots { color: var(--text2); padding: 0 2px; align-self: center; }
/* --- User tickets: кликабельные строки --- */
.ticket-row { cursor: pointer; transition: background .12s; }
.ticket-row:hover { background: rgba(99,102,241,.10); }
.ticket-row:active { background: rgba(99,102,241,.16); }
/* --- Public news (гостевой вид, независим от лендинг-классов) --- */
.public-news-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(7,10,18,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.public-news-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
}
.public-news-nav { display: flex; align-items: center; gap: 18px; }
.public-news-nav a:not(.btn) { color: var(--text2); font-size: .9rem; }
.public-news-nav a:not(.btn):hover { color: #fff; }
.public-news-footer {
  text-align: center;
  padding: 24px;
  color: var(--text2);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}
