/* FLEX-РАЗМЕТКА ДЛЯ ГЛОБУСА И ПАНЕЛИ НАСТРОЕК */
.globe-flex-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  width: 100%;
}

.globe-settings-panel {
  /* Фиксируем ширину как в макете */
  min-width: 260px;
  max-width: 280px;
  
  /* Эффект матового стекла (Frosted Glass) */
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  
  /* Границы и тени */
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.05), /* Мягкая тень */
    inset 0 1px 0 rgba(255, 255, 255, 0.9); /* Внутренний блик сверху */
  
  border-radius: 28px; /* Сильное скругление */
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.globe-main-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 900px) {
  .globe-flex-layout {
    flex-direction: column;
    gap: 16px;
  }
  .globe-settings-panel {
    max-width: 100%;
    min-width: 0;
    margin-bottom: 16px;
  }
}
:root {
  /* Apple Liquid Glass - цветовая палитра */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-hover: rgba(255, 255, 255, 0.3);
  
  --surface-light: #f5f5f7;
  --surface-dark: #1d1d1f;
  
  /* Живые градиенты */
  --liquid-gradient-1: linear-gradient(135deg, 
    rgba(255, 107, 157, 0.8) 0%,
    rgba(147, 51, 234, 0.8) 50%,
    rgba(59, 130, 246, 0.8) 100%);
  
  --liquid-gradient-2: linear-gradient(135deg,
    rgba(236, 72, 153, 0.7) 0%,
    rgba(239, 68, 68, 0.7) 50%,
    rgba(249, 115, 22, 0.7) 100%);
  
  --liquid-gradient-3: linear-gradient(135deg,
    rgba(59, 130, 246, 0.7) 0%,
    rgba(139, 92, 246, 0.7) 50%,
    rgba(236, 72, 153, 0.7) 100%);
  
  /* Mesh градиент для фона */
  --mesh-gradient: 
    radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 0.12) 0px, transparent 50%),
    radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 0.08) 0px, transparent 50%),
    radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 0.1) 0px, transparent 50%),
    radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 0.09) 0px, transparent 50%),
    radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 0.07) 0px, transparent 50%),
    radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 0.1) 0px, transparent 50%),
    radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 0.08) 0px, transparent 50%);
  
  /* Акценты */
  --accent-pink: #ff375f;
  --accent-purple: #bf5af2;
  --accent-blue: #0071e3;
  --accent-green: #30d158;
  
  /* Текст */
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #6e6e73;
  
  /* Тени для liquid glass */
  --glass-shadow: 
    0 0.3px 0.4px rgba(0, 0, 0, 0.02),
    0 0.9px 1.5px rgba(0, 0, 0, 0.045),
    0 3.5px 6px rgba(0, 0, 0, 0.09);
  
  --glass-shadow-hover:
    0 0.7px 1px rgba(0, 0, 0, 0.03),
    0 2.7px 4px rgba(0, 0, 0, 0.06),
    0 12px 18px rgba(0, 0, 0, 0.12);
  
  --glass-shadow-active:
    inset 0 0.5px 1px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 3px rgba(0, 0, 0, 0.08);
  
  /* Радиусы - мягкие Apple-like */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-full: 9999px;
  
  /* Blur эффекты */
  --blur-sm: blur(8px);
  --blur-md: blur(16px);
  --blur-lg: blur(24px);
  --blur-xl: blur(40px);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

/* Улучшенный скроллбар для всей страницы */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Montserrat", sans-serif;
  /* Apple Liquid Glass - живой mesh градиент с фоновым изображением */
  background: var(--surface-light);
  background-image: 
    url('/static/img/background.png'),
    var(--mesh-gradient);
  background-size: cover, auto;
  background-position: center, 0% 0%;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  animation: meshMove 20s ease-in-out infinite;
  background-color: #f5f5f7;
  position: relative;
}

@keyframes meshMove {
  0%, 100% {
    background-position: 0% 0%, 100% 0%, 50% 100%, 0% 50%, 100% 100%, 25% 50%, 75% 50%;
  }
  50% {
    background-position: 100% 100%, 0% 100%, 50% 0%, 100% 50%, 0% 0%, 75% 50%, 25% 50%;
  }
}

/* Декоративные элементы фона - Game UI */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -10%;
  width: auto;
  height: auto;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  bottom: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(135, 206, 250, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.1); }
}

/* ========================================
   GLOBAL BUTTON STYLES
======================================== */

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ========================================
   ПРЕЛОАДЕР
======================================== */

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8ecf3 0%, #f5f8ff 50%, #e0e8f5 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-globe {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-icon {
  font-size: 48px;
  animation: spin 3s linear infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.loader-orbit {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: orbit 2s linear infinite;
}

.loader-orbit:nth-child(1) {
  width: 80px;
  height: 80px;
  animation-delay: 0s;
}

.loader-orbit:nth-child(2) {
  width: 100px;
  height: 100px;
  animation-delay: 0.3s;
}

.loader-orbit:nth-child(3) {
  width: 120px;
  height: 120px;
  animation-delay: 0.6s;
}

.loader-text {
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbit {
  0% { transform: scale(0.8); opacity: 0; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* ========================================
   СТАТИСТИКА
======================================== */

.stats-bar {
  margin-top: 16px;
  padding: 12px 28px;
  display: flex;
  gap: 24px;
  /* Liquid glass pill - полностью закругленная капсула */
  background: transparent;
  position: relative;
  overflow: hidden;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 4px 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.stat-item:hover {
  transform: scale(1.05);
}

.stat-icon {
  font-size: 22px;
  background: linear-gradient(135deg, #FF1B6D, #D820A0, #8B1FD9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(255, 27, 109, 0.3));
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-weight: 500;
}

.app-shell {
  max-width: 1600px;
  margin: 24px auto;
  padding: 8px 16px 32px;
}

.neu-card {
  /* Apple Liquid Glass - многослойная живая стеклянная карточка */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 20px 60px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 80px rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.02);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Динамический mesh градиент внутри карточки */
.neu-card::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 107, 157, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(147, 51, 234, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.6) 0%, transparent 30%);
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
  /* animation: meshRotate 20s linear infinite; */
}

@keyframes meshRotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Светящаяся граница с радужным переливом */
.neu-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 107, 157, 0.08) 20%,
    rgba(147, 51, 234, 0.06) 40%,
    rgba(59, 130, 246, 0.08) 60%,
    rgba(72, 187, 120, 0.05) 80%,
    rgba(255, 255, 255, 0.25) 100%);
  background-size: 400% 400%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.2;
  filter: blur(1px);
  transition: opacity 0.6s ease;
  animation: borderFlow 10s linear infinite;
}

