/* ===== ФЕНИКС · ПРЕМИУМ UI (Mobile First) ===== */
:root {
  --bg: #08080f;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.06);
  --text: #e8e4f0;
  --muted: #88839a;
  --violet: #a78bfa;
  --gold: #fbbf24;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --gradient: linear-gradient(135deg, #a78bfa, #c084fc, #e9b84c);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

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

html, body { width: 100%; overflow-x: hidden; background: var(--bg); }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

/* ========== ГЛАВНАЯ ========== */
.home-garden { padding-top: 80px;  width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.home-title { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.home-subtitle { font-size: 15px; color: var(--muted); margin-top: -12px; }
.halls-grid { display: flex; flex-direction: column; gap: 10px; }
.hall-card { background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s; }
.hall-card:active { transform: scale(0.98); background: rgba(255,255,255,0.06); }
.hall-card h2 { font-size: 17px; font-weight: 500; margin-bottom: 4px; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hall-card p { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ========== СТРАНИЦЫ (общие) ========== */
.page { display: none; min-height: 100vh; min-height: 100dvh; flex-direction: column; align-items: center; justify-content: flex-start; padding: 24px 20px calc(24px + var(--safe-bottom)); width: 100%; max-width: 500px; margin: 0 auto; }
.page.active { display: flex; }
.page h1 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 4px; }
.page-sub { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.back-link { position: fixed; top: 16px; left: 16px; z-index: 100; color: var(--muted); font-size: 14px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: color 0.2s, background 0.2s; }
.back-link:hover { /* цвет задан в SVG */ background: rgba(255,255,255,0.06); }

/* ========== ТАБЫ (Академия / О проекте / Соратник) ========== */
.tab-bar { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 4px; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { flex: 0 0 auto; padding: 8px 18px; border-radius: 100px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.25s ease; font-family: var(--font); }
.tab-btn.active { background: rgba(167,139,250,0.12); border-/* цвет задан в SVG */ color: var(--violet); }

/* ========== КАРТОЧКИ (Сутры / Практики / Артефакты) ========== */
.sutra-card, .artifact-item, .friend-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; text-align: left; cursor: pointer; transition: border-color 0.2s, background 0.2s; margin-bottom: 8px; }
.sutra-card:hover, .artifact-item:hover, .friend-card:hover { border-/* цвет задан в SVG */ }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.card-header h3 { font-size: 15px; font-weight: 500; color: var(--text); margin: 0; }
.card-arrow { font-size: 12px; color: var(--muted); transition: transform 0.35s ease; }
.card-body { max-height: 0; overflow: hidden; transition: max-height 0.45s ease, margin-top 0.45s ease, padding-top 0.45s ease, border-top 0.45s ease; margin-top: 0; padding-top: 0; border-top: none; }
.card-body.open { max-height: 3000px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ========== МАСТЕРСКАЯ ========== */
.workshop-create textarea, .workshop-create input[type="text"] { width: 100%; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-family: var(--font); transition: border-color 0.2s; }
.workshop-create textarea:focus, .workshop-create input:focus { outline: none; border-/* цвет задан в SVG */ }
.btn-primary { padding: 14px 20px; border-radius: var(--radius); border: none; background: var(--gradient); color: #08080f; font-weight: 600; font-size: 15px; cursor: pointer; font-family: var(--font); width: 100%; transition: opacity 0.2s, transform 0.15s; }
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 12px 16px; border-radius: var(--radius); font-size: 13px; cursor: pointer; font-family: var(--font); transition: border-color 0.2s, color 0.2s; }
.btn-secondary:hover { border-/* цвет задан в SVG */ color: var(--violet); }
.artifact-info { flex: 1; text-align: left; min-width: 0; }
.artifact-info .name { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-info .date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px; border-radius: 8px; transition: color 0.2s, background 0.2s; }
.icon-btn:hover { /* цвет задан в SVG */ background: rgba(255,255,255,0.05); }

/* ========== ПУСТЫЕ СОСТОЯНИЯ (Empty States) ========== */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; color: var(--muted); gap: 8px; }
.empty-state .empty-icon { font-size: 48px; opacity: 0.5; margin-bottom: 8px; }
.empty-state .empty-title { font-size: 15px; color: var(--text); font-weight: 500; }
.empty-state .empty-desc { font-size: 13px; line-height: 1.5; max-width: 260px; }

/* ========== СКЕЛЕТОНЫ (Skeleton Screens) ========== */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.02) 50%, var(--surface) 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: var(--radius-sm); }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-text.short { width: 60%; }
.skeleton-card { height: 60px; margin-bottom: 8px; border-radius: var(--radius); }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== ПРОФИЛЬ ========== */
.profile-container { width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--gradient); display: flex; align-items: center; justify-content: center; font-size: 28px; color: #0a0a14; margin-bottom: 8px; }
.profile-name { font-size: 20px; font-weight: 500; }
.profile-did { font-size: 11px; color: var(--muted); word-break: break-all; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; width: 100%; text-align: left; }
.profile-card h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.profile-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.profile-stat:last-child { border-bottom: none; }
.profile-stat .label { color: var(--muted); }
.profile-stat .value { font-weight: 500; }

/* ========== ЖИВОЕ ПОЛЕ ========== */
#living-field { position: fixed; bottom: 20px; right: 20px; z-index: 9999; cursor: pointer; text-align: center; }
#phoenix-pulsar { width: 14px; height: 14px; border-radius: 50%; background: var(--gradient); animation: breathe 3s ease-in-out infinite; }
#phoenix-pulsar.active { background: var(--gold); box-shadow: 0 0 20px rgba(251,191,36,0.7); }
@keyframes breathe { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
#living-field span { display: block; font-size: 9px; color: var(--muted); letter-spacing: 1.5px; margin-top: 4px; }

/* ========== О ПРОЕКТЕ (ссылка) ========== */
#about-link { position: fixed; bottom: 20px; left: 20px; font-size: 11px; color: var(--muted); text-decoration: none; opacity: 0.6; z-index: 9999; transition: opacity 0.2s, color 0.2s; }
#about-link:hover { opacity: 1; /* цвет задан в SVG */ }

/* ========== ЯЗЫКОВОЙ ПЕРЕКЛЮЧАТЕЛЬ ========== */
#lang-switcher { position: fixed; top: 16px; right: 16px; display: flex; align-items: center; gap: 12px; z-index: 200; }
#lang-btn { display: flex; align-items: center; gap: 6px; background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 100px; padding: 8px 14px; color: var(--text); font-size: 13px; cursor: pointer; font-family: var(--font); }
#lang-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: #12121f; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; min-width: 170px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.lang-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: none; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; border-radius: 12px; font-family: var(--font); text-align: left; transition: background 0.15s, color 0.15s; }
.lang-option:hover { background: rgba(255,255,255,0.04); color: var(--text); }
#profile-link { font-size: 18px; text-decoration: none; opacity: 0.7; transition: opacity 0.2s; }
#profile-link:hover { opacity: 1; }

/* ========== ДЕСКТОП ========== */
@media (min-width: 768px) {
  body { padding: 0; }
  .halls-grid { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px; }
  .hall-card { width: 200px; }
  .hall-card:hover { border-/* цвет задан в SVG */ background: rgba(167,139,250,0.05); transform: translateY(-2px); }
}


/* ========== 🐦‍🔥 ГЛУБИННОЕ ПАРЕНИЕ САКРАЛЬНЫХ СИМВОЛОВ ========== */
#sacred-floating-layer {
  pointer-events: none;
  user-select: none;
}

.sacred-floating-symbol {
  pointer-events: none;
  will-change: transform, opacity, filter;
}

/* Анимация всплытия из глубины */
  15% {
    opacity: 0.7;
    filter: blur(0px);
  }
  30% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.0);
  }
  70% {
    opacity: 0.8;
    transform: scale(0.98);
  }
  85% {
    opacity: 0.5;
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
    filter: blur(12px);
  }
}

