    
html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: var(--tg-viewport-height, 100vh); /* Динамическая высота для Telegram */
  overflow: hidden; /* Прокрутка только внутри .app */
  position: relative;
  
  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%);
  
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overscroll-behavior-y: none; /* Убиваем системную резинку */
  user-select: none;
  -webkit-user-select: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  height: 100%; 
  padding-bottom: 100px;
  overflow-y: auto; 
  -webkit-overflow-scrolling: touch; 
  overscroll-behavior-y: none; /* Убиваем резинку в приложении */
  contain: content; /* Изолирует перерисовки внутри этого блока */
  will-change: scroll-position;
}

    input, textarea {
      user-select: auto; /* Разрешаем выделение и работу с кареткой в полях ввода */
      -webkit-user-select: auto;
    }


    :root {
      --bg: #080a12; /* Глубокий темный, почти черный с оттенком синего */
      --bg2: #0d101c;
      --card: rgba(255, 255, 255, 0.02);
      --stroke: rgba(255, 255, 255, 0.04); /* Максимально деликатные рамки */
    }



    body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  /* Заменяем 6 тяжелых градиентов на один аккуратный паттерн */
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 20px 20px; /* Настрой размер под себя */
  
  /* Включаем GPU-ускорение, чтобы фон не перерисовывался при скролле */
  transform: translateZ(0);
  will-change: transform;
}

    @keyframes stardustDrift {
      0% { transform: translateY(0); }
      100% { transform: translateY(-350px); } /* Плавное движение вверх */
    }

    /* --- 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); /* Карта чуть светлеет при нажатии */
    }

    .bottom-nav {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      max-width: 620px;
      margin: auto;
      /* Увеличиваем непрозрачность фона, чтобы компенсировать меньший блюр */
      background: rgba(8, 10, 18, 0.95); 
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      
      /* GPU-ускорение для фиксированного меню */
      -webkit-transform: translateZ(0);
      transform: translateZ(0);
      
      border: none;
      border-top: 1px solid rgba(255, 255, 255, 0.04);
      border-radius: 24px 24px 0 0; 
      padding: 12px 10px 24px; 
      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;
    }


    .mystic-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(10, 14, 29, 0.92); /* Делаем чуть темнее */
      -webkit-transform: translateZ(0);
      transform: translateZ(0);
      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;
      text-shadow: 0 0 25px rgba(139, 92, 246, 0.8);
      will-change: transform;
    }

    .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; transform: scale(0.98); }
      50% { opacity: 1; 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;
    }

    .astrology-icon {
      text-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;
    }


    /* ========================================================= */
    /* 🌟 ЕДИНАЯ ОПТИМИЗИРОВАННАЯ СИСТЕМА КАРТОЧЕК И ИНПУТОВ     */
    /* ========================================================= */

    /* Единый плотный стиль всех карточек и панелей с результатами (без тормозящего blur) */
    .glass-card, 
    .glass-result-box {
      background: rgba(15, 18, 30, 0.95);
      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); 
      border-radius: 24px;
      color: #e2e8f0;
    }

    /* Отступы для блоков с результатами */
    .glass-result-box {
      padding: 22px;
    }

    /* Единый стиль всех полей ввода во всем приложении */
    .glass-input {
      width: 100%;
      padding: 14px 16px;
      font-size: 15px;
      font-family: inherit;
      color: #fff;
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid var(--stroke);
      border-radius: 16px;
      transition: all 0.3s ease;
      outline: none;
      box-sizing: border-box;
      color-scheme: dark;
    }

    .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);
    }



  

    /* Компактный 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;
      /* Расширяем прозрачную зону, чтобы обойтись без blur */
      background: radial-gradient(circle, rgba(139,92,246,0.5) 0%, rgba(236,72,153,0.2) 40%, transparent 80%);
      animation: pulseMystic 4s ease-in-out infinite alternate;
      z-index: 0;
      will-change: transform, opacity;
    }

    /* Динамические свечения для мастей (нативные мягкие края) */
    .mystic-glow.glow-cups { background: radial-gradient(circle, rgba(37, 99, 235, 0.5) 0%, rgba(56, 189, 248, 0.2) 40%, transparent 80%); }
    .mystic-glow.glow-wands { background: radial-gradient(circle, rgba(234, 88, 12, 0.5) 0%, rgba(250, 204, 21, 0.2) 40%, transparent 80%); }
    .mystic-glow.glow-swords { background: radial-gradient(circle, rgba(14, 165, 233, 0.5) 0%, rgba(148, 163, 184, 0.2) 40%, transparent 80%); }
    .mystic-glow.glow-pentacles { background: radial-gradient(circle, rgba(16, 185, 129, 0.5) 0%, rgba(251, 191, 36, 0.2) 40%, transparent 80%); }
    .mystic-glow.glow-major { background: radial-gradient(circle, rgba(139, 92, 246, 0.5) 0%, rgba(236, 72, 153, 0.2) 40%, transparent 80%); }

    /* Элегантный таймер обратного отсчета */
    .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); }
    }


    /* --- Табы (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(20, 24, 38, 0.95); /* Плотный темный фон */
      border: 1px solid var(--stroke);
      border-radius: 22px;
      padding: 18px 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      /* УДАЛИЛИ backdrop-filter */
      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.95);
      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 .feature-card {
      background: rgba(255, 255, 255, 0.03);
      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;
      border-radius: 18px;
    }
    .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;
      -webkit-tap-highlight-color: transparent; /* Убиваем системную подсветку клика везде */
    }

    .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: rgba(20, 24, 38, 0.95); /* Делаем фон плотным, чтобы скрыть отсутствие блюра */
      border:1px solid var(--stroke);
      border-radius:var(--radius);
      padding:18px;
      box-shadow:var(--shadow);
      /* backdrop-filter: blur(18px); - БЕЗЖАЛОСТНО УДАЛЯЕМ */
    }

    .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;
    }


