/* ==========================================================================
   VIVA ULTRA — тема Cyberpunk / Tech-Noir
   Tailwind отвечает за раскладку, здесь — эффекты: стекло, неон, сканлайны.
   ========================================================================== */

:root {
    --accent: #B026FF;
    --lime: #C6FF3D;
    --cyan: #00E0FF;
    --ink: #0B0F19;
    --ink-2: #121826;
}

html { background: var(--ink); }

/* Атрибут hidden обязан побеждать компонентные display (btn-ghost, auth-ava…),
   иначе скрытые элементы остаются видимыми. */
[hidden] { display: none !important; }
body { overflow-x: hidden; }

/* Grid-элементы по умолчанию имеют min-width:auto и могут «распирать» страницу
   длинным неразрывным текстом (заголовки клипов, бегущая строка). На телефоне
   это давало горизонтальный скролл и сжимало весь макет. */
main .grid > * { min-width: 0; }

/* ------------------------------- Фон / FX ------------------------------- */
.fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.fx__grid {
    position: absolute; inset: -10%;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(1200px 800px at 50% 0%, #000 10%, transparent 75%);
    -webkit-mask-image: radial-gradient(1200px 800px at 50% 0%, #000 10%, transparent 75%);
    transform: perspective(600px) rotateX(48deg) translateY(-12%);
    opacity: .5;
}

.fx__blob { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .45; }
.fx__blob--a { width: 520px; height: 520px; left: -120px; top: -160px; background: radial-gradient(circle, var(--accent), transparent 65%); animation: drift 18s ease-in-out infinite; }
.fx__blob--b { width: 460px; height: 460px; right: -100px; top: 120px; background: radial-gradient(circle, var(--cyan), transparent 65%); animation: drift 22s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(40px, 30px, 0); } }

.fx__scan {
    position: absolute; inset: 0; opacity: .06; mix-blend-mode: overlay;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .35) 0 1px, transparent 1px 3px);
}

/* --------------------------- Стекло и кнопки --------------------------- */
.glass {
    background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px) saturate(140%);
    border-radius: 22px;
}
.glass-hover { transition: transform .25s cubic-bezier(.2, .8, .3, 1), border-color .25s ease, box-shadow .3s ease; }
.glass-hover:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 24px 60px -30px var(--accent); }

/* Обычная специфичность: preflight Tailwind (`button { padding: 0 }`) не должен
   сбрасывать отступы кнопок. Скрытие на мобильных — через !hidden/!inline-flex. */
.btn-neon, .btn-ghost {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .55rem 1.05rem; border-radius: 999px; font-size: .875rem; font-weight: 600;
    cursor: pointer; border: 1px solid transparent; transition: all .2s ease; white-space: nowrap;
}
.btn-neon { background: linear-gradient(120deg, var(--accent), var(--cyan)); color: #071018; box-shadow: 0 12px 40px -16px var(--accent); }
.btn-neon:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); color: #e2e8f0; }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-lime { background: var(--lime); color: #0B0F19; }
.btn-lime:hover { filter: brightness(1.05); }

.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
        font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: #cbd5e1; }
.chip[data-tone="up"] { color: var(--lime); border-color: color-mix(in srgb, var(--lime) 50%, transparent); }
.chip[data-tone="down"] { color: #FF6B81; border-color: rgba(255, 107, 129, .5); }
.chip[data-tone="new"] { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 50%, transparent); }
.chip[data-tone="same"] { color: #94a3b8; }

/* ------------------------------- Плеер --------------------------------- */
/* Мягкая рамка плеера: вместо резкой линии — свечение-контур и лёгкая виньетка,
   чтобы граница кадра не «спорила» с анимированным фоном. */
.player-shell {
    position: relative; border-radius: 28px; overflow: hidden; background: #05070d;
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow: 0 30px 80px -45px rgba(0, 0, 0, .95), 0 0 44px -18px rgba(176, 38, 255, .45);
    -webkit-mask-image: radial-gradient(140% 140% at 50% 50%, #000 82%, rgba(0, 0, 0, .82) 100%);
    mask-image: radial-gradient(140% 140% at 50% 50%, #000 82%, rgba(0, 0, 0, .82) 100%);
}
.player-shell::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: inset 0 0 64px rgba(5, 7, 13, .55);
}
.player-shell iframe, .player-shell video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-shell { aspect-ratio: 16 / 9; }
/* Свечение за плеером — вращающийся размытый жёлтый треугольник из логотипа.
   Обёртка отвечает за позицию, фигура вращается вокруг своего центра. */
.player-glow { position: absolute; inset: -22%; z-index: -1; display: grid; place-items: center; pointer-events: none; }
.player-glow__shape {
    display: block; width: 56%; aspect-ratio: 1;
    /* blur — на обёртке: clip-path на самом треугольнике обрезал бы размытие. */
    filter: blur(42px);
    opacity: .55;
    animation: spin 20s linear infinite;
}
.player-glow__shape svg { display: block; width: 100%; height: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Прогресс клипа / программы */
.track-bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.track-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--lime)); transition: width .9s linear; }

