/* ============================================================
   АНИМАЦИИ ПОЯВЛЕНИЯ
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Анимация для parser-card при появлении */
.parser-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Анимация для кнопок действий в parser-card */
.action-btn {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.action-btn:nth-child(1) { animation-delay: 0.3s; }
.action-btn:nth-child(2) { animation-delay: 0.35s; }

/* Анимация для элементов меню */
.menu-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.menu-item:nth-child(1) { animation-delay: 0.05s; }
.menu-item:nth-child(2) { animation-delay: 0.1s; }
.menu-item:nth-child(3) { animation-delay: 0.15s; }
.menu-item:nth-child(4) { animation-delay: 0.2s; }
.menu-item:nth-child(5) { animation-delay: 0.25s; }
.menu-item:nth-child(6) { animation-delay: 0.3s; }
.menu-item:nth-child(7) { animation-delay: 0.35s; }

/* Анимация для экранов при переключении */
.screen {
    animation: fadeIn 0.4s ease-out;
}

/* Анимация для элементов профиля */
.profile-card,
.stats-grid,
.activity-list {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.profile-card { animation-delay: 0.1s; }
.stats-grid { animation-delay: 0.2s; }
.activity-list { animation-delay: 0.3s; }

/* Анимация для элементов настроек */
.settings-row {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.settings-row:nth-child(1) { animation-delay: 0.1s; }
.settings-row:nth-child(2) { animation-delay: 0.15s; }
.settings-row:nth-child(3) { animation-delay: 0.2s; }
.settings-row:nth-child(4) { animation-delay: 0.25s; }
.settings-row:nth-child(5) { animation-delay: 0.3s; }

/* ============================================================
   RESET
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background-image: radial-gradient(circle at 50% 50%, #1f1135 0%, #0c0818 100%);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

:root {
    --tg-top-offset: 12px;
    --tg-bottom-offset: 0px;
    /* Переменная для управления яркостью неона (0 - 1) */
    --neon-intensity: 0;
    --neon-color: rgba(139, 92, 246, var(--neon-intensity));
    --neon-glow: rgba(139, 92, 246, calc(var(--neon-intensity) * 0.4));
    --neon-glow-soft: rgba(139, 92, 246, calc(var(--neon-intensity) * 0.2));
}

/* ============================================================
   ФОНЫ
   ============================================================ */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #0c0818;
}

.bg-blurred,
.bg-sharp,
.bg-glow,
.bg-noise,
.bg-vignette {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-blurred {
    background-image: url('https://s10.iimage.su/s/22/gssmvk4xzX48AQCKi6ObppEjnUbNZhLjYjZuwuA09.png');
    filter: brightness(0.6) blur(2px);
}

.bg-sharp {
    background-image: url('https://s10.iimage.su/s/22/gssmvk4xzX48AQCKi6ObppEjnUbNZhLjYjZuwuA09.png');
    mask-image: linear-gradient(to bottom, transparent 0%, transparent 35%, black 50%, black 70%, transparent 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 35%, black 50%, black 70%, transparent 85%, transparent 100%);
}

@media (orientation: landscape) {
    .bg-blurred {
        background-image: url('https://s10.iimage.su/s/22/g4nCCNjxCXKF6h8HOik3GznztaAKTQezpCCrJtzdl.png');
        filter: brightness(0.6) blur(2px);
    }
    .bg-sharp {
        background-image: url('https://s10.iimage.su/s/22/g4nCCNjxCXKF6h8HOik3GznztaAKTQezpCCrJtzdl.png');
        mask-image: linear-gradient(to bottom, transparent 0%, transparent 35%, black 50%, black 70%, transparent 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 35%, black 50%, black 70%, transparent 85%, transparent 100%);
    }
}

.bg-glow {
    background-image: radial-gradient(circle at 50% 50%, var(--neon-glow-soft), transparent 60%);
}

.bg-noise {
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    mix-blend-mode: soft-light;
    opacity: 0.04;
}

.bg-vignette {
    background-image: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.25) 100%);
}

/* ============================================================
   ЧАСТИЦЫ
   ============================================================ */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
    will-change: transform;
}

/* ============================================================
   КОТЫ-ПРИЗРАКИ
   ============================================================ */
