/* ==========================================================
   immortal — Страница подключения
   Midnight Wave background + стиль Ghosty
   ========================================================== */

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

:root {
    --bg: #0a0a0f;
    --card: #131020;
    --card-2: #1a1628;
    --card-hover: #1f1a33;
    --border: #1f1a2e;
    --border-2: #2a2440;
    --accent: #6d28d9;
    --accent-2: #6d28d9;
    --accent-3: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.25);
    --text: #ffffff;
    --text-dim: #8a8a9e;
    --text-dim2: #55556a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 14px;
    --radius-sm: 10px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Manrope", "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ==========================================================
   BACKGROUND — MIDNIGHT WAVE
   Три больших радиальных градиента с медленной анимацией
   ========================================================== */
   HEADER — шире контейнера на 60px
   ========================================================== */
.header {
    position: relative;
    z-index: 10;
    padding: 18px 0;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 19px;
    color: var(--text);
    flex-shrink: 0;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--card);
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.2);
}

.logo-text { letter-spacing: -0.4px; }

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--card);
    border-color: var(--accent);
    color: var(--accent-2);
}

.btn-pay {
    background: var(--accent);
    border: none;
    color: white;
    padding: 12px 22px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-pay:hover {
    background: var(--accent-2);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ==========================================================
   CONTAINER
   ========================================================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* ==========================================================
   INFO CARDS 2x2
   ========================================================== */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.15s;
    position: relative;
    min-height: 78px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.info-card:hover {
    border-color: var(--border-2);
    background: var(--card-2);
}

.info-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--card-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.info-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-small {
    background: transparent;
    border: none;
    color: var(--text-dim);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.btn-copy-small:hover {
    color: var(--accent-2);
    background: var(--card-2);
}

/* ==========================================================
   TRAFFIC BAR
   ========================================================== */
.traffic-bar {
    height: 3px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.traffic-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s;
}

/* ==========================================================
   DEVICES CARD
   ========================================================== */
.devices-card {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.devices-card:hover {
    border-color: var(--border-2);
    background: var(--card-2);
}

.devices-card svg { color: var(--text-dim); flex-shrink: 0; }

/* ==========================================================
   INSTALL CARD
   ========================================================== */
.install-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.install-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.install-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
}

/* ==========================================================
   OS SELECTOR
   ========================================================== */
.os-selector-wrap { position: relative; }

.os-selector {
    background: var(--card-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 130px;
}

.os-selector:hover,
.os-selector.open {
    border-color: var(--accent);
}

.os-selector-icon { font-size: 16px; }
.os-selector-text { flex: 1; text-align: left; }
.os-selector-arrow {
    color: var(--text-dim);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.os-selector.open .os-selector-arrow { transform: rotate(180deg); }

.os-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--card-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 6px;
    z-index: 50;
    display: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.os-dropdown.open { display: block; }

.os-option {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 9px 12px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
    transition: background 0.1s;
}

.os-option:hover { background: var(--card-hover); }
.os-option.active {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-2);
    font-weight: 600;
}

/* ==========================================================
   APP TABS — прозрачные, активный с фиолетовой подсветкой
   ========================================================== */
.app-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.app-tab {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.app-tab:hover {
    color: var(--text);
}

.app-tab.active {
    background: rgba(124, 58, 237, 0.12);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.3);
}

/* Фиолетовая полоса слева */
.app-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px var(--accent-glow);
}

.app-tab .app-icon { font-size: 14px; }

/* ==========================================================
   STEPS
   ========================================================== */
.steps-wrap {
    display: flex;
    flex-direction: column;
}

.step {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.step:first-child { padding-top: 0; }

.step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.step-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--card-2);
    color: var(--accent-2);
}

.step-body { flex: 1; min-width: 0; }

.step-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.step-text {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-2);
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s;
    background: transparent;
    color: var(--accent-2);
    white-space: nowrap;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-2);
    background: rgba(124, 58, 237, 0.08);
}

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

.btn-primary:hover {
    color: white;
    background: var(--accent-2);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-full { width: 100%; }

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-row .btn { flex: 1; min-width: 0; }

/* ==========================================================
   HELP SECTION — 2 квадратных столбца
   ========================================================== */
.help-section {
    margin-bottom: 20px;
}

.help-section-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 16px;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.help-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 20px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--text);
    text-decoration: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-height: 160px;
    justify-content: center;
}

.help-card:hover {
    border-color: var(--accent);
    background: var(--card-2);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.help-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-2);
    margin-bottom: 16px;
}

.help-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.help-text {
    font-size: 13px;
    color: var(--text-dim);
}

/* ==========================================================
   MODAL
   ========================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--card-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
}

.modal-content h3 {
    font-size: 19px;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-close:hover {
    color: var(--text);
    background: var(--card-hover);
}

.qr-image {
    background: white;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 16px auto;
    display: inline-block;
}

.qr-image img {
    display: block;
    width: 220px;
    height: 220px;
}

.modal-content p {
    font-size: 13px;
    color: var(--text-dim);
}

/* ==========================================================
   TOAST
   ========================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px var(--accent-glow);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================
   STATUS COLORS
   ========================================================== */
