/* --- 1. ГЛУБОКИЙ ТЁМНЫЙ ФОН И СТЕКЛО (Midnight Mystic) --- */
    :root {
      --bg: #080a12; /* Глубокий темный, почти черный с оттенком синего */
      --bg2: #0d101c;
      --card: rgba(255, 255, 255, 0.02);
      --stroke: rgba(255, 255, 255, 0.04); /* Максимально деликатные рамки */
    }

    body {
      background-color: var(--bg);
      /* Снижена прозрачность градиентов для мягкого свечения */
      background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.07), transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(251, 191, 36, 0.04), transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(236, 72, 153, 0.05), transparent 50%);
      position: relative;
    }

    /* Более благородное стекло для всех карточек */
    .glass-card, .glass-result-box, 
    #screen-tarot .glass-result-box, #screen-profile .glass-result-box {
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.03);
      border-top: 1px solid rgba(255, 255, 255, 0.05); /* Легкий блик сверху */
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.01);
    }

    /* --- 2. ЭФФЕКТ "ЗВЁЗДНОЙ ПЫЛИ" (Магия на фоне) --- */
    body::before {
      content: "";
      position: fixed;
      top: 0; left: 0; width: 100%; height: 100%;
      pointer-events: none;
      z-index: 0;
      /* Паттерн из мелких точек */
      background-image: 
        radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 60px 70px, rgba(255, 255, 255, 0.8), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 120px 160px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 190px 40px, rgba(139, 92, 246, 0.6), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 250px 90px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 310px 140px, rgba(251, 191, 36, 0.5), rgba(0,0,0,0));
      background-repeat: repeat;
      background-size: 350px 350px;
      opacity: 0.15;
      animation: stardustDrift 100s linear infinite;
    }

    @keyframes stardustDrift {
      0% { transform: translateY(0); }
      100% { transform: translateY(-350px); } /* Плавное движение вверх */
    }

    /* Чтобы контент приложения был поверх пыли */
    .app {
      position: relative;
      z-index: 1; 
    }


    /* --- 3. ОТКЛЮЧЕНИЕ ДЕРГАНЬЯ (Убираем transform: scale) --- */
    .menu-btn:active, .feature-card:active, .btn:active {
      transform: none !important;
      opacity: 0.7; /* Мягкая визуальная отдача */
    }

    .glass-stat-card:active {
      transform: none !important;
      background: rgba(255, 255, 255, 0.05);
      border-color: rgba(255, 255, 255, 0.1);
    }

    .large-reveal-card:active, .tarot-card:active {
      transform: none !important;
      filter: brightness(1.1); /* Карта чуть светлеет при нажатии */
    }


    /* --- 4. ПОЛНОСТЬЮ ПЕРЕДЕЛАННОЕ НИЖНЕЕ МЕНЮ --- */
    .bottom-nav {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      max-width: 620px;
      margin: auto;
      background: rgba(8, 10, 18, 0.85); /* Сливается с глубоким фоном */
      backdrop-filter: blur(25px);
      -webkit-backdrop-filter: blur(25px);
      border: none;
      border-top: 1px solid rgba(255, 255, 255, 0.04);
      border-radius: 24px 24px 0 0; /* Интеграция в низ экрана */
      padding: 12px 10px 24px; /* Увеличен отступ снизу для комфорта на iOS */
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 4px;
      box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
      z-index: 1000;
    }

    .nav-btn {
      background: transparent;
      border: none;
      color: var(--muted);
      font-family: inherit;
      font-size: 11px; /* Аккуратный мелкий шрифт */
      font-weight: 500;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      opacity: 0.55; /* Приглушенные неактивные кнопки */
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      position: relative;
    }

    .nav-btn .nav-icon {
      font-size: 20px;
      transition: transform 0.4s ease, filter 0.4s ease;
    }

    .nav-btn.active {
      opacity: 1;
      color: var(--gold); /* Золотой акцент для текста */
      text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    }

    .nav-btn.active .nav-icon {
      transform: translateY(-2px); /* Легкое поднятие иконки */
      filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
    }

    /* Красивая светящаяся точка сверху активного таба вместо полоски */
    .nav-btn::before {
      content: '';
      position: absolute;
      top: -12px; /* Привязана к верхнему краю панели */
      left: 50%;
      transform: translateX(-50%) scale(0);
      width: 4px;
      height: 4px;
      background: var(--gold);
      border-radius: 50%;
      box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold);
      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .nav-btn.active::before {
      transform: translateX(-50%) scale(1);
    }

    /* Отключаем старую полоску, если она осталась в твоем коде */
    .nav-btn.active::after {
      display: none !important;
    }

    /* --- SKELETON LOADER --- */
    .skeleton-loader {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-top: 12px;
    }

    .skeleton-line {
      height: 14px;
      background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(139, 92, 246, 0.15) 50%, rgba(255,255,255,0.03) 75%);
      background-size: 200% 100%;
      border-radius: 8px;
      animation: skeletonShimmer 2s infinite linear;
    }

    /* Делаем строчки разной длины для реалистичности */
    .skeleton-line:nth-child(1) { width: 95%; }
    .skeleton-line:nth-child(2) { width: 100%; }
    .skeleton-line:nth-child(3) { width: 80%; }

    @keyframes skeletonShimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .title, .section-title, .welcome-title, .bonus-title {
      font-family: 'Cormorant Garamond', serif;
      letter-spacing: 0.5px;
    }
    body {
      font-family: 'Inter', sans-serif; /* Для всего остального */
    }

    .mystic-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(10, 14, 29, 0.85);
      backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
      padding: 20px;
    }
    .mystic-overlay.active {
      opacity: 1; pointer-events: auto;
    }
    .overlay-container {
      width: 100%; max-width: 420px;
      display: flex; flex-direction: column; align-items: center;
    }
    .overlay-loading {
      text-align: center;
      animation: pulseOverlay 2s infinite ease-in-out;
    }
    .overlay-loading .icon {
      font-size: 64px; margin-bottom: 16px;
      filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.8));
    }
    .overlay-loading .text {
      font-size: 18px; font-weight: 800; letter-spacing: 0.5px;
      background: linear-gradient(135deg, #fff, var(--muted));
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }
    @keyframes pulseOverlay {
      0%, 100% { transform: scale(0.95); opacity: 0.8; }
      50% { transform: scale(1.05); opacity: 1; }
    }
    .overlay-content {
      width: 100%; display: none; flex-direction: column; align-items: center;
      background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke);
      border-radius: 24px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
      max-height: 85vh; overflow-y: auto;
    }
    .overlay-content.visible {
      display: flex; animation: fadeInUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1);
    }
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .overlay-close-btn {
      width: 100%; margin-top: 24px; display: none;
    }

    /* --- МИСТИЧЕСКОЕ РАЗДУМЬЕ ИИ --- */
    .mystic-thinking {
      font-size: 15px;
      font-style: italic;
      text-align: center;
      margin: 20px 0;
      color: var(--muted);
      animation: pulseThinking 2s ease-in-out infinite;
      text-shadow: 0 0 10px rgba(139, 92, 246, 0.6), 0 0 15px rgba(236, 72, 153, 0.4);
      
      /* НОВОЕ: Плавность схлопывания */
      max-height: 50px;
      opacity: 1;
      overflow: hidden;
      transition: all 0.5s ease;
    }

    /* НОВОЕ: Класс для красивого исчезновения */
    .mystic-thinking.fade-out {
      opacity: 0;
      max-height: 0;
      margin-top: 0;
      margin-bottom: 0;
      transform: scale(0.9);
    }

    @keyframes pulseThinking {
      0%, 100% { opacity: 0.5; filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.3)); transform: scale(0.98); }
      50% { opacity: 1; filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.7)); transform: scale(1); }
    }


        /* --- АНИМАЦИЯ ПЕЧАТИ (МАГИЧЕСКИЙ КУРСОР) --- */
    .mystic-cursor {
      display: inline-block;
      width: 8px;
      height: 16px;
      background: var(--gold);
      margin-left: 4px;
      vertical-align: text-bottom;
      animation: blinkCursor 0.8s infinite;
      border-radius: 2px;
      box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
    }

    @keyframes blinkCursor {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.2; }
}

        /* --- АСТРОЛОГИЯ И НУМЕРОЛОГИЯ (MYSTIC GATES UI) --- */
    .mystic-divider {
      border: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), transparent);
      margin: 16px 0 24px;
      opacity: 0.5;
    }

    .partner-divider {
      border: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.5), transparent);
      margin: 24px 0 16px;
    }

    .gate-icon {
      font-size: 64px;
      text-align: center;
      margin-bottom: 24px;
      filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.6));
      animation: floatIcon 4s ease-in-out infinite;
    }

    .astrology-icon {
      filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.6));
    }

    @keyframes floatIcon {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }

    .input-group {
      margin-bottom: 20px;
    }

    .input-group label {
      display: block;
      margin-bottom: 8px;
      font-weight: 500;
      letter-spacing: 0.3px;
    }

        /* --- ДОПОЛНЕНИЯ GLASSMORPHISM ДЛЯ ЭКРАНА ТАРО --- */

    /* Расширяем действие прозрачных панелей на экран Таро */
    #screen-tarot .glass-result-box,
    #screen-profile .glass-result-box {
      background: rgba(10, 14, 29, 0.5);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 24px;
      box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.01), 0 10px 30px rgba(0, 0, 0, 0.3);
      color: #e2e8f0;
      padding: 22px;
    }

    /* Расширяем действие стеклянных полей ввода */
    #screen-tarot .glass-input,
    #screen-profile .glass-input {
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid var(--stroke);
      border-radius: 18px;
      transition: all 0.3s ease;
    }

    #screen-tarot .glass-input:focus,
    #screen-profile .glass-input:focus {
      border-color: rgba(139, 92, 246, 0.6);
      background: rgba(0, 0, 0, 0.4);
      box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    }

    /* Магическое свечение для кнопок запуска раскладов */
    .glass-btn-glow {
      box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .glass-btn-glow:active {
      box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    }

        /* --- SCREEN HOME: GLASSMORPHISM & REDESIGN --- */

    /* Компактный Welcome-блок */
    .welcome-block {
      display: flex;
      flex-direction: column;
      gap: 16px;
      margin-bottom: 20px;
      padding: 20px 24px;
    }
    .welcome-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .welcome-title {
      font-size: 22px;
      font-weight: 800;
      margin: 0;
      background: linear-gradient(135deg, #ffffff, var(--muted));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      letter-spacing: -0.5px;
    }
    .welcome-balance {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(0, 0, 0, 0.4);
      padding: 8px 14px;
      border-radius: 999px;
      border: 1px solid rgba(251, 191, 36, 0.3);
      box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    }
    .star-icon { 
      font-size: 16px; 
      filter: drop-shadow(0 0 6px rgba(251,191,36,0.6)); 
    }
    .star-count { 
      font-weight: 800; 
      color: var(--gold); 
      font-size: 16px; 
    }
    .glass-btn-action {
      width: 100%;
      box-shadow: 0 8px 25px rgba(251, 191, 36, 0.2);
      font-size: 15px;
      letter-spacing: 0.3px;
    }

    /* Баннер Оракула */
    .oracle-banner {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 18px 20px;
      margin-bottom: 24px;
      background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(139, 92, 246, 0.08));
      border-left: 4px solid var(--violet);
      box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    .oracle-icon {
      font-size: 36px;
      filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
    }
    .oracle-content { flex: 1; }
    .oracle-title { 
      font-weight: 800; 
      margin-bottom: 4px; 
      font-size: 15px; 
      color: #fff;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .oracle-text { 
      font-size: 13px; 
      line-height: 1.5; 
      font-style: italic; 
    }

    /* Секция Карты Дня */
    .card-of-the-day-section {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 32px 20px;
      position: relative;
      overflow: visible;
    }
    .mystic-card-container {
      position: relative;
      margin: 24px 0;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    /* Анимированное свечение позади карты */
    .mystic-glow {
      position: absolute;
      width: 180px;
      height: 260px;
      background: radial-gradient(circle, rgba(139,92,246,0.6) 0%, rgba(236,72,153,0.3) 50%, transparent 70%);
      filter: blur(28px);
      animation: pulseMystic 4s ease-in-out infinite alternate;
      z-index: 0;
    }
    @keyframes pulseMystic {
      0% { transform: scale(0.85); opacity: 0.6; filter: hue-rotate(0deg) blur(25px); }
      100% { transform: scale(1.15); opacity: 1; filter: hue-rotate(45deg) blur(35px); }
    }

    /* Динамические свечения для мастей Таро */
    .mystic-glow.glow-cups { background: radial-gradient(circle, rgba(37, 99, 235, 0.6) 0%, rgba(56, 189, 248, 0.3) 50%, transparent 70%); }
    .mystic-glow.glow-wands { background: radial-gradient(circle, rgba(234, 88, 12, 0.6) 0%, rgba(250, 204, 21, 0.3) 50%, transparent 70%); }
    .mystic-glow.glow-swords { background: radial-gradient(circle, rgba(14, 165, 233, 0.6) 0%, rgba(148, 163, 184, 0.3) 50%, transparent 70%); }
    .mystic-glow.glow-pentacles { background: radial-gradient(circle, rgba(16, 185, 129, 0.6) 0%, rgba(251, 191, 36, 0.3) 50%, transparent 70%); }
    .mystic-glow.glow-major { background: radial-gradient(circle, rgba(139, 92, 246, 0.6) 0%, rgba(236, 72, 153, 0.3) 50%, transparent 70%); }

    /* Элегантный таймер обратного отсчета */
    .daily-timer {
      font-size: 13px;
      color: var(--muted);
      margin-top: 12px;
      font-family: 'Inter', monospace; /* Моноширинный шрифт для цифр смотрится аккуратнее */
      letter-spacing: 1px;
      opacity: 0.8;
      text-align: center;
      transition: opacity 0.3s ease;
    }

    /* Увеличенная карта */
    .large-reveal-card {
      width: 140px !important;
      min-width: 140px !important;
      height: 232px !important;
      min-height: 232px !important;
      z-index: 1;
      box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.2);
      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .large-reveal-card .reveal-card-back {
      font-size: 48px; /* Увеличиваем кристалл на рубашке */
    }
    .large-reveal-card:active {
      transform: scale(0.92);
    }

    /* Утилиты выравнивания для секции */
    .mb-2 { margin-bottom: 8px; }
    .mb-4 { margin-bottom: 16px; }
    .mt-4 { margin-top: 16px; }
    .text-center { text-align: center; }



    #screen-profile {
    padding-top: 10px;
    }

    /* --- Главный Аватар --- */
    .profile-premium-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 28px;
    }

    .profile-avatar-wrap {
      position: relative;
      width: 96px;
      height: 96px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--bg2), var(--bg));
      display: grid;
      place-items: center;
      font-size: 46px;
      margin-bottom: 16px;
      z-index: 1;
    }

    /* Внешнее магическое свечение (Glow Effect) */
    .profile-avatar-wrap::before {
      content: "";
      position: absolute;
      inset: -3px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--violet), var(--pink), var(--gold));
      z-index: -1;
      animation: spinGlow 5s linear infinite;
      box-shadow: 0 0 20px rgba(236, 72, 153, 0.3), 0 0 35px rgba(139, 92, 246, 0.3);
    }

    @keyframes spinGlow {
      0% { filter: hue-rotate(0deg); }
      100% { filter: hue-rotate(360deg); }
    }

    /* --- Контейнеры-карточки (Матовое стекло) --- */
    .glass-card, .glass-result-box {
      background: rgba(255, 255, 255, 0.03);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      /* Обновленный border и box-shadow */
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-top: 1px solid rgba(255, 255, 255, 0.15); /* Блик сверху */
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                  inset 0 1px 0 rgba(255, 255, 255, 0.1); /* Внутренний блик */
}

    /* --- Табы (Pill-shaped) --- */
    .glass-pill-tabs {
      display: flex;
      background: rgba(0, 0, 0, 0.3);
      border-radius: 999px;
      padding: 5px;
      border: 1px solid rgba(255, 255, 255, 0.04);
      margin-bottom: 24px;
      box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    }

    .glass-pill-tabs .glass-tab {
      flex: 1;
      text-align: center;
      padding: 12px 0;
      border-radius: 999px;
      font-size: 14px;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      border: none;
      background: transparent;
    }

    .glass-pill-tabs .glass-tab.active {
      background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(236, 72, 153, 0.4));
      color: #fff;
      box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
      border: 1px solid rgba(255, 255, 255, 0.15);
    }

    /* --- Сетка статистики --- */
    .glass-stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }

    .glass-stat-card {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--stroke);
      border-radius: 22px;
      padding: 18px 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      transition: transform 0.2s ease, border-color 0.2s ease;
    }

    .glass-stat-card:active {
      transform: scale(0.96);
      border-color: rgba(255,255,255,0.2);
    }

    .glass-stat-icon {
      font-size: 26px;
      margin-bottom: 8px;
      filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.2));
    }

    .glass-stat-val {
      font-size: 24px;
      font-weight: 800;
      color: #fff;
      margin-bottom: 2px;
      letter-spacing: -0.5px;
    }

    .glass-stat-label {
      font-size: 11px;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /* --- Переопределение базовых элементов для секции --- */
    #screen-profile .glass-result-box {
      background: rgba(10, 14, 29, 0.5);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 24px;
      box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.01), 0 10px 30px rgba(0, 0, 0, 0.3);
      color: #e2e8f0;
      padding: 22px;
    }

    #screen-profile .glass-input {
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid var(--stroke);
      border-radius: 18px;
      transition: all 0.3s ease;
    }

    #screen-profile .glass-input:focus {
      border-color: rgba(139, 92, 246, 0.6);
      background: rgba(0, 0, 0, 0.4);
      box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    }

    #screen-profile .feature-card {
      background: rgba(255, 255, 255, 0.03);
      backdrop-filter: blur(12px);
      border: 1px solid var(--stroke);
      border-radius: 22px;
    }

    .glass-btn-secondary {
      background: rgba(255, 255, 255, 0.04) !important;
      border: 1px solid var(--stroke) !important;
      backdrop-filter: blur(12px);
    }
    .glass-btn-secondary:active {
      background: rgba(255, 255, 255, 0.08) !important;
    }

      


    :root{
      --text:#f7f8fc;
      --muted:#b9c0da;
      --violet:#8b5cf6;
      --pink:#ec4899;
      --gold:#fbbf24;
      --green:#22c55e;
      --shadow:0 18px 42px rgba(0,0,0,.30);
      --radius:22px;
    }

    *{box-sizing:border-box}
    body {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      padding: 16px;
    }

    .app{max-width:620px;margin:0 auto;padding-bottom:100px}
    .screen{display:none}
    .screen.active{display:block}

    .header{
      display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px;
    }

    .brand{display:flex;align-items:center;gap:12px}
    .logo{
      width:48px;height:48px;border-radius:16px;display:grid;place-items:center;
      background:linear-gradient(135deg,var(--violet),var(--pink));
      box-shadow:var(--shadow);font-size:24px;
    }

    .title{font-size:21px;font-weight:800}
    .subtitle{font-size:13px;color:var(--muted);margin-top:2px}
    .badge{
      display:inline-flex;align-items:center;justify-content:center;
      padding:9px 14px;border-radius:999px;border:1px solid var(--stroke);
      background:rgba(255,255,255,.06);font-size:13px;color:var(--muted);
      white-space:nowrap;
    }

    .hero{
      border-radius:30px;padding:24px;margin-bottom:16px;
      background:
        linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.03)),
        radial-gradient(circle at top left, rgba(139,92,246,.28), transparent 32%);
      border:1px solid rgba(255,255,255,.10);
      box-shadow:var(--shadow);
    }

    .hero h1{margin:0 0 8px;font-size:28px;line-height:1.08}
    .hero p{margin:0;color:var(--muted);line-height:1.48}

    .card{
      background:var(--card);
      border:1px solid var(--stroke);
      border-radius:var(--radius);
      padding:18px;
      backdrop-filter: blur(18px);
      box-shadow:var(--shadow);
    }

    .grid{display:grid;gap:14px}
    .section-title{font-size:18px;font-weight:800;margin:0 0 12px}
    .muted{color:var(--muted)}
    .small{font-size:13px}
    .hidden{display:none!important}
    .spacer{height:12px}

    .stats{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:12px;
    }

    .stat{
      background:rgba(255,255,255,.05);
      border:1px solid var(--stroke);
      border-radius:18px;
      padding:16px;
    }

    .stat .v{font-size:24px;font-weight:800;margin-bottom:4px}
    .stat .l{font-size:12px;color:var(--muted)}

    .row{display:flex;gap:10px}
    .row > *{flex:1}

    .menu-grid{
      display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px;
    }

    .menu-btn, .feature-card{
      border:1px solid var(--stroke);
      background:rgba(255,255,255,.05);
      color:var(--text);
      border-radius:20px;
      padding:16px;
      cursor:pointer;
      transition:.2s ease;
    }


    .menu-btn .emoji{font-size:24px;display:block;margin-bottom:8px}
    .menu-btn .label{font-weight:700}
    .menu-btn .hint{display:block;font-size:12px;color:var(--muted);margin-top:4px}

    .btn{
      border:none;
      border-radius:18px;
      padding:14px 18px;
      color:#fff;
      font-weight:700;
      cursor:pointer;
      box-shadow:var(--shadow);
    }

    .btn-primary{background:linear-gradient(135deg,var(--violet),var(--pink))}
    .btn-gold{background:linear-gradient(135deg,#f59e0b,var(--gold));color:#1b1403}
    .btn-green{background:linear-gradient(135deg,#16a34a,var(--green))}
    .btn-secondary{
      background:rgba(255,255,255,.08);
      border:1px solid var(--stroke);
      box-shadow:none;
    }

    .input, .textarea, .select{
      width:100%;
      background:rgba(255,255,255,.06);
      border:1px solid var(--stroke);
      border-radius:16px;
      color:var(--text);
      padding:14px 16px;
      font-size:15px;
      outline:none;
    }

    .textarea{min-height:120px;resize:vertical;line-height:1.6}

    .result-box{
      background:rgba(10,14,29,.64);
      border:1px solid rgba(255,255,255,.08);
      border-radius:20px;
      padding:18px;
      line-height:1.65;
      white-space:pre-wrap;
    }

    .feature-list{display:grid;gap:10px}
    .feature-card{
      display:flex;align-items:center;justify-content:space-between;gap:10px;
    }

    .feature-meta{display:flex;flex-direction:column;gap:3px}
    .feature-title{font-weight:700}
    .feature-hint{font-size:12px;color:var(--muted)}
    .feature-price{font-weight:800;white-space:nowrap}

    .chips{display:flex;flex-wrap:wrap;gap:10px}
    .chip{
      padding:10px 14px;border-radius:999px;border:1px solid var(--stroke);
      background:rgba(255,255,255,.05);cursor:pointer;transition:.2s ease;
      user-select:none;font-size:14px;
    }
    .chip.active{
      background:linear-gradient(135deg, rgba(139,92,246,.38), rgba(236,72,153,.20));
      border-color:rgba(255,255,255,.18);
    }

    .avatar-grid{
      display:grid;
      grid-template-columns:repeat(4,1fr);
      gap:10px;
    }

    .avatar-item{
      padding:14px;border-radius:18px;border:1px solid var(--stroke);
      background:rgba(255,255,255,.05);text-align:center;cursor:pointer;
    }

    .avatar-item.active{
      background:linear-gradient(135deg, rgba(139,92,246,.34), rgba(251,191,36,.16));
      border-color:rgba(255,255,255,.18);
    }

    .avatar-emoji{font-size:28px;display:block;margin-bottom:8px}
    .loading{opacity:.75;font-style:italic}

    .tarot-table{
      display:flex;justify-content:center;gap:14px;margin-top:8px;
    }

    .tarot-card{
      width:88px;height:136px;border-radius:16px;position:relative;cursor:pointer;
      transform-style:preserve-3d;transition:transform .65s ease;
      background:linear-gradient(135deg,#1b2142,#101425);
      border:1px solid rgba(255,255,255,.10);
      box-shadow:var(--shadow);
    }

    .tarot-card::before{
      content:"✦";
      position:absolute;inset:0;display:grid;place-items:center;
      font-size:22px;color:var(--gold);
      backface-visibility:hidden;
    }

    .tarot-card::after{
      content:"🔮";
      position:absolute;inset:0;display:grid;place-items:center;
      font-size:26px;background:linear-gradient(135deg,#2a1140,#251942);
      border-radius:16px;transform:rotateY(180deg);
      backface-visibility:hidden;
    }

    .tarot-card.flipped{transform:rotateY(180deg)}

    .sponsor-box{
      border:1px dashed rgba(251,191,36,.35);
      background:rgba(251,191,36,.08);
      border-radius:18px;padding:14px;
    }

    /* --- МАГИЧЕСКОЕ ПРОЯВЛЕНИЕ КАРТ (100% ЗАЩИТА ОТ БАГОВ) --- */
.reveal-card {
  width: 76px;
  min-width: 76px;
  height: 126px;
  min-height: 126px;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 12px;
  flex-shrink: 0;
  transform: translateZ(0); 
  line-height: 1;
}

.reveal-card-face {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: opacity 0.4s ease;
  overflow: hidden; 
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Рубашка */
.reveal-card-back {
  background: linear-gradient(135deg, #1b2142, #101425);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 2;
}

/* Лицевая сторона (Картинка) */
.reveal-card-front {
  z-index: 1;
  opacity: 0;
  background: #0d0f1d;
}

.reveal-card-front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Анимация при клике */
.reveal-card.flipped .reveal-card-back {
  opacity: 0;
  pointer-events: none;
}
.reveal-card.flipped .reveal-card-front {
  opacity: 1;
}

/* --- КРАСИВОЕ ОКНО БОНУСОВ --- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s ease;
    padding: 20px;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.bonus-modal {
    background: var(--bg2); border: 1px solid var(--stroke);
    border-radius: var(--radius); padding: 24px; width: 100%;
    max-width: 340px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: translateY(30px) scale(0.95); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .bonus-modal { transform: translateY(0) scale(1); }

.bonus-icon { font-size: 64px; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.bonus-title { 
    font-size: 24px; font-weight: 800; margin-bottom: 6px; 
    background: linear-gradient(135deg, #f59e0b, #fef08a); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}
.bonus-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; line-height: 1.4; }

.streak-grid { display: flex; gap: 6px; justify-content: space-between; margin-bottom: 24px; }
.streak-day {
    flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--stroke);
    border-radius: 10px; padding: 10px 0; font-size: 11px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px; transition: 0.3s;
}
.streak-day .d-val { font-weight: 800; font-size: 13px; }

.streak-day.past { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); color: #fff; }
.streak-day.past .d-val { color: var(--green); }

.streak-day.active { 
    background: linear-gradient(135deg, rgba(139,92,246,0.4), rgba(251,191,36,0.2)); 
    border-color: var(--gold); color: #fff; transform: scale(1.15); 
    box-shadow: 0 0 15px rgba(251,191,36,0.3); z-index: 2;
}
.streak-day.active .d-val { color: var(--gold); }


/* ========================================================= */
/* PREMIUM ARTIFACT: ЭЗОТЕРИЧЕСКИЙ СИНТЕЗ (ОБНОВЛЕННЫЙ)      */
/* ========================================================= */

/* Плавное всплытие при загрузке */
.synthesis-entrance {
  animation: floatUpArtifact 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

@keyframes floatUpArtifact {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Базовый стиль: чистое стекло и легкий аметистовый оттенок */
.premium-artifact {
  position: relative;
  cursor: pointer;
  margin: 0 0 16px 0; /* <-- ИЗМЕНЕНО: убрали верхний отступ, оставили только нижний 16px */
  padding: 20px;
  border-radius: 24px;
  overflow: hidden;
  
  /* Полупрозрачный фон вместо глухого черного */
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.5), rgba(50, 25, 60, 0.5));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  
  /* Элегантные грани стекла */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15); 
  
  /* Мягкое дыхание */
  animation: artifactBreatheLight 4s ease-in-out infinite alternate;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Дыхание без грязных теней. Только мягкий свет. */
@keyframes artifactBreatheLight {
  0% { 
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.2), /* Легкая тень для объема */
      inset 0 0 15px rgba(139, 92, 246, 0.05); 
  }
  100% { 
    box-shadow: 
      0 15px 35px rgba(0, 0, 0, 0.3),
      0 0 25px rgba(139, 92, 246, 0.15), /* Нежное внешнее фиолетовое свечение */
      inset 0 0 25px rgba(251, 191, 36, 0.08); /* Теплое золото внутри */
  }
}

/* Тонкая статичная золотая рамка по краям (без агрессивных вспышек) */
.premium-artifact::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.5), transparent 40%, transparent 60%, rgba(139, 92, 246, 0.4));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.8;
  pointer-events: none;
  z-index: 5;
}

/* Легкая аура-подсветка на фоне (за текстом) */
.artifact-aura {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.08) 0%, transparent 40%);
  z-index: 0;
  pointer-events: none;
}

/* Состояние при клике (упругое сжатие) */
.premium-artifact:active {
  transform: scale(0.96);
  box-shadow: 
    inset 0 0 30px rgba(251, 191, 36, 0.15), 
    0 5px 15px rgba(0, 0, 0, 0.4);
  border-color: rgba(251, 191, 36, 0.3);
}

/* --- Типографика и Иконка --- */

.artifact-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.artifact-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 800;
  /* Чистый белый с золотым отливом внизу */
  background: linear-gradient(to bottom, #ffffff 40%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.artifact-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7); /* Читабельный светло-серый вместо ядовитого фиолетового */
  line-height: 1.4;
}

.artifact-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ценник: аккуратный и не кричащий */
.artifact-price {
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 12px;
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Волшебный Ripple при клике (оставляем, но делаем прозрачнее) */
.mystic-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, rgba(139, 92, 246, 0.2) 40%, transparent 70%);
  transform: scale(0);
  animation: mysticRippleAnim 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
@keyframes mysticRippleAnim {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(3.5); opacity: 0; }
}


/* Контейнер трекера */
.zen-stepper-box {
  background: rgba(10, 14, 29, 0.4);
  border-radius: 20px;
  padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 15px rgba(0,0,0,0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

/* Изменяющийся текст состояния */
.zen-stepper-label {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

/* Дорожка */
.zen-stepper-track {
  position: relative;
  display: flex;
  height: 30px;
}

/* Тонкая линия связи */
.zen-track-line {
  position: absolute;
  top: 50%; left: 10%; right: 10%;
  height: 2px;
  background: rgba(255,255,255,0.08);
  transform: translateY(-50%);
  z-index: 0;
  border-radius: 2px;
}

/* Точки касания */
.zen-step {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Маленькие кристаллики (точки) */
.zen-step::after {
  content: '';
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transition: transform 0.3s ease, background 0.3s ease;
}

.zen-step:active::after {
  transform: scale(1.5);
  background: rgba(255,255,255,0.8);
}

/* Скользящее светящееся кольцо */
.zen-stepper-aura {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  /* Анимация левитации и скольжения (очень легкая для телефона) */
  transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
              border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
  transform: translate(-50%, -50%);
}

.zen-stepper-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 10px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  letter-spacing: 1px;
}

/* ========================================================= */
/* ТЕРАПИЯ: ФАЗА 1 (DARK ZEN + ETHEREAL GLASS)               */
/* ========================================================= */

.therapy-actions-grid {
  display: grid;
  gap: 16px;
}

.therapy-action-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.01), 0 8px 20px rgba(0, 0, 0, 0.2);
}

.therapy-action-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.06);
}