.cat-spirit {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    opacity: 0.1;
    filter: blur(3px) drop-shadow(0 0 20px var(--neon-color));
    animation: floatSpirit 25s ease-in-out infinite alternate;
}

.cat-spirit svg {
    width: 100%;
    height: 100%;
    fill: rgba(139, 92, 246, 0.8);
}

.cat-spirit-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: -5%;
    animation-duration: 28s;
    animation-delay: -2s;
    opacity: 0.08;
}

.cat-spirit-2 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    left: -10%;
    animation-duration: 22s;
    animation-delay: -5s;
    opacity: 0.12;
}

.cat-spirit-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 35s;
    animation-delay: -10s;
    opacity: 0.06;
}

@keyframes floatSpirit {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(20px, -30px) scale(1.05) rotate(3deg);
    }
    66% {
        transform: translate(-10px, 20px) scale(0.95) rotate(-2deg);
    }
    100% {
        transform: translate(15px, -10px) scale(1.02) rotate(1deg);
    }
}

/* ============================================================
   КОНТЕНТ
   ============================================================ */
#contentArea {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.content-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px) + var(--tg-top-offset, 12px) + 70px) 10px 90px 10px;
    transition: padding-top 0.3s ease;
}

.content-wrapper.with-top-bars {
    padding-top: 0 !important;
}

@media (min-width: 1025px) {
    .content-wrapper {
        padding-top: calc(24px + 70px);
    }
    .content-wrapper.with-top-bars {
        padding-top: 0 !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .content-wrapper {
        max-width: 600px;
        padding-left: 20px;
        padding-right: 20px;
        padding-top: calc(20px + 70px);
    }
    .content-wrapper.with-top-bars {
        padding-top: 0 !important;
    }
}

@media (max-width: 767px) {
    .content-wrapper {
        padding-top: calc(16px + 70px);
    }
    .content-wrapper.with-top-bars {
        padding-top: 0 !important;
    }
}

/* ============================================================
   ЭКРАНЫ
   ============================================================ */
.screen {
    display: none;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ============================================================
   КАРТОЧКА (ЕДИНАЯ ДЛЯ ВСЕХ УСТРОЙСТВ)
   ============================================================ */
.parser-card {
    --card-width: 418px;
    --card-height: auto;
    --left-col-min-width: 206px;
    --photo-size-middle: 151px;
    --photo-size-right: 154px;
    --grid-gap: 12px;
    --grid-cols: auto 1fr;

    width: var(--card-width);
    height: var(--card-height);
    max-width: 100%;
    padding: 18px 14px 14px 14px;

    border-top-left-radius: 28px;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 34px;
    border-bottom-left-radius: 32px;

    background: linear-gradient(45deg, rgba(0, 0, 0, 0.6), var(--neon-glow-soft));
    border: 1px solid var(--neon-color);
    box-shadow: 0 0 40px var(--neon-glow);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.parser-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 60px var(--neon-color);
}

.parser-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 40%, transparent 70%, rgba(255, 255, 255, 0.01));
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.grid-main {
    display: grid;
    grid-template-columns: var(--grid-cols);
    gap: var(--grid-gap);
    align-items: stretch;
    flex: 1;
    position: relative;
    z-index: 2;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    position: relative;
    background: transparent;
    border-radius: 12px;
    padding: 4px;
}

.left-col {
    grid-column: 1;
    grid-row: 1 / 3;
    min-width: var(--left-col-min-width);
    flex-shrink: 0;
}

.middle-col {
    grid-column: 2;
    grid-row: 1 / 2;
    width: var(--photo-size-middle);
    height: var(--photo-size-middle);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.right-col {
    grid-column: 2;
    grid-row: 2 / 3;
    width: var(--photo-size-right);
    height: var(--photo-size-right);
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--neon-glow-soft);
    min-height: 26px;
    font-size: 11px;
}

.info-label {
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    font-size: 8px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 36px;
    flex-shrink: 0;
}

.info-value {
    font-weight: 600;
    white-space: normal;
    overflow-wrap: break-word;
    flex: 1;
    color: #ffffff;
    line-height: 1.4;
}

.gift-price {
    color: #FDE047;
}

.media-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.media-box {
    width: 100%;
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-box::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -40%;
    bottom: -40%;
    left: -40%;
    background: radial-gradient(circle, var(--neon-color), transparent 70%);
    filter: blur(20px);
    z-index: -1;
    animation: orbRotate 8s linear infinite;
}

@keyframes orbRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.media-box.owner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-box.nft {
    background: #05030f;
    border: 1.5px solid #fcd34d;
    box-shadow: 0 0 20px rgba(252, 211, 77, 0.1);
}

.nft-widget-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.nft-widget-content {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nft-widget-content svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nft-widget-content lottie-player,
.nft-widget-content .sticker-container,
.nft-widget-content .js-gift_model {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(255, 80, 180, 0.35)) drop-shadow(0 0 25px rgba(255, 150, 220, 0.25));
}

.nft-widget-content .js-gift_model canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.nft-widget-content::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.18), transparent 45%);
    transform: translateX(-120%);
    animation: shineNFT 6s infinite;
    pointer-events: none;
    z-index: 20;
}