.status-green { color: var(--success); }
.status-red { color: var(--error); }
.status-yellow { color: var(--warning); }
.status-gray { color: var(--text-dim); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 640px) {
    .header { padding: 14px 0; }
    .header-inner { padding: 0 16px; }
    .container { padding: 16px 16px 60px; }
    .section-title, .install-title, .help-section-title { font-size: 20px; }
    .info-grid { gap: 10px; }
    .info-card { padding: 12px 14px; gap: 10px; min-height: 68px; }
    .info-icon { width: 38px; height: 38px; border-radius: 10px; }
    .info-value { font-size: 14px; }
    .install-card { padding: 18px; }
    .step { padding: 16px 0; gap: 12px; }
    .step-icon-wrap { width: 38px; height: 38px; }
    .step-icon-wrap svg { width: 18px; height: 18px; }
    .step-title { font-size: 15px; }
    .step-text { font-size: 13px; }
    .btn-pay { padding: 9px 14px; font-size: 13px; }
    .btn-icon { width: 38px; height: 38px; }
    .btn { font-size: 13px; padding: 10px 14px; }
    .logo-img { width: 34px; height: 34px; }
    .logo-text { font-size: 16px; }
    .install-header { gap: 8px; }
    .os-selector { padding: 8px 12px; font-size: 13px; min-width: 110px; }
    .app-tab { padding: 8px 12px; font-size: 13px; }
    .help-card { padding: 20px 14px; min-height: 140px; }
    .help-icon { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 12px; }
    .help-title { font-size: 15px; }
}

/* ==========================================================
   SCROLLBAR
   ========================================================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }


/* ==========================================================
   ФОНЫ — 3 ПРЕМИАЛЬНЫХ ВАРИАНТА
   Переключаются классом на <body>:
   - bg-nebula   (туманность — глубокий космос)
   - bg-halo     (нимб — фокусное свечение)
   - bg-prism    (призматический — диагональные лучи)
   ========================================================== */

/* ============ BACKGROUND ============ */
body {
    background: #0a0a0f;
}

/* Все фоновые слои — фиксированные на весь экран */
body > .bg-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

body > .bg-wrap > .bg-grid,
body > .bg-wrap > .bg-glow {
    position: absolute;
    inset: 0;
}

/* ==========================================================
   #5 NEBULA — туманность
   Глубокие фиолетово-синие слои, переплетаются как газ
   ========================================================== */

body.bg-nebula {
    background: #07050d;
}

body.bg-nebula > .bg-wrap {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 100%, rgba(99, 102, 241, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 70% 50% at 80% 80%, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
}

/* Слой 1 — фиолетовая "галактика" сверху */
body.bg-nebula .bg-glow::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 900px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.35) 0%, rgba(99, 102, 241, 0.12) 40%, transparent 75%);
    filter: blur(100px);
    animation: nebula-1 30s ease-in-out infinite;
}

/* Слой 2 — синяя "туманность" снизу-слева */
body.bg-nebula .bg-glow::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 900px;
    height: 900px;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.30) 0%, rgba(59, 130, 246, 0.10) 40%, transparent 75%);
    filter: blur(120px);
    animation: nebula-2 35s ease-in-out infinite;
}

/* Слой 3 — магента снизу-справа — через доп. псевдо-элемент на bg-grid */
body.bg-nebula .bg-grid::before {
    content: '';
    position: absolute;
    bottom: -25%;
    right: -15%;
    width: 800px;
    height: 800px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.28) 0%, transparent 70%);
    filter: blur(110px);
    animation: nebula-3 40s ease-in-out infinite;
}

/* Тонкая сетка поверх — как звёздная пыль */
body.bg-nebula .bg-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at top center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at top center, black 0%, transparent 70%);
}

@keyframes nebula-1 {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.9; }
    50% { transform: translateX(-50%) translateY(40px) scale(1.08); opacity: 1; }
}

@keyframes nebula-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
    50% { transform: translate(60px, -40px) scale(1.1); opacity: 1; }
}

@keyframes nebula-3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    50% { transform: translate(-50px, -30px) scale(1.15); opacity: 0.95; }
}

/* ==========================================================
   #11 HALO — нимб
   Один большой светящийся круг за контентом, пульсирует
   ========================================================== */

body.bg-halo {
    background: #050308;
}

body.bg-halo > .bg-wrap {
    background: #050308;
}

/* Никакой сетки */
body.bg-halo .bg-grid {
    display: none;
}

/* Главный нимб */
body.bg-halo .bg-glow::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle at center,
        rgba(124, 58, 237, 0.35) 0%,
        rgba(124, 58, 237, 0.15) 25%,
        rgba(124, 58, 237, 0.06) 45%,
        transparent 70%);
    filter: blur(80px);
    animation: halo-pulse 8s ease-in-out infinite;
}

/* Второй, поменьше — снизу для баланса */
body.bg-halo .bg-glow::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    filter: blur(100px);
    animation: halo-pulse-2 10s ease-in-out infinite;
}

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

