:root {
  --bg:#07080d;
  --bg-2:#0d1018;
  --card:#11141e;
  --card-2:#161a26;
  --line:#1e2230;
  --border:#1e2230;
  --border-2:#2a2f42;
  --text:#e6e9f2;
  --muted:#7a8298;
  --accent:#6366f1;
  --accent-2:#a855f7;
  --accent2:#ff2d55;
  --brand:#6366f1;
  --brand-2:#a855f7;
  --ok:#22c55e;
  --warn:#f59e0b;
  --err:#ef4444;
  --glow-1:rgba(99,102,241,.45);
  --glow-2:rgba(168,85,247,.35);
  --glow-pink:rgba(255,45,85,.5);
  --glow-cyan:rgba(34,211,238,.5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, sans-serif; line-height: 1.5; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.flex { display: flex; align-items: center; justify-content: space-between; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 0; }
.logo { font-size: 20px; font-weight: 900; color: var(--text); text-decoration: none; }
.desktop-nav a { color: var(--text); text-decoration: none; margin-left: 20px; font-weight: 600; }
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 48px; font-weight: 900; background: linear-gradient(135deg, #2a2f3a, #ff5e7a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 18px; }
h2 { margin: 30px 0 20px; font-size: 24px; }
.stations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.station-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; transition: .2s; }
.station-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.sc-cover { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; margin-bottom: 12px; background: #0a0c10; }
.station-card h3 { font-size: 17px; margin-bottom: 8px; }
.station-card .np { font-size: 13px; color: var(--muted); margin-bottom: 12px; min-height: 36px; }
.actions { display: flex; gap: 8px; }
.btn { display: block; flex: 1; text-align: center; padding: 10px; background: var(--accent); color: #fff; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 14px; }

.chat-main { min-height: 70vh; display: flex; flex-direction: column; }
.chat-messages {
  min-height: 500px;
  max-height: 70vh;
  overflow-y: auto;
}








.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}


#chatSend {
  padding: 10px 18px;
  background: linear-gradient(135deg,#2a2f3a,#3a4150);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.chat-sidebar { background: var(--card); border-radius: 14px; padding: 16px; height: fit-content; }
.sc-cover-chat { display: block; width: 100%; max-width: 200px; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; margin: 0 auto 12px; }
.chat-messages { background: var(--card); border-radius: 14px; padding: 16px; min-height: 400px; }
.msg { padding: 8px 0; border-bottom: 1px solid var(--line); }
.msg b { color: var(--accent2); }
.muted { color: var(--muted); }
.footer { text-align: center; padding: 30px 20px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; }
@media (max-width: 700px) {  .hero h1 { font-size: 32px; } }

/* Кнопка регистрации в шапке */
.btn-register {
  background: linear-gradient(135deg, #2a2f3a, #ff5e7a) !important;
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  margin-left: 20px !important;
  box-shadow: 0 4px 12px rgba(255,45,85,.3);
}
.btn-register:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255,45,85,.5);
}

/* ═══ CHAT PAGE (clean) ═══ */
.chat-page {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  max-width: 1400px;
  margin: 12px auto;
  padding: 0 16px;
  align-items: start;
}
.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--card, #1a1d27);
  border-radius: 14px;
  overflow: hidden;
  min-height: 0;
  height: 80vh;
}
.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  min-height: 0;
}
.chat-input-row {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border, #2a2d3a);
  background: var(--card, #1a1d27);
}
.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg, #0f1117);
  border: 1px solid var(--border, #2a2d3a);
  border-radius: 8px;
  color: var(--text, #e4e4e7);
}

@media (max-width: 900px) {
  .chat-page { grid-template-columns: 1fr; height: auto; }
  .chat-main { height: auto; min-height: 70vh; }
}












/* Красивая кнопка play в чате */




/* Кнопка эмодзи */



/* Кнопка отправки */
#chatSend {
  padding: 10px 18px;
  background: linear-gradient(135deg, #2a2f3a, #3a4150);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
}
#chatSend:hover { filter: brightness(1.1); }

/* Поле ввода чата */
.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg, #0f1117);
  border: 1px solid var(--border, #2a2d3a);
  border-radius: 8px;
  color: var(--text);
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border, #2a2d3a);
  background: var(--card, #1a1d27);
  flex-shrink: 0;
}

/* ═══════ EMOJI ═══════ */
.emoji-toggle {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  color: #e4e4e7;
  line-height: 1;
}
.emoji-toggle:hover {
  background: rgba(255,255,255,.06);
}

.emoji-picker {
  display: none;
  border-top: 1px solid #2a2d3a;
  background: #1a1d27;
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 12px 12px 0 0;
  margin-bottom: 4px;
}
.emoji-picker[style*="block"] {
  display: block !important;
}

.emoji-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.emoji-tab {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid #2a2d3a;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  color: #e4e4e7;
  white-space: nowrap;
}
.emoji-tab:hover {
  background: rgba(255,255,255,.06);
}
.emoji-tab.active {
  background: #2a2f3a;
  color: #fff;
  border-color: #2a2f3a;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 4px;
}
.emoji {
  font-size: 26px;
  cursor: pointer;
  text-align: center;
  padding: 8px 0;
  border-radius: 8px;
  user-select: none;
  line-height: 1;
  display: inline-block;
  transition: transform .1s, background .1s;
}
.emoji:hover {
  background: rgba(255,255,255,.12);
  transform: scale(1.15);
}

/* ═══════ АКТИВНЫЙ ПУНКТ МЕНЮ ═══════ */



/* Активный пункт — яркий + светящийся */


/* Подчёркивание под активным пунктом */


/* Подсветка фона при hover */

/* ═══════ МЕНЮ: ЗЕЛЁНОЕ + КРАСНАЯ АКТИВНАЯ ═══════ */

/* Обычные ссылки — зелёные */
.site-header .nav-link,
.site-header .nav-link:visited {
  color: #22c55e !important;
  opacity: 1;
  font-weight: 600;
  transition: color .15s, text-shadow .15s;
  text-shadow: 0 0 6px rgba(34,197,94,.35);
}

/* Hover — ярче зелёный */
.site-header .nav-link:hover {
  color: #4ade80 !important;
  text-shadow: 0 0 10px rgba(34,197,94,.7), 0 0 20px rgba(34,197,94,.4);
}

/* Активная страница — КРАСНЫЙ */
.site-header .nav-link.nav-active {
  color: #ef4444 !important;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(239,68,68,.8), 0 0 20px rgba(239,68,68,.5);
  position: relative;
}

/* Подчёркивание под активной */
.site-header .nav-link.nav-active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -3px;
  height: 2px;
  background: #ef4444;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(239,68,68,.9);
}

/* ═══ Фон станции: делаем контейнеры полупрозрачными ═══
   Только на страницах, где есть фон (body имеет station-bg-style).
*/
body:has(#__stationBg) .container,
body:has(#__stationBg) main,
body:has(#__stationBg) .chat-page,
body:has(#__stationBg) .chat-main,
body:has(#__stationBg) .chat-sidebar {
  background: transparent !important;
}
body:has(#__stationBg) .dj-card,
body:has(#__stationBg) .sc-card,
body:has(#__stationBg) .chat-messages {
  background: rgba(20, 24, 33, .55) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body:has(#__stationBg) .site-header {
  background: rgba(15, 17, 23, .75) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ═══ MOBILE NO-SHIFT ═══ */
html, body {
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after {
  box-sizing: border-box;
}
/* Плавающие попапы и меню не должны растягивать страницу */
#wallet-pop-panel,
#wallet-pop {
  max-width: calc(100vw - 20px);
}
#wallet-pop-panel {
  right: 0;
}
/* Шапка не должна вызывать горизонтальный скролл */
.site-header,
.header-inner {
  max-width: 100%;
  overflow-x: clip;
}
.site-header .header-inner {
  flex-wrap: wrap;
  row-gap: 6px;
}
/* На узких экранах — перенос кнопок аккуратно, ничего не сдвигается */
@media (max-width: 720px) {
  .site-header .header-inner {
    gap: 6px 8px;
  }
  .site-header .header-inner .nav-link {
    font-size: 13px;
    padding: 6px 8px;
  }
  .logo { font-size: 16px; }
}
/* Модалки и оверлеи — фикс на мобильном */
[id$="Modal"], .modal, [class*="modal"] {
  max-width: 100vw;
}
/* Кнопки не должны вызывать shift из-за focus-outline */
button, a, .btn {
  -webkit-tap-highlight-color: transparent;
  outline-offset: 2px;
}
button:active, .btn:active {
  transform: none;
}
/* Если у кнопок есть transform при :active — отключаем его (частая причина сдвига) */
.btn:active, button:active, a:active {
  transform: none !important;
}

/* На случай если попап fixed/absolute — тоже перебиваем */

/* ═══════════════════════════════════════════════════════════
   DESIGN POLISH — добавлено поверх всех правил (2026-09-28)
   Не перебивает существующее, только улучшает читаемость
   и тактильность. Всё можно откатить из бэкапа.
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Рендер текста — ровнее буквы на тёмном ── */
*, *::before, *::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* ── 2. Поднимаем контраст серых оттенков ── */
:root {
  --text-dim: #a1a9bd;     /* было #8b94a7 — читаемее на тёмном */
  --muted:    #8e97ad;     /* было #6b7280 — на грани был */
}
.muted, .text-dim, [class*="muted"] {
  color: #a1a9bd !important;
}
small, .small {
  color: #a1a9bd;
}

/* ── 3. Цифры не «прыгают» при обновлении ── */
#wallet-pop-bal,
#wallet-pop-balance,
#chatListeners,
#onlineTotal,
#chatClock,
.chat-listeners,
.dj-listeners,
.timer,
[class*="balance"],
[class*="listeners"],
[class*="count"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.01em;
}

/* ── 4. Тактильная реакция кнопок ── */
button, .btn, [role="button"], a.btn {
  transition: transform .08s ease, background-color .15s ease,
              box-shadow .15s ease, filter .15s ease;
}
button:active:not([disabled]),
.btn:active:not([disabled]),
[role="button"]:active:not([disabled]),
a.btn:active {
  transform: scale(0.97);
}
button:hover:not([disabled]),
.btn:hover:not([disabled]),
a.btn:hover {
  filter: brightness(1.08);
}

/* ── 5. Focus-ring для клавиатуры (доступность) ── */
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── 6. Минимальная зона тапа на телефоне (44px) ── */
@media (max-width: 720px) {
  button, .btn, [role="button"], a.btn {
    min-height: 44px;
  }
  input, select, textarea {
    min-height: 40px;
    font-size: 16px;    /* 16px+ iOS не зумит при фокусе */
  }
}

/* ── 7. Пульсация кнопки play во время эфира ── */
.chat-play.live,
#chatPlay.live,
button.play-btn[data-live="1"] {
  animation: polishPlayPulse 2.2s infinite;
}
@keyframes polishPlayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,.55); }
  50%      { box-shadow: 0 0 0 14px rgba(99,102,241,0); }
}

/* ── 8. Бейдж «В эфире» — мягкое свечение ── */
#chatOnAir,
.on-air-badge,
[class*="on-air"] {
  box-shadow: 0 0 22px rgba(139,92,246,.22);
}

/* ── 9. Инпут чата — яркая граница при фокусе ── */
#chatInput:focus,
#dmInput:focus,
.chat-input-row input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
}

/* ── 10. Сообщения чата — легкая тень для объёма ── */
#chatMessages > div > div,
.chat-messages > div > div,
#dmBody > div > div {
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}

/* ── 11. Карточки онлайн — ровный интервал и ховер ── */
.online-user-card,
#onlineList [data-user-id] {
  transition: background-color .15s ease, transform .1s ease;
}
.online-user-card:active,
#onlineList [data-user-id]:active {
  transform: scale(0.99);
}

/* ── 12. Плавное появление оверлеев ── */
#wallet-pop-panel[style*="display: block"],
#wallet-pop-panel[style*="display:block"] {
  animation: polishFadeIn .15s ease-out;
}
@keyframes polishFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── 13. Общий контраст карточек на тёмном ── */
.dj-card, .st-card, .station-card, .card {
  border-color: rgba(99,102,241,.18);
}

/* ── 14. Скроллбары — тонкие и тёмные ── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,.4) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,.35);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(99,102,241,.55);
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* ── 15. Уменьшение анимаций для тех, кто просил ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* [playbtn-fix] Кнопка play на странице станции — принудительно круглая */
#playBtn{
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: 1 / 1 !important;
  flex-shrink: 0 !important;
}


/* ─── [chat-play-final] Круглая кнопка play в чате — фикс ─── */
.chat-player{
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}
.chat-player .chat-play,
button.chat-play,
.chat-play{
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  flex: 0 0 64px !important;
  aspect-ratio: 1/1 !important;
  border-radius: 50% !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #6366f1, #a855f7) !important;
  color: #fff !important;
  font-size: 26px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 0 20px rgba(99,102,241,.5) !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
