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

html,
body {
    background-color: #05070a;
    color: #fff;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}

/* =========================================
   ГЛАВНЫЙ ИНТЕРФЕЙС
========================================= */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    width: 100%;
    padding-top: 60px; /* Отступ под хедер */
    position: relative;
    z-index: 10;
}

.portal-logo-section {
    flex: none;
    height: 350px;
    width: 100%;
    /* Математически точное центрирование по экрану (независимо от карточек!) */
    margin-top: max(20px, calc(48dvh - 235px)); 
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    z-index: 50; /* Портал должен перекрывать карточки при зуме */
    pointer-events: none; /* Пропускаем клики сквозь пустую секцию на карточки, которые подтянулись наверх */
}

/* Фон размываем, чтобы создать глубину вокруг текста */
.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 1;
}

.ambient-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(36, 194, 129, 0.08) 0%, rgba(15, 89, 69, 0.05) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes aurora-breathe {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.7;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

.grid-floor {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40%;
    background-image:
        linear-gradient(rgba(36, 194, 129, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 194, 129, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(75deg);
    transform-origin: bottom;
    opacity: 0.3;
    animation: grid-move 5s linear infinite;
}

@keyframes grid-move {
    0% {
        background-position-y: 0px;
    }

    100% {
        background-position-y: 40px;
    }
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #05070a; /* Непрозрачный фон, защита от скролла */
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    box-sizing: border-box;
}

.logo {
    font-size: 16px;
    letter-spacing: 3px;
    color: #a0a0a0;
}

.logo span {
    color: #0ff;
    font-weight: 600;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 2px;
    color: #a0a0a0;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #0ff;
    border-radius: 50%;
    box-shadow: 0 0 10px #0ff;
}



.center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    cursor: default;
    z-index: 20;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.5s, opacity 0.3s ease;
}

.center-content h1 {
    font-size: 24px;
    letter-spacing: 15px;
    font-weight: 300;
    color: #fff;
    margin-bottom: 5px;
    transition: letter-spacing 0.4s ease;
}

.neon-year {
    font-size: 72px;
    font-weight: 700;
    letter-spacing: 5px;
    background: linear-gradient(90deg, #0ff, #a200ff, #0ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    margin-bottom: 10px;
    display: inline-block;
    /* To allow scale transform */
    animation: gradient-flow 3s linear infinite;
    transition: transform 0.4s ease, text-shadow 0.4s ease;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.center-content p {
    font-size: 14px;
    color: #888;
    letter-spacing: 1px;
}

/* Эффекты при наведении на весь блок */
.center-content:hover .neon-year {
    transform: scale(1.05);
    text-shadow: 0 0 40px rgba(0, 255, 255, 0.8), 0 0 20px rgba(162, 0, 255, 0.6);
}

.center-content:hover h1 {
    letter-spacing: 18px;
}

/* Анимация появления верхнего блока (Срабатывает после телепортации) */
#main-interface header {
    opacity: 0;
    transform: translateY(30px);
}

#main-interface.active header {
    animation: slideUpFade 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.7s;
}

/* Главный текст летит вверх в центр зеленой ауры (30dvh) */
#main-interface.active .center-content {
    transform: translate(-50%, calc(-50% - 18dvh));
}

.cards-container {
    display: flex;
    gap: 20px;
    z-index: 10;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
    margin: 40px auto 50px auto;
    flex-wrap: wrap;
    padding-bottom: 50px;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.5s;
}

/* Карточки подтягиваются вверх, закрывая дыру от портала, встают прямо под текст */
#main-interface.active .cards-container {
    transform: translateY(calc(-18dvh - 135px));
}

.card {
    background: rgba(10, 14, 20, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    flex: 1 1 300px;
    min-width: 300px;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s, border 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Начальное состояние карточек */
    opacity: 0;
    transform: translateY(40px); /* Фикс для мобильного WebKit, чтобы анимация slideUpFade не игнорировалась */
    pointer-events: none;
}

/* Анимация появления карточек (Каскадная) */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(60px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Запуск анимации при активности интерфейса */
#main-interface.active .card {
    animation: slideUpFade 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Каскадная задержка (Stagger Effect) */
#main-interface.active .card:nth-child(1) {
    animation-delay: 0.5s;
}

#main-interface.active .card:nth-child(2) {
    animation-delay: 0.65s;
}