/* Бегущая строка новинок: подпись слева статична, двигаются только названия. */
.ticker {
    display: flex; align-items: center; overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .07);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.ticker__banner {
    flex: none; z-index: 2; margin-right: 1.5rem;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .18rem .75rem; border-radius: 999px;
    font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
    color: #071018; background: linear-gradient(120deg, var(--lime), var(--cyan));
    box-shadow: 0 10px 28px -14px var(--lime);
}
.ticker__viewport {
    flex: 1 1 auto; min-width: 0; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2.5%, #000 97.5%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 2.5%, #000 97.5%, transparent 100%);
}
.ticker__track {
    display: flex; width: max-content; padding: .55rem 0;
    white-space: nowrap; animation: ticker calc(var(--ticker-items, 9) * 10s) linear infinite;
    will-change: transform;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker__group {
    display: flex; align-items: center; gap: 2.5rem;
    flex: none; padding-right: 2.5rem;
}

/* ------------------------------- Чарт ---------------------------------- */
/* Строка чарта: flex, потому что в разметке 3–4 элемента (позиция, обложка,
   текст, кнопка). Раньше стоял grid на 3 колонки — с приходом статического
   Tailwind (он грузится до app.css) это перестало перекрываться классом flex
   и четвёртый элемент уезжал на новую строку. */
.chart-row { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .06); transition: background .2s ease; position: relative; overflow: hidden; }
.chart-row > .min-w-0 { flex: 1 1 auto; }
/* Полоса популярности: заполняет строку пропорционально показам (числа не показываем). */
.chart-row::before, .chart-bar::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: var(--bar, 0%);
    z-index: 0; pointer-events: none;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--lime) 12%, transparent));
}
.chart-row > *, .chart-bar > * { position: relative; z-index: 1; }
.chart-bar { position: relative; overflow: hidden; }
.chart-row:hover { background: rgba(255, 255, 255, .03); }
.chart-row__pos { flex: none; width: 2.5rem; text-align: right; font-family: Unbounded, system-ui, sans-serif; font-size: 1.35rem; color: #94a3b8; }
.chart-row--top .chart-row__pos { color: #fff; text-shadow: 0 0 24px var(--accent); }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--lime); stroke-width: 2; }
.spark--down polyline { stroke: #FF6B81; }

/* ------------------------------- Чат ----------------------------------- */
.chat-list { height: 460px; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem; align-content: start; padding: .6rem; scroll-behavior: smooth; }
.chat-line { display: flex; gap: .55rem; padding: .4rem .5rem; border-radius: 12px; min-width: 0; }
.chat-line:hover { background: rgba(255, 255, 255, .03); }
.chat-line--cont { padding-top: 0; }
.chat-ava { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #0B0F19;
    background: linear-gradient(135deg, var(--lime), var(--cyan)); }
.chat-ava { position: relative; }
.chat-ava--ghost { background: transparent; }
/* Синяя точка «сейчас в чате» (сайт/приложение). */
.chat-online {
    position: absolute; right: -2px; bottom: -2px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #3b82f6; border: 2px solid #0b0f19;
    box-shadow: 0 0 8px rgba(59, 130, 246, .9);
    animation: chatOnlineBlink 1.6s ease-in-out infinite;
}
@keyframes chatOnlineBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .25; transform: scale(.75); }
}
.chat-new { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    border-radius: 999px; border: 1px solid rgba(198, 255, 61, .55); background: rgba(9, 12, 20, .92);
    color: var(--lime); font-size: 12px; padding: .35rem .8rem; backdrop-filter: blur(8px); }
.chat-emoji { width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04); font-size: 16px; line-height: 1; transition: background .15s ease, transform .15s ease; }
.chat-emoji--more { color: var(--lime); font-weight: 700; }
.chat-air { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px;
    border: 1px solid rgba(198, 255, 61, .45); background: rgba(198, 255, 61, .08);
    color: var(--lime); font-size: 10px; letter-spacing: .04em; padding: .05rem .4rem; }