@keyframes halo-pulse-2 {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ==========================================================
   #6 PRISM — призматический
   Тонкие диагональные светящиеся лучи
   ========================================================== */

body.bg-prism {
    background: #08060f;
}

body.bg-prism > .bg-wrap {
    background:
        radial-gradient(ellipse 90% 70% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
}

/* Сетка — плотная, тонкая */
body.bg-prism .bg-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

/* Лучи — диагональные тонкие полосы */
body.bg-prism .bg-glow::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        linear-gradient(115deg,
            transparent 0%,
            transparent 20%,
            rgba(124, 58, 237, 0.15) 25%,
            rgba(124, 58, 237, 0.25) 26%,
            rgba(124, 58, 237, 0.15) 27%,
            transparent 32%),
        linear-gradient(115deg,
            transparent 0%,
            transparent 45%,
            rgba(99, 102, 241, 0.15) 50%,
            rgba(99, 102, 241, 0.22) 51%,
            rgba(99, 102, 241, 0.15) 52%,
            transparent 57%),
        linear-gradient(115deg,
            transparent 0%,
            transparent 68%,
            rgba(124, 58, 237, 0.15) 73%,
            rgba(124, 58, 237, 0.22) 74%,
            rgba(124, 58, 237, 0.15) 75%,
            transparent 80%);
    animation: prism-shift 20s ease-in-out infinite;
}

body.bg-prism .bg-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(124, 58, 237, 0.08) 0%, transparent 50%);
}

@keyframes prism-shift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}


/* ==========================================================
   #1 AURORA — северное сияние
   Горизонтальные волны, плавно двигаются
   ========================================================== */

body.bg-aurora {
    background: #050310;
}

body.bg-aurora > .bg-wrap {
    background: #050310;
}

body.bg-aurora .bg-grid {
    display: none;
}

/* Волна 1 — фиолетовая сверху */
body.bg-aurora .bg-glow::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -30%;
    width: 160%;
    height: 60%;
    background:
        radial-gradient(ellipse 50% 30% at 30% 50%, rgba(124, 58, 237, 0.35) 0%, transparent 70%),
        radial-gradient(ellipse 40% 25% at 70% 50%, rgba(124, 58, 237, 0.25) 0%, transparent 70%);
    filter: blur(80px);
    animation: aurora-wave-1 20s ease-in-out infinite;
}

/* Волна 2 — индиго снизу */
body.bg-aurora .bg-glow::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -30%;
    width: 160%;
    height: 50%;
    background:
        radial-gradient(ellipse 60% 30% at 50% 50%, rgba(99, 102, 241, 0.30) 0%, transparent 70%),
        radial-gradient(ellipse 40% 25% at 30% 50%, rgba(59, 130, 246, 0.20) 0%, transparent 70%);
    filter: blur(100px);
    animation: aurora-wave-2 25s ease-in-out infinite;
}

@keyframes aurora-wave-1 {
    0%, 100% { transform: translateX(-5%) scaleY(1); opacity: 0.85; }
    50% { transform: translateX(5%) scaleY(1.15); opacity: 1; }
}

@keyframes aurora-wave-2 {
    0%, 100% { transform: translateX(5%) scaleY(1); opacity: 0.75; }
    50% { transform: translateX(-5%) scaleY(1.2); opacity: 0.95; }
}


/* ==========================================================
   #8 CONSTELLATION — созвездие
   Точки-звёзды + тонкие линии-связки
   ========================================================== */

body.bg-constellation {
    background: #030014;
}