@keyframes shineNFT {
    0% { transform: translateX(-120%); }
    35%, 100% { transform: translateX(120%); }
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 2;
}

.action-btn {
    height: 40px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--neon-color), rgba(168, 85, 247, 0.2));
    box-shadow: 0 0 25px var(--neon-glow);
}

.action-btn.primary:hover {
    box-shadow: 0 0 40px var(--neon-color);
}

/* ============================================================
   МЕНЮ (АККОРДЕОН) — ТОПОВЫЙ ДВИЖОК НА CSS GRID 120 FPS
   ============================================================ */
.menu-screen-container {
    color: #ffffff;
    text-align: center;
    padding: 20px 10px;
    background: transparent;
    margin: 0 auto;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.6), var(--neon-glow-soft));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    padding: 0;
}

.menu-item:hover {
    transform: translateY(-2px);
    border-color: #ffffff;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.menu-item:active {
    transform: translateY(0) scale(0.98);
}

.menu-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    width: 100%;
    background: transparent;
    transition: background 0.2s;
    position: relative;
    z-index: 2;
}

.menu-item-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.menu-item-icon {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    flex-shrink: 0;
}

.menu-item-text {
    flex: 1;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.menu-item-arrow {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* ========== ТОПОВЫЙ ДВИЖОК НА CSS GRID 0fr → 1fr ========== */
.menu-item-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); /* Пружинный выброс */

    overflow: hidden;
    border-top: 1px solid transparent;
}

.menu-item.expanded .menu-item-content {
    grid-template-rows: 1fr;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Внутренний контент раскрытия */
.accordion-inner {
    min-height: 0; /* Критично для grid-template-rows: 0fr */
    overflow: hidden;
    padding: 0 20px; /* Начальный паддинг (скрытый) */
    
    transform: translateZ(0);
    opacity: 0;
    transition: opacity 0.3s ease 0.05s, padding 0.3s ease 0.05s;
}

.menu-item.expanded .accordion-inner {
    padding: 8px 20px 20px 20px; /* Конечный паддинг */
    opacity: 1;
}

/* ============================================================
   ПРОЧИЕ СТИЛИ (ПРОФИЛЬ, ПОДПИСКА, ХОТБАР, ПРЕЛОАДЕР...)
   ============================================================ */
.profile-card {
    padding: 20px;
    text-align: center;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    border-top-left-radius: 28px;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 34px;
    border-bottom-left-radius: 32px;
    border: 1px solid var(--neon-color);
    box-shadow: 0 0 40px var(--neon-glow);
}

.profile-avatar {
    margin: 0 auto 15px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--neon-color);
    box-shadow: 0 0 20px var(--neon-glow);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h2 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.profile-info p {
    color: #C4B5FD;
    font-size: 0.9rem;
}

.profile-info .profile-id {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    margin-top: 6px;
}

.profile-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-action-btn {
    width: 100%;
    height: 44px;
}

.subscribe-wrapper {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.plan-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
}

.plan-card.expanded {
    border-color: #ffffff;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.6);
}

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-info {
    flex: 1;
}

.plan-title {
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
}

.plan-badge {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    background: #F59E0B;
    color: #000000;
    letter-spacing: 0.04em;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.plan-badge.green {
    background: #22C55E;
}

.plan-price {
    font-weight: 800;
    font-size: 1.1rem;
    color: #ffffff;
}

.plan-arrow {
    font-size: 1.1rem;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.plan-card.expanded .plan-arrow {
    transform: rotate(180deg);
}

.plan-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.3s ease;
}

.plan-card.expanded .plan-details {
    max-height: 600px;
    margin-top: 12px;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #ffffff;
}

.feature-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--neon-glow-soft), rgba(217, 70, 239, 0.15));
    color: #ffffff;
}