@keyframes borderFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  position: relative;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  /* Frosted glass header */
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.75) 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow: visible;
}

/* Декоративный liquid blob */
.header::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle,
    rgba(255, 107, 157, 0.15) 0%,
    rgba(147, 51, 234, 0.1) 50%,
    transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  animation: float 15s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Второй декоративный blob */
.header::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle,
    rgba(59, 130, 246, 0.12) 0%,
    rgba(147, 51, 234, 0.08) 50%,
    transparent 70%);
  border-radius: 50%;
  filter: blur(35px);
  animation: float 18s ease-in-out infinite reverse;
  pointer-events: none;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 4px;
}

/* --- ИКОНКА ЛОГОТИПА --- */
.logo-icon {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Круг глобуса (фоновый градиент) */
.logo-globe-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* Твой фирменный градиент */
  background: linear-gradient(135deg, #ff6b9d 0%, #a855f7 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4); /* Фиолетовое свечение */
  opacity: 0.9;
}

/* Делаем "пин" внутри */
.logo-pin {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 50% 50% 50% 0;
  background: white;
  transform: rotate(-45deg) translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Точка внутри пина */
.logo-pin::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: #a855f7;
  border-radius: 50%;
}

/* --- ТЕКСТ ЛОГОТИПА --- */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.text-memories {
  font-family: 'Montserrat', sans-serif; /* Или твой основной шрифт */
  font-weight: 800;
  font-size: 24px;
  /* Текстовый градиент */
  background: linear-gradient(90deg, #a855f7 0%, #ff6b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.text-globe {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--text-primary); /* Темно-серый цвет текста */
  margin-top: -4px; /* Чуть прижимаем */
}

/* Эффект при наведении */
.brand-logo:hover .logo-globe-circle {
  transform: scale(1.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.6);
}

.brand-logo:hover .logo-pin {
  transform: rotate(-45deg) translateY(-4px); /* Пин "подпрыгивает" */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.user-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--radius-full);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 50px rgba(255, 255, 255, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
/* Globe Settings Panel */
.globe-settings-panel {
  margin-bottom: 20px;
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  /* margin-bottom: 8px; */
  /* padding-bottom: 16px; */
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.settings-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #2d2d2d;
  background: none; 
  -webkit-text-fill-color: initial;
}

.settings-icon {
  font-size: 20px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.setting-group {
  margin-bottom: 0; 
}

.setting-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8a8a98;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}
.globe-styles {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Две колонки */
  gap: 12px;
}

.globe-style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1; /* Делаем их квадратными */
  padding: 12px;
  
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid transparent;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: none;
}

.globe-style-btn .style-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}
.globe-style-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 107, 157, 0.3);
}
.globe-style-btn .style-name {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.globe-style-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.globe-style-btn.active {
  background: rgba(255, 255, 255, 0.95);
  border-color: #a855f7; /* Фиолетовая обводка */
  box-shadow: 
    0 8px 20px rgba(168, 85, 247, 0.15),
    inset 0 0 0 1px #a855f7; /* Двойная обводка для четкости */
}
.globe-style-btn.active .style-icon {
  transform: scale(1.1);
}

.globe-style-btn.active .style-name {
  color: #a855f7;
}
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
}

.toggle-item:hover {
  background: transparent;
  transform: none;
}

.toggle-label {
  color: #444;
  font-weight: 600;
  font-size: 14px;
}

/* Кастомный свитч (iOS style) */
.toggle-switch {
  width: 48px;
  height: 28px;
  background: #e5e7eb; /* Серый выключенный */
  border-radius: 99px;
  position: relative;
  transition: background 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Активный свитч - градиент */
.toggle-switch.active {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.toggle-switch.active::after {
  transform: translateX(20px);
  left: 2px; /* Фикс для корректного смещения */
}

/* 5. Слайдер скорости */
.slider-item {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.slider-label {
  margin-bottom: 12px;
}

.slider-value {
  background: white;
  color: #a855f7;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.15);
}

/* Стилизация input range */
.slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

/* Дорожка слайдера */
.slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  background-image: linear-gradient(90deg, #a855f7, #ec4899);
  background-size: 0% 100%; /* JS может обновлять это, но пока оставим */
  background-repeat: no-repeat;
}

/* Ползунок слайдера */
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  margin-top: -8px; /* Центрирование */
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  border: 2px solid #a855f7;
  transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Mobile адаптация */
@media (max-width: 900px) {
  .globe-settings-panel {
    max-width: 100%;
    border-radius: 20px;
    flex-direction: row; /* На мобильном можно в ряд */
    flex-wrap: wrap;
    align-items: flex-start;
  }
  
  .globe-styles {
    grid-template-columns: repeat(4, 1fr); /* В ряд на мобилках */
  }
  
  .setting-group {
    flex: 1;
    min-width: 200px;
  }
}
.user-info:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--liquid-gradient-1);
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 
    0 4px 12px rgba(255, 107, 157, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  animation: liquidFlow 8s ease-in-out infinite;
  position: relative;
}

.user-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.6),
    transparent 50%,
    rgba(255, 255, 255, 0.2));
  opacity: 0.5;
  pointer-events: none;
}

/* Декоративная полоска - Game UI */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.logo {
  height: 80px;
  width: auto;
  max-width: 300px;
  object-fit: contain;
  display: block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 8px rgba(255, 107, 157, 0.15));
}

.logo:hover {
  transform: scale(1.08) translateY(-3px);
  filter: drop-shadow(0 8px 16px rgba(255, 107, 157, 0.3));
}

.subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.2px;
  opacity: 0.7;
  margin-top: -4px;
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 20px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}