body.bg-constellation > .bg-wrap {
    background:
        radial-gradient(ellipse at center, #0a0520 0%, #030014 70%);
}

body.bg-constellation .bg-grid {
    display: none;
}

/* Точки-звёзды */
body.bg-constellation .bg-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 80% 20%, rgba(124, 58, 237, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 85%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 60%, rgba(124, 58, 237, 0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 90% 50%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 15%, rgba(124, 58, 237, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 90%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 10% 40%, rgba(99, 102, 241, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 45%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 30% 55%, rgba(124, 58, 237, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 75%, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
    animation: constellation-twinkle 6s ease-in-out infinite;
}

/* Свечение в центре */
body.bg-constellation .bg-glow::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    filter: blur(80px);
}

@keyframes constellation-twinkle {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}


/* ==========================================================
   #9 LIQUID GLASS — жидкое стекло
   Размытое пятно снизу + тонкие highlights сверху
   ========================================================== */

body.bg-liquid {
    background: #0a0812;
}

body.bg-liquid > .bg-wrap {
    background:
        radial-gradient(ellipse 100% 60% at 50% 100%, rgba(124, 58, 237, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(99, 102, 241, 0.10) 0%, transparent 70%);
}

body.bg-liquid .bg-grid {
    display: none;
}

/* Большое жидкое пятно снизу */
body.bg-liquid .bg-glow::before {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 70%;
    background:
        radial-gradient(ellipse at 40% 50%, rgba(124, 58, 237, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 60% 50%, rgba(124, 58, 237, 0.30) 0%, transparent 60%);
    filter: blur(90px);
    animation: liquid-flow 25s ease-in-out infinite;
}

/* Тонкий highlight сверху */
body.bg-liquid .bg-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(124, 58, 237, 0.6) 30%,
        rgba(124, 58, 237, 0.8) 50%,
        rgba(124, 58, 237, 0.6) 70%,
        transparent 100%);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
}

@keyframes liquid-flow {
    0%, 100% { transform: translateX(-50%) scale(1) translateY(0); opacity: 0.9; }
    50% { transform: translateX(-50%) scale(1.08) translateY(-20px); opacity: 1; }
}


/* ==========================================================
   #10 CIRCUIT — микросхема
   Сетка + светящиеся дорожки
   ========================================================== */

body.bg-circuit {
    background: #06080f;
}

body.bg-circuit > .bg-wrap {
    background:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
}

/* Плотная сетка */
body.bg-circuit .bg-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* Светящиеся дорожки */
body.bg-circuit .bg-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, transparent 0%, transparent 12%, rgba(124, 58, 237, 0.5) 12%, rgba(124, 58, 237, 0.5) 14%, transparent 14%, transparent 100%),
        linear-gradient(90deg, transparent 0%, transparent 45%, rgba(124, 58, 237, 0.4) 45%, rgba(124, 58, 237, 0.4) 47%, transparent 47%, transparent 100%),
        linear-gradient(0deg, transparent 0%, transparent 25%, rgba(99, 102, 241, 0.5) 25%, rgba(99, 102, 241, 0.5) 27%, transparent 27%, transparent 100%),
        linear-gradient(0deg, transparent 0%, transparent 70%, rgba(124, 58, 237, 0.4) 70%, rgba(124, 58, 237, 0.4) 72%, transparent 72%, transparent 100%);
    animation: circuit-pulse 5s ease-in-out infinite;
}

@keyframes circuit-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}


/* ==========================================================
   #12 HOLOGRAPHIC — голографический
   Многослойный радужный градиент
   ========================================================== */

body.bg-holo {
    background: #08040f;
}

body.bg-holo > .bg-wrap {
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 80% 30%, rgba(59, 130, 246, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 90% 70% at 50% 100%, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
}

body.bg-holo .bg-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* Радужный слой */
body.bg-holo .bg-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        conic-gradient(
            from 45deg at 30% 30%,
            rgba(124, 58, 237, 0.15),
            rgba(59, 130, 246, 0.10),
            rgba(236, 72, 153, 0.10),
            rgba(124, 58, 237, 0.15),
            rgba(124, 58, 237, 0.15)
        ),
        radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(8, 4, 15, 0.6) 100%);
    animation: holo-rotate 60s linear infinite;
}

body.bg-holo .bg-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 40% at 70% 60%, rgba(236, 72, 153, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 30% 70%, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    filter: blur(60px);
}

@keyframes holo-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ==========================================================
   #13 QUANTUM — живая сетка с частицами
   ========================================================== */

body.bg-quantum {
    background: #050510;
}

body.bg-quantum > .bg-wrap {
    background: radial-gradient(ellipse at center, #0a0525 0%, #050510 70%);
}

body.bg-quantum .bg-grid {
    background-image:
        radial-gradient(circle at 25% 30%, rgba(124, 58, 237, 0.6) 1.5px, transparent 2px),
        radial-gradient(circle at 75% 25%, rgba(124, 58, 237, 0.5) 1.5px, transparent 2px),
        radial-gradient(circle at 15% 70%, rgba(99, 102, 241, 0.5) 1.5px, transparent 2px),
        radial-gradient(circle at 85% 65%, rgba(124, 58, 237, 0.5) 1.5px, transparent 2px),
        radial-gradient(circle at 50% 85%, rgba(124, 58, 237, 0.5) 1.5px, transparent 2px),
        radial-gradient(circle at 35% 50%, rgba(59, 130, 246, 0.5) 1.5px, transparent 2px),
        radial-gradient(circle at 65% 40%, rgba(124, 58, 237, 0.4) 1.5px, transparent 2px);
    background-size: 100% 100%;
    animation: quantum-pulse 4s ease-in-out infinite;
}

body.bg-quantum .bg-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(45deg, transparent 45%, rgba(124, 58, 237, 0.06) 49%, rgba(124, 58, 237, 0.06) 51%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, rgba(124, 58, 237, 0.05) 49%, rgba(124, 58, 237, 0.05) 51%, transparent 55%),
        linear-gradient(135deg, transparent 45%, rgba(99, 102, 241, 0.05) 49%, rgba(99, 102, 241, 0.05) 51%, transparent 55%);
    background-size: 200px 200px, 250px 250px, 300px 300px;
    animation: quantum-lines 20s linear infinite;
}

body.bg-quantum .bg-glow::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    filter: blur(60px);
}

@keyframes quantum-pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes quantum-lines {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 200px 200px, -250px 250px, 300px -300px; }
}


/* ==========================================================
   #14 SUNSET — тёплый градиент снизу
   ========================================================== */

body.bg-sunset {
    background: #08040f;
}