#main-interface.active .card:nth-child(3) {
    animation-delay: 0.8s;
}

#main-interface.active .card:nth-child(4) {
    animation-delay: 0.95s;
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(15, 20, 30, 0.8);
}

.card .icon {
    margin-bottom: 20px;
}

/* Mint Spark: #6df0af */
.card-mint {
    border: 2px solid rgba(109, 240, 175, 0.15);
}

.card-mint:hover {
    border: 2px solid rgba(109, 240, 175, 1);
    box-shadow: 0 10px 40px rgba(109, 240, 175, 0.4), inset 0 0 20px rgba(109, 240, 175, 0.2);
}

.card-mint .icon {
    color: #6df0af;
}

/* Aurora Green: #24c281 */
.card-aurora {
    border: 2px solid rgba(36, 194, 129, 0.15);
}

.card-aurora:hover {
    border: 2px solid rgba(36, 194, 129, 1);
    box-shadow: 0 10px 40px rgba(36, 194, 129, 0.4), inset 0 0 20px rgba(36, 194, 129, 0.2);
}

.card-aurora .icon {
    color: #24c281;
}

/* Cyan Accent: #00a388 */
.card-emerald {
    border: 2px solid rgba(0, 163, 136, 0.15);
}

.card-emerald:hover {
    border: 2px solid rgba(0, 163, 136, 1);
    box-shadow: 0 10px 40px rgba(0, 163, 136, 0.4), inset 0 0 20px rgba(0, 163, 136, 0.2);
}

.card-emerald .icon {
    color: #00a388;
}

/* White App: #ffffff */
.card-white {
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.card-white:hover {
    border: 2px solid rgba(255, 255, 255, 1);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.card-white .icon {
    color: #ffffff;
}

.card h3 {
    font-size: 12px;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    color: #ffffff;
    line-height: 1.4;
}

.card-subtitle {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.card-desc {
    font-size: 12px;
    color: #e5e7eb;
    line-height: 1.6;
    text-align: center;
}

/* =========================================
   ПОРТАЛ И АНИМАЦИЯ
========================================= */
#portal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 350px;
    height: 350px;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1.2s cubic-bezier(0.7, 0, 0.2, 1);
    will-change: transform;
}

/* Запеченное ядро портала (Картинка PNG вместо тяжелых CSS теней) */
.portal-core-baked {
    position: absolute;
    width: 1000px;
    height: 1000px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    
    /* Анимация пульсации (дыхания) */
    animation: breathing-core 1.5s ease-in-out infinite alternate;
    transition: opacity 0.8s ease-out;
    will-change: transform;
}

@keyframes breathing-core {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) translateZ(0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05) translateZ(0);
    }
}

/* Бегающая нестабильная обводка */
.portal-core-outline {
    position: absolute;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    border-radius: 50%;
    border: 8px solid transparent;
    border-top: 8px solid rgba(109, 240, 175, 0.8);
    border-bottom: 8px solid rgba(0, 163, 136, 0.8);
    animation: spin-outline 0.8s linear infinite;
    will-change: transform;
}

@keyframes spin-outline {
    0% {
        transform: rotate(0deg) translateZ(0);
    }

    100% {
        transform: rotate(360deg) translateZ(0);
    }
}



/* Пелена внутри портала */
.portal-veil {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(36, 194, 129, 0.03) 0%, transparent 70%);
    backdrop-filter: blur(2px);
    /* Делаем пелену менее мутной */
    z-index: 12;
    transition: opacity 0.8s ease-out;
}

/* Текст внутри портала удален, так как мы используем реальный текст сайта */

/* Утилита для затухания портала перед расширением */
.fade-out {
    opacity: 0 !important;
    transition: opacity 0.4s ease-out !important;
}

/* Стили для Canvas слоя искр (ПК) */
#portal-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1000px;
    height: 1000px;
    transform: translate(-50%, -50%) translateZ(0);
    pointer-events: none;
    z-index: 15;
    will-change: transform;
}

/* Возвращаем оригинальную телепортацию на весь контейнер (15x для ПК) */
.teleport-zoom {
    transform: translate(-50%, -50%) scale(15) !important;
}