.feature-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.btn-choose {
    background: linear-gradient(135deg, #D946EF, var(--neon-color));
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 10px 14px;
    border-radius: 14px;
    width: 100%;
    cursor: pointer;
    margin-top: 10px;
}

.hotbar {
    position: fixed;
    bottom: calc(18px + var(--tg-safe-area-inset-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 90%;
    max-width: 380px;
    height: 60px;
    border-radius: 30px;
    background: rgba(10, 12, 20, 0.55);
    backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), 0 20px 40px -12px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 4px 6px;
    overflow: visible;
}

.hotbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: 1px solid transparent;
    color: #C4B5FD;
    cursor: pointer;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 10px;
    border-radius: 24px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    min-width: 60px;
}

.hotbar-btn:active {
    transform: scale(0.95);
}

.hotbar-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.hotbar-btn.active {
    color: #ffffff;
}

.hotbar-btn.active svg {
    stroke: #ffffff;
    filter: drop-shadow(0 0 5px var(--neon-color));
}

.hotbar-btn:hover:not(.active) {
    color: #ffffff;
    background: var(--neon-glow-soft);
    border-color: var(--neon-color);
    box-shadow: 0 0 10px var(--neon-glow);
}

.drop {
    position: absolute;
    height: 44px;
    border-radius: 22px;
    top: 8px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(135deg, #C084FC, var(--neon-color));
    box-shadow: 0 0 18px var(--neon-glow);
    transition: left 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1), width 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.drop::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 10%;
    width: 80%;
    height: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    border-radius: inherit;
}

/* ============================================================
   ПРЕЛОАДЕР (ЗАГРУЗКА) — ОБНОВЛЕННЫЙ С КРУГОМ, ЗВЕЗДАМИ И БЕЗ ТЕКСТА
   ============================================================ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a1a3e, #0f0f2e 50%, #050512 100%);
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#preloader.hide {
    opacity: 0;
    visibility: hidden;
}

#space-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#terminal-log {
    position: absolute;
    left: 20px;
    top: 10px;
    width: min(320px, 40vw);
    height: 33vh;
    z-index: 3;
    pointer-events: none;
    overflow: visible;
    font-family: 'Courier New', monospace;
    font-size: clamp(12px, 1.5vw, 22px);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 0 8px var(--neon-glow);
}

.log-line {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-wrap: break-word;
    opacity: 0;
    animation: lineAppear 0.4s ease-out forwards;
    margin-bottom: 2px;
    pointer-events: none;
    transition: opacity 1s ease-out;
}

.log-line.fade-out {
    opacity: 0;
}

@keyframes lineAppear {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.loader-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Обертка для круга, чтобы позиционировать звезды */
.circle-container-wrapper {
    position: relative;
    width: min(70vw, 280px);
    height: min(70vw, 280px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

/* Главный круг с двойной обводкой */
.circle-container {
    position: relative;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(circle, #17142b 0%, #0b0a18 70%);
    border: 1px solid rgba(170, 90, 255, 0.35);
    box-shadow: 0 0 25px rgba(140, 60, 255, 0.35), 0 0 80px rgba(140, 60, 255, 0.15), inset 0 0 40px rgba(160, 80, 255, 0.2);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
    z-index: 2;
}

/* Внутреннее свечение под котом */
.circle-container::after {
    content: ''; 
    position: absolute; 
    inset: 15%; 
    border-radius: 50%;
    background: radial-gradient(circle, rgba(155, 70, 255, 0.25), transparent 70%);
    z-index: 1; 
    pointer-events: none;
}

/* Вращающаяся дуга (фиолетовая линия) */
.circle-rotate-line {
    position: absolute; 
    inset: -4px; 
    border-radius: 50%;
    background: conic-gradient(transparent 0deg, transparent 30deg, #c084fc 60deg, transparent 90deg, transparent 360deg);
    animation: spin 4s linear infinite; 
    z-index: 0; 
    pointer-events: none;
    mask-image: radial-gradient(circle at center, transparent 75%, black 76%, black 100%);
    -webkit-mask-image: radial-gradient(circle at center, transparent 75%, black 76%, black 100%);
}
@keyframes spin { 100% { transform: rotate(360deg); } }

#catCanvas {
    position: relative;
    z-index: 2;
    width: 75%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 15px var(--neon-color));
    will-change: filter;
}

/* ЗВЁЗДЫ ВОКРУГ КРУГА */
.star-deco {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #b56cff;
    transform: rotate(45deg);
    filter: drop-shadow(0 0 8px #a855ff);
    animation: blink 2.5s infinite alternate;
    z-index: 3;
    pointer-events: none;
}
.star-deco::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    background: #b56cff;
    left: -3px;
    top: 4px;
}
.star-deco::after {
    content: "";
    position: absolute;
    height: 16px;
    width: 2px;
    background: #b56cff;
    left: 4px;
    top: -3px;
}
.s1 { top: -5%; right: 5%; animation-delay: 0s; }
.s2 { bottom: -5%; left: 5%; animation-delay: 0.8s; transform: scale(0.8) rotate(45deg); }
.s3 { top: 25%; left: -8%; animation-delay: 0.4s; transform: scale(0.6) rotate(45deg); }
.s4 { bottom: 25%; right: -8%; animation-delay: 1.2s; transform: scale(0.7) rotate(45deg); }

/* ТОЧКИ */
.dot-deco {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #c084fc;
    border-radius: 50%;
    box-shadow: 0 0 8px #a855ff;
    animation: blink 2s infinite;
    z-index: 3;
    pointer-events: none;
}
.d1 { top: 15%; left: 10%; animation-delay: 0.3s; }
.d2 { bottom: 15%; right: 10%; animation-delay: 0.9s; }
.d3 { top: 55%; right: -2%; animation-delay: 0.6s; }

@keyframes blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

@media (max-width: 480px) {
    .parser-card {
        --card-width: 355px;
        --left-col-min-width: 180px;
        --photo-size-middle: 142px;
        --photo-size-right: 142px;
        --grid-gap: 10px;
        width: var(--card-width);
        padding: 14px 12px 12px 12px;
    }
    .cat-spirit { display: none !important; }
    #terminal-log {
        width: min(150px, 60vw);
        font-size: clamp(9px, 2vw, 14px);
        height: 20vh;
        left: 5px;
        top: 5px;
    }
}

.menu-badge {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    background: #7c3aed;
    color: #ffffff;
    letter-spacing: 0.5px;
    display: inline-block;
}

.pulse-badge {
    animation: pulseBadge 1.5s ease-in-out infinite;
}

@keyframes pulseBadge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px 5px rgba(124, 58, 237, 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

.update-banner {
    position: relative;
    width: 100%;
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 16px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--neon-color);
    box-shadow: 0 8px 25px var(--neon-glow);
    cursor: pointer;
    overflow: hidden;
    background-image: url('https://s6.iimage.su/s/08/gBlrDJwxk8iwz3q4XJiBkWor3hQpd9zfD5uUEquwQ.jpg');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

.update-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
    border-radius: inherit;
}

.update-banner .banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #ffffff;
}

.update-banner .banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
}