body.bg-sunset > .bg-wrap {
    background:
        radial-gradient(ellipse 120% 70% at 50% 110%, rgba(236, 72, 153, 0.30) 0%, rgba(124, 58, 237, 0.20) 30%, transparent 65%),
        radial-gradient(ellipse 80% 40% at 20% 0%, rgba(99, 102, 241, 0.10) 0%, transparent 60%),
        #08040f;
}

body.bg-sunset .bg-grid {
    display: none;
}

body.bg-sunset .bg-glow::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background:
        radial-gradient(ellipse 100% 100% at 50% 100%, rgba(236, 72, 153, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 80% 80% at 30% 100%, rgba(124, 58, 237, 0.30) 0%, transparent 60%);
    filter: blur(80px);
    animation: sunset-glow 15s ease-in-out infinite;
}

body.bg-sunset .bg-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.4);
}

@keyframes sunset-glow {
    0%, 100% { opacity: 0.85; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.1); }
}


/* ==========================================================
   #15 DEEP SPACE — многослойный космос (усиленный)
   ========================================================== */

body.bg-deepspace {
    background: #02000a;
}

body.bg-deepspace > .bg-wrap {
    background:
        radial-gradient(ellipse 80% 60% at 15% 15%, rgba(99, 102, 241, 0.20) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 85% 55%, rgba(124, 58, 237, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 90% 70% at 50% 100%, rgba(124, 58, 237, 0.15) 0%, transparent 70%),
        #02000a;
}

/* Много звёзд разных размеров — 3 слоя через box-shadow */
body.bg-deepspace .bg-grid {
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, #ffffff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 34% 42%, #ffffff 0%, transparent 100%),
        radial-gradient(2px 2px at 58% 15%, #a855f7 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 82% 32%, #ffffff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 22% 68%, #a855f7 0%, transparent 100%),
        radial-gradient(2px 2px at 68% 78%, #ffffff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 45% 88%, #9333ea 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 92% 52%, #ffffff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 5% 52%, #a855f7 0%, transparent 100%),
        radial-gradient(2px 2px at 52% 58%, #ffffff 0%, transparent 100%),
        radial-gradient(1px 1px at 28% 25%, #ffffff 0%, transparent 100%),
        radial-gradient(1px 1px at 72% 22%, #ffffff 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 48%, #9333ea 0%, transparent 100%),
        radial-gradient(1px 1px at 88% 82%, #ffffff 0%, transparent 100%),
        radial-gradient(1px 1px at 42% 5%, #a855f7 0%, transparent 100%),
        radial-gradient(1px 1px at 95% 8%, #ffffff 0%, transparent 100%),
        radial-gradient(1px 1px at 8% 85%, #ffffff 0%, transparent 100%),
        radial-gradient(1px 1px at 62% 92%, #9333ea 0%, transparent 100%);
    animation: deepspace-twinkle 6s ease-in-out infinite;
    mask-image: none;
    -webkit-mask-image: none;
}

/* Большая фиолетовая туманность сверху */
body.bg-deepspace .bg-glow::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 800px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.35) 0%, rgba(99, 102, 241, 0.15) 40%, transparent 70%);
    filter: blur(90px);
    animation: deepspace-drift-1 40s ease-in-out infinite;
}

/* Индиго-туманность снизу слева */
body.bg-deepspace .bg-glow::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -10%;
    width: 900px;
    height: 700px;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.30) 0%, rgba(124, 58, 237, 0.12) 40%, transparent 70%);
    filter: blur(100px);
    animation: deepspace-drift-2 45s ease-in-out infinite;
}

/* Третья туманность — снизу справа (через ::before на grid) */
body.bg-deepspace .bg-grid::before {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.25) 0%, transparent 70%);
    filter: blur(110px);
    animation: deepspace-drift-3 50s ease-in-out infinite;
    pointer-events: none;
}

@keyframes deepspace-twinkle {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

@keyframes deepspace-drift-1 {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.85; }
    50% { transform: translateX(-50%) translateY(50px); opacity: 1; }
}

@keyframes deepspace-drift-2 {
    0%, 100% { transform: translate(0, 0); opacity: 0.75; }
    50% { transform: translate(80px, -50px); opacity: 1; }
}

@keyframes deepspace-drift-3 {
    0%, 100% { transform: translate(0, 0); opacity: 0.7; }
    50% { transform: translate(-70px, -40px); opacity: 0.95; }
}


/* ==========================================================
   #16 CYBER — неоновая сетка с узлами
   ========================================================== */

body.bg-cyber {
    background: #050510;
}

body.bg-cyber > .bg-wrap {
    background:
        linear-gradient(180deg, rgba(124, 58, 237, 0.05) 0%, transparent 40%),
        #050510;
}

body.bg-cyber .bg-grid {
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.12) 1px, transparent 1px),
        radial-gradient(circle at 33% 33%, rgba(124, 58, 237, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 66% 66%, rgba(124, 58, 237, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.8) 2px, transparent 3px);
    background-size: 60px 60px, 60px 60px, 180px 180px, 180px 180px, 240px 240px, 240px 240px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

body.bg-cyber .bg-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(124, 58, 237, 0.4) 50%, transparent 100%);
    height: 1px;
    top: 33%;
    box-shadow:
        0 0 20px rgba(124, 58, 237, 0.8),
        0 0 40px rgba(124, 58, 237, 0.4);
    animation: cyber-scan 8s ease-in-out infinite;
}

body.bg-cyber .bg-glow::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
    filter: blur(60px);
}