.therapy-btn-icon {
  font-size: 32px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.therapy-btn-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.therapy-btn-text .title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.therapy-btn-text .subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* --- SOS РЕЖИМ: КВАДРАТНОЕ ДЫХАНИЕ --- */
.sos-container {
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.breath-sphere-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0 40px 0;
}

.breath-sphere {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15); /* Приглушенный изумрудный Dark Zen */
  border: 2px solid rgba(16, 185, 129, 0.4);
  box-shadow: 
    0 0 40px rgba(16, 185, 129, 0.3), 
    inset 0 0 30px rgba(16, 185, 129, 0.2);
  /* Анимация: 16 секунд (вдох 4с, задержка 4с, выдох 4с, задержка 4с) */
  animation: boxBreathe 16s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.breath-text {
  position: relative;
  z-index: 2;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

@keyframes boxBreathe {
  0%   { transform: scale(1);   opacity: 0.7; }
  25%  { transform: scale(2.2); opacity: 1;   } /* Конец вдоха */
  50%  { transform: scale(2.2); opacity: 1;   } /* Конец 1-й задержки */
  75%  { transform: scale(1);   opacity: 0.7; } /* Конец выдоха */
  100% { transform: scale(1);   opacity: 0.7; } /* Конец 2-й задержки */
}


/* --- МАК-СЕССИЯ: ВЫБОР КАРТЫ --- */
.mac-card-wrap {
  border-radius: 12px;
  padding: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mac-card-wrap.active {
  background: rgba(139, 92, 246, 0.15); /* Мягкий фиолетовый/синий оттенок */
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: inset 0 0 15px rgba(139, 92, 246, 0.1), 0 8px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-5px);
}

/* ========================================================= */
/* ТЕРАПИЯ: СОЗВЕЗДИЕ СОСТОЯНИЙ (CONSTELLATION OF STATES)    */
/* ========================================================= */

.therapy-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 800;
  margin: 32px 0 16px 0;
  background: linear-gradient(135deg, #ffffff, var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Контейнер ночного неба */
.constellation-box {
  position: relative;
  width: 100%;
  height: 260px;
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.8) 0%, rgba(13, 16, 28, 0.6) 100%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 15px 35px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  overflow: hidden;
  margin-bottom: 24px;
}

/* Эффект туманности на фоне созвездия */
.constellation-box::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Базовая звезда */
.star-point {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-point:active {
  transform: translate(-50%, -50%) scale(1.8);
  z-index: 100;
}

/* Уровень 1: Маленькая, тусклая (Кризис) */
.star-level-1 {
  width: 4px;
  height: 4px;
  background: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.3);
  animation: twinkleDim 3s infinite alternate;
}

/* Уровень 2: Чуть больше, фиолетовая */
.star-level-2 {
  width: 6px;
  height: 6px;
  background: rgba(139, 92, 246, 0.8);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
  animation: twinkleDim 4s infinite alternate-reverse;
}

/* Уровень 3: Средняя, нейтральная белая/серебряная */
.star-level-3 {
  width: 8px;
  height: 8px;
  background: #e2e8f0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: twinkleNormal 3.5s infinite alternate;
}

/* Уровень 4: Крупнее, теплое свечение */
.star-level-4 {
  width: 10px;
  height: 10px;
  background: rgba(251, 191, 36, 0.8);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
  animation: twinkleNormal 2.5s infinite alternate-reverse;
}

/* Уровень 5: Крупная, золотая, пульсирующая (Максимум ресурса) */
.star-level-5 {
  width: 14px;
  height: 14px;
  background: var(--gold);
  box-shadow: 0 0 15px var(--gold), inset 0 0 4px #ffffff;
  animation: pulseGoldStar 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* Анимации мерцания */
@keyframes twinkleDim {
  0% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 10px var(--violet); }
}

@keyframes twinkleNormal {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); }
}