.update-banner .banner-title svg {
    stroke: #a78bfa;
}

.update-banner .banner-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.update-banner .banner-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
}

.update-banner .banner-list svg {
    width: 12px;
    height: 12px;
    stroke: #a78bfa;
    fill: none;
    stroke-width: 2.5;
}

.pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    margin-right: 8px;
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.4; transform: scale(0.8); }
}

.anim-support-svg svg.menu-item-icon {
    animation: supportPulse 1.8s ease-in-out infinite;
    transform-origin: center;
}

@keyframes supportPulse {
    0% { transform: scale(1); stroke-opacity: 0.7; }
    50% { transform: scale(1.12); stroke-opacity: 1; filter: drop-shadow(0 0 6px var(--neon-color)); }
    100% { transform: scale(1); stroke-opacity: 0.7; }
}

.anim-shake svg.menu-item-icon {
    animation: shakeGift 1.2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes shakeGift {
    0%, 100% { transform: rotate(0deg) scale(1); }
    15% { transform: rotate(8deg); }
    30% { transform: rotate(-8deg); }
    45% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    80% { transform: rotate(2deg); }
}

.anim-rotate svg.menu-item-icon {
    animation: spin 4s linear infinite;
    transform-origin: center;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

#customModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

#customModal .modal-box {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.85), var(--neon-glow-soft));
    border: 1px solid var(--neon-color);
    border-radius: 20px;
    padding: 30px 40px;
    max-width: 320px;
    box-shadow: 0 0 40px var(--neon-glow);
    color: #ffffff;
    text-align: center;
}

#customModal .modal-text {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.5;
}