@keyframes cyber-scan {
    0%, 100% { top: 30%; opacity: 0.6; }
    50% { top: 70%; opacity: 1; }
}


/* ==========================================================
   #17 LIQUID AURORA — жидкие переплетающиеся слои
   ========================================================== */

body.bg-liquid-aurora {
    background: #060314;
}

body.bg-liquid-aurora > .bg-wrap {
    background: #060314;
}

body.bg-liquid-aurora .bg-grid {
    display: none;
}

body.bg-liquid-aurora .bg-glow::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.4) 0%, transparent 60%);
    filter: blur(100px);
    animation: liquid-aurora-1 18s ease-in-out infinite;
}

body.bg-liquid-aurora .bg-glow::after {
    content: '';
    position: absolute;
    bottom: 5%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.35) 0%, transparent 60%);
    filter: blur(120px);
    animation: liquid-aurora-2 22s ease-in-out infinite;
}

body.bg-liquid-aurora .bg-grid::before {
    content: '';
    position: absolute;
    top: 40%;
    right: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.3) 0%, transparent 60%);
    filter: blur(90px);
    animation: liquid-aurora-3 26s ease-in-out infinite;
}

@keyframes liquid-aurora-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(200px, 150px) scale(1.3); }
}

@keyframes liquid-aurora-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-250px, -200px) scale(1.4); }
}

@keyframes liquid-aurora-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, 200px) scale(0.9); }
}


/* ==========================================================
   #18 PRISM PRISM — много лучей
   ========================================================== */

body.bg-prism-prism {
    background: #0a0518;
}

body.bg-prism-prism > .bg-wrap {
    background: radial-gradient(ellipse at center, #0f0825 0%, #0a0518 70%);
}

body.bg-prism-prism .bg-grid {
    display: none;
}

body.bg-prism-prism .bg-glow::before {
    content: '';
    position: absolute;
    inset: -30%;
    background:
        linear-gradient(35deg, transparent 0%, transparent 40%, rgba(124, 58, 237, 0.20) 44%, rgba(124, 58, 237, 0.30) 45%, rgba(124, 58, 237, 0.20) 46%, transparent 50%),
        linear-gradient(70deg, transparent 0%, transparent 40%, rgba(124, 58, 237, 0.20) 44%, rgba(124, 58, 237, 0.30) 45%, rgba(124, 58, 237, 0.20) 46%, transparent 50%),
        linear-gradient(115deg, transparent 0%, transparent 40%, rgba(99, 102, 241, 0.20) 44%, rgba(99, 102, 241, 0.30) 45%, rgba(99, 102, 241, 0.20) 46%, transparent 50%),
        linear-gradient(155deg, transparent 0%, transparent 40%, rgba(236, 72, 153, 0.15) 44%, rgba(236, 72, 153, 0.25) 45%, rgba(236, 72, 153, 0.15) 46%, transparent 50%);
    animation: prism-prism-shift 25s ease-in-out infinite;
}

body.bg-prism-prism .bg-glow::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    filter: blur(80px);
}

@keyframes prism-prism-shift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-60px, 60px); }
}


/* ==========================================================
   #19 FROST — ледяные трещины
   ========================================================== */

body.bg-frost {
    background: #050810;
}

body.bg-frost > .bg-wrap {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(124, 58, 237, 0.10) 0%, transparent 70%),
        #050810;
}

body.bg-frost .bg-grid {
    background-image:
        linear-gradient(15deg, transparent 45%, rgba(124, 58, 237, 0.06) 49.5%, rgba(124, 58, 237, 0.06) 50.5%, transparent 55%),
        linear-gradient(-15deg, transparent 45%, rgba(124, 58, 237, 0.05) 49.5%, rgba(124, 58, 237, 0.05) 50.5%, transparent 55%),
        linear-gradient(75deg, transparent 45%, rgba(99, 102, 241, 0.05) 49.5%, rgba(99, 102, 241, 0.05) 50.5%, transparent 55%),
        linear-gradient(-75deg, transparent 45%, rgba(124, 58, 237, 0.04) 49.5%, rgba(124, 58, 237, 0.04) 50.5%, transparent 55%);
    background-size: 300px 300px, 250px 250px, 350px 350px, 400px 400px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

body.bg-frost .bg-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(124, 58, 237, 0.6) 20%,
        rgba(124, 58, 237, 0.9) 50%,
        rgba(124, 58, 237, 0.6) 80%,
        transparent 100%);
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.6);
}

body.bg-frost .bg-glow::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
    filter: blur(80px);
}


/* ==========================================================
   HERO BLOCK — логотип + название + приветствие
   ========================================================== */

.hero {
    text-align: center;
    margin-bottom: 24px;
    padding: 8px 0 4px;
}