.textarea{
  min-height:120px;
  resize:vertical;
  line-height:1.6;
  width: 100%; 
  box-sizing: border-box;
}
    .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-style: preserve-3d; /* Спасает 3D-анимацию переворота */
  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;
  padding: 20px;
  border-radius: 24px;
  overflow: hidden;
  
  /* Делаем фон темнее и убираем блюр */
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.95), rgba(50, 25, 60, 0.95));
  /* УДАЛИЛИ backdrop-filter */
  
  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% { filter: brightness(1); }
  100% { filter: brightness(1.2); }
}

/* Тонкая статичная золотая рамка по краям (без агрессивных вспышек) */
.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; }
}


/* ==========================================================================
   ONBOARDING: BASE & LAYOUT
   ========================================================================== */

#onboarding-overlay.mystic-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(8, 10, 18, 0.98); /* Глухой цвет */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#onboarding-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Контейнер: Используем CSS Grid для идеального наложения шагов */
.onboarding-container {
  width: 100%;
  max-width: 380px;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  
  /* Ethereal Glass Style */
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   ONBOARDING: STEPS TRANSITIONS
   ========================================================================== */

.onboarding-step {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  
  /* Аппаратное ускорение анимаций */
  will-change: transform, opacity;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              visibility 0.5s;
}

.step-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
}

.step-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  z-index: 2;
}

/* ==========================================================================
   ONBOARDING: UI COMPONENTS (GLASS & DARK ZEN)
   ========================================================================== */

/* Иконки и заголовки */
.gate-icon {
  font-size: 64px; text-align: center; margin-bottom: 24px;
  text-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
  animation: floatIcon 4s ease-in-out infinite;
  will-change: transform;
}
/* Поле ввода */
.onboarding-container .glass-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  color: #fff;
  transition: all 0.3s ease;
  outline: none;
}

.onboarding-container .glass-input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* Карточки намерений (Шаг 2) */
.intent-cards-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