#customModal .modal-close {
    background: var(--neon-color);
    border: none;
    color: #ffffff;
    padding: 8px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 15px var(--neon-glow);
    transition: background 0.2s;
}

#customModal .modal-close:hover {
    background: #7c3aed;
}

.top-bars {
    width: 100%;
    max-width: 500px;
    padding: 0 18px;
    box-sizing: border-box;
    display: none;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    margin: calc(var(--tg-top-offset, 12px) + 30px) auto -40px auto;
}

.top-bars.visible {
    display: flex;
    opacity: 1;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.top-bar.left-bar {
    background: rgba(200, 150, 50, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.top-bar.right-bar {
    background: rgba(30, 50, 80, 0.2);
    border: 1px solid rgba(50, 150, 255, 0.4);
}

.top-bar-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
    stroke: rgba(255, 255, 255, 0.95);
}

.top-bar-icon.gram-icon {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 6px rgba(48, 161, 245, 0.7));
}

.top-bar-text {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

#contentArea.is-subscribe .top-bars {
    margin-bottom: 10px;
}

#contentArea:not(.is-subscribe) .top-bars {
    margin-bottom: -13px;
}

#walletPopup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

#walletPopup.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wallet-popup-content {
    background: rgba(20, 10, 30, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    border-radius: 28px;
    padding: 32px 28px;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(168, 85, 247, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    animation: popupSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wallet-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #f5f3ff;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.wallet-balance-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 16px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.wallet-balance-display img {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 8px rgba(48, 161, 245, 0.7));
}

.wallet-balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.wallet-balance-currency {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
}

.wallet-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-btn.deposit {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.wallet-btn.deposit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

.wallet-btn.withdraw {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.wallet-btn.withdraw:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.wallet-btn:active {
    transform: translateY(0) scale(0.96);
}

.wallet-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.wallet-popup-close svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.settings-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 60%;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    transition: background 0.2s;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--neon-color);
    cursor: pointer;
    box-shadow: 0 0 15px var(--neon-glow);
}

input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--neon-color);
    cursor: pointer;
    border: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--neon-color);
    box-shadow: 0 0 20px var(--neon-glow);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ============================================================
   ОВЕРРАЙДЫ ДЛЯ НУЛЕВОГО НЕОНА (добавляется класс neon-zero к :root)
   ============================================================ */
:root.neon-zero .parser-card {
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.15) !important;
}

:root.neon-zero .parser-card:hover {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.2) !important;
}

:root.neon-zero .action-btn.primary {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1) !important;
}

:root.neon-zero .toggle-switch input:checked + .slider {
    background: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15) !important;
}

/* ============================================================
   ДОПОЛНИТЕЛЬНЫЕ ОПТИМИЗАЦИИ ДЛЯ ПРОИЗВОДИТЕЛЬНОСТИ (GPU, минимизация перерисовок)
   ============================================================ */
.parser-card,
.hotbar,
.menu-item,
.update-banner,
/* Отключаем тяжёлый backdrop-filter на мобильных */
@media (max-width: 768px) {
    .hotbar {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(10, 12, 20, 0.9);
    }
    .action-btn {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .top-bar {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.6);
    }
    .wallet-popup-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    #customModal {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    #walletPopup {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}