.hero-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.hero-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px rgba(124, 58, 237, 0.35),
        0 0 60px rgba(124, 58, 237, 0.15);
    position: relative;
    overflow: hidden;
    animation: heroPulse 4s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(124, 58, 237, 0.35),
            0 0 60px rgba(124, 58, 237, 0.15);
    }
    50% {
        box-shadow:
            0 0 40px rgba(124, 58, 237, 0.5),
            0 0 80px rgba(124, 58, 237, 0.25);
    }
}

.hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-logo-fallback {
    font-size: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.hero-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, #a0a0c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-greeting {
    font-size: 15px;
    color: var(--text-dim);
    font-weight: 500;
}

@media (max-width: 640px) {
    .hero { margin-bottom: 20px; padding: 4px 0; }
    .hero-logo { width: 64px; height: 64px; border-radius: 18px; }
    .hero-logo-fallback { font-size: 32px; }
    .hero-title { font-size: 20px; }
    .hero-greeting { font-size: 14px; }
}


/* ==========================================================
   APP TABS — сетка 3 колонки (перебиваем flex)
   ========================================================== */

.app-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    padding: 6px !important;
    margin-bottom: 20px !important;
}

.app-tab {
    justify-content: center !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
}

@media (max-width: 640px) {
    .app-tabs {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .app-tab {
        padding: 9px 10px !important;
        font-size: 12px !important;
    }
}


/* ==========================================================
   FIX: белая полоса сверху на iPhone (Safari chrome)
   Фон должен быть на html, не только на body
   ========================================================== */

html {
    background: #02000a;
    min-height: 100vh;
    min-height: 100dvh;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: #02000a;
}

/* Для конкретного фона Deep Space */
html:has(body.bg-deepspace) {
    background: #02000a;
}

/* Safe area сверху (для iPhone с вырезом) */
body {
    padding-top: env(safe-area-inset-top);
}

/* Тонкая полоска сверху — убираем */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #02000a;
    z-index: 9999;
    pointer-events: none;
}


/* ==========================================================
   FIX: поднимаем hero-блок — больше воздуха сверху
   ========================================================== */

.container {
    padding-top: 32px !important;
}

.hero {
    padding-top: 12px !important;
    padding-bottom: 16px !important;
}

@media (max-width: 640px) {
    .container {
        padding-top: 24px !important;
    }
    .hero {
        padding-top: 8px !important;
        padding-bottom: 14px !important;
    }
}


/* ==========================================================
   TARIFFS MODAL — модалка с тарифами (как у Ghosty)
   ========================================================== */

.modal-tariffs .modal-content-tariffs {
    max-width: 440px;
    padding: 0;
    text-align: left;
    border-radius: 20px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-tariffs .modal-close {
    position: static;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
}

.modal-tariffs .modal-close:hover {
    color: var(--text);
    background: var(--card-2);
}

.tariffs-list {
    padding: 12px 16px 4px;
    max-height: 55vh;
    overflow-y: auto;
}

.tariff-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.tariff-item:hover {
    border-color: var(--border-2);
}

.tariff-item.open {
    border-color: var(--accent);
}

.tariff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}

.tariff-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tariff-icon {
    font-size: 18px;
    opacity: 0.7;
}

.tariff-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.tariff-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tariff-price-from {
    font-size: 13px;
    color: var(--text-dim);
    background: var(--card-2);
    padding: 4px 10px;
    border-radius: 100px;
}

.tariff-arrow {
    color: var(--text-dim);
    font-size: 16px;
    transition: transform 0.2s;
}

.tariff-item.open .tariff-arrow {
    transform: rotate(180deg);
    color: var(--accent);
}

.tariff-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tariff-item.open .tariff-body {
    max-height: 200px;
}

.tariff-radio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    cursor: pointer;
}

.tariff-radio-info {
    flex: 1;
}

.tariff-radio-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.tariff-radio-sub {
    font-size: 12px;
    color: var(--text-dim);
}

.tariff-radio-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tariff-radio-price-num {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.tariff-radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-2);
    display: inline-block;
    position: relative;
    transition: all 0.15s;
}

.tariff-item.selected .tariff-radio-circle {
    border-color: var(--accent);
}

.tariff-item.selected .tariff-radio-circle::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--accent);
}

.modal-continue {
    margin: 12px 24px 20px;
    width: calc(100% - 48px);
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .modal-tariffs .modal-content-tariffs {
        max-width: 100%;
        width: 100%;
    }
}


/* ==========================================================
   BTN-PAY-HERO — кнопка оплаты под приветствием
   ========================================================== */

.btn-pay-hero {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: white;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-pay-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.5);
}

.btn-pay-hero:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .btn-pay-hero {
        padding: 14px 20px;
        font-size: 15px;
        margin-top: 14px;
    }
}


/* ==========================================================
   INSTALL BUTTONS — кнопки скачивания под ОС
   ========================================================== */

#btn-install,
#btn-install-apk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Если кнопка APK показана — обе кнопки в ряд */
.btn-row:has(#btn-install-apk[style*="inline-flex"]) {
    flex-wrap: nowrap;
}