.globe-wrapper {
  position: relative;
  min-height: 600px;
  height: 600px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  
  /* МАГИЯ ФОНА: Градиент, имитирующий глубину и свечение */
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.1) 0%,       /* Светлый центр */
    rgba(255, 182, 193, 0.15) 30%,     /* Розовое свечение */
    rgba(147, 51, 234, 0.1) 60%,       /* Фиолетовая глубина */
    rgba(255, 255, 255, 0.4) 100%      /* Светлые края стекла */
  );
  
  /* Эффект матового стекла */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  
  /* Рамка */
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 20px 50px rgba(147, 51, 234, 0.15), /* Фиолетовая тень */
    inset 0 0 60px rgba(255, 255, 255, 0.5); /* Внутреннее свечение */
}

/* Убираем старые псевдоэлементы, если они мешают */
.globe-wrapper::before,
.globe-wrapper::after {
  display: none;
}

#globe {
  width: 100%;
  height: 100%;
  opacity: 0; /* Скрываем на секунду пока грузится */
  animation: fadeInGlobe 1s ease forwards 0.5s;
}

@keyframes fadeInGlobe {
  to { opacity: 1; }
}
.globe-photo-marker {
  position: relative; /* Относительно wrapper */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  
  /* Центрируем маркер ВНУТРИ обертки */
  transform: translate(-50%, -50%);
  
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
  
  /* Анимация, которая теперь не конфликтует с глобусом */
  animation: floatMarker 3s ease-in-out infinite;
}
/* Основной контейнер (Рамка и Тело) */
.globe-photo-marker::before {
  content: '';
  position: absolute;
  inset: -3px; /* Толщина рамки */
  border-radius: 50%;
  
  /* 1. Градиентная заливка рамки */
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 40%, #a855f7 100%);
  
  /* 2. ТЕНИ ДЛЯ ОБЪЕМА (Самое важное) */
  box-shadow: 
    /* Внешняя темная тень (drop shadow) - дает отрыв от глобуса */
    0 10px 20px rgba(0, 0, 0, 0.3),
    /* Цветное свечение снизу */
    0 5px 15px rgba(168, 85, 247, 0.4),
    /* Внутренняя светлая тень (блик сверху слева) */
    inset 2px 2px 5px rgba(255, 255, 255, 1),
    /* Внутренняя темная тень (тень справа снизу) */
    inset -2px -2px 5px rgba(0, 0, 0, 0.1);
    
  z-index: -1;
}

/* Само фото */
.marker-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  position: relative;
  /* Небольшая внутренняя граница, чтобы отделить фото от рамки */
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: #fff;
}

/* Стеклянный блик (Линза) - делает фото "под стеклом" */
.globe-photo-marker::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  /* Имитация выпуклости */
  background: radial-gradient(
    circle at 30% 30%, 
    rgba(255, 255, 255, 0.4) 0%, 
    rgba(255, 255, 255, 0.1) 20%, 
    transparent 60%
  );
  pointer-events: none; /* Чтобы клики проходили сквозь блик */
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1); /* Внутренняя тень по краям */
}

/* Эффект при наведении */
.globe-photo-marker:hover {
  /* Увеличиваем и поднимаем еще выше */
  transform: translate(-50%, -60%) scale(1.2); 
  z-index: 1000;
}

.globe-photo-marker:hover::before {
  /* Усиливаем тени при подъеме */
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 10px 30px rgba(168, 85, 247, 0.5),
    inset 2px 2px 5px rgba(255, 255, 255, 1),
    inset -2px -2px 5px rgba(0, 0, 0, 0.1);
}

/* Анимация парения */
@keyframes floatMarker {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -65%); } /* Двигается вверх на 15% высоты */
}

/* Пульсация (можно оставить, но сделать тоньше) */
.marker-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 157, 0.5);
  z-index: -2;
  animation: ripple 3s infinite ease-out;
}

/* Тултип (без изменений) */
.marker-tooltip {
  position: absolute;
  bottom: -30px; 
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: #1d1d1f;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.globe-photo-marker:hover .marker-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  bottom: -45px;
}
.marker-photo-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* Нежный градиент в стиле вашего сайта */
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px; /* Размер иконки камеры/глобуса */
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  box-sizing: border-box;
}
/* ========================================
   КОНТРОЛЫ ГЛОБУСА
======================================== */

.globe-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  padding: 12px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.8) 100%);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 40px rgba(255, 255, 255, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.control-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 30px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
}

.control-btn .icon {
  font-size: 20px;
  z-index: 1;
}

.control-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgba(255, 27, 109, 0.1), rgba(139, 31, 217, 0.1));
  box-shadow: 
    0 4px 16px rgba(255, 27, 109, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(255, 27, 109, 0.2);
}

.control-btn:active {
  transform: translateY(-1px) scale(0.95);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 16px rgba(255, 107, 157, 0.15);
}

.control-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: white;
}

/* Подсказка */
.globe-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 107, 157, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  animation: bounceIn 0.6s ease-out, fadeOut 0.5s ease-in 4.5s forwards;
  z-index: 10;
}

.hint-icon {
  font-size: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes bounceIn {
  0% { transform: translateX(-50%) scale(0.3); opacity: 0; }
  50% { transform: translateX(-50%) scale(1.05); }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}

.globe-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.globe-canvas canvas {
  display: block;
  border-radius: var(--radius-xl);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  position: relative;
  padding-bottom: 8px;
}

/* Подчёркивание как в играх */
.sidebar h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.memory-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memory-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  position: relative;
}

.char-counter {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 10px;
  color: var(--text-light);
  font-weight: 500;
  text-transform: none;
}

.input-hint {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 400;
  text-transform: none;
  opacity: 0.7;
  margin-top: -2px;
}

.memory-form input,
.memory-form textarea {
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  padding: 14px 18px;
  outline: none;
  /* Apple Liquid Glass - стеклянные поля ввода */
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  box-shadow: var(--glass-shadow);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", inherit;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.memory-form input:focus,
.memory-form textarea:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 107, 157, 0.5);
  box-shadow: 
    0 0 0 4px rgba(255, 107, 157, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(255, 255, 255, 0.8) inset;
  transform: translateY(-2px);
}