@keyframes pulseGoldStar {
  0% { 
    box-shadow: 0 0 10px var(--gold), 0 0 20px rgba(251, 191, 36, 0.3); 
    transform: translate(-50%, -50%) scale(0.95); 
  }
  100% { 
    box-shadow: 0 0 25px var(--gold), 0 0 45px rgba(251, 191, 36, 0.7); 
    transform: translate(-50%, -50%) scale(1.2); 
  }
}

/* Всплывающая подсказка над звездой */
.star-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(10, 14, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  z-index: 10;
}

.star-point:active .star-tooltip,
.star-point:hover .star-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.star-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.1) transparent transparent transparent;
}

.star-tooltip .tt-date {
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.star-tooltip .tt-note {
  color: var(--gold);
  font-weight: 700;
  white-space: normal;
  max-width: 150px;
  line-height: 1.3;
}

.constellation-empty {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  width: 80%;
  line-height: 1.5;
  font-style: italic;
  opacity: 0.6;
}

/* ========================================================= */
/* ОБНОВЛЕННОЕ СОЗВЕЗДИЕ (SVG ГРАФИК)                        */
/* ========================================================= */

/* Слой для SVG линии, который лежит под звездами */
.constellation-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Сама линия графика */
.graph-path {
  fill: none;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.7));
  
  /* Эффект плавной отрисовки линии при загрузке */
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawGraph 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes drawGraph {
  to { stroke-dashoffset: 0; }
}