@media (max-width: 480px) {
    .btn-row:has(#btn-install-apk[style*="inline-flex"]) {
        flex-wrap: wrap;
    }
    #btn-install,
    #btn-install-apk {
        flex-basis: 100%;
    }
}


/* ==========================================================
   ПЛАВНАЯ ПРОКРУТКА + GPU-ОПТИМИЗАЦИЯ
   Фон остаётся красивым, скролл — плавным
   ========================================================== */

/* Плавная прокрутка при якорных ссылках */
html {
    scroll-behavior: smooth;
}

/* Убираем «отскоки» страницы на iOS */
body {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================
   GPU-ОПТИМИЗАЦИЯ ФОНА
   Фон рендерится на отдельном слое → скролл не тормозит
   ========================================================== */

/* Все фоновые слои — на своих GPU-слоях */
.bg-wrap,
.bg-grid,
.bg-glow,
.bg-glow::before,
.bg-glow::after,
.bg-grid::before {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Звёзды и сетка — без лишних перерисовок */
.bg-grid {
    contain: strict;
}

/* Контейнер — на своём слое, отдельно от фона */
.container {
    position: relative;
    z-index: 1;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ==========================================================
   ПАССИВНАЯ ПРОКРУТКА (клики не блокируют)
   ========================================================== */

button,
a,
.devices-card,
.app-tab,
.os-option,
.tariff-header,
.tariff-radio-row,
.btn {
    touch-action: manipulation;
}

/* ==========================================================
   ДОПОЛНИТЕЛЬНАЯ ОПТИМИЗАЦИЯ ДЛЯ СЛАБЫХ УСТРОЙСТВ
   (срабатывает ТОЛЬКО если CPU очень слабый)
   ========================================================== */

/* Если пользователь предпочитает минимум анимаций (iOS "Reduce Motion") */
@media (prefers-reduced-motion: reduce) {
    .bg-glow::before,
    .bg-glow::after,
    .bg-grid,
    .bg-grid::before {
        animation: none !important;
    }
    .hero-logo {
        animation: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================
   CTA для неактивной подписки
   ========================================================== */
.cta-inactive {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius);
    padding: 28px 20px;
    margin: 20px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-inactive::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    animation: ctaGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ctaGlow {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

.cta-inactive-icon {
    font-size: 56px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.cta-inactive-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.cta-inactive-text {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.cta-inactive-buttons {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.5);
}


/* ==========================================================
   МОДАЛКА УСТРОЙСТВ
   ========================================================== */

.modal-devices .modal-content-devices {
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.devices-info {
    padding: 0 22px 12px;
    text-align: center;
}

.devices-counter {
    font-size: 15px;
    font-weight: 600;
    color: #9333ea;
    margin-bottom: 4px;
}

.devices-hint {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.devices-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.15s;
}

.device-item:hover {
    border-color: var(--border-2);
}

.device-item.device-inactive {
    opacity: 0.5;
}

.device-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

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

.device-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-meta code {
    font-family: ui-monospace, monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

.device-time {
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.7;
}

.device-delete {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #ef4444;
    transition: all 0.15s;
    padding: 0;
}

.device-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.devices-loading,
.devices-error {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-dim);
    font-size: 13px;
}

.devices-error {
    color: #ef4444;
}

.devices-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.devices-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.devices-empty-text {
    font-size: 14px;
    color: var(--text-dim);
}

/* ============================================================
   v3: Кнопка «Открыть сайт» в header
   ============================================================ */
.btn-open-site-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #6d28d9 0%, #6d28d9 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-open-site-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.55);
}
@media (max-width: 480px) {
    .btn-open-site-text {
        display: none;
    }
}

/* ============================================================
   v3: Улучшение видимости кнопок в header (копировать, поддержка)
   ============================================================ */
.btn-icon {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(124, 58, 237, 0.4) !important;
    color: #fff !important;
}

.btn-icon:hover {
    background: rgba(124, 58, 237, 0.15) !important;
    border-color: #6d28d9 !important;
}

/* v3: ФИКС Safari — форсируем GPU-слой для кнопок с SVG */
.btn-icon,
.btn-open-site-header {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.btn-icon svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    fill: none;
    stroke: #fff;
}


/* ============================================================
   v3: Группы приложений (Рекомендуем / Другие)
   ============================================================ */

#app-tabs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-group-label {
    color: var(--accent-3);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-left: 4px;
}

.app-tabs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.app-tabs-collapsible {
    display: none;
}

.app-group.open .app-tabs-collapsible {
    display: flex;
}

.app-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 4px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: color 0.15s;
}

.app-group-toggle:hover {
    color: var(--text);
}

.app-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-3);
    font-size: 11px;
    font-weight: 700;
}

/* Рекомендуемый таб — выделяется */
.app-tab-recommended {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--text);
    font-weight: 600;
}

.app-tab-recommended:hover {
    background: rgba(124, 58, 237, 0.18);
    border-color: rgba(124, 58, 237, 0.5);
}

.app-tab-recommended.active {
    background: linear-gradient(135deg, #6d28d9 0%, #6d28d9 100%);
    border-color: #6d28d9;
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}