/* Медитативное мерцание фона для символов */
.sacred-floating-symbol img {
  animation: sacred-glow 3s ease-in-out infinite;
}

@keyframes sacred-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(167,139,250,0.3));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(167,139,250,0.6)) 
            drop-shadow(0 0 40px rgba(251,191,36,0.2));
  }
}

/* ========== 🐦‍🔥 ГЛУБИННОЕ ПАРЕНИЕ САКРАЛЬНЫХ СИМВОЛОВ ========== */
#sacred-floating-layer {
  pointer-events: none;
  user-select: none;
}

.sacred-floating-symbol {
  pointer-events: none;
  will-change: transform, opacity, filter;
}

/* Анимация всплытия из глубины */
  15% {
    opacity: 0.7;
    filter: blur(0px);
  }
  30% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.0);
  }
  70% {
    opacity: 0.8;
    transform: scale(0.98);
  }
  85% {
    opacity: 0.5;
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
    filter: blur(12px);
  }
}

/* Медитативное мерцание фона для символов */
.sacred-floating-symbol img {
  animation: sacred-glow 3s ease-in-out infinite;
}

@keyframes sacred-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(167,139,250,0.3));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(167,139,250,0.6)) 
            drop-shadow(0 0 40px rgba(251,191,36,0.2));
  }
}

/* ========== 🐦‍🔥 ГЛУБИННОЕ ПАРЕНИЕ (анимация) ========== */
    40% {
        opacity: 1;
        filter: blur(0px) drop-shadow(0 0 20px rgba(255,215,0,0.7)) drop-shadow(0 0 50px rgba(255,215,0,0.35));
    }
    80% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 20px rgba(255,215,0,0.7)) drop-shadow(0 0 50px rgba(255,215,0,0.35));
    }
}

/* ========== 🐦‍🔥 ГЛУБИННОЕ ПАРЕНИЕ (анимация) ========== */
@keyframes sacred-emerge {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
        filter: blur(10px) drop-shadow(0 0 20px rgba(255,215,0,0.7)) drop-shadow(0 0 50px rgba(255,215,0,0.35));
    }
    40% {
        opacity: 1;
        filter: blur(0px) drop-shadow(0 0 20px rgba(255,215,0,0.7)) drop-shadow(0 0 50px rgba(255,215,0,0.35));
    }
    80% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 20px rgba(255,215,0,0.7)) drop-shadow(0 0 50px rgba(255,215,0,0.35));
    }
}

/* ===== МОБИЛЬНАЯ ШАПКА: защита от наезжания ===== */
@media (max-width: 768px) {
    #home-page .home-garden { padding-top: 80px; 
        padding-top: 70px; /* отступ от фиксированной шапки */
    }
    #lang-switcher {
        top: 10px;
        right: 10px;
    }
    #profile-link {
        font-size: 16px;
    }
}