.glass-selectable-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.glass-selectable-card.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: scale(1.02);
}

.glass-selectable-card .card-icon { font-size: 24px; }
.glass-selectable-card .card-label { font-size: 15px; font-weight: 500; }

/* Символы резонанса (Шаг 3) */
.symbols-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.symbol-btn {
  font-size: 32px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: grayscale(100%) opacity(0.5);
}

.symbol-btn.active {
  filter: grayscale(0%) opacity(1);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.2);
  transform: scale(1.15);
}

#onboarding-pet-container {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

/* ==========================================================================
   ONBOARDING: 3D CARD FLIP (STEP 4)
   ========================================================================== */

.gift-scene {
  perspective: 1000px;
  width: 140px;
  height: 220px;
  margin: 0 auto;
}

.gift-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Класс, который мы добавим через JS по клику */
.gift-card.flipped {
  transform: rotateY(180deg);
}

.gift-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.gift-card-front {
  background: linear-gradient(135deg, #1b2142, #101425);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mystic-symbol {
  font-size: 42px;
  color: var(--gold, #fbbf24);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
  animation: pulseMystic 2s infinite alternate;
}

.gift-card-back {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.4);
  transform: rotateY(180deg);
  box-shadow: inset 0 0 30px rgba(251, 191, 36, 0.1);
}

.gift-amount {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.gift-label {
  font-size: 12px;
  color: var(--gold, #fbbf24);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* Утилиты */
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 24px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }

/* ==========================================================================
   ИНТЕРФЕЙС ЧАТА С ФАМИЛЬЯРОМ (DARK ZEN & GLASSMORPHISM)
   ========================================================================== */

/* Кнопка "Поговорить" с легким фиолетовым свечением и полутоном */
.pet-talk-accent-btn {
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    background: rgba(139, 92, 246, 0.05) !important;
    transition: all 0.3s ease;
}
.pet-talk-accent-btn:hover {
    background: rgba(139, 92, 246, 0.12) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4) !important;
}

/* Кнопка "Назад" внутри чата */
.pet-chat-header-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}
.pet-chat-back-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.pet-chat-back-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

/* Зона истории сообщений */
#pet-chat-history {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

/* Кастомный скроллбар для чата в стиле Dark Zen */
#pet-chat-history::-webkit-scrollbar {
    width: 4px;
}
#pet-chat-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
}
#pet-chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
#pet-chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* Органы управления внизу чата */
.pet-chat-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

/* Текстовое поле */
#pet-chat-input {
    width: 100%;
    min-height: 50px;
    max-height: 80px;
    resize: none;
    padding: 10px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    color: #f3f4f6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
#pet-chat-input:focus {
    border-color: rgba(139, 92, 246, 0.4);
    outline: none;
}

/* Кнопка Завершить (Золотая/Медная тема в стиле Dark Zen) */
.btn-gold {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(180, 83, 9, 0.2));
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #fef3c7 !important;
    transition: all 0.3s ease;
}
.btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.35), rgba(180, 83, 9, 0.35));
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6) !important;
}