/* Подписи дат под звездами */
.star-date-label {
  position: absolute;
  transform: translate(-50%, 14px); /* Смещение вниз от центра звезды */
  font-size: 10px;
  font-family: 'Inter', monospace;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.5px;
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Подсветка даты при активной звезде */
.star-point.active-star + .star-date-label {
  color: var(--gold);
  opacity: 1;
  font-weight: 700;
  transform: translate(-50%, 16px) scale(1.1);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}
/* --- THERAPY CHAT BUBBLES --- */
.therapy-chat-msg {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 20px;
  line-height: 1.5;
  font-size: 14px;
}

/* Сообщение от ИИ (слева, фиолетовый акцент) */
.therapy-chat-ai {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-bottom-left-radius: 4px; /* Делает визуальный хвостик */
}
.therapy-chat-ai b { 
  color: #a78bfa; 
  display: inline-block; 
  margin-bottom: 4px; 
}

/* Сообщение от Юзера (справа, нейтральное стекло) */
.therapy-chat-user {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-right-radius: 4px; /* Делает визуальный хвостик */
  text-align: right;
}
.therapy-chat-user b { 
  color: #cbd5e1; 
  display: inline-block; 
  margin-bottom: 4px; 
}

/* ========================================= */
/* SOS-ПРОТОКОЛ: ИНТЕРАКТИВНОЕ ЗАЗЕМЛЕНИЕ И ДЫХАНИЕ */
/* ========================================= */

body.sos-active .bottom-nav,
body.sos-active .header {
  display: none !important;
}

body.sos-active {
  background: radial-gradient(circle at center, #0d1224 0%, #05070d 100%) !important;
  transition: background 1s ease;
}

/* Красный фон для экстренного сброса */
body.sos-active.sos-emergency {
  background: radial-gradient(circle at center, #2e0c10 0%, #0d0505 100%) !important;
}

.sos-grounding-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh; 
  padding: 10px;
}

.sos-instruction {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 50px;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- Неоновая орбита (Кольцо прогресса) --- */
.sos-progress-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sos-progress-ring {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.sos-progress-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 4;
}

.sos-progress-circle-fill {
  fill: none;
  stroke: #10b981; 
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 716;
  stroke-dashoffset: 716;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.6));
}

/* Огромная кнопка-якорь с дыханием */
.sos-anchor-btn {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
  position: relative;
  overflow: hidden;
  z-index: 2;
  animation: anchorBreathe 4s infinite alternate ease-in-out;
}

@keyframes anchorBreathe {
  0% { box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 20px rgba(16, 185, 129, 0.05); border-color: rgba(255, 255, 255, 0.05); }
  100% { box-shadow: 0 15px 50px rgba(16, 185, 129, 0.2), inset 0 0 40px rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); }
}