.chat-src { border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
    color: #94a3b8; font-size: 10px; letter-spacing: .08em; padding: .05rem .35rem; }
/* Разделитель суток: серая линия + дата цветом акцента. */
.chat-day { display: flex; align-items: center; gap: .75rem; padding: .55rem .5rem .3rem; min-width: 0; }
.chat-day::before, .chat-day::after { content: ''; height: 1px; flex: 1 1 auto; background: rgba(255, 255, 255, .14); }
.chat-day__label { flex: none; color: var(--cyan); font-size: 11px; letter-spacing: .04em; }
.chat-line { cursor: pointer; }
.chat-line--selected { background: rgba(34, 211, 238, .07); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .25); }
.chat-ava--src { padding: 0; background: #0b0f19; }
.chat-ava--src img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 50%; }
.chat-ava--vk img { background: #0077FF; }
.chat-ava--rutube img { background: #0b0f19; }
.chat-hide {
    width: 40px; height: 40px; margin-left: .4rem; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
    color: #fda4af; display: grid; place-items: center;
}
.chat-hide svg { width: 20px; height: 20px; }
.chat-hide:hover:not(:disabled) { border-color: #fda4af; background: rgba(253, 164, 175, .1); }
.chat-hide.is-active { border-color: var(--lime); color: var(--lime); background: rgba(198, 255, 61, .10); }
.chat-hide:disabled { opacity: .35; cursor: not-allowed; }
.chat-hide[hidden] { display: none; }
.chat-hide-inline {
    display: inline-grid; place-items: center; width: 20px; height: 20px;
    margin-left: .3rem; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: #fda4af; opacity: .7; cursor: pointer;
    vertical-align: middle;
}
.chat-hide-inline svg { width: 14px; height: 14px; }
.chat-hide-inline:hover { opacity: 1; background: rgba(253, 164, 175, .12); }
.chat-self {
    display: inline-flex; align-items: center; gap: .35rem;
    height: 40px; margin-left: .4rem; padding: 0 .65rem; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
    color: #cbd5e1; font-size: 11px;
}
.chat-self svg { width: 17px; height: 17px; }
.chat-self:hover { border-color: var(--cyan); color: #fff; }
.chat-self.is-active { border-color: var(--lime); color: var(--lime); background: rgba(198, 255, 61, .08); }
.chat-self[hidden] { display: none; }
.chat-emoji:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.chat-msg { padding: .55rem .8rem; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .03); animation: pop .25s ease; }
.chat-msg.is-verified { border-color: color-mix(in srgb, var(--lime) 45%, transparent); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------- Медиа-хаб (коллаж) ------------------------ */
.collage { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.collage__item { grid-column: span 4; perspective: 900px; }
.collage__item--wide { grid-column: span 8; }
.collage__item--full { grid-column: span 12; }
@media (max-width: 1024px) { .collage__item, .collage__item--wide, .collage__item--full { grid-column: span 12; } }
.tilt { transform-style: preserve-3d; transition: transform .2s ease; }


/* --------------------------- Умная обрезка фото -------------------------- */
/* Портретные кадры показываем целиком на размытой подложке —
   так не «срезаются» головы; пейзажные смещаем к верхней части кадра. */
.news-media { position: relative; display: block; overflow: hidden; background: #0d1220; }
.news-media > img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus-x, 50%) var(--focus-y, 28%); }
.news-media.is-portrait > img { object-fit: contain; }
.news-media.is-portrait::before {
    content: ''; position: absolute; inset: -12%; z-index: 0;
    background-image: var(--media-bg); background-size: cover; background-position: var(--focus-x, 50%) var(--focus-y, 22%);
    filter: blur(26px) saturate(115%); transform: scale(1.12); opacity: .6;
}
.news-media.is-broken { display: none; }
/* ------------------------------- Мини-плеер ---------------------------- */
.mini { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; display: flex; align-items: center; gap: .75rem;
        padding: .5rem .8rem .5rem .5rem; border-radius: 999px; background: rgba(11, 15, 25, .92);
        border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(14px); box-shadow: 0 20px 50px -25px #000; }
.mini[hidden] { display: none; }
.mini__btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--lime); color: #071018; cursor: pointer; }
.mini__text { font-size: .75rem; color: #94a3b8; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__text b { color: #fff; }
.mini__bar { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 2px; background: rgba(255, 255, 255, .12); border-radius: 999px; overflow: hidden; }
.mini__bar > span { display: block; height: 100%; width: 0; background: var(--lime); }

/* -------------------------- Модальное окно чата ------------------------ */
.chat-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.chat-modal[hidden] { display: none; }
.chat-modal__backdrop { position: absolute; inset: 0; background: rgba(5, 7, 13, .72); backdrop-filter: blur(6px); }
.chat-modal__panel {
    position: relative; width: min(760px, 100%); height: min(86vh, 860px); max-height: min(86vh, 860px); overflow: hidden;
    display: flex; flex-direction: column;
    border-radius: 22px; border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(12, 16, 27, .96); box-shadow: 0 40px 120px -50px #000;
}
.chat-modal__close {
    position: absolute; top: 10px; right: 12px; z-index: 3;
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(9, 12, 20, .9); color: #e2e8f0; font-size: 15px; line-height: 1; cursor: pointer;
}
.chat-modal__close:hover { color: var(--lime); border-color: rgba(198, 255, 61, .5); }
.chat-modal__body { padding: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* В модалке чат занимает всю ширину: без «стеклянной» рамки и внешних отступов.
   Панель — flex-колонка: прокручивается только лента, форма всегда видна внизу. */
.chat-embed { padding: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-embed > div { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-embed .glass { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; background: transparent; backdrop-filter: none; }
.chat-embed .relative { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-embed .chat-list { height: auto; flex: 1 1 auto; min-height: 0; }
.chat-embed form { flex: none; }
@media (max-width: 640px) {
    .chat-modal { padding: 0; }
    .chat-modal__panel { width: 100%; height: 92vh; max-height: 92vh; border-radius: 18px 18px 0 0; align-self: end; }
}

/* Обложка «сейчас играет»: если картинки нет (или она не загрузилась) —
   показываем заглушку с нотой, а не битую иконку браузера. */
.now-cover {
    position: relative; flex: none; display: grid; place-items: center;
    width: 4rem; height: 4rem; border-radius: .75rem; overflow: hidden;
    background: linear-gradient(145deg, rgba(176, 38, 255, .22), rgba(0, 224, 255, .12));
    border: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .55);
}
.now-cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.now-cover__img.is-empty { display: none; }

/* Обложка трека в списках «что играло»: без картинки — заглушка с нотой. */
.cover-thumb {
    position: relative; flex: none; display: grid; place-items: center;
    width: 3rem; height: 3rem; border-radius: .5rem; overflow: hidden;
    background: linear-gradient(145deg, rgba(176, 38, 255, .2), rgba(0, 224, 255, .1));
    border: 1px solid rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .5);
}
.cover-thumb__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-thumb__img.is-empty { display: none; }

/* Кнопка 30-секундного превью на обложке трека (история / архив). */
.cover-thumb__play {
    position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
    border: 0; padding: 0; cursor: pointer; color: #fff;
    background: rgba(5, 7, 13, .38); opacity: .38;
    transition: opacity .18s ease, background .18s ease, color .18s ease;
}
.cover-thumb:hover .cover-thumb__play,
.cover-thumb__play:focus-visible { opacity: 1; }
.cover-thumb__play.is-playing { opacity: 1; background: rgba(5, 7, 13, .6); color: var(--lime); }
.cover-thumb__pause-icon { display: none; }
.cover-thumb__play.is-playing .cover-thumb__play-icon { display: none; }
.cover-thumb__play.is-playing .cover-thumb__pause-icon { display: block; }
@media (hover: none), (pointer: coarse) {
    .cover-thumb__play { opacity: .55; }
}

/* Профиль и аватары (шапка, чат, профиль). */
.profile-ava {
    flex: none; display: grid; place-items: center; width: 96px; height: 96px;
    border-radius: 50%; overflow: hidden; color: rgba(255, 255, 255, .6);
    background: linear-gradient(145deg, rgba(176, 38, 255, .22), rgba(0, 224, 255, .12));
    border: 1px solid rgba(255, 255, 255, .12);
}
.profile-ava img { width: 100%; height: 100%; object-fit: cover; }
.auth-ava { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: -6px; margin-right: 6px; }
.chat-ava--img { padding: 0; background: none; }
.chat-ava--img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Меню пользователя в шапке: имя → выпадающее окно (профиль/админка/выход). */
.auth-menu { position: relative; }
.auth-menu__toggle {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .9rem; border-radius: 999px;
    border: 1px solid rgba(198, 255, 61, .45); background: rgba(255, 255, 255, .04);
    color: #fff; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.auth-menu__toggle:hover { border-color: var(--lime); }
.auth-menu__panel {
    position: fixed; right: 16px; top: 72px; z-index: 95;
    min-width: 210px; padding: .4rem; display: grid; gap: 2px;
    border-radius: 14px; border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(12, 16, 27, .97); box-shadow: 0 24px 60px -30px #000;
}
.auth-menu__panel[hidden] { display: none; }
.auth-menu__panel a, .auth-menu__panel button {
    display: block; width: 100%; text-align: left; padding: .55rem .7rem;
    border: 0; border-radius: 10px; background: none; cursor: pointer;
    font-size: .9rem; color: #e2e8f0;
}
.auth-menu__panel a:hover, .auth-menu__panel button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.auth-menu__panel [data-auth-logout] { color: #fda4af; }

/* Эмодзи-пикер в чате: категории и сетка, как в мессенджерах. */
/* Пикер привязан к форме (позиционируется от неё), а не к маленькой кнопке. */
[data-chat-form] { position: relative; }
.chat-emoji-bar { display: flex; }
.chat-emoji-trigger {
    width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
    font-size: 20px; line-height: 1;
}
.chat-emoji-trigger:hover { border-color: var(--lime); }
.emoji-picker {
    position: absolute; left: .75rem; right: .75rem; bottom: calc(100% + .5rem); z-index: 65;
    max-height: min(320px, 45vh);
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    background: rgba(12, 16, 27, .98); border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px; box-shadow: 0 30px 80px -40px #000;
}
.emoji-picker[hidden] { display: none; }
.emoji-picker__tabs {
    flex: none; display: flex; gap: 2px; padding: 6px; overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.emoji-tab { flex: none; padding: 4px 6px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: 18px; opacity: .6; }
.emoji-tab:hover { opacity: 1; }
.emoji-tab.is-active { opacity: 1; background: rgba(255, 255, 255, .1); }
.emoji-picker__grid {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 6px;
}
.emoji-item { border: 0; background: none; border-radius: 6px; font-size: 20px; line-height: 1; padding: 4px; cursor: pointer; }
.emoji-item:hover { background: rgba(255, 255, 255, .1); }
.emoji-loading { grid-column: 1 / -1; padding: 12px; text-align: center; color: #94a3b8; }
@media (max-width: 640px) {
    .emoji-picker__grid { grid-template-columns: repeat(7, 1fr); }
}

/* --------------------------- Новостной портал -------------------------- */
.news-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.news-filter { text-transform: none; letter-spacing: .02em; font-size: .8rem; }
.news-filter.is-active { color: var(--lime); border-color: rgba(198, 255, 61, .5); background: rgba(198, 255, 61, .08); }
.news-filter__count { margin-left: .35rem; color: #64748b; font-variant-numeric: tabular-nums; }

.news-hero { display: grid; grid-template-columns: 1.25fr 1fr; overflow: hidden; border-radius: 22px; text-decoration: none; }
.news-hero__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
    background: linear-gradient(145deg, rgba(176, 38, 255, .18), rgba(0, 224, 255, .1)); }
.news-hero__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-hero:hover .news-hero__media img { transform: scale(1.03); }
.news-hero__media img.is-empty { display: none; }
.news-hero__body { display: flex; flex-direction: column; justify-content: center; gap: .6rem; padding: 1.6rem 1.8rem; }
.news-hero__title { font-family: Unbounded, system-ui, sans-serif; font-size: 1.45rem; line-height: 1.28; color: #fff; }
.news-hero__lead { color: #94a3b8; font-size: .95rem; line-height: 1.55; }
.news-hero__more { margin-top: .35rem; color: var(--lime); font-size: .85rem; }

.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.news-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; text-decoration: none; }
.news-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden;
    background: linear-gradient(145deg, rgba(176, 38, 255, .16), rgba(0, 224, 255, .09)); }
.news-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.news-card:hover .news-card__media img { transform: scale(1.04); }
.news-card__media img.is-empty { display: none; }
.news-card__body { display: flex; flex-direction: column; gap: .45rem; padding: .9rem 1rem 1.1rem; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
    font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #64748b; }
.news-cat { color: var(--lime); }
.news-card__title, .news-hero__title { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.news-card__title { -webkit-line-clamp: 3; color: #fff; font-weight: 600; line-height: 1.35; }
.news-card__lead { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: #94a3b8; font-size: .83rem; line-height: 1.45; }

@media (max-width: 1100px) {
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-hero { grid-template-columns: 1fr; }
    .news-hero__media { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-hero__title { font-size: 1.2rem; }
    .news-hero__body { padding: 1rem; }
}

/* ------------------------------ Мелочи -------------------------------- */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.09) 37%, rgba(255,255,255,.04) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 12px; }

/* ------------------------------ Тосты ------------------------------ */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; gap: 10px; align-items: flex-start;
    padding: 13px 15px; border-radius: 14px; cursor: pointer;
    background: rgba(9, 12, 20, .94); border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 24px 60px -28px #000; backdrop-filter: blur(14px);
    animation: toast-in .28s ease both;
}
.toast--ok { border-color: rgba(198, 255, 61, .55); box-shadow: 0 24px 60px -28px #000, 0 0 34px -18px var(--lime); }
.toast--err { border-color: rgba(255, 61, 127, .6); box-shadow: 0 24px 60px -28px #000, 0 0 34px -18px #FF3D7F; }
.toast__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--cyan); }
.toast--ok .toast__dot { background: var(--lime); }
.toast--err .toast__dot { background: #FF3D7F; }
.toast__text { font-size: 14px; line-height: 1.35; color: #F2F4FF; }
.toast--out { animation: toast-out .24s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 640px) {
    .toast-wrap { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #253046; border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
    .fx__blob, .player-glow__shape, .ticker__track, .chip .animate-ping { animation: none; }
}

/* ------------------- Мобильные: отключаем тяжёлые эффекты ------------------ *
 * Факт: backdrop-filter, filter: blur(110px), mix-blend-mode и постоянные
 * анимации дорого стоят мобильному GPU — из-за них подтормаживают прокрутка
 * и видео. Вид сохраняем, нагрузку убираем (широкие экраны не затрагиваем). */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .fx__scan { display: none; }                 /* mix-blend-mode: overlay поверх видео — самый дорогой слой */
    .fx__grid { transform: none; opacity: .32; -webkit-mask-image: none; mask-image: none; }
    .fx__blob { animation: none; filter: none; opacity: .33; }   /* мягкий радиальный градиент без blur */
    .glass { backdrop-filter: none; background: rgba(255, 255, 255, .05); }
    .glass-hover:hover { transform: none; box-shadow: none; }
    .mini, .toast, .chat-new { backdrop-filter: none; }
    header.site-header { backdrop-filter: none !important; background: rgba(11, 15, 25, .94); }
    .player-glow { display: none; }              /* свечение-треугольник под плеером */
    .news-media.is-portrait::before { display: none; }   /* размытая подложка карточки новости */
    .player-shell { box-shadow: 0 18px 44px -32px rgba(0, 0, 0, .9); }
    .chart-row--top .chart-row__pos { text-shadow: none; }
    .vote-heart__svg { filter: none; }
    .ticker__track { animation-duration: calc(var(--ticker-items, 9) * 12s); }
    .skeleton { animation: none; }
    .chat-list { scroll-behavior: auto; }
}


/* ------------------------------- Текст новости --------------------------- */
.prose-news { color: #d6dbe7; font-size: 1.02rem; line-height: 1.8; }
.prose-news p { margin: 0 0 1.05em; }
.prose-news h2, .prose-news h3 { font-family: Unbounded, system-ui, sans-serif; font-size: 1.15rem; margin: 1.6em 0 .6em; color: #fff; }
.prose-news a { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.prose-news img { display: block; width: 100%; border-radius: 16px; margin: 1.2em 0; }
.prose-news blockquote { margin: 1.2em 0; padding: .3em 1.1em; border-left: 3px solid var(--accent); color: #aab3c6; }
.prose-news ul, .prose-news ol { padding-left: 1.3em; margin: 0 0 1.1em; }

/* ------------------- Голос за клип: красное сердце ---------------------- */
.vote-heart {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
    transition: transform .15s ease, filter .2s ease;
}
.vote-heart:hover { transform: scale(1.07); }
.vote-heart:active { transform: scale(.96); }
.vote-heart:disabled { opacity: .6; cursor: default; }
.vote-heart__svg {
    width: 48px; height: 44px; display: block;
    filter: drop-shadow(0 6px 16px rgba(225, 29, 47, .45));
}
.vote-heart__count {
    position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
    color: #fff; font-weight: 800; font-size: .82rem; line-height: 1;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

/* --------- Сердечко TIP TOP в блоке «Сейчас играет» (главная) -------------
   Бледное до голоса, яркое после. Цифру голосов не показываем. */
.now-vote {
    flex: 0 0 auto; margin-left: auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 48px; padding: 0; border: 0; background: transparent;
    cursor: pointer; opacity: .42; filter: grayscale(1);
    -webkit-tap-highlight-color: transparent;
    transition: opacity .2s ease, filter .2s ease, transform .15s ease;
}
.now-vote:hover { opacity: .72; transform: scale(1.05); }
.now-vote:active { transform: scale(.95); }
.now-vote:disabled { cursor: default; }
.now-vote.is-voted {
    opacity: 1; filter: drop-shadow(0 6px 16px rgba(225, 29, 47, .45));
}
.now-vote__svg { width: 48px; height: 44px; display: block; }
.now-vote__svg path { fill: #e11d2f; }
.now-vote[hidden] { display: none !important; }

/* ==========================================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   Шапка, меню-шторка и мелкая правка отступов. Всё, что касается телефонов,
   держим здесь: desktop-раскладка остаётся без изменений.
   ========================================================================== */

/* Кнопка-гамбургер: 46×46 — удобная цель для пальца. */
.menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; padding: 0;
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px;
    background: rgba(255, 255, 255, .05); color: #e2e8f0;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: border-color .2s ease, background .2s ease, color .2s ease, transform .12s ease;
}
.menu-btn:hover { border-color: color-mix(in srgb, var(--accent) 65%, transparent); color: #fff; background: rgba(255, 255, 255, .09); }
.menu-btn:active { transform: scale(.95); }
.menu-btn__icon { display: block; }

/* Шторка мобильного меню. Прокрутку страницы фиксируем в JS (position:fixed
   у body), потому что overflow:hidden на мобильном Chrome сбрасывает позицию. */
.mobile-menu { position: fixed; inset: 0; z-index: 100; }
.mobile-menu[hidden] { display: none !important; }

.mobile-menu__backdrop {
    position: absolute; inset: 0;
    background: rgba(5, 7, 13, .72);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    animation: menu-fade .22s ease both;
}
.mobile-menu__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(372px, 92vw);
    display: flex; flex-direction: column; gap: 16px;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    background:
        radial-gradient(420px 260px at 100% 0%, rgba(176, 38, 255, .20), transparent 70%),
        radial-gradient(360px 240px at 0% 100%, rgba(0, 224, 255, .10), transparent 72%),
        linear-gradient(180deg, #0e1422 0%, #0a0e18 62%, #080b12 100%);
    border-left: 1px solid rgba(255, 255, 255, .09);
    box-shadow: -30px 0 80px -40px #000;
    animation: menu-slide .28s cubic-bezier(.2, .8, .3, 1) both;
}

.mobile-menu__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-menu__kicker { font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--lime); }
.mobile-menu__title { margin-top: 2px; font-family: Unbounded, system-ui, sans-serif; font-size: 1.55rem; line-height: 1.15; color: #fff; }
.mobile-menu__close {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%;
    background: rgba(255, 255, 255, .05); color: #e2e8f0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu__close:hover { color: var(--lime); border-color: rgba(198, 255, 61, .5); }

.mobile-menu__nav { display: grid; gap: 4px; }
.mobile-menu__link {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 50px; padding: 0 14px; border: 1px solid transparent; border-radius: 14px;
    color: #cbd5e1; font-size: 1rem; font-weight: 600;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.mobile-menu__link:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .08); }
.mobile-menu__link.is-active {
    color: #fff; background: rgba(198, 255, 61, .08);
    border-color: rgba(198, 255, 61, .34); box-shadow: inset 3px 0 0 var(--lime);
}
.mobile-menu__chevron { flex: none; opacity: .4; }
.mobile-menu__link.is-active .mobile-menu__chevron { opacity: .9; color: var(--lime); }

.mobile-menu__label { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: #64748b; }
.mobile-menu__lang {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, .07);
}
.mobile-menu__lang .chip { font-size: .76rem; padding: .48rem .9rem; }
.mobile-menu__lang .chip[href*="ru"] { min-width: 0; }

.mobile-menu__account { display: grid; gap: 8px; }
.mobile-menu__login {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 14px; border-radius: 14px;
    background: linear-gradient(120deg, var(--accent), var(--cyan));
    color: #071018; font-size: .92rem; font-weight: 700;
    box-shadow: 0 14px 36px -20px var(--accent);
}
.mobile-menu__login:active { filter: brightness(.95); }
.mobile-menu__user {
    display: grid; gap: 2px; padding: 8px;
    border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
    background: rgba(255, 255, 255, .04);
}
.mobile-menu__user[hidden] { display: none !important; }
.mobile-menu__user-top { display: flex; align-items: center; gap: 12px; padding: 8px; }
.mobile-menu__ava {
    flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
    border: 1px solid rgba(198, 255, 61, .4);
    background: linear-gradient(145deg, rgba(176, 38, 255, .25), rgba(0, 224, 255, .12));
}
.mobile-menu__name { margin-top: 2px; color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu__account-link {
    display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 10px;
    border: 0; border-radius: 10px; background: none; color: #cbd5e1;
    font-size: .92rem; text-align: left; cursor: pointer;
}
.mobile-menu__account-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.mobile-menu__logout { color: #fda4af; }

.mobile-menu__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 4px; }
.mobile-menu__actions .btn-neon,
.mobile-menu__actions .btn-ghost { justify-content: center; padding: .82rem .6rem; font-size: .84rem; }
.mobile-menu__chat svg, .mobile-menu__app svg { flex: none; }

@keyframes menu-slide { from { transform: translateX(28px); opacity: .55; } to { transform: none; opacity: 1; } }
@keyframes menu-fade { from { opacity: 0; } to { opacity: 1; } }

/* На телефоне меню занимает всю высоту — убираем «двойные» отступы секций. */
@media (max-width: 640px) {
    .site-header .brand { gap: .5rem; }
    .site-header .brand-ultra { font-size: .52rem; padding: .1rem .34rem; letter-spacing: .18em; }
    main > section:first-of-type { padding-top: 1.25rem; }
    footer.mt-16 { margin-top: 2.5rem; }
    .ticker__banner { margin-right: .75rem; padding: .16rem .55rem; font-size: .62rem; letter-spacing: .08em; }
    .ticker__group { gap: 1.5rem; padding-right: 1.5rem; }
    .mobile-menu__actions { grid-template-columns: 1fr; }
    /* Заголовок раздела + кнопка «Все …»: на узких экранах кнопка переносится,
       иначе строка вылезает за правый край (замерено на 320px). */
    main .flex.items-end.justify-between { flex-wrap: wrap; }
}

/* Общая мобильная эргономика: без «синего» блика при тапе, без случайного
   зума при фокусе поля (iOS увеличивает страницу, если шрифт меньше 16px),
   мини-плеер на всю ширину и день-лента без полосы прокрутки. */
@media (max-width: 1023px) {
    html { scroll-padding-top: 76px; }
    a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }
    .btn-neon, .btn-ghost, .chip, .menu-btn { touch-action: manipulation; }
    input, select, textarea { font-size: 16px !important; }
    .mini {
        left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
        max-width: none;
    }
    .mini__text { max-width: none; flex: 1 1 auto; }
    .guide-days { scrollbar-width: none; -ms-overflow-style: none; }
    .guide-days::-webkit-scrollbar { display: none; }
}

/* ------------------------------ Контакты -------------------------------- */
.contact-layout { display: grid; gap: 1.25rem; }
@media (min-width: 1024px) {
    .contact-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
}

/* Новости на главной: ровная сетка без «дыр» от wide-карточек. */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.news-card { min-width: 0; }
@media (max-width: 1024px) {
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .news-grid { grid-template-columns: 1fr; }
}

/* ------------------------------- Подвал -------------------------------- */
.site-footer {
    position: relative; z-index: 10; margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
    background: rgba(9, 12, 20, .62);
    backdrop-filter: blur(10px);
}
.site-footer__accent {
    position: absolute; inset: 0 0 auto 0; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--lime), var(--cyan), transparent);
    opacity: .55;
}
.site-footer__inner {
    max-width: 1500px; margin: 0 auto; padding: 1.6rem 1rem 1.35rem;
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(190px, 220px) auto;
    align-items: start; gap: 1.5rem 2.5rem;
}
.site-footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; min-width: 0; }
.site-footer__logo { display: inline-flex; line-height: 0; border-radius: 6px; }
.site-footer__logo:focus-visible { outline: 2px solid var(--neon); outline-offset: 4px; }
.site-footer__badges { display: flex; gap: .35rem; }
.site-footer__badge {
    padding: .16rem .45rem; border-radius: 999px;
    font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--lime); background: color-mix(in srgb, var(--lime) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--lime) 40%, transparent);
}
.site-footer__badge--ghost { color: #94a3b8; background: transparent; border-color: rgba(255, 255, 255, .14); }
.site-footer__tagline { margin: 0; max-width: 270px; font-size: 12px; line-height: 1.5; color: #64748b; }

.site-footer__appcard { min-width: 0; padding-left: 1.5rem; border-left: 1px solid rgba(255, 255, 255, .07); }
.site-footer__applink {
    display: flex; align-items: center; gap: .65rem;
    margin-top: .5rem; padding: .55rem .75rem; border-radius: 12px;
    border: 1px solid rgba(198, 255, 61, .3); background: rgba(198, 255, 61, .06);
    color: #fff; transition: background .15s ease, border-color .15s ease;
}
.site-footer__applink:hover { background: rgba(198, 255, 61, .12); border-color: rgba(198, 255, 61, .55); }
.site-footer__applink svg { width: 26px; height: 26px; flex: none; color: var(--lime); }
.site-footer__applink b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.site-footer__applink i { display: block; margin-top: 2px; font-style: normal; font-size: 11px; color: #94a3b8; }

.site-footer__cols { display: grid; grid-template-columns: repeat(3, minmax(110px, auto)); gap: 1rem 2rem; }
.site-footer__title { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #475569; }
.site-footer__list { margin: .4rem 0 0; padding: 0; list-style: none; display: grid; gap: .28rem; font-size: 12px; }
/* «Разделы» — в две колонки, чтобы не вытягивать подвал в высоту. */
.site-footer__list--split { grid-template-columns: repeat(2, minmax(80px, auto)); column-gap: 1.5rem; }
.site-footer__list a { position: relative; display: inline-block; color: #cbd5e1; transition: color .15s ease; }
.site-footer__list a::after {
    content: ""; position: absolute; left: 0; bottom: -1px; width: 0; height: 1px;
    background: var(--neon); transition: width .18s ease;
}
.site-footer__list a:hover { color: var(--neon); }
.site-footer__list a:hover::after { width: 100%; }
.site-footer__list a:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 3px; }



@media (max-width: 1100px) {
    .site-footer__inner { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); }
    .site-footer__cols { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .site-footer__inner { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem 1rem 1rem; }
    .site-footer__appcard { padding-left: 0; border-left: 0; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .07); }
    .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer__legal { margin-left: 0; }
}
@media (max-width: 400px) {
    .site-footer__cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .site-footer__list a::after { transition: none; }
}

/* ------------------------------- Админка ------------------------------- */
.admin-tabs {
    display: flex; flex-wrap: wrap; gap: .3rem; padding: .3rem;
    border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px;
    background: rgba(255, 255, 255, .03);
}
.admin-tab {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .38rem .75rem; border-radius: 10px; border: 0;
    font-size: 12px; color: #94a3b8; background: transparent; cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.admin-tab:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.admin-tab.is-active { color: #0b0f19; background: var(--lime); font-weight: 600; }
.admin-tab__badge {
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    display: inline-grid; place-items: center; font-size: 10px;
    color: #0b0f19; background: rgba(198, 255, 61, .85);
}
.admin-tab.is-active .admin-tab__badge { background: rgba(11, 15, 25, .22); color: #0b0f19; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.admin-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; text-align: left; }
.admin-table th {
    padding: 0 .75rem .35rem 0; font-size: 10px; font-weight: 500;
    letter-spacing: .14em; text-transform: uppercase; color: #64748b; text-align: left;
}
.admin-table td { padding: .4rem .75rem .4rem 0; border-top: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }

/* Пользователи и роли: аккуратные селекты вместо системных белых. */
.admin-users-table td { padding-top: .55rem; padding-bottom: .55rem; }
.admin-user { display: flex; align-items: center; gap: .55rem; min-width: 190px; }
.admin-user__ava {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
}
.admin-user__ava--text {
    display: grid; place-items: center; color: var(--lime); font-size: 11px; font-weight: 700;
    background: rgba(198, 255, 61, .1);
}
.admin-user__name { display: flex; align-items: center; gap: .3rem; color: #fff; font-size: 13px; font-weight: 600; }
.admin-user__meta { color: #64748b; font-size: 10px; letter-spacing: .04em; }
.admin-role-select {
    appearance: none; -webkit-appearance: none; color-scheme: dark;
    min-width: 132px; padding: .38rem 1.9rem .38rem .65rem;
    border-radius: 9px; border: 1px solid rgba(255, 255, 255, .14);
    background-color: #0b0d17; color: #e2e8f0; font-size: 12px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .55rem center; background-size: 14px;
}
.admin-role-select option { background: #0b0d17; color: #e2e8f0; }
.admin-select {
    appearance: none; -webkit-appearance: none; color-scheme: dark;
    background-color: #0b0d17 !important; color: #e2e8f0; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .65rem center; background-size: 14px;
    padding-right: 2rem !important;
}
.admin-select option { background: #0b0d17; color: #e2e8f0; }
.admin-color { width: 100%; max-width: 170px; background: transparent; cursor: pointer; }
.admin-programs-list { max-height: 360px; overflow-y: auto; padding-right: .25rem; }
.admin-slots-list { max-height: 480px; overflow-y: auto; padding-right: .25rem; }
.admin-slot-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; align-items: end; }
.admin-slot-form__submit { grid-column: 1 / -1; width: fit-content; }
@media (max-width: 900px) {
    .admin-slot-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .admin-slot-form { grid-template-columns: 1fr; }
}
.admin-role-select[data-role="admin"] { border-color: rgba(198, 255, 61, .55); color: var(--lime); }
.admin-role-select[data-role="moderator"] { border-color: rgba(0, 224, 255, .45); color: var(--cyan); }
.admin-role-select[data-role="editor"] { border-color: rgba(176, 38, 255, .55); color: #d8b4fe; }
.admin-role-select:disabled { opacity: .65; cursor: not-allowed; }
.admin-switch { position: relative; display: inline-block; width: 38px; height: 20px; vertical-align: middle; }
.admin-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.admin-switch span {
    position: absolute; inset: 0; border-radius: 999px;
    background: rgba(255, 255, 255, .12); transition: background .15s ease;
}
.admin-switch span::before {
    content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
    border-radius: 50%; background: #94a3b8; transition: transform .15s ease, background .15s ease;
}
.admin-switch input:checked + span { background: rgba(198, 255, 61, .3); }
.admin-switch input:checked + span::before { transform: translateX(18px); background: var(--lime); }
.admin-switch input:disabled + span { opacity: .35; }
.admin-muted { color: #475569; }

/* Права на новости: две маленькие кнопки-флажка. */
.admin-news-perms { display: flex; gap: .3rem; }
.admin-perm {
    position: relative; display: inline-grid; place-items: center;
    width: 27px; height: 25px; border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .03);
    color: #64748b; font-size: 13px; cursor: pointer; user-select: none;
}
.admin-perm input { position: absolute; opacity: 0; width: 0; height: 0; }
.admin-perm:has(input:checked) { border-color: rgba(198, 255, 61, .45); color: var(--lime); background: rgba(198, 255, 61, .08); }
.admin-perm:has(input:disabled) { cursor: default; }
.admin-perm input:disabled + span { opacity: .7; }

.admin-news-form { align-items: start; }
.admin-news-list { max-height: 620px; overflow-y: auto; padding-right: .25rem; }
.admin-news-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.admin-news-cats { display: flex; flex-wrap: wrap; gap: .3rem; }
.admin-news-cat {
    padding: .34rem .65rem; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
    color: #94a3b8; font-size: 11px;
}
.admin-news-cat span { color: #64748b; }
.admin-news-cat.is-active { color: #0b0f19; background: var(--lime); border-color: var(--lime); font-weight: 600; }
.admin-news-cat.is-active span { color: rgba(11, 15, 25, .6); }
.admin-news-pager { display: flex; align-items: center; gap: .4rem; }
.admin-news-pager .btn-ghost { padding: .25rem .6rem; }
.admin-news-actions { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Визуальный редактор текста новости. */
.admin-editor { overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.admin-editor__toolbar { display: flex; flex-wrap: wrap; gap: .18rem; padding: .28rem; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.admin-editor__toolbar button {
    min-width: 30px; height: 28px; padding: 0 .42rem; border-radius: 6px;
    border: 1px solid transparent; background: transparent; color: #cbd5e1;
    font-size: 12px; cursor: pointer;
}
.admin-editor__toolbar button:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); }
.admin-editor__area {
    min-height: 200px; max-height: 430px; overflow-y: auto;
    padding: .75rem .9rem; color: #e2e8f0; font-size: 14px; line-height: 1.6; outline: none;
}
.admin-editor__area:empty::before { content: attr(data-placeholder); color: #64748b; }
.admin-editor__area p { margin: 0 0 .6rem; }
.admin-editor__area h2 { margin: .8rem 0 .4rem; font-size: 1.2rem; color: #fff; }
.admin-editor__area h3 { margin: .7rem 0 .35rem; font-size: 1.05rem; color: #fff; }
.admin-editor__area ul, .admin-editor__area ol { margin: .4rem 0 .7rem; padding-left: 1.4rem; }
.admin-editor__area blockquote { margin: .5rem 0; padding-left: .8rem; border-left: 2px solid var(--lime); color: #cbd5e1; }
.admin-editor__area a { color: var(--cyan); text-decoration: underline; }
.admin-editor__area img { max-width: 100%; height: auto; border-radius: 8px; margin: .4rem 0; }
.admin-news-group { display: grid; gap: .4rem; }
.admin-news-group__title { margin-top: .35rem; color: #94a3b8; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.admin-news-group__title span { color: #475569; letter-spacing: .04em; text-transform: none; }
.admin-news-row {
    display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem;
    border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: rgba(255, 255, 255, .03);
}
.admin-news-row__title { color: #fff; font-size: 13px; font-weight: 600; }
.admin-news-row__meta { color: #64748b; font-size: 11px; }

/* ТВ-программа: передачи и слоты. */
.admin-program-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem; border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px; background: rgba(255, 255, 255, .03);
}
.admin-program-row__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.admin-program-row__title { color: #fff; font-size: 13px; font-weight: 600; }
.admin-program-row__meta { color: #64748b; font-size: 11px; }
.admin-slot-day { border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; padding: .55rem .7rem; }
.admin-slot-day__title { margin-bottom: .3rem; color: #64748b; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.admin-slot-row { display: flex; align-items: center; gap: .6rem; padding: .28rem 0; border-top: 1px solid rgba(255, 255, 255, .05); font-size: 12px; }
.admin-slot-row:first-child { border-top: 0; }
.admin-slot-row__time { min-width: 92px; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.admin-slot-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }

@media (max-width: 1023px) {
    .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    .admin-stats { grid-template-columns: 1fr; }
}

/* Превью клипа в You Decide: фиксированный размер, чтобы карточка не «прыгала»
   без обложки; вместо битой картинки — заглушка с нотой. */
.yd-cover {
    position: relative; flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
    background: rgba(255, 255, 255, .05); display: grid; place-items: center;
}
.yd-cover[data-yd-preview] { cursor: pointer; }
.yd-cover[data-yd-preview]::after {
    content: '▶'; position: absolute; right: 3px; bottom: 3px; width: 17px; height: 17px;
    display: grid; place-items: center; border-radius: 50%; font-size: 8px; line-height: 1;
    color: var(--lime); background: rgba(11, 15, 25, .82); border: 1px solid rgba(198, 255, 61, .4);
    pointer-events: none;
}
.yd-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.yd-cover__empty {
    width: 100%; height: 100%; display: grid; place-items: center;
    color: rgba(255, 255, 255, .55);
    background: linear-gradient(135deg, rgba(176, 38, 255, .22), rgba(34, 211, 238, .16));
}
.yd-cover__empty svg { width: 26px; height: 26px; }

/* Заказы You Decide на телефоне — карточками, а не сжатой строкой в четыре
   колонки (дата, исполнитель, трек и статус иначе переносятся как попало). */
@media (max-width: 640px) {
    .yd-order {
        display: grid; grid-template-columns: minmax(0, 1fr) auto;
        gap: .18rem .75rem; padding: .65rem .75rem;
        border: 1px solid rgba(255, 255, 255, .06); border-radius: 12px;
        background: rgba(255, 255, 255, .03);
    }
    .yd-order__date { grid-column: 1; grid-row: 1; font-size: .72rem; }
    .yd-order__artist { grid-column: 1; grid-row: 2; font-weight: 600; }
    .yd-order__title { grid-column: 1; grid-row: 3; font-size: .8rem; }
    .yd-order .chip { grid-column: 2; grid-row: 1 / span 3; align-self: center; justify-self: end; }
    /* В модалке чата заголовок не должен упираться в кнопку закрытия. */
    .chat-modal__panel .chat-embed .glass > div:first-child { padding-right: 44px; }
}

/* Планшетный диапазон (1024–1179): полное меню в шапку не помещается —
   оставляем логотип и гамбургер, как на телефоне. Ширины проверены замером:
   при 1024–1100 правый блок уходил за экран на ~100px. */
@media (min-width: 1024px) and (max-width: 1179px) {
    .site-header [data-nav],
    .site-header .header-desktop { display: none !important; }
    .site-header .menu-btn { display: inline-flex !important; }
}

/* На iOS шапка не должна залезать под «чёлку» в standalone-режиме. */
.site-header { padding-top: env(safe-area-inset-top, 0px); }

@media (prefers-reduced-motion: reduce) {
    .mobile-menu__backdrop, .mobile-menu__panel { animation: none; }
}

/* -------------------------- Провайдеры и платформы ---------------------- */
.provider-card { display: flex; align-items: center; gap: .7rem; min-width: 0; padding: .55rem .6rem; border: 1px solid rgba(255,255,255,.08); border-radius: .75rem; background: rgba(255,255,255,.035); }
.provider-logo { position: relative; flex: none; width: 42px; height: 42px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, rgba(176,38,255,.28), rgba(0,224,255,.18)); border: 1px solid rgba(255,255,255,.12); }
.provider-mono { font-size: 12px; font-weight: 800; color: #C6FF3D; letter-spacing: .02em; }
.provider-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; background: rgba(11,15,25,.72); }

/* ----------------------------- Темы сайта ------------------------------- */
/* Карточки в админке: превью палитры, описание и кнопка включения. */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.theme-card {
    display: grid; grid-template-columns: 132px minmax(0, 1fr) auto;
    align-items: stretch; gap: .9rem; padding: .7rem;
    border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    transition: border-color .18s ease, background .18s ease;
}
.theme-card:hover { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .045); }
.theme-card.is-active { border-color: rgba(198, 255, 61, .5); box-shadow: inset 0 0 0 1px rgba(198, 255, 61, .18); }
.theme-card__preview {
    position: relative; min-height: 92px; border-radius: 10px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(140deg, var(--p1) 0 32%, var(--p2) 32% 56%, var(--p3) 56% 78%, var(--p4) 78% 100%);
}
.theme-card__preview-bar {
    position: absolute; inset: 8px 8px auto 8px; height: 9px; border-radius: 3px;
    background: rgba(255, 255, 255, .24); backdrop-filter: blur(2px);
}
.theme-card__preview-dot {
    position: absolute; left: 8px; top: 26px; width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0, 0, 0, .32); border: 1px solid rgba(255, 255, 255, .35);
}
.theme-card__preview-line {
    position: absolute; left: 34px; top: 30px; right: 18px; height: 10px; border-radius: 3px;
    background: rgba(255, 255, 255, .42);
}
.theme-card__body { min-width: 0; }
.theme-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: #fff; font-size: 13px; }
.theme-card__tagline { margin-top: 2px; color: #94a3b8; font-size: 11px; }
.theme-card__text { margin: .3rem 0 0; color: #cbd5e1; font-size: 12px; line-height: 1.45; }
.theme-card__meta { margin-top: .35rem; color: #64748b; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.theme-card__actions { display: flex; align-items: center; justify-content: flex-end; }
.theme-card__actions .btn-ghost { white-space: nowrap; }
.theme-card__actions .btn-ghost:disabled { opacity: .55; cursor: default; }
@media (max-width: 1100px) {
    .theme-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .theme-card { grid-template-columns: 92px minmax(0, 1fr); }
    .theme-card__actions { grid-column: 1 / -1; }
    .theme-card__actions .btn-ghost { width: 100%; justify-content: center; }
    .theme-card__preview { min-height: 78px; }
}

/* Модальное окно действий модератора (блокировка/удаление пользователя) */
.admin-modal {
    position: fixed; inset: 0; z-index: 90;
    display: grid; place-items: center; padding: 16px;
}
.admin-modal[hidden] { display: none; }
.admin-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(5, 8, 15, .74);
    backdrop-filter: blur(3px);
}
.admin-modal__card {
    position: relative; width: 100%; max-width: 540px;
    max-height: calc(100vh - 32px); overflow: auto;
    padding: 22px; border-radius: 18px;
    background: #121826; border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 30px 80px -40px #000;
}

/* Компактные кнопки-иконки в таблице (операции с пользователем) */
.admin-icon-btn {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px; border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: #cbd5e1; cursor: pointer; padding: 0;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.admin-icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-icon-btn:disabled { opacity: .45; cursor: default; }
.admin-icon-btn--danger { color: #fda4af; border-color: rgba(253, 164, 175, .35); }
.admin-icon-btn--danger:hover { background: rgba(253, 164, 175, .12); color: #fecdd3; }
.admin-icon-btn svg { width: 15px; height: 15px; display: block; }
.admin-user-ops { display: inline-flex; align-items: center; gap: 6px; }

/* Personality: строки клипов — перетаскивание мышью для смены порядка. */
.admin-pers-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    cursor: grab;
}
.admin-pers-row.is-dragging { opacity: .45; cursor: grabbing; }
.admin-pers-grip { color: #64748b; font-size: 14px; line-height: 1; user-select: none; }