.memory-form input::placeholder,
.memory-form textarea::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.memory-form textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Apple scrollbar для textarea */
.memory-form textarea::-webkit-scrollbar {
  width: 10px;
}

.memory-form textarea::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.memory-form textarea::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.memory-form textarea::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.location-helper {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.coordinates-toggle {
  margin: 8px 0 12px;
}

.toggle-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 27, 109, 0.3);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.toggle-btn.active {
  background: linear-gradient(135deg, rgba(255, 27, 109, 0.1), rgba(139, 31, 217, 0.08));
  border-color: rgba(255, 27, 109, 0.4);
  color: #FF1B6D;
}

.coordinates-section {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.helper-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(255, 107, 157, 0.3);
  background: var(--bg);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.helper-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-light), var(--bg));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 107, 157, 0.15);
}

.helper-btn:active {
  transform: translateY(-1px) scale(0.97);
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.12);
}

  .helper-btn .icon {
    font-size: 14px;
  }

  /* ========================================
     PHOTO DROPZONE
  ======================================== */

  .photo-dropzone {
    border: 2px dashed rgba(255, 107, 157, 0.3);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .photo-dropzone:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-light), var(--bg));
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 107, 157, 0.15);
  }

  .photo-dropzone.drag-over {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 179, 193, 0.05));
    border-width: 3px;
    box-shadow: 
      0 0 20px rgba(255, 107, 157, 0.2),
      inset 0 0 20px rgba(255, 107, 157, 0.1);
  }

  .photo-dropzone-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-main);
  }

  .dropzone-icon {
    font-size: 48px;
    opacity: 0.6;
    /* animation: float 3s ease-in-out infinite; */
  }

  .photo-dropzone-content span:nth-child(2) {
    font-size: 14px;
    font-weight: 600;
  }

  .photo-dropzone-sub {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
  }

  .photo-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .photo-dropzone.has-image {
    padding: 12px;
    border-style: solid;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-light), var(--bg));
  }

  .photo-remove-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
    z-index: 10;
  }

  .photo-dropzone.has-image .photo-remove-btn {
    display: flex;
  }

  .photo-remove-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
  }

  .photo-remove-btn:active {
    transform: scale(0.95);
  }

/* Music Dropzone */
.music-dropzone {
  border: 2px dashed rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-dropzone:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-light), var(--bg));
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(168, 85, 247, 0.15);
}

.music-dropzone.drag-over {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(196, 181, 253, 0.05));
  border-width: 3px;
  box-shadow: 
    0 0 20px rgba(168, 85, 247, 0.2),
    inset 0 0 20px rgba(168, 85, 247, 0.1);
}

.music-dropzone-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-main);
  align-items: center;
}

.music-icon {
  font-size: 32px;
  display: block;
}

.music-dropzone-content span:nth-child(2) {
  font-size: 14px;
  font-weight: 600;
}

.music-dropzone-sub {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
}

.music-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--bg-light), var(--bg));
  border-radius: var(--radius-md);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.music-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-word;
}

.music-dropzone.has-music {
  padding: 12px;
  border-style: solid;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-light), var(--bg));
}

.music-remove-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #a855f7, #9333ea);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(168, 85, 247, 0.3);
  transition: all 0.2s ease;
  z-index: 10;
}

.music-dropzone.has-music .music-remove-btn {
  display: flex;
}

.music-remove-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 12px rgba(168, 85, 247, 0.4);
}

.music-remove-btn:active {
  transform: scale(0.95);
}

.primary-btn {
  margin-top: 8px;
  padding: 16px 32px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  /* Apple Liquid Glass - живая градиентная кнопка */
  background: var(--liquid-gradient-1);
  background-size: 200% 200%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  box-shadow: 
    0 8px 24px rgba(255, 107, 157, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: liquidFlow 8s ease-in-out infinite;
}

@keyframes liquidFlow {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.primary-btn .btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.primary-btn.loading {
  pointer-events: none;
  opacity: 0.9;
}

.primary-btn.loading .btn-text {
  opacity: 0.7;
}

.primary-btn.loading .btn-loader {
  display: block;
}

.primary-btn .btn-icon {
  font-size: 18px;
}

/* Живой блик */
.primary-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 20px 50px rgba(255, 107, 157, 0.4),
    0 0 40px rgba(255, 107, 157, 0.3);
}

.primary-btn:hover::before {
  left: 100%;
}

.primary-btn:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 
    0 8px 20px rgba(255, 107, 157, 0.3),
    0 0 20px rgba(255, 107, 157, 0.2);
}

.generate-ai-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent);
  cursor: pointer;
  background: linear-gradient(135deg, 
    rgba(168, 85, 247, 0.1) 0%, 
    rgba(147, 51, 234, 0.05) 100%);
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.generate-ai-btn:hover {
  background: linear-gradient(135deg, 
    rgba(168, 85, 247, 0.2) 0%, 
    rgba(147, 51, 234, 0.1) 100%);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.2);
  transform: translateY(-2px);
}

.generate-ai-btn:active {
  transform: translateY(0);
}

.generate-ai-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.generate-ai-btn .btn-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.generate-ai-btn.loading .btn-loader {
  display: block;
}

.generate-ai-btn.loading .btn-text {
  opacity: 0.7;
}

.form-status {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  text-align: center;
  transition: all 0.3s ease;
}