@media (max-width: 768px) {
    /* Текст больше не пропадает на мобилках */

    /* Оптимизация телепорта: вместо расширения в 15 раз, увеличиваем в 6 раз, чтобы не лагало */
    .teleport-zoom {
        transform: translate(-50%, -50%) scale(6) !important;
    }

    /* Главный убийца FPS на телефонах - это размытие фона во время масштабирования. Отключаем его. */
    .portal-veil {
        backdrop-filter: none !important;
        background: radial-gradient(circle, rgba(36, 194, 129, 0.10) 0%, transparent 70%);
    }
}

/* Зум видео с искрами, чтобы они летели навстречу камере при телепорте */
.teleport-zoom-canvas {
    transform-origin: 50% 50%;
    transform: translate(-50%, -50%) scale(15) !important;
    opacity: 0 !important;
    transition: transform 1.2s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.8s ease-in !important;
}

/* Текст пропадает МГНОВЕННО, чтобы не увеличиваться вместе с порталом */
.teleport-zoom-text-hide {
    opacity: 0 !important;
    transition: none !important;
    display: none !important;
}

/* Все остальные элементы портала плавно растворяются, пока мы "пролетаем" сквозь них */
.teleport-zoom .portal-core-baked,
.teleport-zoom .portal-core-outline,
.teleport-zoom .portal-veil,
.teleport-zoom .baked-sparks {
    opacity: 0 !important;
    transition: opacity 0.8s ease-in !important;
}

/* baked-sparks removed */

/* (Удален loading-text) */

@media (max-width: 768px) {
    /* Текст больше не пропадает на мобилках */

    #portal-canvas {
        display: block !important;
    }

    /* Оптимизация телепорта: вместо расширения в 15 раз, увеличиваем в 6 раз, чтобы не лагало */
    .teleport-zoom, .teleport-zoom-canvas {
        transform: translate(-50%, -50%) scale(6) !important;
    }

    /* Главный убийца FPS на телефонах - это размытие фона во время масштабирования. Отключаем его. */
    .portal-veil {
        backdrop-filter: none !important;
        background: radial-gradient(circle, rgba(36, 194, 129, 0.10) 0%, transparent 70%);
    }
}

/* =========================================
   ИНТЕРАКТИВНЫЕ КАРТОЧКИ
========================================= */
.card.interactive {
    position: relative;
    padding: 0; /* Убираем padding у родителя, чтобы абсолютные дети управляли им */
    transition: height 0.4s ease, transform 0.3s, box-shadow 0.3s, background 0.3s, border 0.3s;
    display: block;
    overflow: hidden;
}

.card-state-default, .card-state-instruction, .card-state-active {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 32px;
    box-sizing: border-box;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-state-instruction, .card-state-active {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Состояние 2: Инструкция */
.card.is-instruction-step .card-state-default {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.card.is-instruction-step .card-state-instruction {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Состояние 3: Активная подписка */
.card.is-expanded .card-state-default,
.card.is-expanded .card-state-instruction {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.card.is-expanded .card-state-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Стили контента активной карточки */
.access-timer {
    font-family: monospace;
    font-size: 32px;
    color: #ffaa00;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.access-instruction {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    line-height: 1.5;
}

.qr-container {
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 1px solid rgba(109, 240, 175, 0.2);
}

.open-app-btn {
    background: #6df0af;
    color: #000;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, background 0.2s;
    margin-bottom: 16px;
}
.open-app-btn:hover {
    background: #4ae098;
    transform: scale(1.05);
}

.copy-fallback {
    font-size: 14px;
    color: #6df0af;
    text-decoration: underline;
    cursor: pointer;
    margin-bottom: 24px;
    border: none;
    background: transparent;
    padding: 0;
}

.cancel-btn {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.2s;
    margin-top: auto;
    border: none;
    background: transparent;
    padding: 8px;
}
.cancel-btn:hover {
    color: white;
}

/* Стили состояния инструкции */
.app-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(109, 240, 175, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.instruction-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    line-height: 1.5;
    text-align: center;
}
.download-app-btn {
    display: block;
    background: transparent;
    color: #6df0af;
    border: 1px solid #6df0af;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 32px;
    width: 100%;
    box-sizing: border-box;
}
.download-app-btn:hover {
    background: rgba(109, 240, 175, 0.1);
}
.continue-btn {
    background: #6df0af;
    color: #000;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    margin-bottom: 24px;
}
.continue-btn:hover:not(:disabled) {
    background: #4ae098;
    transform: scale(1.05);
}
.continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #555;
    color: #aaa;
}

@media (max-width: 768px) {
    .qr-container {
        display: none !important;
    }
}