/* ARK entrance — extracted stylesheet (polished build) */
        body {
            font-family: 'Inter', sans-serif;
            background-color: #000000;
        }
        #starry-sky-bg {
            position: fixed; top: 0; left: 0;
            width: 100%; height: 100%;
            z-index: 0;
            pointer-events: none;
        }

        /* ── Анимации ────────────────────────────────────────────── */
        @keyframes custom-pulse {
            0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(59,130,246,0.7)); }
            50%       { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(59,130,246,0.4)); }
        }
        @keyframes flicker {
            0%, 100% { opacity: 1; text-shadow: 0 0 10px #fcd34d, 0 0 20px #fcd34d; }
            50%       { opacity: 0.6; text-shadow: 0 0 8px #fcd34d; }
        }
        @keyframes spin {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }
        @keyframes aurora-line {
            0%   { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        @keyframes star-shimmer {
            0%   { --sc:#f8fafc;  --sg:rgba(248,250,252,0.7); }
            16%  { --sc:#c4b5fd;  --sg:rgba(167,139,250,0.7); }
            33%  { --sc:#bae6fd;  --sg:rgba(125,211,252,0.7); }
            50%  { --sc:#fca5a5;  --sg:rgba(248,113,113,0.7); }
            66%  { --sc:#c4b5fd;  --sg:rgba(167,139,250,0.6); }
            83%  { --sc:#a5f3fc;  --sg:rgba(34,211,238,0.6);  }
            100% { --sc:#f8fafc;  --sg:rgba(248,250,252,0.7); }
        }
        @keyframes star-outline-spin {
            0%   { stroke-dashoffset: 200; opacity: 0.3; }
            50%  { stroke-dashoffset: 0;   opacity: 0.9; }
            100% { stroke-dashoffset: -200; opacity: 0.3; }
        }
        @keyframes ark-btn-glow {
            0%, 100% { box-shadow: 0 0 12px rgba(59,130,246,0.3), 0 4px 24px rgba(0,0,0,0.5); }
            50%       { box-shadow: 0 0 28px rgba(99,102,241,0.6), 0 0 50px rgba(59,130,246,0.2), 0 4px 24px rgba(0,0,0,0.5); }
        }
        @keyframes star-birth {
            0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
            60%  { transform: scale(1.4) rotate(10deg); opacity: 1; }
            80%  { transform: scale(0.9) rotate(-5deg); }
            100% { transform: scale(1) rotate(0deg); opacity: 1; }
        }
        /* ── Шапка ───────────────────────────────────────────────── */
        header { position: relative; }

        /* ── Модалки ─────────────────────────────────────────────── */
        #add-post-modal, #view-post-modal, #admin-login-modal,
        #ark-enter-modal { transition: none; }
        #add-post-modal > div, #view-post-modal > div,
        #admin-login-modal > div {
            transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
        }
        #ark-enter-modal > div {
            transition: none;
        }
        #add-post-modal.flex, #view-post-modal.flex,
        #admin-login-modal.flex { opacity: 1; }
        #add-post-modal.flex > div, #view-post-modal.flex > div,
        #admin-login-modal.flex > div {
            opacity: 1; transform: translateY(0);
        }

        /* ── Звёзды-профили ──────────────────────────────────────── */
        .post-star-wrapper {
            position: relative; display: flex;
            align-items: center; justify-content: center;
            cursor: pointer; transition: transform 0.2s ease-in-out;
            margin: 0.5rem;
        }
        .post-star-wrapper:hover { transform: scale(1.3); }
        .post-star-wrapper.new-star {
            animation: star-birth 0.7s cubic-bezier(0.34,1.56,0.64,1) forwards;
        }
        .post-star, .vip-star {
            opacity: 0.92;
        }
        /* SVG-звезда — без обводки, только пульсация */
        .star-svg {
            overflow: visible;
            animation: custom-pulse 2s ease-in-out infinite var(--pulse-delay);
        }
        .star-svg .star-fill {
            animation: star-color var(--shimmer-dur, 4s) ease-in-out infinite var(--pulse-delay);
        }
        .star-svg .star-outline {
            display: none;
        }
        @keyframes star-color {
            0%   { fill: #f8fafc;  filter: drop-shadow(0 0 2px rgba(248,250,252,0.6)); }
            16%  { fill: #c4b5fd;  filter: drop-shadow(0 0 3px rgba(167,139,250,0.7)); }
            33%  { fill: #bae6fd;  filter: drop-shadow(0 0 3px rgba(125,211,252,0.7)); }
            50%  { fill: #fca5a5;  filter: drop-shadow(0 0 3px rgba(248,113,113,0.7)); }
            66%  { fill: #c4b5fd;  filter: drop-shadow(0 0 3px rgba(167,139,250,0.6)); }
            83%  { fill: #a5f3fc;  filter: drop-shadow(0 0 3px rgba(34,211,238,0.6));  }
            100% { fill: #f8fafc;  filter: drop-shadow(0 0 2px rgba(248,250,252,0.6)); }
        }
        .post-star {
            color: #e2e8f0;
            animation: star-shimmer 4s ease-in-out infinite var(--pulse-delay), custom-pulse 2s infinite var(--pulse-delay);
        }
        .vip-star {
            color: #FFD700;
            animation: vip-star-glow 2.5s ease-in-out infinite var(--pulse-delay), custom-pulse 2s infinite var(--pulse-delay);
            position: relative; display: inline-flex;
            align-items: center; justify-content: center;
            font-size: 1.25em;
        }
        @keyframes vip-star-glow {
            0%,100% { filter: drop-shadow(0 0 4px rgba(255,210,0,0.8)) drop-shadow(0 0 10px rgba(255,180,0,0.4)); }
            50%      { filter: drop-shadow(0 0 8px rgba(255,230,50,1))  drop-shadow(0 0 20px rgba(255,200,0,0.7)) drop-shadow(0 0 35px rgba(255,160,0,0.3)); }
        }
        .vip-star-gold {
            animation: vip-star-glow 2.5s ease-in-out infinite var(--pulse-delay), custom-pulse 2s infinite var(--pulse-delay) !important;
            display: inline-block;
            vertical-align: middle;
        }
        .vip-badge-wrap {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            z-index: 10;
        }
        .vip-badge-wrap img {
            height: 4rem;
            width: auto;
            display: block;
        }

        /* ── Сетка ───────────────────────────────────────────────── */
        #posts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(var(--star-size-px), 1fr));
            justify-items: center; align-items: center; gap: 0.5rem;
        }

        /* ── Поиск ───────────────────────────────────────────────── */
        @keyframes search-border-breathe {
            0%, 100% { border-color: rgba(255,255,255,0.04); }
            50%       { border-color: rgba(255,255,255,0.18); }
        }
        #search-input {
            transition: box-shadow 0.3s ease, border-color 0.6s ease;
            animation: search-border-breathe 4s ease-in-out infinite;
            border-color: rgba(255,255,255,0.04) !important;
        }
        #search-input:focus {
            animation: none;
            border-color: rgba(59,130,246,0.5) !important;
            box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
        }

        /* ── Кнопка «Вход в Ковчег» ──────────────────────────────── */
        #ark-enter-btn {
            background: rgba(8,12,24,0.55) !important;
            border: none !important;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            overflow: hidden;
        }
        #ark-enter-btn::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            padding: 1.5px;
            background: linear-gradient(90deg, transparent 0%, #3B82F6 20%, #8B5CF6 50%, #06B6D4 75%, transparent 100%);
            background-size: 300% 100%;
            animation: aurora-line 6s linear infinite;
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
        }
        #ark-enter-btn:hover {
            background: rgba(15,23,42,0.75) !important;
            transform: translateX(-50%) translateY(-2px) scale(1.04) !important;
        }
        #ark-enter-btn:active {
            transform: translateX(-50%) scale(0.97) !important;
        }

        /* ══════════════════════════════════════════════════════════
           COSMIC REGISTRATION CARD — step-0 redesign
        ══════════════════════════════════════════════════════════ */

        @keyframes orbit-spin {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }
        @keyframes orbit-spin-rev {
            from { transform: rotate(0deg); }
            to   { transform: rotate(-360deg); }
        }
        @keyframes astronaut-float {
            0%,100% { transform: translateY(0px) scale(1); }
            50%      { transform: translateY(-6px) scale(1.03); }
        }
        @keyframes neon-glow-pulse {
            0%,100% { text-shadow: 0 0 10px rgba(56,189,248,0.6), 0 0 30px rgba(56,189,248,0.3), 0 0 60px rgba(56,189,248,0.1); }
            50%      { text-shadow: 0 0 20px rgba(56,189,248,0.9), 0 0 50px rgba(56,189,248,0.5), 0 0 90px rgba(139,92,246,0.2); }
        }
        @keyframes field-icon-pulse {
            0%,100% { opacity:0.85; filter: drop-shadow(0 0 4px rgba(56,189,248,0.6)); }
            50%      { opacity:1;   filter: drop-shadow(0 0 10px rgba(56,189,248,1)); }
        }
        @keyframes btn-next-shine {
            0%   { background-position: -200% center; }
            100% { background-position: 200% center; }
        }

        /* Обёртка step-0 — космическое стекло */
        #ark-step-0 {
            background: linear-gradient(160deg,
                rgba(6,10,36,0.88) 0%,
                rgba(10,6,40,0.82) 50%,
                rgba(4,14,44,0.88) 100%) !important;
            backdrop-filter: blur(32px) !important;
            -webkit-backdrop-filter: blur(32px) !important;
            border-radius: 1.5rem !important;
            border: none !important;
            overflow: visible !important;
            animation: none !important;
        }
        #ark-step-0::after { display: none !important; }

        /* Внешняя рамка карточки — неоновый контур */
        #ark-inner-card {
            border-radius: 1.5rem !important;
            overflow: visible !important;
        }

        /* Аватар-астронавт */
        .cosmic-avatar-wrap {
            position: relative;
            width: 96px; height: 96px;
            margin: 0 auto 0.5rem;
        }
        .cosmic-avatar-inner {
            position: absolute; inset: 16px;
            border-radius: 50%;
            background: radial-gradient(circle at 35% 30%, rgba(139,92,246,0.5), rgba(56,189,248,0.3));
            border: 2px solid rgba(56,189,248,0.5);
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 0 20px rgba(56,189,248,0.4), inset 0 0 20px rgba(139,92,246,0.2);
            animation: astronaut-float 4s ease-in-out infinite;
            z-index: 2;
        }
        /* Внешнее кольцо орбиты */
        .cosmic-orbit-ring {
            position: absolute; inset: 0;
            border-radius: 50%;
            border: 1.5px solid transparent;
            border-top-color: rgba(56,189,248,0.9);
            border-right-color: rgba(139,92,246,0.5);
            animation: orbit-spin 3s linear infinite;
        }
        .cosmic-orbit-ring-2 {
            position: absolute; inset: 5px;
            border-radius: 50%;
            border: 1px solid transparent;
            border-bottom-color: rgba(56,189,248,0.5);
            border-left-color: rgba(139,92,246,0.3);
            animation: orbit-spin-rev 5s linear infinite;
        }
        /* Частицы орбиты */
        .cosmic-orbit-dot {
            position: absolute; width: 5px; height: 5px;
            border-radius: 50%; top: -2.5px; left: calc(50% - 2.5px);
            background: #38bdf8;
            box-shadow: 0 0 8px #38bdf8, 0 0 16px rgba(56,189,248,0.6);
            transform-origin: 50% 50px;
        }

        /* Заголовок — неоновый */
        .cosmic-title {
            font-size: 1.75rem;
            font-weight: 800;
            font-family: 'Inter', sans-serif;
            color: #e0f2fe;
            text-align: center;
            margin: 0;
            letter-spacing: 0.01em;
            animation: neon-glow-pulse 3s ease-in-out infinite;
        }
        .cosmic-subtitle {
            font-size: 0.85rem;
            font-weight: 600;
            color: rgba(56,189,248,0.7);
            text-align: center;
            margin: 0.2rem 0 0;
            font-family: 'Inter', sans-serif;
            letter-spacing: 0.05em;
        }

        /* Поля с иконкой внутри — glassmorphism */
        .cosmic-field {
            position: relative;
            margin-bottom: 0.875rem;
        }
        .cosmic-field-icon {
            position: absolute;
            left: 1rem; top: 50%; transform: translateY(-50%);
            color: rgba(56,189,248,0.95);
            font-size: 1.05rem;
            filter: drop-shadow(0 0 6px rgba(56,189,248,0.7));
            animation: field-icon-pulse 2.5s ease-in-out infinite;
            pointer-events: none; z-index: 1;
        }
        .cosmic-input {
            width: 100%;
            padding: 0.9rem 1rem 0.9rem 2.75rem;
            background: rgba(6,14,44,0.7);
            border: 1.5px solid rgba(56,189,248,0.45);
            border-radius: 0.875rem;
            color: #e2e8f0;
            font-size: 0.92rem;
            font-family: 'Inter', sans-serif;
            outline: none;
            box-sizing: border-box;
            transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
            backdrop-filter: blur(12px);
            box-shadow: 0 0 0 1px rgba(56,189,248,0.08), inset 0 1px 0 rgba(56,189,248,0.06);
        }
        .cosmic-input::placeholder { color: rgba(148,163,184,0.6); font-size: 0.875rem; }
        .cosmic-input:focus {
            border-color: rgba(56,189,248,0.9);
            background: rgba(6,14,50,0.85);
            box-shadow: 0 0 0 3px rgba(56,189,248,0.15), 0 0 24px rgba(56,189,248,0.2);
        }

        /* Кнопка Назад */
        .cosmic-btn-back {
            flex: 1;
            padding: 0.875rem 1rem;
            background: rgba(15,23,50,0.5);
            border: 1.5px solid rgba(56,189,248,0.25);
            border-radius: 2rem;
            color: rgba(148,163,184,0.8);
            font-size: 0.875rem;
            font-weight: 600;
            font-family: 'Inter', sans-serif;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            animation: cancel-btn-breathe 3s ease-in-out infinite;
        }
        .cosmic-btn-back:hover {
            border-color: rgba(56,189,248,0.6);
            color: #e2e8f0;
            background: rgba(15,30,70,0.7);
            transform: translateY(-1px);
        }
        .cosmic-btn-back:active {
            transform: scale(0.97);
        }

        /* Кнопка Далее — неоновый градиент */
        .cosmic-btn-next {
            flex: 1;
            padding: 0.875rem 1rem;
            background: linear-gradient(90deg, #0ea5e9, #6366f1, #8b5cf6, #0ea5e9);
            background-size: 300% 100%;
            border: none;
            border-radius: 2rem;
            color: white;
            font-size: 0.875rem;
            font-weight: 700;
            font-family: 'Inter', sans-serif;
            cursor: pointer;
            white-space: nowrap;
            box-shadow: 0 0 20px rgba(14,165,233,0.5), 0 0 40px rgba(99,102,241,0.2);
            animation: btn-next-shine 3s linear infinite, cosmic-btn-glow 2.5s ease-in-out infinite;
            transition: box-shadow 0.2s, transform 0.15s;
            position: relative; overflow: hidden;
        }
        .cosmic-btn-next::after {
            content: '';
            position: absolute; inset: 0; border-radius: inherit;
            background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
            background-size: 200% 100%;
            animation: hud-btn-shimmer 2.5s linear infinite;
            pointer-events: none;
        }
        .cosmic-btn-next:hover {
            box-shadow: 0 0 35px rgba(14,165,233,0.8), 0 0 70px rgba(99,102,241,0.4);
            transform: translateY(-2px) scale(1.03);
        }
        .cosmic-btn-next:active {
            transform: scale(0.97);
        }

        /* ── Кастомный дропдаун языков ──────────────────────────── */
        .lang-item {
            display: flex;
            align-items: center;
            gap: 0.625rem;
            padding: 0.55rem 0.875rem;
            cursor: pointer;
            font-size: 0.82rem;
            font-family: 'Inter', sans-serif;
            color: #cbd5e1;
            transition: background 0.15s, color 0.15s;
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }
        .lang-item:last-child { border-bottom: none; }
        .lang-item:hover { background: rgba(59,130,246,0.12); color: white; }
        .lang-item.active { background: rgba(59,130,246,0.18); color: white; font-weight: 600; }
        .lang-item .fi { font-size: 1rem; border-radius: 2px; flex-shrink: 0; }

        /* ── Toggle VIP ──────────────────────────────────────────── */
        .toggle-switch {
            position: relative; display: inline-block;
            width: 44px; height: 24px; vertical-align: middle;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute; cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background-color: #4b5563;
            transition: .4s; border-radius: 24px;
        }
        .toggle-slider:before {
            position: absolute; content: "";
            height: 18px; width: 18px; left: 3px; bottom: 3px;
            background-color: white; transition: .4s; border-radius: 50%;
        }
        input:checked + .toggle-slider { background-color: #3b82f6; }
        input:focus  + .toggle-slider { box-shadow: 0 0 1px #3b82f6; }
        input:checked + .toggle-slider:before { transform: translateX(20px); }

        /* ── Модалка просмотра — тёмная карточка ARK ───────────── */
        #view-post-modal > div::-webkit-scrollbar { display: none; }
        #view-post-modal .profile-header {
            display: flex; flex-direction: column;
            align-items: center; margin-bottom: 0;
            padding-bottom: 0;
        }
        #view-post-modal .profile-header #view-avatar { display: none; }
        #view-post-modal .profile-header #view-nickname {
            text-align: center; margin-bottom: 0.375rem;
            word-break: break-word; overflow-wrap: break-word;
            font-size: 0.525rem;
        }
        /* ── TikTok embed — обрезаем лишнее снизу ───────────────── */
        #tiktok-embed-container {
            width: 100%;
            margin-bottom: 0.75rem;
        }
        .tiktok-embed-wrap {
            position: relative;
            width: 100%;
            /* Обрезаем нижнюю часть iframe (политика + кнопка открыть) */
            overflow: hidden;
            border-radius: 0.75rem;
            /* clip нижних ~72px из ~240px высоты */
            max-height: 168px;
        }
        .tiktok-embed-wrap blockquote.tiktok-embed {
            margin: 0 !important;
            min-width: 100% !important;
            max-width: 100% !important;
        }
        .tiktok-embed-wrap iframe {
            /* Сдвигаем iframe вверх чтобы убрать нижний padding TikTok */
            margin-bottom: -80px !important;
            border-radius: 0 !important;
        }
        #tiktok-embed-container .no-tiktok-message {
            text-align: center; padding: 0.75rem;
            border-bottom: 1px solid rgba(71,85,105,0.3);
            margin-bottom: 0.75rem; font-size: 0.875rem;
            color: #64748b;
        }
        #view-post-modal #other-social-links-container {
            padding-top: 0.5rem; margin-bottom: 0.75rem;
            display: flex; flex-wrap: wrap; gap: 0.5rem;
            justify-content: center;
            border-bottom: 1px solid rgba(71,85,105,0.3); padding-bottom: 0.5rem;
        }
        #view-post-modal #other-social-links-container.hidden { display: none; }
        #view-post-modal #other-social-links-container .social-link-item {
            text-align: center; width: auto;
        }
        #view-post-modal #other-social-links-container .social-link-item i {
            display: block; font-size: 1.5rem;
        }
        /* Hover свечение иконок соцсетей */
        .social-link-item a { color: #94a3b8; }
        .social-link-item a:hover .fa-instagram { filter: drop-shadow(0 0 5px #e1306c); color: #e1306c; }
        .social-link-item a:hover .fa-tiktok    { filter: drop-shadow(0 0 5px #a5f3fc); color: #e2e8f0; }
        .social-link-item a:hover .fa-telegram  { filter: drop-shadow(0 0 5px #2aabee); color: #2aabee; }
        .social-link-item a:hover .fa-youtube   { filter: drop-shadow(0 0 5px #ff0000); color: #ff0000; }
        .social-link-item a:hover .fa-vk        { filter: drop-shadow(0 0 5px #4a76a8); color: #4a76a8; }
        .social-link-item a:hover .fa-twitter   { filter: drop-shadow(0 0 5px #1da1f2); color: #1da1f2; }
        .social-link-item a:hover .fa-github    { filter: drop-shadow(0 0 5px #e2e8f0); color: #e2e8f0; }
        .social-link-item a:hover .fa-globe     { filter: drop-shadow(0 0 5px #059669); color: #34d399; }
        #analyze-profile-btn, #ai-analysis-result { display: none !important; }
        #view-text {
            text-align: center; margin-top: 0.375rem;
            margin-bottom: 0.375rem; font-size: 0.875rem;
        }
        #vip-request-container { margin-top: 0.75rem; }

        /* ── ARK модалка — анимация появления ───────────────────── */
        @keyframes ark-modal-appear {
            0%   { opacity: 0; transform: translateY(24px) scale(0.97); filter: blur(8px); }
            40%  { opacity: 0.4; filter: blur(3px); }
            100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
        }
        @keyframes ark-overlay-appear {
            0%   { opacity: 0; }
            100% { opacity: 1; }
        }
        #ark-enter-modal.flex {
            animation: ark-overlay-appear 0.3s ease forwards;
        }
        #ark-enter-modal.animating #ark-inner-card {
            animation: ark-modal-appear 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        /* ═══════════════════════════════════════════════════════════
           HUD СТИЛЬ — ВСЕ МОДАЛКИ
        ═══════════════════════════════════════════════════════════ */

        /* Сканлайн-оверлей для HUD эффекта */
        @keyframes hud-scanline {
            0%   { transform: translateY(-100%); }
            100% { transform: translateY(100vh); }
        }
        @keyframes hud-blink {
            0%,100% { opacity:1; } 48%,52% { opacity:0; }
        }
        @keyframes hud-flicker {
            0%,96%,100% { opacity:1; } 97% { opacity:0.85; } 98% { opacity:1; } 99% { opacity:0.9; }
        }
        @keyframes hud-corner-pulse {
            0%,100% { opacity:0.7; box-shadow: 0 0 4px rgba(59,130,246,0.6); }
            50%      { opacity:1;   box-shadow: 0 0 10px rgba(59,130,246,1); }
        }
        @keyframes hud-line-scan {
            0%   { top: 0%; opacity:0.6; }
            100% { top: 100%; opacity:0; }
        }
        @keyframes falling-star {
            0%   { transform: translate(0,0) rotate(315deg) scaleX(1); opacity:1; }
            100% { transform: translate(180px,180px) rotate(315deg) scaleX(3); opacity:0; }
        }

        /* ── Обёртка ARK modal ────────────────────────────────── */
        #ark-enter-modal > div {
            background: transparent;
            border: none;
            box-shadow: none;
        }

        /* ── Общий HUD стиль для всех шагов ──────────────────── */
        #ark-step-0,
        #ark-step-1,
        #ark-step-2 {
            background: rgba(4, 8, 24, 0.92);
            backdrop-filter: blur(32px);
            -webkit-backdrop-filter: blur(32px);
            border-radius: 0;
            border: none;
            overflow: hidden;
            position: relative;
            animation: hud-flicker 8s ease-in-out infinite;
        }

        /* Горизонтальная сканлиния */
        #ark-step-0::after,
        #ark-step-1::after {
            content: '';
            position: absolute;
            left: 0; right: 0; height: 1px;
            background: linear-gradient(90deg, transparent, rgba(59,130,246,0.4), transparent);
            animation: hud-line-scan 4s linear infinite;
            pointer-events: none;
            z-index: 10;
        }

        /* Угловые маркеры HUD */
        .hud-corner {
            position: absolute;
            width: 12px; height: 12px;
            animation: hud-corner-pulse 2s ease-in-out infinite;
            pointer-events: none; z-index: 5;
        }
        .hud-corner-tl { top:0; left:0; border-top:2px solid #3b82f6; border-left:2px solid #3b82f6; }
        .hud-corner-tr { top:0; right:0; border-top:2px solid #3b82f6; border-right:2px solid #3b82f6; animation-delay:0.5s; }
        .hud-corner-bl { bottom:0; left:0; border-bottom:2px solid #3b82f6; border-left:2px solid #3b82f6; animation-delay:1s; }
        .hud-corner-br { bottom:0; right:0; border-bottom:2px solid #3b82f6; border-right:2px solid #3b82f6; animation-delay:1.5s; }

        /* Шапка шагов */
        .hud-header {
            background: linear-gradient(180deg, rgba(10,20,60,0.95) 0%, rgba(4,8,24,0.9) 100%);
            padding: 1.25rem 1.5rem 1rem;
            border-bottom: 1px solid rgba(59,130,246,0.2);
            position: relative;
        }
        .hud-header::before {
            content: '';
            position: absolute; bottom: -1px; left:0; right:0; height:1px;
            background: linear-gradient(90deg, transparent 0%, #3b82f6 30%, #8b5cf6 60%, transparent 100%);
        }

        /* HUD аватар иконка */
        .hud-avatar {
            width: 3rem; height: 3rem; border-radius: 50%;
            background: rgba(10,20,60,0.8);
            border: 1px solid rgba(59,130,246,0.5);
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 0 16px rgba(59,130,246,0.4), inset 0 0 12px rgba(59,130,246,0.1);
            flex-shrink: 0; position: relative;
        }
        .hud-avatar::after {
            content: '';
            position: absolute; inset: -3px; border-radius: 50%;
            border: 1px solid rgba(59,130,246,0.2);
            animation: hud-corner-pulse 2s ease-in-out infinite;
        }

        /* HUD заголовок */
        .hud-title {
            font-size: 1.1rem; font-weight: 700; color: #e2e8f0;
            font-family: 'Inter', sans-serif; letter-spacing: 0.04em;
            text-transform: uppercase; margin: 0;
        }
        .hud-subtitle {
            font-size: 0.65rem; color: rgba(96,165,250,0.7);
            font-family: 'Courier New', monospace; margin: 0.15rem 0 0;
            letter-spacing: 0.08em; text-transform: uppercase;
        }

        /* Тело формы */
        .ark-form-body {
            -ms-overflow-style: none; scrollbar-width: none;
        }
        .ark-form-body::-webkit-scrollbar { display: none; }
        .ark-form-bg {
            background: repeating-linear-gradient(
                0deg,
                transparent,
                transparent 23px,
                rgba(59,130,246,0.02) 23px,
                rgba(59,130,246,0.02) 24px
            );
        }

        /* HUD лейблы */
        .hud-label {
            display: flex; align-items: center; gap: 0.4rem;
            font-size: 0.7rem; font-weight: 600; color: rgba(96,165,250,0.8);
            font-family: 'Courier New', monospace; text-transform: uppercase;
            letter-spacing: 0.1em; margin-bottom: 0.4rem;
        }

        /* Поля ввода — HUD стиль */
        .ark-input-glass {
            width: 100%;
            padding: 0.7rem 1rem;
            background: rgba(4,10,30,0.8);
            border: 1.5px solid rgba(59,130,246,0.45);
            border-radius: 0;
            color: #e2e8f0;
            font-size: 0.875rem;
            font-family: 'Courier New', monospace;
            outline: none;
            box-sizing: border-box;
            transition: border-color 0.15s, box-shadow 0.15s;
            border-radius: 0.5rem;
            box-shadow: 0 0 0 1px rgba(59,130,246,0.08), inset 0 1px 0 rgba(59,130,246,0.06);
        }
        .ark-input-glass::placeholder { color: rgba(96,165,250,0.4); }
        .ark-input-glass:focus {
            border-color: rgba(59,130,246,0.9);
            box-shadow: 0 0 0 2px rgba(59,130,246,0.2), 0 0 20px rgba(59,130,246,0.18);
        }

        /* ── Анимации для кнопок ──────────────────────────────────── */
        @keyframes hud-btn-pulse {
            0%,100% { box-shadow: 0 0 10px rgba(59,130,246,0.25), 0 0 0 0 rgba(59,130,246,0.15); }
            50%      { box-shadow: 0 0 22px rgba(59,130,246,0.55), 0 0 0 4px rgba(59,130,246,0.08); }
        }
        @keyframes hud-btn-shimmer {
            0%   { background-position: -200% center; }
            100% { background-position: 200% center; }
        }
        @keyframes cosmic-btn-glow {
            0%,100% { box-shadow: 0 0 12px rgba(14,165,233,0.35), 0 0 30px rgba(99,102,241,0.15); }
            50%      { box-shadow: 0 0 28px rgba(14,165,233,0.65), 0 0 55px rgba(99,102,241,0.3); }
        }
        @keyframes btn-border-run {
            0%   { background-position: 0% 50%; }
            50%  { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        @keyframes btn-ripple {
            0%   { transform: scale(0.92); opacity: 0.6; }
            100% { transform: scale(1.5);  opacity: 0; }
        }
        @keyframes success-btn-pulse {
            0%,100% { box-shadow: 0 0 8px rgba(37,99,235,0.3); }
            50%      { box-shadow: 0 0 20px rgba(37,99,235,0.7), 0 0 40px rgba(99,102,241,0.2); }
        }
        @keyframes cancel-btn-breathe {
            0%,100% { border-color: rgba(71,85,105,0.35); }
            50%      { border-color: rgba(100,116,139,0.6); }
        }

        /* HUD кнопки */
        .hud-btn-primary {
            flex: 1; padding: 0.75rem 1rem;
            background: rgba(37,99,235,0.2);
            border: 1px solid rgba(59,130,246,0.6);
            color: #93c5fd;
            font-size: 0.8rem; font-weight: 700;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em; text-transform: uppercase;
            cursor: pointer;
            border-radius: 0.875rem;
            transition: background 0.2s, box-shadow 0.2s, transform 0.15s, color 0.15s;
            box-shadow: 0 0 12px rgba(59,130,246,0.2);
            animation: hud-btn-pulse 2.5s ease-in-out infinite;
            position: relative; overflow: hidden;
        }
        .hud-btn-primary::after {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(105deg, transparent 40%, rgba(147,197,253,0.12) 50%, transparent 60%);
            background-size: 200% 100%;
            animation: hud-btn-shimmer 3s linear infinite;
            pointer-events: none;
        }
        .hud-btn-primary:hover {
            background: rgba(37,99,235,0.45);
            box-shadow: 0 0 28px rgba(59,130,246,0.55), 0 0 8px rgba(59,130,246,0.3);
            color: white;
            transform: translateY(-1px) scale(1.02);
        }
        .hud-btn-primary:active {
            transform: scale(0.97);
        }
        .hud-btn-secondary {
            flex: 1; padding: 0.75rem 1rem;
            background: rgba(15,23,42,0.6);
            border: 1px solid rgba(71,85,105,0.4);
            color: #64748b;
            font-size: 0.8rem; font-weight: 600;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em; text-transform: uppercase;
            cursor: pointer;
            border-radius: 0.875rem;
            transition: background 0.2s, color 0.2s, transform 0.15s, border-color 0.2s;
            animation: cancel-btn-breathe 3s ease-in-out infinite;
        }
        .hud-btn-secondary:hover {
            background: rgba(30,40,70,0.85);
            color: #94a3b8;
            transform: translateY(-1px);
            border-color: rgba(100,116,139,0.7);
        }

        /* Кнопка Далее — главная */
        #reg-submit-btn, #ark-submit-btn {
            background: rgba(37,99,235,0.2) !important;
            border: 1px solid rgba(59,130,246,0.6) !important;
            color: #93c5fd !important;
            font-family: 'Courier New', monospace !important;
            letter-spacing: 0.1em !important;
            text-transform: uppercase !important;
            box-shadow: 0 0 12px rgba(59,130,246,0.2) !important;
            transition: background 0.2s, box-shadow 0.2s, transform 0.15s, color 0.15s !important;
            animation: hud-btn-pulse 2.5s ease-in-out infinite !important;
            position: relative; overflow: hidden;
        }
        #reg-submit-btn::after, #ark-submit-btn::after {
            content: '';
            position: absolute; inset: 0;
            background: linear-gradient(105deg, transparent 40%, rgba(147,197,253,0.13) 50%, transparent 60%);
            background-size: 200% 100%;
            animation: hud-btn-shimmer 3s linear infinite;
            pointer-events: none;
        }
        #reg-submit-btn:hover, #ark-submit-btn:hover {
            background: rgba(37,99,235,0.45) !important;
            box-shadow: 0 0 28px rgba(59,130,246,0.6), 0 0 8px rgba(59,130,246,0.3) !important;
            color: white !important;
            transform: translateY(-2px) scale(1.02) !important;
        }
        #reg-submit-btn:active, #ark-submit-btn:active {
            transform: scale(0.97) !important;
        }
        #ark-cancel-btn-0, #ark-cancel-btn {
            background: rgba(15,23,42,0.6) !important;
            border: 1px solid rgba(71,85,105,0.4) !important;
            color: #64748b !important;
            font-family: 'Courier New', monospace !important;
            letter-spacing: 0.08em !important;
            text-transform: uppercase !important;
            transition: background 0.2s, color 0.2s, transform 0.15s, border-color 0.2s !important;
            animation: cancel-btn-breathe 3s ease-in-out infinite !important;
        }
        #ark-cancel-btn-0:hover, #ark-cancel-btn:hover {
            background: rgba(30,40,70,0.85) !important;
            color: #94a3b8 !important;
            border-color: rgba(100,116,139,0.7) !important;
            transform: translateY(-1px) !important;
        }
        #ark-cancel-btn-0:active, #ark-cancel-btn:active {
            transform: scale(0.97) !important;
        }

        /* ── Карточка пользователя — HUD ─────────────────────── */
        #view-post-modal .profile-header {
            background: linear-gradient(180deg, rgba(8,14,40,0.95) 0%, rgba(4,8,24,0.9) 100%);
        }
        #view-post-modal #view-avatar { display: none; }
        #view-post-modal #view-nickname {
            font-size: 0.66rem; font-weight: 700;
            color: #e2e8f0; letter-spacing: 0.06em;
            text-transform: uppercase;
            font-family: 'Courier New', monospace;
        }

        /* Canvas для падающих звёзд внутри карточки */
        #card-stars-canvas {
            position: absolute; top:0; left:0; width:100%; height:100%;
            pointer-events: none; z-index: 0;
        }

        /* ── Кнопки платформ — горизонтальные ──────────────────── */
        .ark-platform-btn {
            display: flex; align-items: center; gap: 0.4rem;
            padding: 0.45rem 0.7rem;
            background: rgba(15,23,42,0.9);
            border: 1px solid rgba(71,85,105,0.5);
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.18s ease;
            white-space: nowrap;
            font-size: 0.75rem;
            color: #94a3b8;
            font-family: 'Inter', sans-serif;
            min-width: 90px;
        }
        .ark-platform-btn:hover {
            border-color: rgba(99,102,241,0.6);
            background: rgba(30,41,59,0.9);
            color: #e2e8f0;
        }
        .ark-platform-btn.selected {
            border-color: rgba(99,102,241,0.7);
            background: rgba(30,27,75,0.8);
            color: #a5b4fc;
        }
        .ark-platform-btn i { font-size: 0.875rem; }
        /* Цвета иконок платформ */
        .ark-platform-btn .fa-tiktok    { color: #e2e8f0; }
        .ark-platform-btn .fa-instagram { color: #e1306c; }
        .ark-platform-btn .fa-telegram  { color: #2aabee; }
        .ark-platform-btn .fa-youtube   { color: #ff4444; }
        .ark-platform-btn .fa-twitter   { color: #1da1f2; }
        .ark-platform-btn .fa-vk        { color: #4a76a8; }
        .ark-platform-btn .fa-facebook  { color: #1877f2; }
        .ark-platform-btn .fa-github    { color: #e2e8f0; }
        .ark-platform-btn .fa-globe     { color: #34d399; }
        .ark-platform-btn .fa-linkedin  { color: #0a66c2; }

        /* ── Орбитальная иконка в карточке профиля ──────────────── */
        #card-ark-icon {
            position: relative;
            overflow: visible !important;
        }
        .card-orbit-ring {
            position: absolute;
            inset: -6px;
            border-radius: 50%;
            border: 1.5px solid transparent;
            border-top-color: rgba(56,189,248,0.9);
            border-right-color: rgba(139,92,246,0.4);
            animation: orbit-spin 3s linear infinite;
            pointer-events: none;
            z-index: 10;
        }
        .card-orbit-ring-2 {
            position: absolute;
            inset: -3px;
            border-radius: 50%;
            border: 1px solid transparent;
            border-bottom-color: rgba(56,189,248,0.5);
            border-left-color: rgba(139,92,246,0.3);
            animation: orbit-spin-rev 5s linear infinite;
            pointer-events: none;
            z-index: 10;
        }
        /* VIP вариант — золотые кольца */
        .card-orbit-ring.gold {
            border-top-color: rgba(255,215,0,0.95);
            border-right-color: rgba(245,158,11,0.5);
        }
        .card-orbit-ring-2.gold {
            border-bottom-color: rgba(255,215,0,0.6);
            border-left-color: rgba(217,119,6,0.35);
        }
        .card-icon-inner {
            animation: custom-pulse 2s ease-in-out infinite;
            position: relative;
            z-index: 1;
        }
        .spinner { animation: spin 1s linear infinite; }

        /* ── Фильтр/сортировка ──────────────────────────────── */
        .filter-btn {
            background: rgba(8,14,36,0.7);
            border: 1px solid rgba(59,130,246,0.2);
            color: #64748b;
            border-radius: 1.5rem;
            padding: 0.3rem 0.75rem;
            font-size: 0.72rem;
            font-family: 'Inter', sans-serif;
            cursor: pointer;
            transition: all 0.18s;
            white-space: nowrap;
        }
        .filter-btn:hover, .filter-btn.active {
            background: rgba(37,99,235,0.25);
            border-color: rgba(59,130,246,0.6);
            color: #93c5fd;
        }
        .filter-btn.active { font-weight: 600; }

        /* ── Онлайн счётчик ─────────────────────────────────── */
        #online-counter {
            display: inline-flex; align-items: center; gap: 0.3rem;
            font-size: 0.68rem; color: #475569;
            font-family: 'Inter', sans-serif;
        }
        #online-counter .dot {
            width: 6px; height: 6px; border-radius: 50%;
            background: #22c55e;
            box-shadow: 0 0 6px rgba(34,197,94,0.8);
            animation: custom-pulse 2s infinite;
        }



        /* ── Категории (теги) ───────────────────────────────── */
        .cat-badge {
            display: inline-flex; align-items: center; gap: 0.25rem;
            padding: 0.15rem 0.5rem;
            border-radius: 1rem;
            font-size: 0.65rem; font-weight: 600;
            font-family: 'Inter', sans-serif;
            letter-spacing: 0.04em;
            background: rgba(99,102,241,0.18);
            border: 1px solid rgba(99,102,241,0.35);
            color: #a5b4fc;
        }

        /* ── Просмотры ──────────────────────────────────────── */
        /* ── Категории в форме — чекбоксы ──────────────────────── */
        .cat-check-item {
            display: inline-flex; align-items: center; gap: 0.25rem;
            padding: 0.2rem 0.5rem; border-radius: 1rem;
            font-size: 0.72rem; font-family: 'Inter', sans-serif;
            cursor: pointer; background: rgba(8,14,36,0.7);
            border: 1px solid rgba(59,130,246,0.15);
            color: #64748b; transition: all 0.15s; user-select: none;
        }
        .cat-check-item:has(input:checked) {
            background: rgba(37,99,235,0.2);
            border-color: rgba(59,130,246,0.5);
            color: #93c5fd;
        }
        .cat-check-item input { display: none; }

        .view-count {
            font-size: 0.65rem; color: #334155;
            font-family: 'Inter', sans-serif;
            display: inline-flex; align-items: center; gap: 0.2rem;
        }

        /* ── Редактирование профиля ─────────────────────────── */
        #edit-profile-modal {
            transition: none;
        }
        #edit-profile-modal > div {
            transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
        }

        /* ── QR код ─────────────────────────────────────────── */
        #qr-container canvas { border-radius: 0.5rem; }

        /* ══════════════════════════════════════════════════════
           ТЕМА — светлая / тёмная для карточки профиля
        ══════════════════════════════════════════════════════ */
        :root {
            --card-bg: rgba(4,8,24,0.45);
            --card-text: #94a3b8;
            --card-nick: #93c5fd;
            --card-section-bg: rgba(4,8,24,0.28);
            --card-loc: rgba(148,163,184,0.55);
            --msg-bg: rgba(8,14,36,0.7);
            --msg-border: rgba(59,130,246,0.15);
            --msg-text: #94a3b8;
            --msg-author: #7c9cbf;
            --msg-input-bg: rgba(4,10,30,0.6);
        }

        #view-nickname { color: var(--card-nick) !important; text-shadow: 0 0 16px rgba(96,165,250,0.2); }
        #view-text { color: var(--card-text) !important; }
        #view-location { color: var(--card-loc) !important; }
        .themed-card { background: var(--card-bg) !important; }
        .themed-section { background: var(--card-section-bg) !important; }
        /* ── Сообщения ────────────────────────────────────────── */
        .msg-item { background:var(--msg-bg);border:1px solid var(--msg-border);border-radius:0.5rem;padding:0.35rem 0.55rem;margin-bottom:0.3rem;position:relative; }
        .msg-author { font-size:0.67rem;font-weight:600;color:var(--msg-author);font-family:'Inter',sans-serif; }
        .msg-privacy-tag { font-size:0.57rem;color:#475569;margin-left:0.25rem; }
        .msg-text { font-size:0.76rem;color:var(--msg-text);font-family:'Inter',sans-serif;line-height:1.4;margin:0.08rem 0 0;word-break:break-word; }
        .msg-del { position:absolute;top:0.25rem;right:0.35rem;background:none;border:none;color:#334155;font-size:0.62rem;cursor:pointer;padding:0.1rem;display:none;line-height:1; }
        .msg-del:hover { color:#f87171; }
        .msg-item:hover .msg-del { display:block; }
        .msg-more { font-size:0.68rem;color:rgba(96,165,250,0.45);cursor:pointer;text-align:center;padding:0.15rem;margin-bottom:0.3rem;font-family:'Inter',sans-serif; }
        .msg-more:hover { color:#93c5fd; }
        .msg-inp { padding:0.3rem 0.45rem;background:var(--msg-input-bg);border:1px solid rgba(59,130,246,0.2);border-radius:0.45rem;color:var(--card-text);font-size:0.74rem;font-family:'Inter',sans-serif;outline:none;transition:border-color 0.15s; }
        .msg-inp:focus { border-color:rgba(59,130,246,0.55); }
        .msg-send { padding:0.3rem 0.6rem;background:rgba(37,99,235,0.22);border:1px solid rgba(59,130,246,0.4);border-radius:0.45rem;color:#93c5fd;font-size:0.7rem;font-weight:600;cursor:pointer;transition:all 0.15s;font-family:'Inter',sans-serif;white-space:nowrap; }
        .msg-send:hover { background:rgba(37,99,235,0.45); }
        .msg-textarea { width:100%;box-sizing:border-box;padding:0.3rem 0.45rem;background:var(--msg-input-bg);border:1px solid rgba(59,130,246,0.2);border-radius:0.45rem;color:var(--card-text);font-size:0.74rem;font-family:'Inter',sans-serif;outline:none;resize:none;min-height:48px;transition:border-color 0.15s; }
        .msg-textarea:focus { border-color:rgba(59,130,246,0.55); }


        /* ══════════════════════════════════════════════════════
           3D ГАЛАКТИКА
        ══════════════════════════════════════════════════════ */
        #galaxy-container {
            position: fixed;
            inset: 0;
            z-index: 1;
            display: none;
        }
        #galaxy-container.active {
            display: block;
        }
        #galaxy-container canvas {
            display: block;
            width: 100% !important;
            height: 100% !important;
        }

        /* В режиме галактики — main поверх галактики */
        body.galaxy-mode main {
            position: relative;
            z-index: 3;
            pointer-events: none; /* сквозные клики к canvas */
        }
        body.galaxy-mode main * {
            pointer-events: auto;
        }
        body.galaxy-mode #posts-grid,
        body.galaxy-mode #no-results {
            display: none !important;
        }
        body.galaxy-mode header {
            background: transparent;
            box-shadow: none;
        }

        /* SEO контент — скрыт визуально, читается поисковиками */
        .seo-content {
            position: absolute;
            width: 1px; height: 1px;
            padding: 0; margin: -1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            white-space: nowrap;
            border: 0;
        }

        /* ══════════════════════════════════════════════════════
           ПАНЕЛЬ РЕАКЦИЙ
        ══════════════════════════════════════════════════════ */
        .reactions-bar {
            display: flex;
            align-items: center;
            justify-content: space-around;
            padding: 0.55rem 0.5rem 0.4rem;
            border-top: 1px solid rgba(59,130,246,0.1);
            margin-top: 0.5rem;
        }
        .reaction-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.2rem;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.3rem 0.6rem;
            border-radius: 0.5rem;
            transition: all 0.18s;
            min-width: 3rem;
            color: #475569;
            font-family: 'Inter', sans-serif;
        }
        .reaction-btn:hover {
            background: rgba(59,130,246,0.08);
            color: #93c5fd;
        }
        .reaction-btn:active {
            transform: scale(0.88);
        }
        .reaction-btn i {
            font-size: 1.1rem;
            transition: all 0.18s;
        }
        .reaction-btn .r-count {
            font-size: 0.62rem;
            font-weight: 500;
            letter-spacing: 0.02em;
            min-width: 1rem;
            text-align: center;
            transition: all 0.18s;
        }
        /* Активные состояния */
        .reaction-btn.liked i { color: #f87171; }
        .reaction-btn.liked .r-count { color: #f87171; }
        .reaction-btn.liked i {
            animation: like-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
        }
        .reaction-btn.saved i { color: #fbbf24; }
        .reaction-btn.saved .r-count { color: #fbbf24; }
        .reaction-btn.saved i {
            animation: like-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
        }
        @keyframes like-pop {
            0%   { transform: scale(1); }
            50%  { transform: scale(1.45); }
            100% { transform: scale(1); }
        }



        /* ══════════════════════════════════════════════════════
           ОВЕРЛЕЙ КОММЕНТАРИЕВ (TikTok-стиль)
        ══════════════════════════════════════════════════════ */
        /* Оверлей — позиционируется относительно карточки профиля */
        #comments-overlay {
            position: absolute;
            inset: 0;
            z-index: 10;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            background: rgba(0,0,0,0);
            pointer-events: none;
            transition: background 0.3s;
            border-radius: 1.25rem;
            overflow: hidden;
        }
        #comments-overlay.open {
            background: rgba(4,8,24,0.55);
            pointer-events: all;
        }
        #comments-sheet {
            background: rgba(6,10,26,0.98);
            border-top: 1px solid rgba(59,130,246,0.2);
            display: flex;
            flex-direction: column;
            max-height: 72%;
            transform: translateY(100%);
            transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
        }
        #comments-overlay.open #comments-sheet {
            transform: translateY(0);
        }

        /* Шапка оверлея */
        #comments-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.875rem 1.25rem 0.6rem;
            border-bottom: 1px solid rgba(59,130,246,0.1);
            flex-shrink: 0;
        }
        #comments-title {
            font-size: 0.85rem;
            font-weight: 700;
            color: #e2e8f0;
            font-family: 'Inter', sans-serif;
        }
        #comments-close-btn {
            background: none; border: none;
            color: #475569; font-size: 1.3rem;
            cursor: pointer; padding: 0.15rem;
            line-height: 1; transition: color 0.15s;
        }
        #comments-close-btn:hover { color: #e2e8f0; }

        /* Список комментариев */
        #comments-list {
            flex: 1;
            overflow-y: auto;
            padding: 0.75rem 1rem;
            scrollbar-width: thin;
            scrollbar-color: rgba(59,130,246,0.2) transparent;
        }
        #comments-list::-webkit-scrollbar { width: 3px; }
        #comments-list::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.2); border-radius: 2px; }

        /* Один комментарий */
        .comment-item {
            display: flex;
            gap: 0.625rem;
            margin-bottom: 0.875rem;
            position: relative;
        }
        /* Звезда-аватар в комментариях */
        .comment-avatar {
            width: 2rem; height: 2rem;
            border-radius: 50%;
            background: rgba(8,14,36,0.7);
            border: 1px solid rgba(59,130,246,0.2);
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
            font-size: 0.95rem;
            color: #93c5fd;
            position: relative;
        }
        .comment-avatar.vip {
            border-color: rgba(245,158,11,0.5);
            background: rgba(30,20,5,0.7);
            box-shadow: 0 0 8px rgba(245,158,11,0.25);
        }
        /* Орбитальные кольца для VIP */
        .comment-avatar.vip::before,
        .comment-avatar.vip::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            border: 1px solid transparent;
        }
        .comment-avatar.vip::before {
            inset: -3px;
            border-top-color: rgba(245,158,11,0.8);
            border-right-color: rgba(245,158,11,0.3);
            animation: orbit-spin 3s linear infinite;
        }
        .comment-avatar.vip::after {
            inset: -5px;
            border-bottom-color: rgba(245,158,11,0.4);
            border-left-color: rgba(245,158,11,0.2);
            animation: orbit-spin-rev 5s linear infinite;
        }
        .comment-body { flex: 1; min-width: 0; }
        .comment-author {
            font-size: 0.75rem; font-weight: 600;
            color: #93c5fd;
            font-family: 'Inter', sans-serif;
            margin-bottom: 0.15rem;
        }
        .comment-text {
            font-size: 0.82rem; color: #cbd5e1;
            font-family: 'Inter', sans-serif;
            line-height: 1.45;
            word-break: break-word;
        }
        .comment-meta {
            font-size: 0.65rem; color: #334155;
            font-family: 'Inter', sans-serif;
            margin-top: 0.2rem;
        }
        .comment-del-btn {
            position: absolute; top: 0; right: 0;
            background: none; border: none;
            color: #334155; font-size: 0.75rem;
            cursor: pointer; padding: 0.1rem 0.3rem;
            display: none; line-height: 1;
        }
        .comment-del-btn:hover { color: #f87171; }
        .comment-item:hover .comment-del-btn { display: block; }

        /* Кнопка показать больше */
        .comments-show-more {
            text-align: center; font-size: 0.72rem;
            color: rgba(96,165,250,0.5);
            cursor: pointer; padding: 0.25rem;
            font-family: 'Inter', sans-serif;
            margin-bottom: 0.25rem;
        }
        .comments-show-more:hover { color: #93c5fd; }

        /* Пустое состояние */
        #comments-empty {
            text-align: center;
            padding: 2rem 1rem;
            color: #334155;
            font-size: 0.8rem;
            font-family: 'Inter', sans-serif;
        }
        #comments-empty i {
            display: block;
            font-size: 2rem;
            color: rgba(59,130,246,0.2);
            margin-bottom: 0.5rem;
        }

        /* Нижняя панель ввода */
        #comments-input-area {
            border-top: 1px solid rgba(59,130,246,0.12);
            padding: 0.625rem 1rem;
            flex-shrink: 0;
            padding-bottom: env(safe-area-inset-bottom, 0.625rem);
        }
        /* Для гостей */
        #comments-guest-bar {
            display: none;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0;
        }
        #comments-guest-bar p {
            flex: 1; font-size: 0.75rem;
            color: #475569;
            font-family: 'Inter', sans-serif;
            margin: 0;
        }
        #comments-guest-bar button {
            flex-shrink: 0;
            padding: 0.35rem 0.875rem;
            background: rgba(37,99,235,0.25);
            border: 1px solid rgba(59,130,246,0.4);
            border-radius: 1.5rem;
            color: #93c5fd; font-size: 0.75rem; font-weight: 600;
            font-family: 'Inter', sans-serif;
            cursor: pointer; transition: all 0.15s;
        }
        /* Для авторизованных */
        #comments-auth-bar {
            display: none;
            align-items: flex-end;
            gap: 0.5rem;
        }
        #comments-auth-bar textarea {
            flex: 1;
            background: rgba(15,23,42,0.6);
            border: 1px solid rgba(59,130,246,0.2);
            border-radius: 1.25rem;
            padding: 0.5rem 0.875rem;
            color: #e2e8f0;
            font-size: 0.82rem;
            font-family: 'Inter', sans-serif;
            outline: none;
            resize: none;
            max-height: 100px;
            min-height: 38px;
            line-height: 1.4;
            overflow-y: auto;
            transition: border-color 0.15s;
        }
        #comments-auth-bar textarea:focus {
            border-color: rgba(59,130,246,0.55);
        }
        #comments-send-btn {
            width: 2.25rem; height: 2.25rem;
            flex-shrink: 0;
            border-radius: 50%;
            background: rgba(37,99,235,0.3);
            border: 1px solid rgba(59,130,246,0.4);
            color: #93c5fd;
            font-size: 0.9rem;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: all 0.15s;
        }
        #comments-send-btn:hover {
            background: rgba(37,99,235,0.6);
            color: white;
        }
        #comments-send-btn:disabled {
            opacity: 0.4; cursor: default;
        }
        #comments-char-cnt {
            font-size: 0.6rem; color: #334155;
            font-family: 'Inter', sans-serif;
            text-align: right; margin-top: 0.2rem;
        }
        #comments-err {
            font-size: 0.7rem; color: #f87171;
            font-family: 'Inter', sans-serif;
            margin-top: 0.2rem; display: none;
        }

/* ══════════════════════════════════════════════════════════════════
   POLISH PASS — additive refinements (premium feel + mobile)
   Safe by design: low-specificity globals that defer to existing rules.
   ══════════════════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;   /* no grey flash on mobile taps */
    overscroll-behavior: contain;                /* no scroll-chaining glitches over fixed starfield */
}
/* Cleaner keyboard focus (only for keyboard users, never mouse/touch) */
:focus-visible {
    outline: 2px solid rgba(96,165,250,0.85);
    outline-offset: 2px;
    border-radius: 4px;
}
/* Themed global scrollbar — more specific rules (modals) still win */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(59,130,246,0.28);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(96,165,250,0.5); background-clip: content-box; }
* { scrollbar-color: rgba(59,130,246,0.35) transparent; }  /* Firefox; element-level rules override */
/* Smooth media decode */
img { image-rendering: auto; }