.sos-anchor-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.08);
}

.sos-counter-text {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  z-index: 2;
}

.sos-counter-sub {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
  z-index: 2;
}

/* Расходящаяся волна при клике */
.sos-ripple {
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  background: rgba(16, 185, 129, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: sosRippleAnim 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes sosRippleAnim {
  to { transform: translate(-50%, -50%) scale(15); opacity: 0; }
}

/* --- Сфера Дыхания --- */
.sos-breath-sphere {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  border: 2px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3), inset 0 0 30px rgba(139, 92, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: boxBreathe 16s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 40px 0;
}

.sos-breath-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  /* Отменяем скейлинг сферы для текста, чтобы он оставался читаемым */
  animation: counterScaleBreathe 16s cubic-bezier(0.4, 0, 0.2, 1) infinite; 
}

/* Сфера дышит */
@keyframes boxBreathe {
  0%   { transform: scale(1);   opacity: 0.7; }
  25%  { transform: scale(2.2); opacity: 1;   } /* Вдох 4с */
  50%  { transform: scale(2.2); opacity: 1;   } /* Задержка 4с */
  75%  { transform: scale(1);   opacity: 0.7; } /* Выдох 4с */
  100% { transform: scale(1);   opacity: 0.7; } /* Задержка 4с */
}

/* Текст компенсирует скейлинг сферы */
@keyframes counterScaleBreathe {
  0%   { transform: scale(1); }
  25%  { transform: scale(0.45); } 
  50%  { transform: scale(0.45); } 
  75%  { transform: scale(1); }
  100% { transform: scale(1); }
}

/* Кнопка эскалации */
.sos-escalate-btn {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 13px !important;
  text-decoration: underline;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  margin-top: 30px;
}
/* --- Анимация катарсиса (Пустой стул) --- */
.dissolve-out {
  opacity: 0 !important;
  filter: blur(12px) !important;
  transform: scale(0.98);
  transition: all 1.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.catharsis-message {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 1.5s ease;
  line-height: 1.4;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.catharsis-message.visible {
  opacity: 1;
  transform: translateY(0);
}
/* --- СВЕЧЕНИЕ ТЕРАПЕВТИЧЕСКОГО СТРИКА --- */
.btn-mystic-streak {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(139, 92, 246, 0.2)) !important;
  border: 1px solid rgba(251, 191, 36, 0.5) !important;
  color: #fde68a !important; /* Светло-золотой текст */
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4), inset 0 0 15px rgba(139, 92, 246, 0.3) !important;
  animation: pulseMysticStreak 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate !important;
}

@keyframes pulseMysticStreak {
  0% { 
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2), inset 0 0 10px rgba(139, 92, 246, 0.2); 
    border-color: rgba(251, 191, 36, 0.3);
  }
  100% { 
    box-shadow: 0 0 35px rgba(251, 191, 36, 0.6), inset 0 0 25px rgba(139, 92, 246, 0.5); 
    border-color: rgba(251, 191, 36, 0.7);
  }
}