.form-status.error {
  color: #dc2626;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  box-shadow: 
    0 4px 8px rgba(220, 38, 38, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: shake 0.4s ease;
}

.form-status.success {
  color: #059669;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  box-shadow: 
    0 4px 8px rgba(5, 150, 105, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: pulse 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.memory-card {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 340px;
  max-width: 85vw;
  z-index: 40;
  padding: 20px;
  /* Game UI стиль карточки */
  background: linear-gradient(135deg, var(--bg-light), var(--bg));
  border-radius: var(--radius-xl);
  box-shadow: 
    var(--shadow-soft),
    0 0 40px rgba(255, 107, 157, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: slideIn 0.3s ease-out;
  cursor: default;
  user-select: text;
}

/* Индикатор закрепления */
.memory-card::after {
  content: '📌';
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 16px;
  opacity: 0.6;
  filter: grayscale(0.3);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.memory-card.hidden {
  display: none;
}

/* Декоративная рамка как у карты */
.memory-card::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(255, 107, 157, 0.2);
  border-radius: calc(var(--radius-xl) - 4px);
  pointer-events: none;
}

.card-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  max-height: 200px;
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 3px solid var(--bg);
}

.memory-card h3 {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.memory-card p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 500;
}

.audio-player {
  width: 100%;
  margin-top: 8px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inset);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: white;
  font-weight: bold;
  box-shadow: 
    0 4px 8px rgba(255, 107, 157, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 
    0 6px 12px rgba(255, 107, 157, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 0 20px rgba(255, 107, 157, 0.4);
}

.close-btn:active {
  transform: scale(0.95) rotate(90deg);
  box-shadow: 
    0 2px 4px rgba(255, 107, 157, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .globe-wrapper {
    min-height: 400px;
    height: 400px;
  }
  
  .memory-card {
    right: 16px;
    bottom: 16px;
    width: 280px;
  }
}

/* Улучшения для мобильных устройств */
@media (max-width: 600px) {
  .app-shell {
    margin: 12px auto;
    padding: 4px 8px 16px;
  }
  
  .header {
    padding: 12px 16px;
  }
  
  .logo {
    font-size: 20px;
  }
  
  .subtitle {
    font-size: 12px;
  }
  
  .stats-bar {
    margin-top: 8px;
    padding-top: 8px;
  }
  
  .stat-item {
    font-size: 11px;
  }
  
  .stat-value {
    font-size: 16px;
  }
  
  .globe-wrapper {
    min-height: 300px;
    height: 300px;
  }
  
  .globe-controls {
    top: 8px;
    right: 8px;
    gap: 6px;
  }
  
  .control-btn {
    width: 38px;
    height: 38px;
  }
  
  .control-btn .icon {
    font-size: 18px;
  }
  
  .globe-hint {
    font-size: 11px;
    padding: 8px 14px;
    bottom: 12px;
  }
  
  .sidebar {
    padding: 14px 18px;
  }
  
  .memory-form label {
    font-size: 11px;
  }
  
  .memory-form input,
  .memory-form textarea {
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .helper-btn {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .primary-btn {
    padding: 12px 20px;
    font-size: 13px;
  }
  
  .memory-card {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 32px);
    max-width: 320px;
    padding: 16px;
  }
  
  .card-photo {
    max-height: 160px;
  }
  
  .memory-card h3 {
    font-size: 16px;
  }
  
  .memory-card p {
    font-size: 13px;
  }
}

/* Touch-friendly увеличение размеров для тач-устройств */
@media (hover: none) and (pointer: coarse) {
  .control-btn,
  .helper-btn,
  .close-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .primary-btn {
    min-height: 48px;
  }
  
  /* Убираем hover эффекты на touch */
  .control-btn:hover,
  .helper-btn:hover,
  .primary-btn:hover {
    transform: none;
  }
  
  /* Добавляем активное состояние */
  .control-btn:active,
  .helper-btn:active {
    transform: scale(0.95);
  }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
======================================== */

/* Фокус для клавиатурной навигации */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Уменьшение движения для пользователей с вестибулярными нарушениями */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .loader-icon,
  .loader-orbit,
  body::before,
  body::after {
    animation: none !important;
  }
}

/* Высокая контрастность */
@media (prefers-contrast: high) {
  :root {
    --text-main: #000000;
    --text-muted: #333333;
    --accent: #ff1493;
  }
  
  .neu-card {
    border: 2px solid var(--text-main);
  }
}

/* ========================================
   MODAL STYLES
======================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* Apple Liquid Glass - светлый blur backdrop */
  background: rgba(245, 245, 247, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  /* Apple Liquid Glass - яркая стеклянная панель */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 1px rgba(255, 255, 255, 0.8) inset;
  border: 0.5px solid rgba(255, 255, 255, 0.8);
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes modalAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(40px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--liquid-gradient-1);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: liquidFlow 8s ease-in-out infinite;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  box-shadow: var(--shadow-soft);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  box-shadow: var(--shadow-hover);
  color: var(--accent);
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px 32px 32px;
}

/* Auth Forms */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-full);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tab.active {
  background: white;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 1px rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  transform: scale(1.02);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus {
  outline: none;
  background: white;
  border-color: rgba(255, 107, 157, 0.4);
  box-shadow: 
    0 0 0 4px rgba(255, 107, 157, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.auth-error {
  display: none;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fee, #fdd);
  border-left: 4px solid #ef4444;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 600;
}

.auth-error.active {
  display: block;
}

/* Memories List */
.memories-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.memory-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.memory-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.memory-photo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.memory-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.memory-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.memory-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memory-date {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}

.memory-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.memory-delete-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========================================
   APPLE LIQUID GLASS - CORE ELEMENTS
======================================== */

/* Живое стекло для карточек */
.glass {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) var(--blur-lg);
  -webkit-backdrop-filter: saturate(180%) var(--blur-lg);
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-hover);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) var(--blur-lg);
  -webkit-backdrop-filter: saturate(180%) var(--blur-lg);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

/* Светящиеся границы */
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.6) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ========================================
   LOADING STATES
======================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(224, 229, 236, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   ENHANCED BUTTONS
======================================== */

.control-btn,
.helper-btn {
  position: relative;
  overflow: hidden;
}

.control-btn::after,
.helper-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.control-btn:active::after,
.helper-btn:active::after {
  width: 100px;
  height: 100px;
}

/* ========================================
   GLASSMORPHISM SIDEBAR
======================================== */

.sidebar {
  background: rgba(224, 229, 236, 0.7);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* ========================================
   ENHANCED INPUTS
======================================== */

input:not([type="file"]),
textarea {
  transition: all 0.3s ease;
  position: relative;
}

input:not([type="file"]):hover,
textarea:hover {
  box-shadow: 
    inset 2px 2px 4px rgba(0, 0, 0, 0.08),
    inset -2px -2px 4px rgba(255, 255, 255, 0.8);
}

input:not([type="file"]):focus,
textarea:focus {
  transform: scale(1.01);
}

/* Floating labels effect */
.form-group {
  position: relative;
}

.form-group label {
  transition: all 0.3s ease;
}

.form-group input:focus + label,
.form-group textarea:focus + label {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ========================================
   NOTIFICATION TOAST
======================================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--bg);
  box-shadow: 
    var(--shadow-strong),
    0 0 0 1px rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.3s ease;
  z-index: 10001;
  pointer-events: none;
  max-width: 400px;
}

.toast.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid var(--accent);
}

.toast-icon {
  font-size: 20px;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.toast-close:hover {
  color: var(--text-main);
  transform: scale(1.2);
}

/* ========================================
   ENHANCED STATS BAR
======================================== */



.stat-item {
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-item:hover .stat-icon {
  transform: scale(1.2) rotate(5deg);
}

/* ========================================
   MEMORY PREVIEW MODAL
======================================== */

.preview-modal-content {
  max-width: 600px;
}

.preview-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
}

.preview-photo-wrapper {
  margin-bottom: 20px;
}

.preview-photo {
  width: 100%;
  border-radius: var(--radius-md);
  max-height: 300px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.preview-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #FF1B6D, #8B1FD9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.preview-text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.preview-location,
.preview-music {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.preview-icon {
  font-size: 18px;
}

.preview-coords {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 13px;
}

.preview-actions {
  display: flex;
  gap: 12px;
}

.secondary-btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 27, 109, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.secondary-btn .icon {
  font-size: 18px;
}

#preview-confirm {
  flex: 2;
}

/* ========================================
   RECENT MEMORIES LIST (SIDEBAR)
======================================== */

.recent-memories {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.recent-memories h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-memories h3::before {
  content: '⏱️';
  font-size: 18px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-item {
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.recent-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--liquid-gradient-1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.recent-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recent-item:hover::before {
  opacity: 1;
}

.recent-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-item-location {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.recent-item-location::before {
  content: '📍';
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

/* ========================================
   MEMORIES GALLERY
======================================== */

.memories-gallery {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 800px;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.gallery-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  background: var(--liquid-gradient-1);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: liquidFlow 8s ease-in-out infinite;
}

.gallery-filters {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 450px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 27, 109, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 27, 109, 0.12);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.filter-select {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.filter-select:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 27, 109, 0.3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 60px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gallery-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 107, 157, 0.08) 25%,
    rgba(147, 51, 234, 0.06) 50%,
    rgba(59, 130, 246, 0.08) 75%,
    rgba(255, 255, 255, 0.12) 100%);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.12;
  filter: blur(1px);
  transition: opacity 0.4s ease;
  animation: borderFlow 8s linear infinite;
}

.gallery-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(255, 255, 255, 0.4) 0%, 
    transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.gallery-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 12px 32px rgba(255, 107, 157, 0.25),
    0 20px 60px rgba(255, 107, 157, 0.15),
    inset 0 0 80px rgba(255, 255, 255, 0.4);
}

.gallery-card:hover::before {
  opacity: 1;
}

.gallery-card:hover::after {
  opacity: 1;
}

.gallery-card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  position: relative;
  flex-shrink: 0;
}

.gallery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: var(--mesh-gradient);
}

.gallery-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.gallery-card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card-text {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  margin-top: auto;
}

.gallery-card-location {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.gallery-card-location::before {
  content: '📍';
  font-size: 14px;
}

.gallery-card-music-indicator {
  font-size: 14px;
}

.gallery-card-date {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.gallery-empty-icon {
  font-size: 96px;
  display: block;
  margin-bottom: 20px;
  opacity: 0.4;
  /* animation: float 6s ease-in-out infinite; */
}

.gallery-empty h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.gallery-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   MEMORY DETAIL MODAL
======================================== */

.memory-detail-modal .modal-content {
  max-width: 700px;
}

.memory-detail-hero {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.memory-detail-hero.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  background: var(--mesh-gradient);
}

.memory-detail-title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.memory-detail-text {
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.memory-detail-meta {
  display: flex;
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.memory-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.memory-meta-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.memory-meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header,
  .modal-body {
    padding: 20px;
  }
  
  .memory-item {
    flex-direction: column;
  }
  
  .memory-photo {
    width: 100%;
    height: 160px;
  }
  
  .memory-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
  
  .toast {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .gallery-filters {
    max-width: none;
    flex-direction: column;
  }
  
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .left-column {
    gap: 16px;
  }
  
  .globe-wrapper {
    height: 400px;
    min-height: 400px;
  }
  
  .recent-memories {
    margin-top: 16px;
    padding-top: 16px;
  }
}


body.theme-night {
  /* GLOBAL BACKGROUND AND TEXT */
  background-color: #050510; /* Глубокий космос (как резерв) */
  
  /* НОВАЯ ФОТОГРАФИЯ ФОНА */
  /* !!! ЗАМЕНИТЕ ЭТОТ АДРЕС НА ВАШУ ФОТОГРАФИЮ НОЧНОГО НЕБА !!! */
  background-image: url('https://images.unsplash.com/photo-1475274044238-0ed4b2420271?fit=crop&w=1920&q=80'); 
  background-size: cover; /* Растягивает изображение на весь экран */
  background-position: center center; /* Центрирует изображение */
  background-attachment: fixed; /* Фиксирует изображение, чтобы оно не прокручивалось при скролле */

  color: #f0f0f0; /* Основной текст становится светлым */
  
  /* OVERRIDE CSS VARIABLES */
  --surface-light: #050510;
  --text-primary: #f0f0f0;  
  --text-secondary: #a0a0a0;
  --text-tertiary: #707070;
  
  /* Dark Glass Variables */
  --glass-bg: rgba(20, 20, 30, 0.72); /* Тёмное прозрачное стекло */
  --glass-border: rgba(255, 255, 255, 0.1); /* Светлая обводка */
}

/* Декоративные элементы фона (блобы) */
body.theme-night::before {
  background: radial-gradient(circle, rgba(147, 51, 234, 0.05) 0%, transparent 70%);
}
body.theme-night::after {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
}

/* --- КОМПОНЕНТЫ: ПАНЕЛЬ НАСТРОЕК (.globe-settings-panel) --- */
body.theme-night .globe-settings-panel {
  background: rgba(30, 30, 40, 0.65); 
  border: 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); 
}

/* --- КОМПОНЕНТЫ: КАРТОЧКА (.neu-card) --- */
body.theme-night .neu-card {
  background: linear-gradient(135deg, 
    rgba(20, 20, 30, 0.95) 0%,
    rgba(30, 30, 40, 0.85) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 80px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* --- КОМПОНЕНТЫ: HEADER и USER INFO --- */
body.theme-night .header,
body.theme-night .user-info {
  background: linear-gradient(135deg,
    rgba(20, 20, 30, 0.85) 0%,
    rgba(30, 30, 40, 0.75) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* --- КОМПОНЕНТЫ: ТЕКСТ И КНОПКИ СТИЛЕЙ --- */
body.theme-night .settings-title,
body.theme-night .toggle-label,
body.theme-night .style-name,
body.theme-night .stat-item,
body.theme-night .text-globe,
body.theme-night .stat-value,
body.theme-night .stat-label,
body.theme-night .memory-meta-value {
    color: var(--text-primary);
}
body.theme-night .setting-label,
body.theme-night .memory-meta-label {
    color: var(--text-secondary);
}
body.theme-night .globe-style-btn, body.theme-night .coordinates-toggle, 
body.theme-night .toggle-btn, body.theme-night .memory-form textarea, 
body.theme-night .slider-item, body.theme-night .memory-form input, 
body.theme-night .search-input, body.theme-night .filter-select,
body.theme-night .slider-label, body.theme-night .slider{
    background: rgba(37, 37, 77, 0.5); /* Темный фон для неактивных кнопок */
}
body.theme-night .globe-style-btn:hover {
    background: rgba(30, 30, 40, 0.9);
}
body.theme-night .globe-style-btn.active {
    background: rgba(50, 50, 70, 0.95);
    /* Оставляем обводку яркой */
}

body.theme-night .globe-style-btn.active {
    background: rgba(50, 50, 70, 0.95);
    /* Оставляем обводку яркой */
}

/* --- GALLERY CARDS --- */
body.theme-night .gallery-card {
  background: linear-gradient(135deg, 
    rgba(20, 20, 30, 0.95) 0%, 
    rgba(30, 30, 40, 0.85) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.theme-night .gallery-card:hover {
  box-shadow: 
    0 12px 32px rgba(168, 85, 247, 0.25),
    0 20px 60px rgba(168, 85, 247, 0.15),
    inset 0 0 80px rgba(255, 255, 255, 0.1);
}

body.theme-night .gallery-card-title,
body.theme-night .gallery-card-text,
body.theme-night .gallery-card-location {
  color: var(--text-primary);
}

body.theme-night .gallery-card-date {
  color: var(--text-tertiary);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- RECENT MEMORIES --- */
body.theme-night .recent-item {
  background: rgba(37, 37, 77, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-night .recent-item:hover {
  background: rgba(50, 50, 70, 0.9);
}

body.theme-night .recent-item-title {
  color: var(--text-primary);
}

body.theme-night .recent-item-location {
  color: var(--text-secondary);
}

/* --- MODALS --- */
body.theme-night .modal {
  background: rgba(5, 5, 16, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
}

body.theme-night .modal-content {
  background: rgba(20, 20, 30, 0.95);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 1px rgba(255, 255, 255, 0.2) inset;
}

body.theme-night .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-night .modal-close {
  background: rgba(40, 40, 50, 0.8);
  color: var(--text-primary);
}

body.theme-night .modal-close:hover {
  background: rgba(50, 50, 60, 0.9);
}

/* --- AUTH FORMS --- */
body.theme-night .auth-tab {
  background: rgba(40, 40, 50, 0.4);
  color: var(--text-secondary);
}

body.theme-night .auth-tab.active {
  background: rgba(50, 50, 70, 0.8);
  color: var(--text-primary);
}

body.theme-night .form-group input {
  background: rgba(37, 37, 77, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

body.theme-night .form-group input:focus {
  background: rgba(40, 40, 50, 0.9);
}


body.theme-night .memory-item:hover {
  background: rgba(40, 40, 50, 0.9);
}

body.theme-night .memory-title {
  color: var(--text-primary);
}

body.theme-night .memory-text {
  color: var(--text-secondary);
}

body.theme-night .memory-date {
  color: var(--text-tertiary);
}

/* --- PREVIEW MODAL --- */
body.theme-night .preview-card {
  background: linear-gradient(135deg, 
    rgba(20, 20, 30, 0.95) 0%, 
    rgba(30, 30, 40, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.theme-night .preview-title {
  color: var(--text-primary);
}

body.theme-night .preview-text {
  color: var(--text-secondary);
}

body.theme-night .preview-location,
body.theme-night .preview-music {
  background: rgba(40, 40, 50, 0.5);
  color: var(--text-secondary);
}

/* --- BUTTONS --- */
body.theme-night .secondary-btn {
  background: rgba(40, 40, 50, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

body.theme-night .secondary-btn:hover {
  background: rgba(50, 50, 60, 0.9);
  border-color: rgba(168, 85, 247, 0.5);
}

/* --- DROPZONES --- */
body.theme-night .photo-dropzone,
body.theme-night .music-dropzone {
  background: rgba(30, 30, 40, 0.8);
  border: 2px dashed rgba(255, 107, 157, 0.3);
}

body.theme-night .photo-dropzone:hover,
body.theme-night .music-dropzone:hover {
  background: rgba(40, 40, 50, 0.9);
}

body.theme-night .photo-dropzone.has-image,
body.theme-night .music-dropzone.has-music {
  background: rgba(40, 40, 50, 0.9);
}

body.theme-night .photo-dropzone-content,
body.theme-night .music-dropzone-content {
  color: var(--text-secondary);
}

body.theme-night .music-name {
  color: var(--text-primary);
}

/* --- MEMORY CARD (POPUP) --- */
body.theme-night .memory-card {
  background: linear-gradient(135deg, 
    rgba(20, 20, 30, 0.95) 0%, 
    rgba(30, 30, 40, 0.9) 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(168, 85, 247, 0.15);
}

body.theme-night .memory-card h3 {
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.theme-night .memory-card p {
  color: var(--text-secondary);
}

/* --- HELPER BUTTONS --- */
body.theme-night .helper-btn {
  background: rgba(30, 30, 40, 0.8);
  border: 2px dashed rgba(255, 107, 157, 0.3);
  color: var(--text-primary);
}

body.theme-night .helper-btn:hover {
  background: rgba(40, 40, 50, 0.9);
  border-color: rgba(255, 107, 157, 0.5);
}

/* --- TOGGLE BUTTONS --- */
body.theme-night .toggle-btn {
  background: rgba(37, 37, 77, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

body.theme-night .toggle-btn:hover {
  background: rgba(40, 40, 50, 0.9);
}

body.theme-night .toggle-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.15));
  border-color: rgba(168, 85, 247, 0.4);
  color: #a855f7;
}

/* --- EMPTY STATES --- */
body.theme-night .empty-state,
body.theme-night .gallery-empty {
  color: var(--text-secondary);
}

body.theme-night .empty-state h3,
body.theme-night .gallery-empty h3 {
  color: var(--text-primary);
}

/* --- LOGO AND BRAND --- */
body.theme-night .brand-text .text-memories {
  background: linear-gradient(90deg, #a855f7 0%, #ff6b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-night .logo-globe-circle {
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.6);
}

/* --- STATS BAR --- */
body.theme-night .stats-bar {
  background: transparent;
}

body.theme-night .stat-icon {
  filter: drop-shadow(0 2px 6px rgba(168, 85, 247, 0.5));
}

/* --- GLOBE HINT --- */
body.theme-night .globe-hint {
  background: rgba(168, 85, 247, 0.95);
  color: white;
}

/* --- SCROLLBAR --- */
body.theme-night::-webkit-scrollbar-track {
  background: rgba(20, 20, 30, 0.8);
}

body.theme-night::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(147, 51, 234, 0.8));
  border: 2px solid rgba(20, 20, 30, 0.8);
}

/* --- GENERATE AI BUTTON --- */
body.theme-night .generate-ai-btn {
  background: linear-gradient(135deg, 
    rgba(168, 85, 247, 0.2) 0%, 
    rgba(147, 51, 234, 0.1) 100%);
  border: 2px solid rgba(168, 85, 247, 0.4);
  color: #a855f7;
}

body.theme-night .generate-ai-btn:hover {
  background: linear-gradient(135deg, 
    rgba(168, 85, 247, 0.3) 0%, 
    rgba(147, 51, 234, 0.2) 100%);
}

/* --- FORM STATUS --- */
body.theme-night .form-status.error {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(239, 68, 68, 0.1));
  color: #ef4444;
}

body.theme-night .form-status.success {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(16, 185, 129, 0.1));
  color: #10b981;
}

/* --- MEMORY DETAIL MODAL --- */
body.theme-night .memory-detail-hero {
  border: 3px solid rgba(30, 30, 40, 0.8);
}

body.theme-night .memory-detail-title {
  color: var(--text-primary);
}

body.theme-night .memory-detail-text {
  color: var(--text-secondary);
}

body.theme-night .memory-detail-meta {
  background: rgba(37, 37, 77, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-night .neu-card {
  background: linear-gradient(135deg, 
    rgba(20, 20, 30, 0.95) 0%,
    rgba(30, 30, 40, 0.85) 100%);

  border: 1.5px solid rgba(255, 255, 255, 0.15); 

  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4), 
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 80px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.theme-night .neu-card::before {

  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 107, 157, 0.2) 0%, transparent 40%), /* Розовый */
    radial-gradient(circle at 80% 70%, rgba(147, 51, 234, 0.15) 0%, transparent 40%), /* Фиолетовый */
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 50%), /* Голубой */
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.1) 0%, transparent 30%); /* Белый/Звездный свет */
  opacity: 0.8; /* Чуть уменьшаем видимость, чтобы не перебивал контент */
}

body.theme-night .neu-card::after {
  opacity: 0.4; /* Увеличиваем, чтобы был виден на темном фоне (было 0.2) */
  filter: blur(1.5px); /* Чуть больше размытия для "свечения" */
}

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.3; transform: scale(0.8); }
}

/* Генерация звезд через CSS (без картинок) */
.stars, .stars2, .stars3 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

body.theme-night {
  background-color: #050510;
  color: #e0e0e0;
  
  /* Глубокий градиент космоса (Nebula) */
  background-image: 
    radial-gradient(circle at 50% 120%, #1a1a2e 10%, transparent 80%),
    radial-gradient(circle at 0% 0%, #0f172a 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(76, 29, 149, 0.1) 0%, transparent 30%);
  background-attachment: fixed;

  --surface-light: #0b0b15;
  --text-primary: #f0f0f0;  
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  /* Dark Glass Variables - Obsidian Style */
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Маленькие звезды */
body.theme-night .stars {
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 50px 160px, #fff, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0));
  background-size: 200px 200px;
  opacity: 0.4;
}

/* Средние мерцающие звезды */
body.theme-night .stars2 {
  background-image: radial-gradient(2px 2px at 100px 150px, #fff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 200px 50px, #fff, rgba(0,0,0,0));
  background-size: 300px 300px;
  opacity: 0.6;
  animation: twinkle 4s infinite ease-in-out;
}

/* --- КОМПОНЕНТЫ В НОЧНОЙ ТЕМЕ --- */

/* Прозрачный контейнер глобуса, чтобы видеть звезды */
body.theme-night .globe-wrapper {
  background: rgba(10, 10, 20, 0.2); /* Очень прозрачный */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 0 50px rgba(0, 0, 0, 0.5),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px); /* Меньше блюра, чтобы звезды были видны */
}

/* Карточки (Obsidian Glass) */
body.theme-night .neu-card,
body.theme-night .header, 
body.theme-night .globe-settings-panel,
body.theme-night .memory-card {
  background: linear-gradient(135deg, 
    rgba(20, 20, 35, 0.85) 0%,
    rgba(15, 15, 25, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* Текст и элементы управления */
body.theme-night .settings-title, 
body.theme-night .stat-value, 
body.theme-night .brand-text .text-globe {
  color: #fff;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

body.theme-night .slider-item,
body.theme-night .globe-style-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-night .globe-style-btn.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

/* Кнопка AI генерации в ночи */
body.theme-night .generate-ai-btn {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
}