/* Анимации появления */
.pet-chat-fade-in {
    animation: chatZoneAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes chatZoneAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes msgEmit {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
/* ==========================================================================
   FAMILIAR MODAL: DARK ZEN & ETHEREAL GLASS (CLEAN VERSION)
   ========================================================================== */

/* Обновленный контейнер модалки */
.pet-modal-glass {
  padding: 32px 24px !important;
  max-width: 360px !important;
  background: rgba(10, 12, 22, 0.98) !important;
  -webkit-background: rgba(10, 12, 22, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  border-radius: 36px !important;
  overflow: visible !important;
}

/* --- Главная сцена (Только Сфера по центру) --- */
.pet-scene-container {
  display: flex;
  align-items: center;
  justify-content: center; /* Центрируем жестко */
  margin-bottom: 32px;
  position: relative;
}

/* --- ОБНОВЛЕННЫЕ РАЗМЕРЫ ФАМИЛЬЯРА --- */
.pet-incubator {
  position: relative;
  width: 300px;  /* Максимальная ширина под модалку */
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatSphere 6s ease-in-out infinite;
}

/* Волшебное свойство: искусственно приближаем зайчика, съедая пустые края Lottie-файла */
#pet-animation-container {
  width: 100%;
  height: 100%;
  transform: scale(0.8); /* Уменьшили с 1.4 до 1.15, чтобы он стал компактнее */
  transform-origin: center bottom; /* Оставляем привязку к полу */
}

/* Растягиваем внутреннюю обертку */
.pet-sphere-glass {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes floatSphere {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Тень под новый масштаб */
.pet-pedestal-glow {
  position: absolute;
  bottom: -20px;
  width: 240px; 
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.6) 0%, rgba(139, 92, 246, 0) 70%);
  opacity: 0.8;
  animation: breathePedestalGPU 6s ease-in-out infinite;
  z-index: 0;
  will-change: transform, opacity;
}

@keyframes breathePedestalGPU {
  0%, 100% { transform: scaleX(0.9); opacity: 0.5; }
  50% { transform: scaleX(1.2); opacity: 0.9; }
}



/* --- Состояние блокировки --- */
.pet-locked-glass {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 18, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 50%;
  transition: opacity 0.5s ease; /* ДОБАВЛЕНА ПЛАВНОСТЬ */
}

/* ДОБАВЛЕНО: Переопределяем жесткий display: none */
.pet-locked-glass.hidden {
  opacity: 0;
  pointer-events: none;
  display: flex !important; 
}

.pet-lock-icon {
  color: var(--muted);
  margin-bottom: 8px;
  opacity: 0.7;
}

.pet-locked-text {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
}

.pet-cutscene-glass {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 22, 0.95); /* Почти черный */
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: opacity 0.5s ease;
}

.pet-cutscene-anim {
  width: 140px;
  height: 140px;
}

.pet-cutscene-action {
  font-size: 11px;
  padding: 8px 16px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  z-index: 100;
  border-radius: 14px;
}

/* --- Полоска энергии (Neon Glass) --- */
.pet-energy-wrapper {
  margin-bottom: 24px;
}

.pet-energy-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 8px;
  padding: 0 4px;
}

.pet-energy-value {
  color: var(--gold);
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.glass-energy-track {
  width: 100%;
  height: 6px; /* Сделал чуть тоньше для элегантности */
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.neon-energy-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #fbbf24);
  background-size: 200% 100%;
  border-radius: 8px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
  animation: gradientFlow 3s infinite linear;
}

@keyframes gradientFlow {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}




.pet-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important; /* Было 1fr 1fr. Теперь 3 одинаковые колонки */
  gap: 12px;
  width: 100%;
}

.pet-action-btn {
  background: rgba(30, 35, 55, 0.6); 
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px; 
  padding: 16px 8px;
  color: #e2e8f0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  
  /* Идеальное центрирование текста и иконки */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center; 
  
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- 3. СТИЛИ ДЛЯ СООБЩЕНИЯ (Ethereal Glass) --- */
.pet-speech-bubble {
  position: absolute;
  /* Выставляем справа от питомца */
  right: -30px;
  top: 10px;
  max-width: 140px;
  
  background: rgba(30, 20, 50, 0.95);
  -webkit-background: rgba(30, 20, 50, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3), inset 0 0 15px rgba(139, 92, 246, 0.15);
  
  border-radius: 16px;
  border-bottom-left-radius: 4px; /* Хвостик направлен к питомцу */
  padding: 12px 14px;
  
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  z-index: 100;
  
  /* Анимация появления */
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.pet-speech-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Адаптив для узких экранов, чтобы текст не уезжал */
@media (max-width: 360px) {
  .pet-speech-bubble {
    right: -10px;
    max-width: 120px;
  }
}

/* Пульсирующая магическая кнопка Контакта */
.btn-pulse-magic {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(236, 72, 153, 0.05));
  border-color: rgba(139, 92, 246, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-pulse-magic svg {
  color: #a78bfa;
}

.btn-pulse-magic::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  /* Задаем тень сразу максимальной */
  box-shadow: inset 0 0 30px rgba(139, 92, 246, 0.4); 
  animation: pulseBorderGPU 3s infinite alternate ease-in-out;
  pointer-events: none;
  border-radius: inherit;
  will-change: transform, opacity; /* Подсказка для браузера включить GPU */
}

@keyframes pulseBorderGPU {
  0% { 
    opacity: 0.4; 
    transform: scale(0.95); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* Исправляем адаптив для маленьких экранов (iPhone SE и т.д.) */
@media (max-width: 360px) {
  .pet-incubator {
    width: 240px;
    height: 240px;
  }
  .pet-action-btn {
    font-size: 10px;
    padding: 14px 6px;
  }
}

/* Стили для кликабельного имени */
#pet-name-display {
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  padding-bottom: 2px;
}

#pet-name-display:hover {
  color: #8b5cf6; /* Неоново-фиолетовый акцент */
  border-bottom-color: #8b5cf6;
}

/* Стеклянный инпут */
.pet-name-glass-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-align: center;
  padding: 4px 8px;
  width: 140px;
  outline: none;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.pet-name-glass-input.hidden {
  display: none !important;
}


/* --- Звездные послания (Кристаллы лимитов) --- */
.gift-crystal {
  font-size: 32px;
  filter: grayscale(100%) opacity(0.2);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.8);
}

.gift-crystal.active {
  filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.6)) grayscale(0%) opacity(1);
  transform: scale(1);
  animation: floatIcon 3s ease-in-out infinite;
}

/* Рассинхронизируем левитацию, чтобы они двигались живей */
.gift-crystal.active:nth-child(2) { animation-delay: 0.5s; }
.gift-crystal.active:nth-child(3) { animation-delay: 1s; }

/* --- Стили для магазина --- */
.shop-item-loading {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(0.5);
  transform: scale(0.98);
}

.shop-price-xtr {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.shop-price-rub {
  color: #fff;
}

/* ========================================================= */
/* GRIMOIRE STYLES (ДНЕВНИК СНОВИДЕНИЙ)                      */
/* ========================================================= */

.grimoire-textarea {
    width: 100%;
    min-height: 160px;
    background: rgba(10, 14, 29, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 20px;
    color: #e2e8f0; /* Фикс невидимого текста! */
    font-family: 'Cormorant Garamond', serif; /* Красивый книжный шрифт */
    font-size: 18px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.grimoire-textarea {
    width: 100%;
    min-height: 160px;
    background: rgba(10, 14, 29, 0.6) !important; /* Принудительно темный */
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 20px;
    padding: 20px;
    color: #e2e8f0 !important; /* Принудительно светлый текст */
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.5) !important;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Убивает стандартный белый фон на iOS/Android */
}

.grimoire-textarea:focus {
    background: rgba(10, 14, 29, 0.8);
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.5), 0 0 15px rgba(139, 92, 246, 0.3);
}

/* --- PET CHAT BUBBLES --- */
.pet-chat-msg {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 20px;
  line-height: 1.5;
  font-size: 14px;
}

/* Сообщение от ИИ (слева, фиолетовый акцент) */
.pet-chat-ai {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-bottom-left-radius: 4px;
}
.pet-chat-ai b { 
  color: #a78bfa; 
  display: inline-block; 
  margin-bottom: 4px; 
}

/* Сообщение от Юзера (справа, нейтральное стекло) */
.pet-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;
}
.pet-chat-user b { 
  color: #cbd5e1; 
  display: inline-block; 
  margin-bottom: 4px; 
}

/* --- ФИКС БЕЛЫХ ИКОНОК КАЛЕНДАРЯ --- */
input[type="date"],
input[type="time"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}