@import "./sound-toggle.css";

/* ==============================================================
   НАРОДНЫЙ ГАЙД ПО ВЬЕТНАМУ | ЧИСТЫЙ СТАТИЧЕСКИЙ САЙТ
   Вертикальный формат 9:16 | Механический диск выбора разделов
   ============================================================== */


:root {
  --app-visible-height: 100vh;
  --app-visible-height: 100dvh;
  --section-color: #40E0D0;
  --glow-color: rgba(64, 224, 208, 0.6);
  --core-size: clamp(96px, 28vw, 150px);
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --main-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", sans-serif;
  --app-font-family: var(--main-font);
  --cjk-font-family: 'Noto Sans SC', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* Единая мягкая светлая голографическая палитра */
  --ui-amber-primary: #ff9f2e;
  --ui-amber-secondary: #ffb74d;
  --ui-amber-glow: rgba(255, 159, 46, 0.45);
  --ui-amber-glow-soft: rgba(255, 183, 77, 0.22);
  --ui-holo-cyan: #00f0ff;
  --ui-holo-cyan-glow: rgba(0, 240, 255, 0.35);

  --ui-surface: rgba(255, 248, 238, 0.94);
  --ui-surface-glass: rgba(255, 248, 240, 0.82);
  --ui-surface-card: rgba(255, 252, 248, 0.96);
  --ui-border-amber: rgba(255, 159, 46, 0.52);
  --ui-border-amber-light: rgba(255, 190, 90, 0.68);
  --ui-border-holo: rgba(0, 240, 255, 0.45);

  --ui-text-main: #2b1404;
  --ui-text-muted: #664930;
  --ui-text-accent: #d86800;
  --ui-text-on-dark: #ffffff;
}

/* 1. БАЗОВЫЙ СБРОС И ТИПОГРАФИКА */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
.welcome-stage,
.welcome-deck,
.app-stage,
.info-panel,
.faq-panel,
.comic-stage,
.game-stage,
.knowledge-base,
#kb-layer,
#extra-buttons,
.flower-widget,
.section-buttons {
  font-family: var(--main-font);
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
}

/* Поддержка CJK (китайский язык) */
html[lang="zh"] body,
html[lang="zh"] button,
html[lang="zh"] input,
html[lang="zh"] .welcome-stage,
html[lang="zh"] .welcome-deck,
html[lang="zh"] .flower-widget,
html[lang="zh"] .section-buttons,
html[lang="zh"] .top-control {
  font-family: var(--cjk-font-family);
}

/* 2. WELCOME STAGE: МГНОВЕННЫЙ ЭКРАН С ЛОГОТИПОМ-ИНДИКАТОРОМ ЗАГРУЗКИ И ВЫБОРОМ ЯЗЫКА */

/* Изоляция элементов главного экрана во время Welcome */
.app-stage.has-welcome .main-bg-viewport,
.app-stage.has-welcome .video-layer,
.app-stage.has-welcome .extra-buttons,
.app-stage.has-welcome .flower-widget,
.app-stage.has-welcome .section-buttons,
.app-stage.has-welcome .scan-line {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Сам Welcome-экран занимает 100% пространства главной сцены (9:16) */
.welcome-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #02070e;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  touch-action: manipulation;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.65s ease;
}

.welcome-stage.is-fading-out {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* A. Фоновое изображение: мягкий нейропанк, глубокие тона, свечение и слияние с круглым логотипом-компасом */
.welcome-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0d1a2d 0%, #081220 40%, #040810 80%, #010306 100%);
}

.neuropunk-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.welcome-bg__aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(280px, min(80vw, 44vh), 390px);
  height: clamp(280px, min(80vw, 44vh), 390px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.14) 0%, rgba(0, 140, 200, 0.05) 45%, transparent 75%);
  filter: blur(20px);
  animation: welcomeAuraBreath 8s ease-in-out infinite alternate;
}

@keyframes welcomeAuraBreath {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.welcome-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
}

.welcome-bg__subtle-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(250px, min(68vw, 38vh), 330px);
  height: clamp(250px, min(68vw, 38vh), 330px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.08);
  pointer-events: none;
}

.welcome-deck__mist {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 240, 255, 0.04) 70%, rgba(1, 16, 26, 0.4) 100%);
  pointer-events: none;
  animation: welcomeMistDrift 14s ease-in-out infinite alternate;
}

@keyframes welcomeMistDrift {
  0% { transform: translateY(0) scale(1); opacity: 0.7; }
  100% { transform: translateY(-8px) scale(1.02); opacity: 0.95; }
}

.welcome-deck__particles {
  position: absolute;
  inset: 0;
}

.welcome-deck__particles .particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 6px #00f0ff;
  opacity: 0.35;
  animation: welcomeParticleFloat 6s ease-in-out infinite alternate;
}

.welcome-deck__particles .p1 { top: 18%; left: 16%; animation-delay: 0s; }
.welcome-deck__particles .p2 { top: 32%; left: 82%; animation-delay: 1.2s; width: 4px; height: 4px; }
.welcome-deck__particles .p3 { top: 68%; left: 14%; animation-delay: 2.4s; }
.welcome-deck__particles .p4 { top: 78%; left: 84%; animation-delay: 0.8s; width: 2px; height: 2px; }
.welcome-deck__particles .p5 { top: 48%; left: 48%; animation-delay: 3.5s; width: 2.5px; height: 2.5px; }
.welcome-deck__particles .p6 { top: 88%; left: 42%; animation-delay: 1.8s; }

@keyframes welcomeParticleFloat {
  0% { transform: translateY(0) scale(0.85); opacity: 0.25; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-16px) scale(1.15); opacity: 0.35; }
}

/* E. Флажки выбора языка: начальное положение НАД логотипом, отлёт вверх при выборе */
.welcome-lang-container {
  position: absolute;
  top: calc(50% - clamp(130px, min(40vw, 21vh), 175px) - 62px);
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  z-index: 25;
  display: flex;
  justify-content: center;
  transition: top 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), width 0.65s ease;
  pointer-events: auto;
  animation: welcomeFlagsFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes welcomeFlagsFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.welcome-lang-container.is-at-top {
  top: max(20px, calc(env(safe-area-inset-top, 0px) + 16px));
  width: min(420px, calc(100% - 24px));
}

.welcome-lang-deck {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1.6vw, 8px);
  width: 100%;
}

.welcome-lang-deck.is-pulsing {
  animation: langDeckPulse 0.4s ease 2;
}

@keyframes langDeckPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 10px #00f0ff); }
}

.lang-btn {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-height: 42px;
  padding: 6px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.94) 0%, rgba(255, 242, 226, 0.9) 100%);
  border: 1.5px solid rgba(255, 140, 0, 0.4);
  box-shadow: 0 4px 14px rgba(200, 100, 20, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #4a2810;
  font-family: var(--main-font);
  font-size: clamp(11px, 2.7vw, 13px);
  font-weight: 700;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.lang-btn:active {
  transform: scale(0.95);
}

.lang-btn:hover {
  border-color: rgba(255, 140, 0, 0.8);
  box-shadow: 0 0 16px rgba(255, 140, 0, 0.35);
}

.lang-btn.is-selected {
  border-color: #ff9800;
  background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%);
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.35);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.lang-btn__flag {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lang-btn__flag .flag-svg {
  width: 22px;
  height: 16px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  transition: width 0.3s ease, height 0.3s ease;
}

.lang-btn__label {
  white-space: nowrap;
  transition: font-size 0.3s ease;
}

.lang-btn__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 10px rgba(255, 140, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lang-btn.is-selected .lang-btn__glow {
  opacity: 1;
}

/* Компактный вид после отлёта к верхней кромке */
.welcome-lang-container.is-at-top .lang-btn {
  flex: 1;
  min-height: 38px;
  max-width: 88px;
  padding: 5px 8px;
  gap: 6px;
  border-radius: 9px;
  font-size: clamp(11px, 2.7vw, 12px);
  background: rgba(255, 250, 240, 0.88);
  border-color: rgba(255, 140, 0, 0.4);
  color: #4a2810;
}

.welcome-lang-container.is-at-top .lang-btn.is-selected {
  border-color: #ff9800;
  background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%);
  box-shadow: 0 0 16px rgba(255, 140, 0, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.welcome-lang-container.is-at-top .lang-btn__flag .flag-svg {
  width: 22px;
  height: 16.5px;
}

/* B. Логотип-компас по центру экрана */
.welcome-compass-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: auto;
  animation: welcomeCompassEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes welcomeCompassEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.welcome-compass-medallion {
  position: relative;
  width: clamp(260px, min(80vw, 42vh), 350px);
  height: clamp(260px, min(80vw, 42vh), 350px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.welcome-compass-medallion.is-pulsing {
  transform: scale(1.05);
  filter: drop-shadow(0 0 24px #00f0ff);
}

/* Фоновое свечение за медальоном */
.compass-back-glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.28) 0%, rgba(138, 92, 246, 0.12) 40%, rgba(255, 215, 107, 0.06) 60%, transparent 75%);
  filter: blur(16px);
  pointer-events: none;
  transition: background 0.5s ease;
}

/* D. Электрическая молния и неоновый индикатор загрузки (SVG) */
.compass-neon-rim-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 14;
  overflow: visible;
}

.compass-tesla-waves {
  animation: teslaWaveFlicker 3s ease-in-out infinite alternate;
}

.tesla-arc {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.tesla-arc--1 { animation: teslaArcPulse1 2.2s infinite; }
.tesla-arc--2 { animation: teslaArcPulse2 2.7s infinite 0.4s; }
.tesla-arc--3 { animation: teslaArcPulse1 3.1s infinite 0.9s; }
.tesla-arc--4 { animation: teslaArcPulse2 2.5s infinite 1.2s; }

@keyframes teslaWaveFlicker {
  0% { opacity: 0.45; }
  50% { opacity: 0.85; }
  100% { opacity: 0.55; }
}

@keyframes teslaArcPulse1 {
  0%, 100% { opacity: 0.2; stroke-dasharray: 4 12; }
  45% { opacity: 0.95; stroke-dasharray: 20 4; stroke: #00f0ff; }
  55% { opacity: 0.7; stroke-dasharray: 12 8; }
}

@keyframes teslaArcPulse2 {
  0%, 100% { opacity: 0.15; stroke-dasharray: 6 14; }
  40% { opacity: 0.9; stroke-dasharray: 24 6; stroke: #ffffff; }
  60% { opacity: 0.6; stroke-dasharray: 10 10; stroke: #00d2ff; }
}

.compass-rim-track {
  opacity: 0.65;
}

.compass-rim-bar--plasma {
  transition: stroke 0.35s ease, filter 0.35s ease, stroke-dashoffset 0.08s linear;
}

.compass-rim-bar--core {
  transition: stroke-dashoffset 0.08s linear;
}

.compass-lightning-head {
  transition: transform 0.08s linear;
}

.lightning-head-aura {
  animation: lightningSparks 0.35s steps(2, start) infinite;
}

@keyframes lightningSparks {
  0% { transform: translate(500px, 10px) scale(1); filter: drop-shadow(0 0 10px #00f0ff) drop-shadow(0 0 20px #00f0ff); }
  50% { transform: translate(500px, 9px) scale(1.08) rotate(1.5deg); filter: drop-shadow(0 0 16px #00f0ff) drop-shadow(0 0 28px #ffffff); }
  100% { transform: translate(500px, 10px) scale(0.96) rotate(-1.5deg); filter: drop-shadow(0 0 12px #00d2ff) drop-shadow(0 0 22px #00f0ff); }
}

.compass-neon-rim-svg.is-complete .compass-rim-bar--plasma {
  stroke: #00f0ff !important;
  stroke-width: 24px !important;
  animation: completeLightningCircuit 3s ease-in-out infinite alternate;
}

.compass-neon-rim-svg.is-complete .compass-lightning-head {
  opacity: 0.85;
}

@keyframes completeLightningCircuit {
  0% { filter: drop-shadow(0 0 12px #00f0ff) drop-shadow(0 0 24px rgba(0, 240, 255, 0.6)); }
  100% { filter: drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 36px #00f0ff); }
}

@media (prefers-reduced-motion: reduce) {
  .compass-rim-bar--plasma {
    filter: url(#welcomeNeonGlow) !important;
    stroke-width: 16px !important;
  }
  .compass-tesla-waves,
  .tesla-arc {
    animation: none !important;
    opacity: 0.4 !important;
  }
  .compass-lightning-head {
    animation: none !important;
  }
  .lightning-head-aura {
    animation: none !important;
  }
}

/* Фоновое глубинное свечение шлюза (появляется при открытии створок) */
.compass-airlock-glow {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.35) 0%, rgba(0, 160, 255, 0.15) 55%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s ease;
  transform: scale(0.88);
}

/* Портальный слой открытых состояний (Login / Registration) под створками */
.compass-portal-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.portal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.portal-img.is-visible {
  opacity: 1;
}

/* Круглая основа логотипа и створки закрытого состояния */
.compass-core-disc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

/* Полукруглые створки шлюза (дефолтный закрытый логотип) */
.logo-shutter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  will-change: transform, opacity;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
  pointer-events: none;
}

.logo-shutter--left {
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  transform: translateX(0);
}

.logo-shutter--right {
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
  transform: translateX(0);
}

.logo-shutter__inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.compass-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

/* Неоновый стык створок шлюза по центру */
.logo-shutter-seam {
  position: absolute;
  left: calc(50% - 1px);
  top: 15%;
  bottom: 30%;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 240, 255, 0.95) 50%, transparent 100%);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8), 0 0 18px rgba(0, 240, 255, 0.5);
  z-index: 6;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

/* Неоновые кромки на гранях полукруглых створок при открытии */
.logo-shutter__edge {
  position: absolute;
  top: 15%;
  bottom: 30%;
  width: 2px;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.logo-shutter__edge--left {
  left: calc(50% - 1px);
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.9), transparent);
  box-shadow: -2px 0 8px rgba(0, 240, 255, 0.8);
}

.logo-shutter__edge--right {
  left: 50%;
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.9), transparent);
  box-shadow: 2px 0 8px rgba(0, 240, 255, 0.8);
}

/* Встроенные интерактивные кнопки на самом логотипе */
.welcome-builtin-buttons {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 18;
}

.welcome-builtin-btn {
  position: absolute;
  top: 71.5%;
  height: 13.0%;
  width: 20.0%;
  border-radius: 8px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  margin: 0;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  z-index: 25;
}

.welcome-builtin-btn--login {
  left: 28.5%;
}

.welcome-builtin-btn--register {
  left: 51.5%;
}

.welcome-builtin-btn__img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s ease;
}

.welcome-builtin-btn:hover .welcome-builtin-btn__img,
.welcome-builtin-btn:focus-visible .welcome-builtin-btn__img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.85)) drop-shadow(0 0 18px rgba(0, 240, 255, 0.45));
}

.welcome-builtin-btn--register:hover .welcome-builtin-btn__img,
.welcome-builtin-btn--register:focus-visible .welcome-builtin-btn__img {
  filter: drop-shadow(0 0 10px rgba(80, 255, 140, 0.85)) drop-shadow(0 0 18px rgba(80, 255, 140, 0.45));
}

.welcome-builtin-btn:active .welcome-builtin-btn__img {
  transform: scale(0.96);
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.95));
}

.welcome-builtin-btn--register:active .welcome-builtin-btn__img {
  filter: drop-shadow(0 0 14px rgba(80, 255, 140, 0.95));
}

.welcome-builtin-btn.is-active .welcome-builtin-btn__img {
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.95)) drop-shadow(0 0 24px rgba(0, 240, 255, 0.7));
}

.welcome-builtin-btn--register.is-active .welcome-builtin-btn__img {
  filter: drop-shadow(0 0 14px rgba(80, 255, 140, 0.95)) drop-shadow(0 0 24px rgba(80, 255, 140, 0.7));
}

@keyframes airlockPulseGlow {
  0% { transform: scale(0.95); opacity: 0.75; }
  100% { transform: scale(1.05); opacity: 1; }
}

.welcome-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}

.medallion-emblem-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.65));
}

.medallion-lens-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.65) 48%,
    rgba(0, 240, 255, 0.5) 52%,
    transparent 58%,
    transparent 100%
  );
  transform: translate3d(-180%, -180%, 0) rotate(25deg);
  opacity: 0;
  animation: medallionSheenSweep 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes medallionSheenSweep {
  0%, 86% {
    transform: translate3d(-180%, -180%, 0) rotate(25deg);
    opacity: 0;
  }
  88% {
    opacity: 0.85;
  }
  96% {
    transform: translate3d(180%, 180%, 0) rotate(25deg);
    opacity: 0.85;
  }
  98%, 100% {
    transform: translate3d(180%, 180%, 0) rotate(25deg);
    opacity: 0;
  }
}

/* C. Стрелка-индикатор (вращается вокруг центральной оси на 360°) */
.compass-needle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compass-needle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  will-change: transform;
}

.needle-pointer {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 42%;
  clip-path: polygon(50% 0%, 100% 100%, 50% 88%, 0% 100%);
  background: linear-gradient(to right, #ffd782 0%, #ffffff 50%, #00f0ff 100%);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.7);
  transform-origin: bottom center;
}

.needle-tip-glow {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #00f0ff, 0 0 16px #00f0ff;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.needle-pivot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd782 0%, #a67c1e 60%, #4a3407 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  z-index: 10;
}

/* Бейдж процентов загрузки */
.compass-percent-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--main-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #00f0ff;
  background: rgba(3, 14, 26, 0.86);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 12;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.compass-percent-badge.is-complete {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
}

/* Верхний контейнер: «Добро пожаловать» / «Welcome» над логотипом */
.welcome-top-text-container {
  position: absolute;
  bottom: calc(50% + clamp(130px, min(40vw, 21vh), 175px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 460px);
  text-align: center;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-top-text-container.is-visible {
  opacity: 1;
}

.welcome-top-title {
  font-family: var(--main-font);
  font-size: clamp(16px, 4.4vw, 22px);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #d8eeff;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.5), 0 2px 10px rgba(0, 0, 0, 0.85);
  margin: 0;
  padding: 0;
  transition: opacity 0.3s ease;
}

/* Нижний контейнер: «на Народный гайд» (крупнее, доминирует) + подсказка входа */
.welcome-bottom-text-container {
  position: absolute;
  top: calc(50% + clamp(130px, min(40vw, 21vh), 175px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 460px);
  text-align: center;
  pointer-events: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-bottom-text-container.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.welcome-brand-title {
  font-family: var(--main-font);
  font-size: clamp(23px, 6.4vw, 34px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 15%, #c8f3ff 55%, #00e5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0, 240, 255, 0.55)) drop-shadow(0 4px 26px rgba(0, 15, 35, 0.95));
  transition: opacity 0.3s ease;
}

.welcome-text-prompt {
  font-family: var(--main-font);
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 500;
  color: #00f0ff;
  opacity: 0;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
  transition: opacity 0.4s ease;
}

.welcome-text-prompt.is-ready {
  opacity: 1;
  animation: welcomePromptBreath 2.2s ease-in-out infinite alternate;
}

@keyframes welcomePromptBreath {
  0% { opacity: 0.75; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); text-shadow: 0 0 16px rgba(0, 240, 255, 0.9), 0 0 24px rgba(255, 215, 0, 0.5); }
}

.welcome-guest-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 7px 18px;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  font-family: var(--main-font);
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  pointer-events: auto;
}
.welcome-guest-btn:hover, .welcome-guest-btn:active {
  background: rgba(0, 240, 255, 0.22);
  border-color: #00f0ff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.55);
  transform: translateY(-1px);
}

/* Шторка затемнения перехода */
.welcome-curtain {
  position: absolute;
  inset: 0;
  background: #000000;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.welcome-curtain.is-dark {
  opacity: 1;
  pointer-events: auto;
}

/* Шторки экрана выхода из Welcome (горизонтальный разрез через центр логотипа) */
.welcome-screen-curtains {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10005;
  pointer-events: none;
  overflow: hidden;
}

.welcome-screen-curtains.is-hidden {
  display: none !important;
}

.welcome-screen-curtain {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.welcome-screen-curtain--top {
  top: 0;
  transform: translateY(0);
  border-bottom: 1.5px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.4);
}

.welcome-screen-curtain--bottom {
  top: 50%;
  transform: translateY(0);
  border-top: 1.5px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 -4px 20px rgba(0, 240, 255, 0.4);
}

.welcome-screen-curtains.is-opening .welcome-screen-curtain--top {
  transform: translateY(-100%) !important;
}

.welcome-screen-curtains.is-opening .welcome-screen-curtain--bottom {
  transform: translateY(100%) !important;
}

.welcome-screen-curtain__surface {
  position: absolute;
  left: 0;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, #0d1a2d 0%, #081220 40%, #040810 80%, #010306 100%);
}

.welcome-screen-curtain--top .welcome-screen-curtain__surface {
  top: 0;
}

.welcome-screen-curtain--bottom .welcome-screen-curtain__surface {
  top: -100%;
}

/* Новые шторки переключения разделов со схождением к центру и логотипом-компасом */
.section-switch-curtains {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5000;
  pointer-events: none;
  overflow: hidden;
}

.section-switch-curtains.is-hidden {
  display: none !important;
}

.section-switch-curtains.is-active {
  pointer-events: auto;
}

.sec-curtain {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.sec-curtain--top {
  top: 0;
  transform: translateY(-100%);
  border-bottom: 1.5px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 4px 25px rgba(0, 240, 255, 0.4);
}

.sec-curtain--bottom {
  top: 50%;
  transform: translateY(100%);
  border-top: 1.5px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 -4px 25px rgba(0, 240, 255, 0.4);
}

.section-switch-curtains.is-closing .sec-curtain--top,
.section-switch-curtains.is-closed .sec-curtain--top {
  transform: translateY(0) !important;
}

.section-switch-curtains.is-closing .sec-curtain--bottom,
.section-switch-curtains.is-closed .sec-curtain--bottom {
  transform: translateY(0) !important;
}

.sec-curtain__bg {
  position: absolute;
  left: 0;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, #0d1a2d 0%, #081220 40%, #040810 80%, #010306 100%);
}

.sec-curtain--top .sec-curtain__bg {
  top: 0;
}

.sec-curtain--bottom .sec-curtain__bg {
  top: -100%;
}

.sec-curtain-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.section-switch-curtains.is-closed .sec-curtain-center {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.sec-curtain-compass-wrap {
  width: clamp(200px, min(65vw, 32vh), 270px);
  height: clamp(200px, min(65vw, 32vh), 270px);
  position: relative;
}

.sec-curtain-label {
  margin-top: 14px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  letter-spacing: 0.5px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .welcome-screen-curtain,
  .sec-curtain {
    transition-duration: 0.15s !important;
  }
}

/* 3. ВЕРТИКАЛЬНАЯ СЦЕНА 9:16 С ЦЕНТРИРОВАНИЕМ */
.app-stage {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, calc(100vh * 9 / 16));
  width: min(100vw, calc(100dvh * 9 / 16));
  min-height: 100vh;
  min-height: var(--app-visible-height, 100dvh);
  height: min(100vh, calc(100vw * 16 / 9));
  height: min(100dvh, calc(100vw * 16 / 9));
  max-height: 100vh;
  max-height: var(--app-visible-height, 100dvh);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #000000;
  isolation: isolate;
  visibility: hidden;
  opacity: 0;
  box-sizing: border-box;
  container-type: inline-size;
  container-name: appstage;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-stage.is-ready,
.app-stage.has-welcome {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Мгновенная изоляция кнопок входа/регистрации для пользователя с сохраненным токеном */
html.has-saved-token .welcome-auth-mode-buttons,
body.has-saved-token .welcome-auth-mode-buttons {
  display: none !important;
}

@media (max-aspect-ratio: 9/16) {
  .app-stage:not(.app-stage--game-mode) {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    width: 100%;
    min-height: 100vh;
    min-height: var(--app-visible-height, 100dvh);
    height: 100vh;
    height: var(--app-visible-height, 100dvh);
    max-height: 100vh;
    max-height: var(--app-visible-height, 100dvh);
    aspect-ratio: auto;
  }
}

/* ЯВНОЕ ИСКЛЮЧЕНИЕ ДЛЯ МИНИ-ИГРЫ — ГОРИЗОНТАЛЬНАЯ СЦЕНА 16:9 */
.is-mini-game-mode .app-stage,
.app-stage--game-mode,
.is-game-page .app-stage--game-mode {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #000000;
  visibility: visible;
  opacity: 1;
}

@media (max-aspect-ratio: 9/16) {
  .is-mini-game-mode .app-stage,
  .app-stage--game-mode,
  .is-game-page .app-stage--game-mode {
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
    aspect-ratio: 16 / 9;
  }
}

/* 4. 3D CARD FLIPPER ДЛЯ ФОНА СЦЕНЫ */
.main-bg-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.main-bg-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform;
}

.main-bg-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.main-bg-face--front {
  transform: rotateY(0deg);
  z-index: 2;
}

.main-bg-face--back {
  transform: rotateY(180deg);
  z-index: 1;
}

.video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.video-layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-layer--current {
  z-index: 1;
  clip-path: none;
}

.video-layer--next,
.next-video-mask {
  z-index: 1;
  clip-path: none !important;
}

.video-layer--transition {
  z-index: 4;
  clip-path: none;
  visibility: hidden;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-layer--transition.is-visible {
  visibility: visible;
}

.video-layer--transition.is-fading {
  opacity: 0;
}

.transition-ui-hidden {
  opacity: 0 !important;
  transform: scale(0.95) !important;
  filter: blur(4px) !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease !important;
}

.scan-line {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.app-stage.is-wiping .scan-line {
  display: none !important;
  opacity: 0 !important;
}

.app-stage:not(.is-wiping) .scan-line {
  display: none !important;
  opacity: 0 !important;
}

.sos-btn.element-appear.is-visible {
  animation: sosHologramMaterialize 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sosHologramMaterialize {
  0% {
    opacity: 0;
    transform: scale(0.65);
    filter: blur(8px) brightness(2);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.12);
    filter: blur(2px) brightness(1.6);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) brightness(1);
  }
}

/* Начальное состояние интерфейса при первой поочерёдной постановке */
.app-stage.is-intro-staging .sos-btn:not(.is-visible),
.app-stage.is-intro-staging .home-btn:not(.is-visible),
.app-stage.is-intro-staging .sound-btn:not(.is-visible),
.app-stage.is-intro-staging .info-btn:not(.is-visible),
.app-stage.is-intro-staging .kb-btn:not(.is-visible),
.app-stage.is-intro-staging .section-buttons:not(.is-visible),
.app-stage.is-intro-staging .flower-widget:not(.is-visible),
.app-stage.is-intro-staging .flower-core:not(.is-visible),
.app-stage.is-intro-staging .flower-petal:not(.is-visible) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 5. ВЕРХНИЕ ЭЛЕМЕНТЫ: SOS, ЯЗЫК, ПРОФИЛЬ, HOME, SOUND, INFO, 24/7 (ЕДИНАЯ СОГЛАСОВАННАЯ ЛИНИЯ) */
.extra-buttons {
  position: absolute;
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
  left: 0;
  width: 100%;
  padding-left: max(8px, env(safe-area-inset-left, 8px));
  padding-right: max(8px, env(safe-area-inset-right, 8px));
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  pointer-events: none;
  box-sizing: border-box;
}

.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1.2vw, 8px);
  width: 100%;
  max-width: 520px;
  pointer-events: none;
  box-sizing: border-box;
  margin: 0 auto;
}

.top-nav-bar > * {
  margin: 0 !important;
  flex-shrink: 1;
}

/* Fallback-колонки для обратной совместимости */
.top-nav-col {
  display: flex;
  align-items: center;
  pointer-events: none;
}

.top-nav-col--left {
  justify-content: flex-start;
  flex: 1;
}

.top-nav-col--center {
  justify-content: center;
  gap: clamp(16px, 4vw, 24px);
  flex: 1;
}

.top-nav-col--right {
  justify-content: flex-end;
  flex: 1;
  gap: clamp(6px, 1.8vw, 10px);
}

.top-control {
  pointer-events: auto;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow: visible;
  min-width: 44px;
  min-height: 44px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.top-control:active {
  transform: scale(0.92);
}

.top-control__visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75))
          drop-shadow(0 0 8px rgba(190, 235, 255, 0.26));
  transition: filter 0.25s ease;
}

/* Единый голографический световой блик верхних элементов (редкий, медленный, асинхронный) */
.top-control__visual::after {
  content: "";
  position: absolute;
  inset: -22%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-150%, 0, 0) skewX(-18deg);
  background: linear-gradient(
    100deg,
    transparent 39%,
    rgba(255, 255, 255, 0.03) 44%,
    rgba(255, 255, 255, 0.48) 50%,
    rgba(211, 248, 255, 0.14) 56%,
    transparent 62%
  );
  mix-blend-mode: screen;
}

.top-control--home .top-control__visual::after {
  animation: topControlShineSlow 24s cubic-bezier(.22,.61,.36,1) 3.5s infinite;
}

.top-control--sound .top-control__visual::after {
  animation: topControlShineSlow 29s cubic-bezier(.22,.61,.36,1) 11s infinite;
}

.top-control--sos .top-control__visual::after {
  animation: topControlShineSlow 21s cubic-bezier(.22,.61,.36,1) 17s infinite;
}

.top-control--info .top-control__visual::after,
.top-control--kb .top-control__visual::after {
  animation: topControlShineSlow 31s cubic-bezier(.22,.61,.36,1) 7s infinite;
}

@keyframes topControlShineSlow {
  0%,
  78%,
  100% {
    opacity: 0;
    transform: translate3d(-150%, 0, 0) skewX(-18deg);
  }

  80% {
    opacity: 0.12;
  }

  84% {
    opacity: 0.62;
  }

  91% {
    opacity: 0.20;
    transform: translate3d(150%, 0, 0) skewX(-18deg);
  }

  94% {
    opacity: 0;
    transform: translate3d(150%, 0, 0) skewX(-18deg);
  }
}

/* SOS: ~44px (в 2 раза крупнее), глубокий красный акцент и объёмный glow */
.top-control--sos .top-control__visual {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85))
          drop-shadow(0 0 12px rgba(255, 46, 75, 0.72));
}

.top-control--sos img.top-control__icon,
.top-control--sos .sos-svg {
  width: clamp(40px, 9.5vw, 48px);
  height: clamp(40px, 9.5vw, 48px);
  object-fit: contain;
  display: block;
}

/* HOME: ~44px, дорогой high-tech / holographic стиль */
.top-control--home .top-control__visual {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85))
          drop-shadow(0 0 10px rgba(0, 229, 255, 0.45));
}

.top-control--home .home-icon,
.top-control--home img.top-control__icon {
  width: clamp(40px, 9.5vw, 48px);
  height: clamp(40px, 9.5vw, 48px);
  display: block;
}

.top-control--home:active,
.top-control--sound:active {
  transform: scale(1.04);
}

/* ==============================================================
   КОМПАКТНЫЙ ЦИКЛИЧЕСКИЙ ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА (ОДНА КНОПКА-ФЛАГ)
   ============================================================== */
.lang-cycle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 28px;
  min-width: 38px;
  max-width: 38px;
  min-height: 28px;
  max-height: 28px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.94) 0%, rgba(255, 238, 220, 0.9) 100%);
  border: 1.5px solid rgba(255, 140, 0, 0.45);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.8),
    0 2px 8px rgba(255, 140, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  position: relative;
  transition: transform 0.16s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  box-sizing: border-box;
}

.lang-cycle-btn:hover {
  border-color: rgba(255, 140, 0, 0.8);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.9),
    0 0 12px rgba(255, 140, 0, 0.38);
}

.lang-cycle-btn:active {
  transform: scale(0.92);
}

.lang-cycle-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.6);
}

.lang-cycle-btn__flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.lang-cycle-btn__flag .flag-svg {
  display: block;
  width: 26px;
  height: 19.5px;
  border-radius: 3px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.lang-cycle-btn.is-cycling .lang-cycle-btn__flag {
  transform: rotate(360deg) scale(0.85);
  opacity: 0.6;
}


/* ИНФО (База знаний / формат) — чистая интерактивная иконка без блочной плашки */
.top-control--kb .top-control__visual {
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 10px rgba(255, 152, 0, 0.45));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.top-control--kb .kb-svg,
.top-control--info .info-svg {
  width: clamp(40px, 9.5vw, 48px);
  height: clamp(40px, 9.5vw, 48px);
  display: block;
}

.top-control--kb:hover .top-control__visual,
.top-control--kb:focus-visible .top-control__visual {
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 16px rgba(255, 160, 0, 0.85));
  transform: scale(1.08);
}

/* 24/7 (Онлайн-консультант) — чистая интерактивная иконка без блочной плашки */
.top-control--info .top-control__visual {
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 10px rgba(255, 152, 0, 0.45));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.top-control--info:hover .top-control__visual,
.top-control--info:focus-visible .top-control__visual {
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 16px rgba(255, 160, 0, 0.85));
  transform: scale(1.08);
}

/* Скрытие элементов сцены при открытой базе знаний */
.app-stage.kb-open .flower-widget,
.app-stage.kb-open .section-buttons,
.app-stage.kb-open .extra-buttons {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease;
}

/* PC / Desktop адаптация верхней панели навигации (привязка к вертикальной сцене 9:16) */
@media (min-aspect-ratio: 9/16) {
  .extra-buttons {
    padding-left: 6px;
    padding-right: 6px;
    width: 100%;
    box-sizing: border-box;
  }

  .top-nav-bar {
    max-width: 100%;
    width: 100%;
    justify-content: space-evenly;
    gap: clamp(2px, 0.8vh, 6px);
    padding: 0 2px;
    box-sizing: border-box;
  }

  .top-nav-bar > * {
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }

  .top-control {
    min-width: 0 !important;
    min-height: 0 !important;
  }

  .top-control--sos img.top-control__icon,
  .top-control--sos .sos-svg,
  .top-control--home .home-icon,
  .top-control--home img.top-control__icon,
  .top-control--kb .kb-svg,
  .top-control--info .info-svg {
    width: clamp(30px, 4.2vh, 42px);
    height: clamp(30px, 4.2vh, 42px);
  }

  .lang-cycle-btn {
    width: clamp(28px, 3.8vh, 36px) !important;
    min-width: 0 !important;
    height: clamp(22px, 2.8vh, 26px) !important;
    min-height: 0 !important;
  }

  .lang-cycle-btn__flag .flag-svg {
    width: clamp(18px, 2.6vh, 24px);
    height: auto;
  }

  .top-nav-bar .sound-toggle {
    width: clamp(42px, 5.2vh, 52px) !important;
    min-width: 0 !important;
    height: clamp(22px, 2.8vh, 26px) !important;
    min-height: 0 !important;
  }

  .top-nav-bar .sound-toggle__track {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  .top-nav-bar .sound-toggle__thumb {
    width: clamp(18px, 2.3vh, 22px) !important;
    height: clamp(18px, 2.3vh, 22px) !important;
  }

  .top-control--profile.profile-nav-btn {
    min-width: 0 !important;
    min-height: 0 !important;
  }

  .profile-nav-btn__visual {
    width: clamp(28px, 3.8vh, 36px) !important;
    height: clamp(28px, 3.8vh, 36px) !important;
  }

  .profile-nav-btn__label {
    font-size: clamp(8px, 1vh, 9.5px) !important;
    max-width: 48px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

@container appstage (max-width: 440px) {
  .extra-buttons {
    padding-left: 4px;
    padding-right: 4px;
  }
  .top-nav-bar {
    gap: 3px;
    padding: 0 1px;
  }
  .top-control--sos img.top-control__icon,
  .top-control--sos .sos-svg,
  .top-control--home .home-icon,
  .top-control--home img.top-control__icon,
  .top-control--kb .kb-svg,
  .top-control--info .info-svg {
    width: 34px !important;
    height: 34px !important;
  }
  .top-nav-bar .sound-toggle {
    width: 44px !important;
    height: 24px !important;
  }
  .lang-cycle-btn {
    width: 30px !important;
    height: 24px !important;
  }
  .profile-nav-btn__visual {
    width: 30px !important;
    height: 30px !important;
  }
}

/* 6. ГОЛОГРАФИЧЕСКИЙ БАРАБАН СЕКЦИЙ И ПРОЕКЦИОННЫЙ ЛУЧ (СТАБИЛЬНЫЙ, НЕВРАЩАЮЩИЙСЯ) */

/* 6.1 Динамический проекционный луч полностью удалён по ТЗ */
.drum-projection-svg,
.drum-proj-cone,
.drum-proj-laser,
.drum-proj-emitter,
.drum-proj-target {
  display: none !important;
}

.flower-widget,
.holo-drum-widget {
  position: absolute;
  left: auto !important;
  right: 2.5% !important;
  top: 50% !important;
  transform: translate3d(0, -50%, 0) !important;
  width: var(--drum-size, clamp(240px, min(68vw, 40vh), 324px)) !important;
  width: var(--drum-size, clamp(240px, min(68vw, 40dvh), 324px)) !important;
  max-width: 326px !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.4s ease;
}

.flower-widget.is-dragging {
  will-change: transform;
}

/* 6.3 Барабан секций (строго концентрический, не вращается) */
.drum-wheel,
.flower-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 6.3.1 Послойный стек голографических ассетов барабана */
.drum-layers-stack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  border-radius: 50%;
  overflow: visible;
}

.drum-layer-base,
.drum-layer-sector,
.drum-layer-active,
.drum-layer-core {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.drum-layer-base {
  z-index: 10;
  opacity: 1;
}

.drum-layer-sector {
  z-index: 12;
  opacity: 1;
  transform-origin: 50% 50%;
  transform: scale(1);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.drum-layer-sector.is-selected-preview {
  opacity: 0;
}

.drum-layer-active {
  z-index: 14;
  opacity: 0;
  transform-origin: 50% 50%;
  transform: scale(1);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
  filter: none !important;
}

.drum-layer-active.is-active {
  opacity: 1;
  transform: scale(1.10);
}

.drum-layer-core {
  z-index: 16;
  opacity: 1;
  transform-origin: 50% 50%;
  transform: scale(1);
  transition: transform 0.28s ease, opacity 0.28s ease, filter 0.28s ease;
}

.drum-wheel:has(#flower-core:hover) .drum-layer-core {
  transform: scale(1.04);
  filter: drop-shadow(0 0 16px var(--section-color, #00f0ff));
}

.drum-wheel:has(#flower-core:active) .drum-layer-core {
  transform: scale(0.97);
}

/* 6.4 SVG слой клиновидных секций и контуров */
.drum-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 20;
}

.drum-outer-ring,
.drum-outer-glow-ring,
.drum-inner-ring,
.drum-spoke {
  display: none !important;
}

.drum-section-wedge {
  cursor: pointer !important;
  pointer-events: all !important;
  fill: rgba(0, 0, 0, 0.001) !important;
  stroke: transparent !important;
  stroke-width: 0 !important;
  transition: none;
}

.drum-section-wedge:hover {
  fill: rgba(0, 0, 0, 0.001) !important;
  stroke: transparent !important;
}

.drum-section-wedge.is-preview-active {
  fill: rgba(0, 0, 0, 0.001) !important;
  stroke: transparent !important;
  filter: none !important;
}

/* Специальные стили для кухонного барабана: надписи строго на плашках, ядро очищено */
.drum-wheel[data-section="kitchen"] .drum-section-item,
.drum-sections-content-layer[data-section-id="kitchen"] .drum-section-item {
  width: auto !important;
  min-width: 60px !important;
  max-width: 140px !important;
  height: auto !important;
  border-radius: 8px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 6px !important;
  margin: 0 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Устранение черных дублирующих надписей: HTML titles скрыты, надписи рендерятся в SVG слое */
.drum-wheel[data-section="kitchen"] .drum-sector-title,
.drum-sections-content-layer[data-section-id="kitchen"] .drum-sector-title,
.drum-sector-title {
  display: none !important;
}

/* Локализуемый SVG текстовый слой барабана «Кухня» */
.drum-kitchen-labels,
.drum-kitchen-label {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.drum-wheel[data-section="kitchen"] #flower-core {
  cursor: default !important;
}

.drum-wheel[data-section="kitchen"] #core-title {
  display: none !important;
}

/* Устаревший SVG контур полностью отключен для предотвращения дублирования подсветки */
.drum-active-contour {
  display: none !important;
}

/* 6.5 Слой интерактивного контента секций барабана */
.drum-sections-content-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

.drum-section-item,
.flower-petal {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  width: clamp(54px, 15vw, 76px) !important;
  height: clamp(54px, 15vw, 76px) !important;
  border-radius: 50% !important;
  z-index: 25;
}

.drum-section-item__icon,
.drum-section-item__label {
  display: none !important;
}

/* 6.6 Центральное ядро барабана: строго в геометрическом центре (X=0, Y=0), прозрачная интерактивная зона */
.drum-core,
.flower-core {
  position: absolute;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 31.25% !important;
  height: 31.25% !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.drum-core__backdrop,
.drum-core__icon,
.drum-core__glow,
.drum-core__ring,
.flower-core__ring,
.drum-core__title,
.flower-core__title {
  display: none !important;
}

/* 6.7 Анимация плавного появления секций */
.element-appear {
  opacity: 0;
  transform: scale(0.85);
  filter: blur(6px);
  transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.element-appear.is-visible {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.element-appear:not(.is-visible) {
  pointer-events: none !important;
}

.drum-section-item.element-appear {
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
}

.drum-section-item.element-appear.is-visible {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
}

/* Защита позиционирования барабана и центрального ядра от сброса при element-appear */
.flower-widget.element-appear,
.flower-core.element-appear {
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
}

.flower-widget.element-appear.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(var(--drum-x, calc(100% - 330px)), var(--drum-y, calc(50% - 165px)), 0);
  pointer-events: none;
}

.flower-widget.is-dragging,
.flower-widget.element-appear.is-visible.is-dragging {
  transform: translate3d(var(--drum-x), var(--drum-y), 0) scale(1.03) !important;
}

.flower-core.element-appear.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, -50%) !important;
  pointer-events: auto;
}

.flower-core.element-appear.is-visible:hover,
.flower-core:hover {
  transform: translate(-50%, -50%) scale(1.05) !important;
}

.flower-core.element-appear.is-visible:active,
.flower-core:active {
  transform: translate(-50%, -50%) scale(0.97) !important;
}

.flower-widget.is-dragging .flower-core,
.flower-widget.is-dragging .flower-core.element-appear.is-visible {
  transform: translate(-50%, -50%) scale(1.03) !important;
}


/* 7. НИЖНЕЕ МЕНЮ ИЗ 7 КНОПОК РАЗДЕЛОВ */
.section-buttons {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom, 10px));
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-left: max(4px, env(safe-area-inset-left, 4px));
  padding-right: max(4px, env(safe-area-inset-right, 4px));
  padding-top: 0;
  padding-bottom: 0;
  z-index: 40;
  box-sizing: border-box;
  transition: opacity 0.4s ease;
  pointer-events: auto;
}

.section-item,
.section-button,
.section-btn {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(2px, 0.6vh, 4px);
  gap: clamp(2px, 0.6dvh, 4px);
  padding: 0;
  border-radius: 50%;
  transition: opacity 0.2s ease;
  opacity: 0.94;
  overflow: visible;
  position: relative;
  flex: 1 1 0;
  max-width: 66px;
  box-shadow: none !important;
}

.section-button::before,
.section-button::after,
.section-btn::before,
.section-btn::after,
.section-item::before,
.section-item::after {
  content: none !important;
}

.section-button:hover,
.section-button:focus-visible,
.section-btn:hover,
.section-btn:focus-visible,
.section-item:hover,
.section-item:focus-visible {
  opacity: 1;
}

.section-button.active,
.section-btn.active,
.section-item.active {
  opacity: 1 !important;
}

.section-control,
.btn-icon-wrapper {
  position: relative;
  width: clamp(34px, min(9.2vw, 5.2vh), 42px);
  width: clamp(34px, min(9.2vw, 5.2dvh), 42px);
  height: clamp(34px, min(9.2vw, 5.2vh), 42px);
  height: clamp(34px, min(9.2vw, 5.2dvh), 42px);
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  overflow: visible;
  flex-shrink: 0;
  transform-origin: center bottom;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Активная кнопка ровно в 1.5 раза больше, строго вверх и в стороны, нижний край фиксирован */
.section-button.active .btn-icon-wrapper,
.section-btn.active .btn-icon-wrapper,
.section-item.active .btn-icon-wrapper {
  transform: scale(1.5);
  transform-origin: center bottom;
}

/* Полное отключение любого внешнего свечения/halo */
.section-btn__glow {
  display: none !important;
}

.btn-icon-wrapper img,
.section-control img,
.section-btn__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  transform: translateZ(0);
  box-shadow: none !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
  transition: transform 0.2s ease;
}

.section-button.active .btn-icon-wrapper img,
.section-btn.active .btn-icon-wrapper img,
.section-btn.active .section-btn__image,
.section-item.active .btn-icon-wrapper img,
.section-item.active .section-btn__image {
  box-shadow: none !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.section-label {
  order: -1;
  font-size: clamp(9px, 2.3vw, 11px);
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-shadow:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000,
     0 1px 3px rgba(0, 0, 0, 0.95);
  -webkit-font-smoothing: antialiased;
  transition: color 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), font-size 0.25s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
  user-select: none;
  pointer-events: none;
  line-height: 1.15;
  text-align: center;
}

/* Подпись над активной кнопкой: заметно увеличена, цвет раздела, поднята над шаром */
.section-button.active .section-label,
.section-btn.active .section-label,
.section-item.active .section-label {
  color: var(--section-color, #00d9ff);
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 900;
  transform: translateY(clamp(-16px, -2.4vh, -20px));
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.95),
     1px -1px 0 rgba(0, 0, 0, 0.95),
    -1px  1px 0 rgba(0, 0, 0, 0.95),
     1px  1px 0 rgba(0, 0, 0, 0.95),
     0 2px 4px rgba(0, 0, 0, 0.95),
     0 0 6px var(--section-color, #00d9ff);
}

.section-item[data-section="guide"].active .section-label { color: #00d9ff; }
.section-item[data-section="kitchen"].active .section-label { color: #ff9500; }
.section-item[data-section="realty"].active .section-label { color: #ff2e63; }
.section-item[data-section="tips"].active .section-label { color: #00ff88; }
.section-item[data-section="entertainment"].active .section-label { color: #9d00ff; }
.section-item[data-section="driving"].active .section-label { color: #ffcc00; }
.section-item[data-section="news"].active .section-label { color: #00aaff; }

/* 8. ЭКРАН ТИТРОВ / ПЕРЕХОДА (ОБЕЗЬЯНА) */
.preloader-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(10, 16, 26, 0.94), #000000 95%);
  display: grid;
  place-items: center;
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.preloader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.monkey-frame {
  width: clamp(110px, 32vw, 160px);
  height: clamp(110px, 32vw, 160px);
  border-radius: 50%;
  border: 3px solid var(--section-color);
  box-shadow: 0 0 20px var(--section-color);
  overflow: hidden;
}

.monkey-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preloader-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preloader-super {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--section-color);
  font-weight: 800;
}

.preloader-section {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.preloader-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

/* 9. ЧАТ / ОБРАТНАЯ СВЯЗЬ 24/7 (Компактное перетаскиваемое окно) */
.chat-widget {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(60, 40, 20, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: auto;
}

.chat-widget.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.chat-panel {
  position: fixed;
  width: min(340px, calc(100vw - 20px));
  max-height: min(460px, calc(100vh - 100px - var(--keyboard-offset, 0px)));
  top: calc(50% - (var(--keyboard-offset, 0px) * 0.45));
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 252, 248, 0.96);
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(180, 80, 20, 0.18), 0 0 25px rgba(255, 140, 0, 0.2);
  overflow: hidden;
  z-index: 90;
  user-select: text;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: top 0.24s cubic-bezier(0.2, 0.9, 0.3, 1), max-height 0.24s ease;
}

.chat-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(255, 140, 0, 0.2);
  background: rgba(255, 245, 232, 0.96);
  cursor: grab;
  touch-action: none;
  user-select: none;
  flex-shrink: 0;
}

.chat-header.is-dragging {
  cursor: grabbing;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-drag-handle {
  font-size: 14px;
  color: rgba(255, 140, 0, 0.6);
  letter-spacing: -1px;
}

.chat-title {
  font-family: "Montserrat", sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: #2c1a0e;
}

.chat-status {
  font-size: 10.5px;
  font-weight: 700;
  color: #1b5e20;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #00e676;
  border-radius: 50%;
  box-shadow: 0 0 6px #00e676;
}

.chat-close {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.25);
  color: #7a5c43;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-close:hover {
  background: rgba(255, 75, 75, 0.2);
  color: #d32f2f;
  border-color: rgba(255, 75, 75, 0.4);
}

/* Вид тем (по умолчанию) */
.chat-topics-view {
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-topics-prompt {
  font-size: 12.5px;
  color: #7a5c43;
  font-weight: 600;
  text-align: center;
}

.chat-topics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-topic-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 140, 0, 0.28);
  border-radius: 12px;
  color: #2c1a0e;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 2px 8px rgba(200, 100, 20, 0.06);
}

.chat-topic-btn:hover,
.chat-topic-btn:active {
  background: rgba(255, 245, 230, 0.98);
  border-color: #ff9800;
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.25);
  transform: translateX(2px);
}

.chat-topic-badge {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.chat-topic-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chat-topic-arrow {
  font-size: 16px;
  color: #e65100;
  font-weight: 700;
}

/* Вид диалога */
.chat-dialog-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chat-dialog-view.is-hidden {
  display: none !important;
}

.chat-topics-view.is-hidden {
  display: none !important;
}

.chat-topic-subbar {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 140, 0, 0.15);
  background: rgba(255, 245, 235, 0.95);
  display: flex;
  align-items: center;
}

.chat-back-topics-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.35);
  border-radius: 14px;
  padding: 3px 10px;
  color: #e65100;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-back-topics-btn:hover {
  background: #ff9800;
  border-color: #ff9800;
  color: #ffffff;
}

.chat-messages {
  flex: 1;
  min-height: 140px;
  max-height: 220px;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 86%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.chat-bubble.bot,
.chat-bubble.author {
  align-self: flex-start;
  background: rgba(255, 245, 235, 0.95);
  border: 1.5px solid rgba(255, 140, 0, 0.2);
  color: #2c1a0e;
  box-shadow: 0 2px 6px rgba(200, 100, 20, 0.05);
}

.chat-bubble.user,
.chat-bubble.visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 124, 0, 0.25);
}

.chat-input-bar {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1.5px solid rgba(255, 140, 0, 0.2);
  background: rgba(255, 248, 238, 0.95);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 140, 0, 0.3);
  border-radius: 16px;
  padding: 8px 12px;
  color: #2c1a0e;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #ff9800;
  box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
}

.chat-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245, 124, 0, 0.3);
}

.chat-send:hover {
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.chat-send:active {
  transform: scale(0.92);
}

.chat-send.sending {
  opacity: 0.6;
  pointer-events: none;
}

.chat-send svg,
.chat-send path {
  pointer-events: none;
}

/* 10. БЕЙДЖ НЕПРОЧИТАННЫХ СООБЩЕНИЙ */
.info-btn {
  position: relative;
}

.info-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3344;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(255, 51, 68, 0.9);
  animation: pulse-badge 1.8s infinite;
  pointer-events: none;
  z-index: 5;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); box-shadow: 0 0 14px rgba(255, 51, 68, 1); }
  100% { transform: scale(1); }
}

/* 11. ЭКСТРЕННОЕ ОКНО SOS / ГОЛОГРАФИЧЕСКИЙ ТЕМНЫЙ БОРДО */
.sos-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 4, 7, 0.78);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
}

.sos-overlay.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.sos-open {
  overflow: hidden !important;
  touch-action: none;
}

.sos-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  background: linear-gradient(175deg, rgba(32, 12, 20, 0.94) 0%, rgba(18, 7, 12, 0.97) 100%);
  border: 1px solid rgba(255, 60, 90, 0.32);
  border-radius: 22px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(220, 20, 60, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 45, 85, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Декоративное голографическое бордовое свечение */
.sos-glow-flare {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 140px;
  background: radial-gradient(ellipse at center, rgba(255, 45, 85, 0.32) 0%, rgba(180, 15, 45, 0.12) 55%, transparent 75%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

/* Шапка окна */
.sos-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 60, 90, 0.15);
  background: linear-gradient(180deg, rgba(255, 45, 85, 0.08) 0%, transparent 100%);
  flex-shrink: 0;
}

.sos-emblem {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.sos-emblem__svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(255, 56, 92, 0.4));
}

.sos-header__text {
  flex: 1;
  min-width: 0;
}

.sos-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-family: inherit;
  line-height: 1.2;
}

.sos-subtitle {
  margin: 3px 0 0 0;
  font-size: 11px;
  color: rgba(255, 170, 185, 0.85);
  font-weight: 500;
  line-height: 1.2;
}

.sos-close {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sos-close:hover,
.sos-close:focus-visible {
  background: rgba(255, 45, 85, 0.3);
  border-color: rgba(255, 75, 105, 0.6);
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(255, 45, 85, 0.4);
}

.sos-close:active {
  transform: scale(0.94);
}

/* Список служб */
.sos-body {
  position: relative;
  z-index: 1;
  padding: 12px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  overscroll-behavior: contain;
}

.sos-body::-webkit-scrollbar {
  width: 4px;
}
.sos-body::-webkit-scrollbar-track {
  background: transparent;
}
.sos-body::-webkit-scrollbar-thumb {
  background: rgba(255, 60, 90, 0.25);
  border-radius: 4px;
}

.sos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Карточка службы */
.sos-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-decoration: none;
  color: #ffffff;
  box-sizing: border-box;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.sos-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 56, 92, 0.14) 0%, transparent 80%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.sos-card:hover,
.sos-card:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 80, 110, 0.45);
  box-shadow: 0 4px 16px rgba(220, 20, 60, 0.22);
  outline: none;
}

.sos-card:hover::before,
.sos-card:focus-visible::before {
  opacity: 1;
}

.sos-card:active {
  transform: scale(0.98);
  background: rgba(255, 56, 92, 0.2);
  border-color: rgba(255, 80, 110, 0.7);
}

/* Иконка карточки */
.sos-card__icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: rgba(255, 45, 85, 0.12);
  border: 1px solid rgba(255, 45, 85, 0.24);
  color: #ff5470;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.sos-card:hover .sos-card__icon,
.sos-card:focus-visible .sos-card__icon {
  background: rgba(255, 45, 85, 0.24);
  color: #ffffff;
  transform: scale(1.05);
}

.sos-card--consular .sos-card__icon {
  background: rgba(255, 180, 70, 0.12);
  border-color: rgba(255, 180, 70, 0.25);
  color: #ffb84d;
}

.sos-card--consular:hover .sos-card__icon,
.sos-card--consular:focus-visible .sos-card__icon {
  background: rgba(255, 180, 70, 0.22);
  color: #ffffff;
}

/* VietMed Telegram Card in SOS */
.sos-card--vietmed .sos-card__icon {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.28);
  color: #00f0ff;
}

.sos-card--vietmed:hover .sos-card__icon,
.sos-card--vietmed:focus-visible .sos-card__icon {
  background: rgba(0, 240, 255, 0.24);
  color: #ffffff;
}

.sos-card--vietmed .sos-card__name--wrap {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.sos-card__call-btn--tg {
  background: linear-gradient(135deg, #2aabee 0%, #0088cc 100%) !important;
  box-shadow: 0 0 8px rgba(42, 171, 238, 0.45) !important;
}

.sos-card:hover .sos-card__call-btn--tg,
.sos-card:focus-visible .sos-card__call-btn--tg {
  box-shadow: 0 0 14px rgba(42, 171, 238, 0.75) !important;
  transform: scale(1.1);
}

/* Описание службы */
.sos-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sos-card__name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: 0.1px;
}

.sos-card__desc {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Блок действия и номера */
.sos-card__action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sos-card__number {
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 56, 92, 0.4);
}

.sos-card__number--full {
  font-size: 11.5px;
  letter-spacing: 0;
  font-weight: 700;
}

.sos-card__call-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff2a54 0%, #c91838 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 8px rgba(255, 42, 84, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.sos-card:hover .sos-card__call-btn,
.sos-card:focus-visible .sos-card__call-btn {
  transform: scale(1.1);
  box-shadow: 0 0 14px rgba(255, 42, 84, 0.7);
}

/* Нижняя кнопка закрытия */
.sos-footer {
  position: relative;
  z-index: 1;
  padding: 10px 16px 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 60, 90, 0.15);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(0deg, rgba(255, 45, 85, 0.06) 0%, transparent 100%);
}

.sos-footer-close {
  width: 100%;
  max-width: 240px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sos-footer-close:hover,
.sos-footer-close:focus-visible {
  background: rgba(255, 56, 92, 0.25);
  border-color: rgba(255, 80, 110, 0.55);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 56, 92, 0.3);
  transform: translateY(-1px);
}

.sos-footer-close:active {
  transform: scale(0.97);
}

/* ПОСЛЕДОВАТЕЛЬНАЯ АНИМАЦИЯ ПОЯВЛЕНИЯ (0.55 - 0.75s) */
@keyframes sosPanelMaterialize {
  0% {
    opacity: 0;
    transform: scale(0.91) translateY(22px);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes sosFadeDown {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sosCardSlideIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sosFadeUp {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.sos-overlay.is-active .sos-panel {
  animation: sosPanelMaterialize 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sos-overlay.is-active .sos-emblem {
  animation: sosFadeDown 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both;
}

.sos-overlay.is-active .sos-header__text {
  animation: sosFadeDown 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

.sos-overlay.is-active .sos-close {
  animation: sosFadeDown 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.20s both;
}

.sos-overlay.is-active .sos-card:nth-child(1) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}
.sos-overlay.is-active .sos-card:nth-child(2) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
}
.sos-overlay.is-active .sos-card:nth-child(3) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.34s both;
}
.sos-overlay.is-active .sos-card:nth-child(4) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.40s both;
}
.sos-overlay.is-active .sos-card:nth-child(5) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.46s both;
}
.sos-overlay.is-active .sos-card:nth-child(6) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.52s both;
}
.sos-overlay.is-active .sos-card:nth-child(7) {
  animation: sosCardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.58s both;
}

.sos-overlay.is-active .sos-footer {
  animation: sosFadeUp 0.38s ease 0.64s both;
}

/* Компактный режим для экранов малой высоты */
@media (max-height: 640px) {
  .sos-header {
    padding: 10px 14px 8px;
  }
  .sos-emblem {
    width: 32px;
    height: 32px;
  }
  .sos-title {
    font-size: 14px;
  }
  .sos-body {
    padding: 8px 12px;
  }
  .sos-card {
    padding: 8px 10px;
    gap: 8px;
  }
  .sos-card__icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  .sos-card__name {
    font-size: 12.5px;
  }
  .sos-card__desc {
    font-size: 9.5px;
  }
  .sos-footer {
    padding: 8px 14px 10px;
  }
}

/* ==========================================================================
   ЭКРАН ВЫБОРА ФОРМАТА БАЗЫ ЗНАНИЙ (СТИЛЬ WELCOME & ДВА ИСТОЧНИКА ДИНАМИКИ)
   ========================================================================== */
.info-format-layer {
  position: absolute;
  inset: 0;
  z-index: 110;
  background: #02070e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  pointer-events: auto;
}

.info-format-layer.is-hidden {
  opacity: 0 !important;
  transform: scale(0.96) !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Фоновая атмосфера в стиле Welcome: два мягких динамических центра */
.info-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0d1a2d 0%, #081220 40%, #040810 80%, #010306 100%);
}

.info-neuropunk-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.info-bg__gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 28%, rgba(245, 158, 11, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 72%, rgba(0, 240, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, #0d1a2d 0%, #081220 40%, #040810 80%, #010306 100%);
  pointer-events: none;
  z-index: 1;
}

.info-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.68) 100%);
  pointer-events: none;
  z-index: 3;
}

.info-bg__mist {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 240, 255, 0.04) 70%, rgba(1, 16, 26, 0.4) 100%);
  pointer-events: none;
  animation: welcomeMistDrift 14s ease-in-out infinite alternate;
  z-index: 3;
}

/* Шапка INFO в стиле Welcome */
.info-format-header {
  position: relative;
  z-index: 10;
  height: clamp(52px, 8vh, 64px);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(0, 240, 255, 0.2);
  background: rgba(4, 9, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.info-format-header__left,
.info-format-header__right {
  display: flex;
  align-items: center;
  min-width: 60px;
}

.info-format-header__right {
  justify-content: flex-end;
}

.info-format-header__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.info-format-title {
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

.info-format-subtitle {
  font-size: 11px;
  color: #8fa3bf;
  font-weight: 500;
  margin-top: 2px;
}

/* Кнопка Home (иконка домика в стиле Welcome) */
.info-format-back-btn,
.kb-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 18, 30, 0.85);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  color: #00e5ff;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.info-format-back-btn:hover,
.info-format-back-btn:active,
.kb-back-btn:hover,
.kb-back-btn:active {
  background: #00e5ff;
  border-color: #00e5ff;
  color: #02070e;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.65);
  transform: scale(1.08);
}

.info-format-body {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 24px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.info-format-cards-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
}

.info-format-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* Источник 1: Динамическая аура вокруг окна Классического гайда (золотисто-янтарная с мягким светом) */
.info-item-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(250px, 54vw, 320px);
  height: clamp(250px, 54vw, 320px);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(24px);
  z-index: 1;
}

.info-item-aura--classic {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.08) 42%, transparent 72%);
  animation: infoAuraBreathClassic 8s ease-in-out infinite alternate;
}

@keyframes infoAuraBreathClassic {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.65; }
  100% { transform: translate(-50%, -50%) scale(1.12); opacity: 0.95; }
}

/* Источник 2: Динамическая аура вокруг окна Комикса (неоново-бирюзовая в стиле Welcome) */
.info-item-aura--comic {
  background: radial-gradient(circle, rgba(0, 240, 255, 0.22) 0%, rgba(0, 140, 200, 0.08) 42%, transparent 72%);
  animation: infoAuraBreathComic 8s ease-in-out infinite alternate -4s;
}

@keyframes infoAuraBreathComic {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.65; }
  100% { transform: translate(-50%, -50%) scale(1.12); opacity: 0.95; }
}

/* Мягкие концентрические кольца Welcome вокруг каждого окна */
.info-item-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(235px, 50vw, 295px);
  height: clamp(235px, 50vw, 295px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.info-item-ring--classic {
  border: 1px dashed rgba(245, 158, 11, 0.18);
  animation: infoRingPulseClassic 7s ease-in-out infinite alternate;
}

@keyframes infoRingPulseClassic {
  0% { transform: translate(-50%, -50%) scale(0.96) rotate(0deg); opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(1.05) rotate(20deg); opacity: 0.85; }
}

.info-item-ring--comic {
  border: 1px dashed rgba(0, 240, 255, 0.18);
  animation: infoRingPulseComic 7s ease-in-out infinite alternate -3.5s;
}

@keyframes infoRingPulseComic {
  0% { transform: translate(-50%, -50%) scale(0.96) rotate(0deg); opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(1.05) rotate(-20deg); opacity: 0.85; }
}

/* Мягкие частицы вокруг каждого окна в стиле Welcome */
.info-item-particles {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  z-index: 2;
}

.info-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: infoParticleFloat 6s ease-in-out infinite alternate;
}

.info-item-particles--classic .ip1 {
  width: 3px; height: 3px; top: 15%; left: 8%; background: #f59e0b; box-shadow: 0 0 6px #f59e0b; opacity: 0.35; animation-delay: 0s;
}
.info-item-particles--classic .ip2 {
  width: 4px; height: 4px; top: 75%; left: 88%; background: #f59e0b; box-shadow: 0 0 8px #f59e0b; opacity: 0.45; animation-delay: 1.5s;
}
.info-item-particles--classic .ip3 {
  width: 2.5px; height: 2.5px; top: 82%; left: 12%; background: #d97706; box-shadow: 0 0 6px #d97706; opacity: 0.3; animation-delay: 3s;
}

.info-item-particles--comic .ip1 {
  width: 3px; height: 3px; top: 18%; left: 86%; background: #00f0ff; box-shadow: 0 0 6px #00f0ff; opacity: 0.35; animation-delay: 0.8s;
}
.info-item-particles--comic .ip2 {
  width: 4px; height: 4px; top: 78%; left: 10%; background: #00f0ff; box-shadow: 0 0 8px #00f0ff; opacity: 0.45; animation-delay: 2.2s;
}
.info-item-particles--comic .ip3 {
  width: 2.5px; height: 2.5px; top: 12%; left: 14%; background: #00d2ff; box-shadow: 0 0 6px #00d2ff; opacity: 0.3; animation-delay: 3.8s;
}

@keyframes infoParticleFloat {
  0% { transform: translateY(0) scale(0.85); opacity: 0.25; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-12px) scale(1.15); opacity: 0.35; }
}

.info-format-circle-btn {
  position: relative;
  width: clamp(210px, 48vw, 270px) !important;
  height: clamp(210px, 48vw, 270px) !important;
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 0;
  outline: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.info-format-circle-btn:hover {
  transform: scale(1.05) translateY(-3px);
}

.info-format-circle-btn:active {
  transform: scale(0.96);
}

.circle-btn__content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  border-radius: 50%;
}

.info-format-picture {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-format-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 12px 28px rgba(20, 15, 10, 0.28));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.info-format-circle-btn:hover .info-format-img {
  filter: drop-shadow(0 18px 38px rgba(20, 15, 10, 0.38)) drop-shadow(0 0 22px rgba(0, 240, 255, 0.32));
}

.info-format-circle-btn[data-info-format="comic"]:hover .info-format-img {
  filter: drop-shadow(0 18px 38px rgba(20, 15, 10, 0.38)) drop-shadow(0 0 22px rgba(245, 158, 11, 0.38));
}

.info-format-circle-label {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  visibility: hidden !important;
}

/* ==========================================================================
   РЕДКИЕ БЛИКИ ДЛЯ КАРТОЧЕК ВЫБОРА INFO (CLASSIC & COMICS)
   ========================================================================== */
.info-format-glint {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
}

.info-format-glint::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: linear-gradient(
    115deg,
    transparent 36%,
    rgba(255, 255, 255, 0.04) 44%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(220, 245, 255, 0.16) 53%,
    transparent 62%
  );
  transform: translate3d(-100%, -100%, 0) rotate(25deg);
  opacity: 0;
  pointer-events: none;
}

/* Classic: длительность ~1.2s, пауза ~22s, старт через 3.5s */
.info-format-glint--classic::after {
  animation: glintSweepClassic 22s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  animation-delay: 3.5s;
}

/* Comic: длительность ~1.2s, пауза ~27s, старт через 14s */
.info-format-glint--comic::after {
  animation: glintSweepComic 27s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  animation-delay: 14s;
}

@keyframes glintSweepClassic {
  0% {
    transform: translate3d(-110%, -110%, 0) rotate(25deg);
    opacity: 0;
  }
  1% {
    opacity: 0.24;
  }
  5.5% {
    transform: translate3d(110%, 110%, 0) rotate(25deg);
    opacity: 0.18;
  }
  6.5% {
    opacity: 0;
    transform: translate3d(120%, 120%, 0) rotate(25deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(120%, 120%, 0) rotate(25deg);
  }
}

@keyframes glintSweepComic {
  0% {
    transform: translate3d(-110%, -110%, 0) rotate(25deg);
    opacity: 0;
  }
  1% {
    opacity: 0.26;
  }
  4.5% {
    transform: translate3d(110%, 110%, 0) rotate(25deg);
    opacity: 0.20;
  }
  5.5% {
    opacity: 0;
    transform: translate3d(120%, 120%, 0) rotate(25deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(120%, 120%, 0) rotate(25deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .info-format-glint::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* ==========================================================================
   СИСТЕМА АВТОРИЗАЦИИ И РЕГИСТРАЦИИ (WELCOME-ЭКРАН, ГОСТЬ / ПОЛЬЗОВАТЕЛЬ)
   ========================================================================== */

/* ==========================================================================
   СИСТЕМА АВТОРИЗАЦИИ И РЕГИСТРАЦИИ (WELCOME-ЭКРАН, STATE-MODEL & ЦЕНТРАЛЬНАЯ КРУГЛАЯ ФОРМА)
   ========================================================================== */

/* State Model: отображение и сокрытие зон по data-welcome-state */
/* State Model: отображение и сокрытие зон по data-welcome-state */
/* Скрытие гостевого приветствия для всех неавторизованных состояний (без пустого зазора) */
[data-welcome-state="initial"] .welcome-top-text-container,
[data-welcome-state="language-selected"] .welcome-top-text-container,
[data-welcome-state="login-open"] .welcome-top-text-container,
[data-welcome-state="register-open"] .welcome-top-text-container,
[data-welcome-state="registration-contact"] .welcome-top-text-container,
[data-welcome-state="closing-shutters"] .welcome-top-text-container,
[data-welcome-state="initial"] .welcome-bottom-text-container,
[data-welcome-state="language-selected"] .welcome-bottom-text-container,
[data-welcome-state="login-open"] .welcome-bottom-text-container,
[data-welcome-state="register-open"] .welcome-bottom-text-container,
[data-welcome-state="registration-contact"] .welcome-bottom-text-container,
[data-welcome-state="closing-shutters"] .welcome-bottom-text-container {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  margin: 0 !important;
}

/* Старые отдельные кнопки под логотипом полностью скрыты в пользу встроенных прямо в логотип */
#welcome-auth-mode-buttons,
.welcome-auth-mode-buttons,
[data-welcome-state="initial"] .welcome-auth-mode-buttons,
[data-welcome-state="language-selected"] .welcome-auth-mode-buttons,
[data-welcome-state="login-open"] .welcome-auth-mode-buttons,
[data-welcome-state="register-open"] .welcome-auth-mode-buttons,
[data-welcome-state="registration-contact"] .welcome-auth-mode-buttons,
[data-welcome-state="closing-shutters"] .welcome-auth-mode-buttons,
[data-welcome-state="authenticated"] .welcome-auth-mode-buttons {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

[data-welcome-state="initial"] .circular-auth,
[data-welcome-state="language-selected"] .circular-auth {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Анимация космического шлюза: полукруглые створки логотипа раздвигаются влево и вправо */
[data-welcome-state="login-open"] .logo-shutter--left,
[data-welcome-state="register-open"] .logo-shutter--left,
[data-welcome-state="registration-contact"] .logo-shutter--left {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

[data-welcome-state="login-open"] .logo-shutter--right,
[data-welcome-state="register-open"] .logo-shutter--right,
[data-welcome-state="registration-contact"] .logo-shutter--right {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

[data-welcome-state="login-open"] .logo-shutter-seam,
[data-welcome-state="register-open"] .logo-shutter-seam,
[data-welcome-state="registration-contact"] .logo-shutter-seam {
  opacity: 0;
}

[data-welcome-state="login-open"] .logo-shutter__edge,
[data-welcome-state="register-open"] .logo-shutter__edge,
[data-welcome-state="registration-contact"] .logo-shutter__edge {
  opacity: 0.95;
}

/* Активация портальных слоев (Login / Register) под раздвинутыми створками */
[data-welcome-state="login-open"] #portal-img-login {
  opacity: 1 !important;
}

[data-welcome-state="register-open"] #portal-img-register,
[data-welcome-state="registration-contact"] #portal-img-register {
  opacity: 1 !important;
}

[data-welcome-state="login-open"] .compass-airlock-glow,
[data-welcome-state="register-open"] .compass-airlock-glow,
[data-welcome-state="registration-contact"] .compass-airlock-glow {
  opacity: 1;
  transform: scale(1);
  animation: airlockPulseGlow 3s ease-in-out infinite alternate;
}

[data-welcome-state="login-open"] #compass-needle-layer,
[data-welcome-state="register-open"] #compass-needle-layer,
[data-welcome-state="registration-contact"] #compass-needle-layer,
[data-welcome-state="login-open"] #compass-percent-badge,
[data-welcome-state="register-open"] #compass-percent-badge,
[data-welcome-state="registration-contact"] #compass-percent-badge {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.35s ease;
}

[data-welcome-state="login-open"] .circular-auth,
[data-welcome-state="register-open"] .circular-auth,
[data-welcome-state="registration-contact"] .circular-auth {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: scale(1) !important;
  z-index: 100 !important;
}

[data-welcome-state="login-open"] .welcome-builtin-buttons,
[data-welcome-state="register-open"] .welcome-builtin-buttons,
[data-welcome-state="registration-contact"] .welcome-builtin-buttons {
  pointer-events: none !important;
}

/* Закрытие створок логотипа (Этап 1 выхода из Welcome) */
[data-welcome-state="closing-shutters"] .welcome-top-text-container,
[data-welcome-state="closing-shutters"] .welcome-bottom-text-container,
[data-welcome-state="closing-shutters"] .welcome-auth-mode-buttons {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

[data-welcome-state="closing-shutters"] .logo-shutter--left,
[data-welcome-state="closing-shutters"] .logo-shutter--right {
  transform: translateX(0) !important;
  opacity: 1 !important;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
}

[data-welcome-state="closing-shutters"] .logo-shutter-seam {
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
}

[data-welcome-state="closing-shutters"] .logo-shutter__edge {
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

[data-welcome-state="closing-shutters"] .circular-auth {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease !important;
}

/* ==============================================================
   СТРОГАЯ МАШИНА СОСТОЯНИЙ WELCOME:
   СОСТОЯНИЕ A: ГОСТЬ / НЕВЕРИФИЦИРОВАННЫЙ
   СОСТОЯНИЕ B: АВТОРИЗОВАННЫЙ / ВЕРИФИЦИРОВАННЫЙ
   ============================================================== */

/* Кнопки Welcome: строго две кнопки (#welcome-builtin-btn-login и #welcome-builtin-btn-register).
   Они всегда остаются в DOM на своих местах и видимы как в состоянии гостя, так и в состоянии авторизованного пользователя. */
.welcome-builtin-btn--login,
.welcome-builtin-btn--register {
  display: flex !important;
  pointer-events: auto !important;
}
/* При переходе новые кнопки Home и ЛК остаются на своих местах поверх логотипа
   до полного исчезновения Welcome, ни на один кадр не обнажая старые иконки */
.welcome-stage.is-fading-out .welcome-builtin-btn--login,
.welcome-stage.is-fading-out .welcome-builtin-btn--register,
.welcome-stage.is-transitioning .welcome-builtin-btn--login,
.welcome-stage.is-transitioning .welcome-builtin-btn--register,
html.is-auth-user .welcome-builtin-btn--login,
html.is-auth-user .welcome-builtin-btn--register,
[data-welcome-state="authenticated"] .welcome-builtin-btn--login,
[data-welcome-state="authenticated"] .welcome-builtin-btn--register,
[data-welcome-state="closing-shutters"].is-auth-user .welcome-builtin-btn--login,
[data-welcome-state="closing-shutters"].is-auth-user .welcome-builtin-btn--register {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.welcome-stage.is-transitioning .welcome-builtin-btn--login,
.welcome-stage.is-transitioning .welcome-builtin-btn--register,
.welcome-stage.is-fading-out .welcome-builtin-btn--login,
.welcome-stage.is-fading-out .welcome-builtin-btn--register {
  pointer-events: none !important;
}

/* Формы авторизации/регистрации в состоянии B всегда закрыты и скрыты */
html:not([data-welcome-state="login-open"]):not([data-welcome-state="register-open"]).has-saved-token #welcome-circular-auth,
[data-welcome-state="authenticated"] #welcome-circular-auth,
[data-welcome-state="authenticated"] .circular-auth,
[data-welcome-state="authorized"] #welcome-circular-auth,
[data-welcome-state="authorized"] .circular-auth {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Кнопка гостевого входа в состоянии B строго скрыта */
[data-welcome-state="authenticated"] #welcome-guest-btn,
[data-welcome-state="authorized"] #welcome-guest-btn,
html.is-auth-user #welcome-guest-btn,
html.has-saved-token #welcome-guest-btn {
  display: none !important;
  pointer-events: none !important;
}

/* Значок профиля на главной странице: для гостя СТРОГО скрыт, для авторизованного ВИДЕН */
html.is-guest-user #header-profile-btn,
body.is-guest-mode #header-profile-btn,
#header-profile-btn.is-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.has-saved-token:not(.is-guest-user) #header-profile-btn:not(.is-hidden),
html.is-auth-user:not(.is-guest-user) #header-profile-btn:not(.is-hidden),
body.is-user-mode:not(.is-guest-mode) #header-profile-btn:not(.is-hidden) {
  display: inline-flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Принудительная видимость при открытых формах авторизации / регистрации */
html[data-welcome-state="login-open"] #welcome-circular-auth,
html[data-welcome-state="register-open"] #welcome-circular-auth,
html[data-welcome-state="registration-contact"] #welcome-circular-auth,
[data-welcome-state="login-open"] .circular-auth,
[data-welcome-state="register-open"] .circular-auth,
[data-welcome-state="registration-contact"] .circular-auth {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1000 !important;
}

[data-welcome-state="authenticated"] .compass-core-disc {
  opacity: 1 !important;
  pointer-events: auto !important;
}

[data-welcome-state="authenticated"] .welcome-top-text-container {
  opacity: 1 !important;
  visibility: visible !important;
}

[data-welcome-state="authenticated"] .welcome-bottom-text-container {
  opacity: 1 !important;
  visibility: visible !important;
  top: calc(50% + clamp(130px, min(40vw, 21vh), 175px) + 20px) !important;
}

/* 4. ДВЕ КНОПКИ ПОД ЛОГОТИПОМ (АВТОРИЗАЦИЯ И РЕГИСТРАЦИЯ) */
.welcome-auth-mode-buttons {
  position: absolute;
  top: calc(50% + clamp(130px, min(40vw, 21vh), 175px) + 22px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: clamp(52px, min(14.5vw, 7.2vh), 66px);
  width: auto;
  background: transparent;
  border: none;
  border-radius: 9999px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 25;
  box-sizing: border-box;
  overflow: visible;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  pointer-events: auto;
}

.welcome-auth-mode-buttons.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.welcome-mode-btn {
  flex: none;
  height: 100%;
  min-height: 48px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.22s ease;
  padding: 0;
  border-radius: 12px;
}

.welcome-mode-btn:hover,
.welcome-mode-btn:active {
  background: transparent;
  transform: scale(1.05);
}

.welcome-mode-btn:focus-visible {
  outline: 2px solid #00f0ff;
  outline-offset: 2px;
}

.welcome-mode-btn__divider {
  display: none !important;
}

.welcome-mode-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 0;
}

.welcome-mode-btn__img {
  display: block;
  height: clamp(52px, min(14.5vw, 7.2vh), 66px);
  width: auto;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  transition: transform 0.22s ease, filter 0.22s ease;
}

.welcome-mode-btn--login:hover .welcome-mode-btn__img {
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.85)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.welcome-mode-btn--register:hover .welcome-mode-btn__img {
  filter: drop-shadow(0 0 12px rgba(60, 140, 255, 0.85)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

/* Активное изумрудно-зелёное состояние выбранной кнопки («Вход» или «Регистрация») */
.welcome-mode-btn.is-active-mode .welcome-mode-btn__img,
.welcome-mode-btn[aria-pressed="true"] .welcome-mode-btn__img {
  filter: drop-shadow(0 0 14px rgba(0, 255, 136, 0.95)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.welcome-mode-btn__glow {
  display: none;
}

/* 5. ВНУТРЕННЕЕ ОКНО ФОРМЫ (ПОРТАЛЬНЫЙ ОВЕРЛЕЙ) */
.circular-auth {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 15;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.circular-auth.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Верхняя панель и переключатели */
.circular-auth__top-bar,
.circular-auth__switch,
.circ-switch-btn {
  display: none !important;
}

/* Кнопка закрытия формы (крестик): аккуратно в правом верхнем углу окна */
.circular-auth__close-btn {
  position: absolute;
  top: 19.5%;
  right: 21%;
  z-index: 25;
  background: rgba(3, 20, 36, 0.75);
  border: 1.5px solid rgba(0, 240, 255, 0.6);
  color: #00f0ff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.circular-auth__close-btn:hover,
.circular-auth__close-btn:focus-visible {
  color: #ffffff;
  background: rgba(0, 240, 255, 0.35);
  border-color: #00f0ff;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
}

/* Тело формы */
.circular-auth__body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto !important;
}

/* Формы авторизации и регистрации накладываются поверх графических окон нового логотипа */
.circ-form {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto !important;
}

.circ-form.is-hidden {
  display: none !important;
}

.circ-field {
  margin: 0;
  padding: 0;
}

/* Поля формы входа (Login: 2 поля + кнопка) */
.circ-form--login #circ-login-user {
  position: absolute;
  left: 30.3%;
  top: 27.2%;
  width: 39.4%;
  height: 7.8%;
}

.circ-form--login #circ-login-pass {
  position: absolute;
  left: 30.3%;
  top: 38.0%;
  width: 39.4%;
  height: 8.4%;
}

.circ-form--login .circ-error {
  position: absolute;
  left: 24%;
  top: 48%;
  width: 52%;
}

.circ-form--login #circ-login-submit {
  position: absolute;
  left: 31.0%;
  top: 61.8%;
  width: 38.1%;
  height: 7.6%;
}

/* Поля формы регистрации (Register: 3 поля + кнопка) */
.circ-form--register #circ-reg-user {
  position: absolute;
  left: 30.3%;
  top: 27.2%;
  width: 39.4%;
  height: 7.8%;
}

.circ-form--register #circ-reg-pass {
  position: absolute;
  left: 30.3%;
  top: 38.0%;
  width: 39.4%;
  height: 8.4%;
}

.circ-form--register #circ-reg-repeat {
  position: absolute;
  left: 30.3%;
  top: 49.0%;
  width: 39.4%;
  height: 8.4%;
}

.circ-form--register .circ-error {
  position: absolute;
  left: 24%;
  top: 57.5%;
  width: 52%;
}

.circ-form--register #circ-reg-submit {
  position: absolute;
  left: 31.0%;
  top: 61.8%;
  width: 38.1%;
  height: 7.6%;
}

/* Стилизация инпутов: аккуратное совмещение с графикой */
.circ-input {
  box-sizing: border-box;
  background: rgba(3, 16, 28, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  color: #ffffff !important;
  font-family: inherit;
  font-size: clamp(11px, 2.3vw, 13px);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 0 8px;
  outline: none;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.circ-input:focus {
  background: rgba(4, 22, 38, 0.96);
  border-color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6), inset 0 0 8px rgba(0, 240, 255, 0.25);
}

.circ-input::placeholder {
  color: rgba(200, 235, 255, 0.75);
  font-size: clamp(10px, 2vw, 12px);
}

/* Ошибки валидации */
.circ-error {
  text-align: center;
  color: #ff4757;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 0 4px #000, 0 0 8px #000;
  z-index: 20;
  pointer-events: none;
}

.circ-error.is-hidden {
  display: none !important;
}

/* Кнопка отправки формы («ПРИНЯТЬ» / «Войти») */
.circ-submit-btn {
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(0, 190, 250, 0.9) 0%, rgba(0, 130, 210, 0.95) 100%);
  border: 1.5px solid #00f0ff;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 800;
  font-size: clamp(11px, 2.2vw, 13px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 240, 255, 0.8);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.circ-submit-btn:hover,
.circ-submit-btn:focus-visible {
  background: linear-gradient(180deg, #00f0ff 0%, #0099ff 100%);
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.9), inset 0 0 12px rgba(255, 255, 255, 0.5);
  transform: scale(1.02);
}

.circ-submit-btn:active {
  transform: scale(0.98);
}

/* Форма контактов (Шаг 2 после регистрации) */
.circ-form--contact {
  position: absolute;
  inset: 18% 18% 18% 18%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  pointer-events: auto;
}

.circ-form--contact.is-hidden {
  display: none !important;
}

.circ-contact-header {
  text-align: center;
  margin-bottom: 4px;
}

.circ-contact-title {
  font-size: 13px;
  font-weight: 700;
  color: #00f0ff;
}

.circ-contact-subtitle {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.2;
}

.circ-form--contact .circ-field {
  width: 100%;
}

.circ-form--contact .circ-input {
  width: 100%;
  height: 28px;
}

.circ-form--contact .circ-submit-btn {
  width: 100%;
  height: 30px;
  margin-top: 4px;
}

/* Запрос дополнительных контактов (Шаг 2) */
.circ-contact-header {
  text-align: center;
  margin-bottom: 2px;
}

.circ-contact-title {
  font-size: 11px;
  font-weight: 800;
  color: #d95d00;
  text-shadow: 0 0 8px rgba(255, 160, 48, 0.4);
  margin-bottom: 2px;
}

.circ-contact-subtitle {
  font-size: 8.5px;
  color: #664930;
  line-height: 1.25;
  margin-bottom: 4px;
}

/* Адаптивность для низких экранов */
@media (max-height: 640px) {
  .welcome-compass-medallion {
    width: clamp(230px, 46vh, 260px) !important;
    height: clamp(230px, 46vh, 260px) !important;
  }
  .welcome-auth-mode-buttons {
    height: 30px;
    width: auto;
    top: calc(50% + clamp(115px, 23vh, 130px) + 14px);
  }
  .welcome-mode-btn__img {
    height: 30px;
  }
  [data-welcome-state="language-selected"] .welcome-bottom-text-container {
    top: calc(50% + clamp(115px, 23vh, 130px) + 52px) !important;
    gap: 2px;
  }
  [data-welcome-state="authenticated"] .welcome-bottom-text-container {
    top: calc(50% + clamp(115px, 23vh, 130px) + 14px) !important;
    gap: 2px;
  }
  .welcome-brand-title {
    font-size: 19px !important;
  }
  .welcome-text-prompt {
    font-size: 11px !important;
  }
  .circ-input {
    height: 25px;
    font-size: 10px;
    padding: 3px 6px;
  }
  .circ-submit-btn {
    height: 26px;
    font-size: 10px;
  }
}

/* Иконка колокольчика скрыта */
#header-bell-btn,
.top-control--bell {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Иконка профиля: скрыта для гостей и в состояниях без подтверждённой авторизации */
#header-profile-btn.is-hidden,
body.is-guest-mode #header-profile-btn,
body:not(.is-user-mode) #header-profile-btn,
html:not(.is-auth-user) #header-profile-btn,
.app-stage.has-welcome #header-profile-btn,
.game-stage-active #header-profile-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Авторизованный пользователь на главной странице: показываем профиль */
body.is-user-mode:not(.kb-open) .app-stage:not(.has-welcome) #header-profile-btn:not(.is-hidden),
html.is-auth-user body.is-user-mode .app-stage:not(.has-welcome) #header-profile-btn:not(.is-hidden) {
  display: inline-flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Стили кнопки Профиль */
.top-control--profile.profile-nav-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 !important;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.top-control--profile.profile-nav-btn:hover {
  transform: scale(1.05);
}

.top-control--profile.profile-nav-btn:active {
  transform: scale(0.92);
}

.profile-nav-btn__visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(34px, 8.2vw, 38px);
  height: clamp(34px, 8.2vw, 38px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(0, 240, 255, 0.28), rgba(6, 22, 42, 0.45));
  border: 1.5px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65), 0 0 10px rgba(0, 240, 255, 0.35);
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.2s ease;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.75));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.top-control--profile.profile-nav-btn:hover .profile-nav-btn__visual {
  border-color: #00f0ff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 240, 255, 0.65);
}

.profile-nav-btn__avatar-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.profile-nav-btn__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.profile-nav-btn__label {
  display: block;
  position: absolute;
  top: calc(100% - 3px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--main-font, 'Inter', sans-serif);
  font-size: clamp(8.5px, 2.1vw, 10px);
  font-weight: 700;
  line-height: 1;
  color: #dff6ff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 240, 255, 0.6);
  pointer-events: none;
  white-space: nowrap;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bell-unread-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2e4b;
  box-shadow: 0 0 6px #ff2e4b;
}

.bell-unread-dot.is-hidden {
  display: none !important;
}

.welcome-brand-title.is-personalized {
  font-size: clamp(16px, 4.4vw, 22px);
  line-height: 1.35;
  letter-spacing: 0.01em;
  font-weight: 700;
  max-width: 320px;
}



/* ==========================================================================
   ЛИЧНЫЙ КАБИНЕТ И ПАНЕЛЬ УВЕДОМЛЕНИЙ (ПРОМТ 2)
   ========================================================================== */

/* Полноэкранный оверлей Личного Кабинета */
.cabinet-widget {
  position: absolute;
  inset: 0;
  z-index: 120;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  pointer-events: auto;
  box-sizing: border-box;
  overflow: hidden;
  background: #060b14;
}

.cabinet-widget.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Stage 1 Cryocapsule Onboarding - Полноэкранные прототипы экрана ЛК
   714x1280 (aspect-ratio ~9:16). Сохранение пропорций, без растяжения,
   без дублирования элементов визуала.
   ========================================================================== */

.cryo-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #060b14;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  touch-action: manipulation;
  margin: 0;
  padding: 0;
}

.cryo-stage.is-hidden {
  display: none !important;
}

.cryo-stage-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.cryo-stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  display: block;
}

/* ==============================================================
   ВНУТРЕННИЕ СЛОИ КРИОКАМЕРЫ И СВЕТОВОЙ ПЕРЕХОД (>= 1 СЕК)
   ============================================================== */

.cryo-chamber-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.cryo-char-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transform: scale(1);
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.45));
  transition: none;
  will-change: opacity, filter, transform;
}

.cryo-char-layer.is-visible {
  opacity: 1 !important;
  transform: scale(1);
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.45));
}

.cryo-char-layer.is-hidden {
  display: none !important;
}

/* Первое появление / материализация (650ms) */
.cryo-char-layer.is-materializing {
  animation: cryoMaterialize 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cryoMaterialize {
  0% {
    opacity: 0;
    transform: scale(0.98);
    filter: drop-shadow(0 0 45px rgba(0, 240, 255, 0.95)) brightness(1.8) blur(6px);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.005);
    filter: drop-shadow(0 0 28px rgba(0, 240, 255, 0.75)) brightness(1.3) blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.45)) brightness(1);
  }
}

/* Растворение исходного персонажа при смене (0 - 450ms) */
.cryo-char-layer.is-outgoing {
  animation: cryoOutgoing 0.48s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cryoOutgoing {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.45)) brightness(1);
  }
  30% {
    opacity: 0.95;
    transform: scale(1.01);
    filter: drop-shadow(0 0 40px rgba(0, 255, 240, 0.95)) brightness(1.45) contrast(1.1);
  }
  65% {
    opacity: 0.45;
    transform: scale(1.015);
    filter: drop-shadow(0 0 45px rgba(0, 240, 255, 0.8)) brightness(1.7) blur(3px);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
    filter: drop-shadow(0 0 50px rgba(0, 240, 255, 0)) brightness(2) blur(8px);
  }
}

/* Материализация нового персонажа (420ms - 1200ms -> 780ms) */
.cryo-char-layer.is-incoming {
  animation: cryoIncoming 0.78s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cryoIncoming {
  0% {
    opacity: 0;
    transform: scale(0.99);
    filter: drop-shadow(0 0 50px rgba(0, 255, 240, 0.95)) brightness(1.9) blur(7px);
  }
  35% {
    opacity: 0.75;
    transform: scale(1.006);
    filter: drop-shadow(0 0 35px rgba(0, 240, 255, 0.85)) brightness(1.4) blur(3px);
  }
  75% {
    opacity: 0.96;
    transform: scale(1);
    filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.6)) brightness(1.12) blur(0.5px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.45)) brightness(1);
  }
}

/* Ограниченная область светового перехода строго внутри камеры за стеклом */
.cryo-trans-fx {
  position: absolute;
  top: 16.5%;
  left: 20.5%;
  width: 59%;
  height: 57.5%;
  border-radius: 80px 80px 50px 50px;
  overflow: hidden;
  pointer-events: none;
  z-index: 25;
  contain: paint;
}

.cryo-trans-fx.is-hidden {
  display: none !important;
}

/* Центральная голографическая аура перехода */
.cryo-trans-aura {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 240, 255, 0.52) 0%, rgba(60, 160, 255, 0.28) 45%, rgba(138, 43, 226, 0.12) 70%, transparent 85%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.cryo-trans-fx.is-active .cryo-trans-aura {
  animation: cryoTransAura 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes cryoTransAura {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  25% {
    opacity: 0.55;
  }
  48% {
    opacity: 0.88;
    transform: scale(1.06);
  }
  72% {
    opacity: 0.48;
    transform: scale(1.0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Вертикальный световой сканер */
.cryo-trans-scanner {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 240, 255, 0.45) 30%, rgba(255, 255, 255, 0.95) 50%, rgba(0, 240, 255, 0.45) 70%, transparent 100%);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.95), 0 0 50px rgba(0, 240, 255, 0.65);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.cryo-trans-fx.is-active .cryo-trans-scanner {
  animation: cryoTransScan 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes cryoTransScan {
  0% {
    top: 5%;
    opacity: 0;
  }
  15% {
    opacity: 0.95;
  }
  42% {
    top: 60%;
    opacity: 0.9;
  }
  50% {
    top: 75%;
    opacity: 0.35;
  }
  56% {
    top: 15%;
    opacity: 0.85;
  }
  85% {
    top: 85%;
    opacity: 0.8;
  }
  100% {
    top: 96%;
    opacity: 0;
  }
}

/* Энергетические световые линии и лучи */
.cryo-trans-rays {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(0, 240, 255, 0.15) 11px, transparent 13px);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.cryo-trans-fx.is-active .cryo-trans-rays {
  animation: cryoTransRays 1.2s ease forwards;
}

@keyframes cryoTransRays {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.75;
    transform: translateY(-8px);
  }
  80% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(0);
  }
}

/* Поддержка prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .cryo-char-layer.is-materializing {
    animation: cryoReducedFadeIn 0.35s ease forwards !important;
  }
  .cryo-char-layer.is-outgoing {
    animation: cryoReducedFadeOut 0.4s ease forwards !important;
  }
  .cryo-char-layer.is-incoming {
    animation: cryoReducedFadeIn 0.4s ease forwards !important;
  }
  .cryo-trans-fx {
    display: none !important;
  }
}

@keyframes cryoReducedFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cryoReducedFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Полная изоляция и скрытие устаревших вспомогательных оверлеев (лампочки, блики, сканеры) */
.cryo-lamps-wrap,
.cryo-lamps-img,
.cryo-chamber-fx,
.cryo-btn-glow {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.cryo-btn-label {
  display: none !important;
}

.cryo-msg-badge {
  display: none !important;
}
.cryo-msg-counter.has-unread .cryo-msg-badge {
  display: flex !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #00f0ff;
  color: #030a16;
  font-family: 'SF Pro Display', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px #00f0ff, 0 0 20px rgba(0, 240, 255, 0.6);
  pointer-events: none;
  z-index: 5;
}

/* ==============================================================
   ВИДЕОПЛЕЕР С ТРЕМЯ ДИНАМИЧЕСКИМИ ЗОНАМИ
   ============================================================== */
.cryo-video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 30;
  pointer-events: none;
  clip-path: url(#cryo-video-mask);
  -webkit-clip-path: url(#cryo-video-mask);
  background: transparent;
  display: block;
}

.cryo-video-player.is-hidden {
  display: none !important;
}

/* ==============================================================
   ВЕРХНЯЯ СТАТИЧНАЯ ПАНЕЛЬ ПОВЕРХ ВИДЕО: Home, Sound, Messages
   ============================================================== */
.cryo-top-panel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.cryo-top-btn,
.cryo-msg-counter {
  position: absolute;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.cryo-top-btn:hover,
.cryo-msg-counter:hover {
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.75)) brightness(1.12);
}

.cryo-top-btn:active,
.cryo-msg-counter:active {
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.95)) brightness(1.22);
  transform: scale(0.97);
}

/* Home: точный скошенный контур крыла панели */
.cryo-top-btn--home {
  top: 3.75%;
  left: 25.91%;
  width: 15.82%;
  height: 5.31%;
  clip-path: polygon(71.4% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 76.7%, 33.3% 33.3%);
  -webkit-clip-path: polygon(71.4% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 76.7%, 33.3% 33.3%);
}

/* Sound: точный круглый контур строго по гнезду */
.cryo-top-btn--sound {
  top: 2.031%;
  left: 45.098%;
  width: 14.006%;
  height: 7.8125%;
  border-radius: 50%;
  clip-path: circle(41% at 50% 50%);
  -webkit-clip-path: circle(41% at 50% 50%);
}

/* Messages: симметричный скошенный контур */
.cryo-msg-counter {
  top: 3.75%;
  left: 59.38%;
  width: 15.82%;
  height: 5.31%;
  clip-path: polygon(0% 0%, 28.6% 0%, 66.7% 33.3%, 100% 76.7%, 100% 100%, 0% 100%);
  -webkit-clip-path: polygon(0% 0%, 28.6% 0%, 66.7% 33.3%, 100% 76.7%, 100% 100%, 0% 100%);
  opacity: 0.38;
  filter: grayscale(0.8) brightness(0.65);
  transition: opacity 0.25s ease, filter 0.25s ease, transform 0.1s ease;
}
.cryo-msg-counter.has-unread {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.95)) brightness(1.25);
  animation: cryoMsgPulse 2.4s infinite ease-in-out;
}
@keyframes cryoMsgPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.8)) brightness(1.15); }
  50% { filter: drop-shadow(0 0 16px rgba(0, 240, 255, 1)) brightness(1.35); }
}

/* Первая лампа слева: точный локальный контур без кнопок и без широких оверлеев */
.cryo-lamp-left {
  position: absolute;
  top: 46.797%;
  left: 11.765%;
  width: 8.403%;
  height: 4.688%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 20;
  display: block;
}

.cryo-lamp-left.is-hidden {
  display: none !important;
}

.cryo-lamp-left-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Mode B Top Bar Message Counter */
.cab-msg-counter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.2);
  cursor: pointer;
  opacity: 0.42;
  filter: grayscale(0.8) brightness(0.7);
  transition: all 0.25s ease;
  user-select: none;
}
.cab-msg-counter:hover {
  opacity: 0.85;
  filter: brightness(1);
  border-color: rgba(0, 240, 255, 0.5);
}
.cab-msg-badge {
  display: none;
}
.cab-msg-counter.has-unread {
  opacity: 1;
  filter: none;
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
  animation: cryoMsgPulse 2.4s infinite ease-in-out;
}
.cab-msg-counter.has-unread .cab-msg-badge {
  display: flex;
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #00f0ff;
  color: #020814;
  font-size: 10px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px #00f0ff;
  pointer-events: none;
}

.cryo-top-btn-img,
.cryo-sound-icon-on,
.cryo-sound-icon-off {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.cryo-sound-icon-off.is-hidden,
.cryo-sound-icon-on.is-hidden {
  display: none !important;
}

/* ==============================================================
   НИЖНИЙ ПУЛЬТ: Мужчина / Принять / Женщина
   ============================================================== */
.cryo-bottom-dock {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 45;
}

.cryo-slot-btn {
  position: absolute;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.cryo-btn-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.cryo-btn-img.is-hidden {
  display: none !important;
}

/* Кнопка Мужчина: точный контур скругленной кнопки */
.cryo-slot-btn--male {
  top: 82.266%;
  left: 7.563%;
  width: 25.770%;
  height: 11.641%;
  border-radius: 24px;
  clip-path: inset(0 round 24px);
  -webkit-clip-path: inset(0 round 24px);
}

/* Кнопка Принять: точный скругленный контур */
.cryo-slot-btn--accept {
  top: 81.250%;
  left: 37.255%;
  width: 25.490%;
  height: 13.281%;
  border-radius: 28px;
  clip-path: inset(0 round 28px);
  -webkit-clip-path: inset(0 round 28px);
}

/* Кнопка Женщина: симметричный точный контур */
.cryo-slot-btn--female {
  top: 82.266%;
  left: 66.667%;
  width: 25.770%;
  height: 11.641%;
  border-radius: 24px;
  clip-path: inset(0 round 24px);
  -webkit-clip-path: inset(0 round 24px);
}

/* Состояния кнопок: hover, press, active */
.cryo-slot-btn:hover:not(:disabled) {
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.7)) brightness(1.1);
}

.cryo-slot-btn:active:not(:disabled),
.cryo-slot-btn.is-pressing:not(:disabled) {
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.95)) brightness(1.22);
  transform: scale(0.975);
}

.cryo-slot-btn--accept:hover:not(:disabled) {
  filter: drop-shadow(0 0 12px rgba(255, 170, 0, 0.85)) brightness(1.14);
}

.cryo-slot-btn--accept:active:not(:disabled),
.cryo-slot-btn--accept.is-pressing:not(:disabled) {
  filter: drop-shadow(0 0 20px rgba(255, 170, 0, 1.0)) brightness(1.25);
  transform: scale(0.975);
}

.cryo-slot-btn:disabled,
.cryo-slot-btn.is-disabled {
  cursor: not-allowed;
  filter: brightness(0.85);
  pointer-events: none;
}

/* Оверлей блокировки нижней консоли во время показа видео */
.cryo-lock-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 25%;
  z-index: 55;
  pointer-events: auto;
  background: transparent;
}

.cryo-lock-overlay.is-hidden {
  display: none !important;
}

/* Дефолтный тёмный Hi-Tech фон: Графит/Тёмно-синий/Фиолетовый + голографическая сетка + аура */
.cab-neuropunk-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: radial-gradient(circle at 50% 32%, #111e38 0%, #0a1324 45%, #050913 85%, #03050a 100%);
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 38px 38px;
}

.cab-neuropunk-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.35;
}

.cab-bg__aura {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(0, 240, 255, 0.09) 0%, rgba(138, 43, 226, 0.07) 40%, transparent 70%);
  pointer-events: none;
}

.cab-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 50%, rgba(3, 5, 10, 0.8) 100%);
  pointer-events: none;
}

/* Верхняя постоянная панель навигации: Home и Sound */
.cab-top-nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top, 14px)) 18px 10px;
  pointer-events: none;
  box-sizing: border-box;
}

.cab-top-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 140, 0, 0.4);
  color: #e65100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 14px rgba(220, 110, 20, 0.16);
  transition: all 0.22s ease;
  cursor: pointer;
  padding: 0;
}

.cab-top-btn:hover {
  background: #ffffff;
  border-color: #ff9800;
  color: #d84315;
  transform: translateY(-1.5px);
  box-shadow: 0 0 18px rgba(255, 152, 0, 0.45);
}

.cab-top-btn:active {
  transform: scale(0.95);
}

.cab-top-btn .sound-control-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cab-top-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cab-top-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.cab-top-nav-right.is-hidden {
  display: none !important;
}

/* Боковая кнопка Профиль по правому краю */
.cab-side-nav-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  pointer-events: none;
}

.cab-side-nav-right.is-hidden {
  display: none !important;
}

.cab-side-btn {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 140, 0, 0.38);
  color: #e65100;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220, 110, 20, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.22s ease;
}

.cab-side-btn:hover {
  background: #ffffff;
  border-color: #ff9800;
  color: #d84315;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.45);
}

.cab-side-btn.is-active {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border-color: #ff7a00;
  color: #ffffff;
  box-shadow: 0 0 22px rgba(255, 152, 0, 0.6);
}

.cab-side-btn__label {
  font-family: var(--main-font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   СЛОЙ 2: ПЕРСОНАЖ НА ЛЕВИТИРУЮЩЕЙ ПЛАТФОРМЕ
   ========================================================================== */
.cabinet-char-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  flex: 1 1 auto;
  max-height: calc(100dvh - 170px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}

.cab-char-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #00f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.22s ease;
  padding: 0;
}

.cab-char-arrow:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: #00f0ff;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.55);
  transform: translateY(-50%) scale(1.08);
}

.cab-char-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.cab-char-arrow--prev {
  left: 6px;
}

.cab-char-arrow--next {
  right: 6px;
}

.cab-char-arrow.is-hidden {
  display: none !important;
}

.cabinet-char-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: min(88vw, 72vh, 72dvh, calc(100dvh - 180px), 510px);
  height: min(88vw, 72vh, 72dvh, calc(100dvh - 180px), 510px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.25s ease;
}

.cabinet-char-wrap:hover .cabinet-char-img {
  filter: drop-shadow(0 18px 36px rgba(0, 240, 255, 0.35));
}

.cabinet-char-wrap:active {
  transform: scale(0.985);
}

.cabinet-char-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45));
  transition: filter 0.3s ease, opacity 0.25s ease;
}

/* Световой портал (вертикальный сканирующий луч: ИЗ платформы ВВЕРХ) */
.char-light-portal {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 27%;
  top: 4%;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.char-light-portal.is-active {
  opacity: 1;
}

.char-light-beam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 50px;
  background: linear-gradient(0deg, rgba(0, 240, 255, 0) 0%, rgba(0, 240, 255, 0.7) 30%, rgba(255, 255, 255, 0.98) 50%, rgba(0, 240, 255, 0.7) 70%, rgba(0, 240, 255, 0) 100%);
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.95));
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.8), inset 0 0 12px rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
}

.char-light-portal.is-active .char-light-beam {
  animation: charBeamShootUp 0.5s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

.char-light-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(0, 240, 255, 0.5) 0%, rgba(0, 240, 255, 0.15) 50%, transparent 80%);
  filter: blur(16px);
  opacity: 0;
}

.char-light-portal.is-active .char-light-glow {
  animation: charGlowPulse 0.5s ease-out forwards;
}

@keyframes charBeamShootUp {
  0% {
    bottom: -20px;
    opacity: 0;
    transform: scaleX(0.7);
  }
  20% {
    opacity: 1;
    transform: scaleX(1);
  }
  80% {
    opacity: 1;
    transform: scaleX(0.9);
  }
  100% {
    bottom: 102%;
    opacity: 0;
    transform: scaleX(0.6);
  }
}

@keyframes charGlowPulse {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* Табло на платформе: неоновый никнейм (некликабельно) */
.cab-tablo-overlay {
  position: absolute;
  left: 36.13%;
  top: 82.23%;
  width: 27.34%;
  height: 6.45%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
  pointer-events: none;
  z-index: 6;
  outline: none;
  border-radius: 4px;
  background: transparent;
  box-sizing: border-box;
}

.cab-tablo-text {
  font-family: var(--main-font, 'Inter', sans-serif);
  font-size: clamp(9px, 2.2vw, 13px);
  font-weight: 800;
  color: #00f0ff;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 5px #00f0ff, 0 0 12px rgba(0, 240, 255, 0.8), 0 0 20px rgba(0, 240, 255, 0.4);
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* Свитки из бересты на этапе 3 онбординга */
.cab-scrolls-zone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
  z-index: 8;
  box-sizing: border-box;
}

.cab-scrolls-zone.is-hidden {
  display: none !important;
}

.cab-birch-scroll {
  pointer-events: auto;
  width: clamp(100px, 24vw, 140px);
  background-color: #fbf7ee;
  background-image: 
    repeating-linear-gradient(180deg, transparent, transparent 10px, rgba(120, 80, 40, 0.08) 11px, rgba(120, 80, 40, 0.15) 13px, transparent 14px),
    linear-gradient(135deg, #ffffff 0%, #f7edd8 50%, #e6d4b4 100%);
  border: 1.5px solid rgba(160, 110, 60, 0.55);
  border-radius: 14px;
  padding: 8px 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cab-birch-scroll:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 24px rgba(255, 140, 0, 0.35);
}

.cab-birch-scroll.is-selected {
  border-color: #00f0ff;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.8), 0 0 45px rgba(0, 240, 255, 0.35), inset 0 0 12px rgba(0, 240, 255, 0.25);
  transform: scale(1.05);
}

.cab-scroll-frame {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cab-scroll-cap {
  width: 88%;
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(90deg, #6d4c41, #8d6e63, #5d4037);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cab-scroll-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  gap: 2px;
  text-align: center;
}

.cab-scroll-rune {
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(255, 152, 0, 0.5));
  transition: filter 0.2s ease;
}

.cab-birch-scroll.is-selected .cab-scroll-rune {
  filter: drop-shadow(0 0 10px #00f0ff);
}

.cab-scroll-title {
  font-family: var(--main-font);
  font-size: 12.5px;
  font-weight: 800;
  color: #2c1608;
  margin: 1px 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cab-birch-scroll.is-selected .cab-scroll-title {
  color: #0d47a1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 8px rgba(0, 240, 255, 0.5);
}

.cab-scroll-desc {
  font-size: 10px;
  font-weight: 600;
  color: #5d3a1a;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Нижняя зона ЛК (Onboarding & Persistent) */
.cab-bottom-zone {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 10px auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.cab-onboarding-zone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: cabFadeIn 0.25s ease;
}

.cab-onboarding-zone.is-hidden {
  display: none !important;
}

.cab-onboarding-prompt {
  font-family: var(--main-font);
  font-size: clamp(16px, 3.8vw, 22px);
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 14px rgba(255, 140, 0, 0.4);
}

.cab-onboarding-progress-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 2px 0;
}

.cab-onboarding-progress-img {
  width: 220px;
  max-width: 80%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(255, 140, 0, 0.3));
}

.cab-onboarding-controls {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.cab-onboarding-btn {
  padding: 10px 26px;
  border-radius: 14px;
  font-family: var(--main-font);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.22s ease;
  border: none;
}

.cab-onboarding-btn--action {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 124, 0, 0.35);
  min-width: 130px;
}

.cab-onboarding-btn--action:hover {
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.6);
  transform: translateY(-2px);
}

.cab-onboarding-btn--action:active {
  transform: scale(0.97);
}

.cab-onboarding-btn--action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  filter: grayscale(0.5);
  transform: none !important;
}

.cab-onboarding-btn--back {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 140, 0, 0.4);
  color: #e65100;
  min-width: 95px;
}

.cab-onboarding-btn--back:hover {
  background: #ffffff;
  border-color: #ff9800;
  transform: translateY(-2px);
}

.cab-onboarding-btn--back:active {
  transform: scale(0.97);
}

.cab-onboarding-btn.is-hidden {
  display: none !important;
}

/* Зона постоянных кнопок готового ЛК */
.cab-persistent-zone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: cabFadeIn 0.25s ease;
}

.cab-persistent-zone.is-hidden {
  display: none !important;
}

.cab-bottom-nav-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.cab-persistent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 140, 0, 0.38);
  color: #e65100;
  font-family: var(--main-font);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 110, 20, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s ease;
}

.cab-persistent-btn:hover {
  background: #ffffff;
  border-color: #ff9800;
  color: #d84315;
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 152, 0, 0.45);
}

.cab-persistent-btn:active {
  transform: scale(0.97);
}

.cab-persistent-btn.is-active {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border-color: #ff7a00;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.6);
}

.cab-btn-halong-icon {
  font-size: 18px;
  line-height: 1;
}

.cab-badge-newcomer-wrap {
  margin-top: 6px;
  display: flex;
  justify-content: center;
}

.cab-badge-newcomer-wrap.is-hidden {
  display: none !important;
}

.cab-badge-newcomer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 248, 225, 0.96), rgba(255, 236, 179, 0.92));
  border: 1.5px solid #ffb300;
  color: #e65100;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(255, 179, 0, 0.28);
  animation: cabBadgeGlow 3.5s ease-in-out infinite;
}

@keyframes cabBadgeGlow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.25);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 179, 0, 0.65), 0 0 30px rgba(255, 179, 0, 0.3);
  }
}

.cab-badge-icon {
  font-size: 15px;
  line-height: 1;
}

/* Нейтральное состояние загрузки профиля */
.cab-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.cab-loading-state.is-hidden {
  display: none !important;
}

.cab-loading-spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid rgba(255, 140, 0, 0.22);
  border-top-color: #ff9800;
  border-radius: 50%;
  animation: cabSpin 0.75s linear infinite;
}

@keyframes cabSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Базовая сцена Личного Кабинета (Фиксированная, без прокрутки) */
.cabinet-scrollable-content {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  padding: calc(max(10px, env(safe-area-inset-top, 10px)) + 50px) 16px max(16px, env(safe-area-inset-bottom, 16px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.cabinet-scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.cabinet-scrollable-content::-webkit-scrollbar-track {
  background: transparent;
}

.cabinet-scrollable-content::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 0, 0.4);
  border-radius: 6px;
}

/* Блок 403: Ограничение доступа к чужому URL */
.cab-403-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  padding: 24px 12px;
  width: 100%;
}

.cab-403-panel.is-hidden {
  display: none !important;
}

.cab-403-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(255, 140, 0, 0.38);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(220, 110, 20, 0.14);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cab-403-icon {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(255, 140, 0, 0.3));
}

.cab-403-title {
  margin: 0;
  font-family: var(--main-font);
  font-size: 18px;
  font-weight: 800;
  color: #2c1a0e;
}

.cab-403-desc {
  margin: 0;
  font-size: 13px;
  color: #7a5c43;
  line-height: 1.45;
}

.cab-403-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

/* ==========================================================================
   ИНДИКАТОР ЭТАПОВ: «ТРИ ГОЛОГРАФИЧЕСКИХ УЗЛА ОБРАЗА»
   ========================================================================== */
.cab-wz-nodes-indicator {
  width: 100%;
  max-width: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px auto 14px;
  user-select: none;
  -webkit-user-select: none;
}

.cab-wz-nodes-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  overflow: visible;
}

.cab-synapse-track {
  stroke: rgba(245, 158, 11, 0.2);
  transition: stroke 0.3s ease;
}

.cab-synapse-active {
  stroke: #f59e0b;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.75));
  transition: stroke-dashoffset 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cab-holo-node {
  cursor: default;
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
  transform-origin: center center;
}

.cab-holo-node .cab-node-ring {
  transition: stroke 0.3s ease, fill 0.3s ease, stroke-width 0.3s ease, filter 0.3s ease;
}

.cab-holo-node .cab-node-halo {
  opacity: 0;
  transition: opacity 0.35s ease;
  transform-origin: center center;
}

.cab-holo-node .cab-node-check-halo,
.cab-holo-node .cab-node-check-icon {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.28s ease, transform 0.28s ease;
  transform-origin: center center;
}

/* Состояние: FUTURE */
.cab-holo-node.is-future {
  opacity: 0.38;
}

.cab-holo-node.is-future .cab-node-ring {
  stroke: rgba(245, 158, 11, 0.3);
  fill: rgba(255, 255, 255, 0.6);
}

.cab-holo-node.is-future .cab-node-icon {
  fill: rgba(180, 115, 20, 0.45);
}
.cab-holo-node.is-future .cab-node-icon-rect,
.cab-holo-node.is-future .cab-node-icon-line {
  stroke: rgba(180, 115, 20, 0.45);
}

/* Состояние: CURRENT */
.cab-holo-node.is-current {
  opacity: 1;
  animation: cabHoloNodeActivate 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cab-holo-node.is-current .cab-node-halo {
  opacity: 1;
  animation: cabHoloHaloPulse 2.8s ease-in-out infinite;
}

.cab-holo-node.is-current .cab-node-ring {
  stroke: #f59e0b;
  stroke-width: 2.2px;
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
}

.cab-holo-node.is-current .cab-node-icon {
  fill: #d97706;
}
.cab-holo-node.is-current .cab-node-icon-rect,
.cab-holo-node.is-current .cab-node-icon-line {
  stroke: #d97706;
}

/* Состояние: COMPLETED */
.cab-holo-node.is-completed {
  opacity: 1;
}

.cab-holo-node.is-completed .cab-node-ring {
  stroke: #f59e0b;
  stroke-width: 2px;
  fill: #fffbeb;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

.cab-holo-node.is-completed .cab-node-icon {
  fill: #d97706;
  opacity: 0.75;
}
.cab-holo-node.is-completed .cab-node-icon-rect,
.cab-holo-node.is-completed .cab-node-icon-line {
  stroke: #d97706;
  opacity: 0.75;
}

.cab-holo-node.is-completed .cab-node-check-halo,
.cab-holo-node.is-completed .cab-node-check-icon {
  opacity: 1;
  transform: scale(1);
}

@keyframes cabHoloNodeActivate {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes cabHoloHaloPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.18); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cab-synapse-active,
  .cab-holo-node,
  .cab-holo-node .cab-node-ring,
  .cab-holo-node .cab-node-halo,
  .cab-holo-node .cab-node-check-halo,
  .cab-holo-node .cab-node-check-icon {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   РЕЖИМ A: WIZARD ПЕРВИЧНОЙ НАСТРОЙКИ ОБРАЗА
   ========================================================================== */
.cab-wizard-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cab-wizard-wrap.is-hidden {
  display: none !important;
}

.cab-wz-step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  animation: cabFadeIn 0.28s ease;
}

.cab-wz-step.is-hidden {
  display: none !important;
}

.cab-wz-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cab-wz-title {
  font-family: var(--main-font);
  font-size: clamp(20px, 3.5vw, 24px);
  font-weight: 900;
  color: #2c1a0e;
  margin: 0;
  letter-spacing: -0.01em;
}

.cab-wz-subtitle {
  font-size: 12.5px;
  color: #7a5c43;
  margin: 0;
  max-width: 320px;
  line-height: 1.4;
}

/* Карусель выбора персонажа и стиля */
.cab-wz-carousel {
  position: relative;
  width: 100%;
  max-width: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  margin: 4px 0;
}

.cab-wz-arrow {
  position: absolute;
  top: 48%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 140, 0, 0.42);
  color: #e65100;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(220, 110, 20, 0.16);
  padding: 0;
}

.cab-wz-arrow:hover {
  background: #ff9800;
  border-color: #ff9800;
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 16px rgba(255, 140, 0, 0.5);
}

.cab-wz-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.cab-wz-arrow--prev {
  left: 0;
}

.cab-wz-arrow--next {
  right: 0;
}

.cab-wz-viewport {
  position: relative;
  width: 240px;
  height: 390px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cab-wz-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateX(80px);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s ease;
}

.cab-wz-card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateX(0);
  z-index: 2;
}

.cab-wz-card.is-prev {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateX(-80px);
  z-index: 1;
}

.cab-wz-card.is-next {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateX(80px);
  z-index: 1;
}

.cab-wz-img-frame {
  width: 230px;
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 24px rgba(220, 110, 20, 0.24));
}

.cab-wz-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.cab-wz-card-name {
  margin-top: 6px;
  font-family: var(--main-font);
  font-size: 14.5px;
  font-weight: 800;
  color: #e65100;
  background: rgba(255, 255, 255, 0.92);
  padding: 5px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 0, 0.32);
  box-shadow: 0 2px 8px rgba(220, 110, 20, 0.1);
  white-space: nowrap;
}

.cab-wz-action-box {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Главная кнопка «Принять» с золотисто-янтарным свечением */
.cab-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 13px 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9800 0%, #ff6f00 50%, #f57c00 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  font-family: var(--main-font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 124, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.22s ease;
  user-select: none;
}

.cab-primary-btn:hover {
  background: linear-gradient(135deg, #ffa726 0%, #ff7a00 50%, #fb8c00 100%);
  box-shadow: 0 0 24px rgba(255, 152, 0, 0.65), 0 6px 22px rgba(245, 124, 0, 0.5);
  transform: translateY(-2px);
}

.cab-primary-btn:active {
  transform: scale(0.97);
}

/* Шаг 3 Wizard: Выбор ника */
.cab-wz-nick-preview-wrap {
  width: 180px;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 22px rgba(220, 110, 20, 0.22));
  margin: 0 auto;
}

.cab-wz-nick-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.cab-wz-nick-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.cab-wz-nick-label {
  font-family: var(--main-font);
  font-size: 17px;
  font-weight: 800;
  color: #2c1a0e;
  text-align: center;
}

.cab-wz-input-wrap {
  width: 100%;
}

.cab-wz-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 140, 0, 0.45);
  border-radius: 14px;
  padding: 12px 18px;
  font-family: var(--main-font);
  font-size: 16px;
  font-weight: 700;
  color: #2c1a0e;
  text-align: center;
  outline: none;
  box-shadow: 0 3px 12px rgba(220, 110, 20, 0.08);
  transition: all 0.2s ease;
}

.cab-wz-input:focus {
  border-color: #ff7a00;
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.4);
  background: #ffffff;
}

/* ==========================================================================
   РЕЖИМ B: НАСТРОЕННЫЙ ЛИЧНЫЙ КАБИНЕТ
   ========================================================================== */
.cab-configured-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: cabFadeIn 0.3s ease;
}

.cab-configured-wrap.is-hidden {
  display: none !important;
}

/* 1. Голографический ник над головой персонажа */
.cab-head-nick-anchor {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin-top: 6px;
  margin-bottom: 2px;
  min-height: 28px;
  pointer-events: none;
}

.cab-nick-text {
  font-family: var(--main-font);
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75), 0 0 12px rgba(0, 240, 255, 0.28);
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
  user-select: none;
  -webkit-user-select: none;
}

.cab-holo-line,
.cab-floating-nick-badge,
.cab-nick-sparkle,
.cab-nick-edit-glyph {
  display: none !important;
}

/* 2. Центральный 3D персонаж в полный рост */
.cab-fullbody-avatar-stage {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: clamp(280px, 42vh, 380px);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 28px rgba(220, 110, 20, 0.24));
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  margin: 4px auto 0;
}

.cab-fullbody-avatar-img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: filter 0.3s ease;
}

/* 3. Форма быстрого редактирования ника */
.cab-inline-nick-editor {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(255, 140, 0, 0.45);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(220, 110, 20, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cabFadeIn 0.22s ease;
  z-index: 15;
}

.cab-inline-nick-editor.is-hidden {
  display: none !important;
}

.cab-inline-nick-question {
  font-family: var(--main-font);
  font-size: 13px;
  font-weight: 700;
  color: #5c3e28;
  text-align: center;
}

.cab-inline-nick-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.cab-inline-nick-input-wrap {
  position: relative;
  flex: 1;
}

.cab-inline-nick-input {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  border-radius: 10px;
  padding: 8px 36px 8px 12px;
  font-family: var(--main-font);
  font-size: 13px;
  font-weight: 600;
  color: #2c1a0e;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cab-inline-nick-counter {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  font-weight: 700;
  color: #8c7362;
  pointer-events: none;
}

.cab-inline-nick-input:focus {
  border-color: #ff7a00;
  box-shadow: 0 0 10px rgba(255, 140, 0, 0.3);
}

.cab-inline-nick-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cab-inline-nick-btn--save {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 124, 0, 0.25);
}

.cab-inline-nick-btn--save:hover {
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.45);
}

.cab-inline-nick-btn--cancel {
  background: rgba(0, 0, 0, 0.06);
  color: #7a5c43;
}

.cab-inline-nick-btn--cancel:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* 4. Ровно 4 интерактивные иконки разделов (названия НАД иконками) */
.cab-four-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 460px;
  margin: 4px auto 14px;
  padding: 0 4px;
  box-sizing: border-box;
}

.cab-nav-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Название раздела строго НАД иконкой */
.cab-nav-cell__label {
  font-family: var(--main-font);
  font-size: 11.5px;
  font-weight: 800;
  color: #7a5c43;
  text-align: center;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cab-nav-cell.is-active .cab-nav-cell__label,
.cab-nav-cell:has(.cab-nav-cell__btn.is-active) .cab-nav-cell__label {
  color: #d84315;
  font-weight: 900;
}

.cab-nav-cell__btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 246, 235, 0.9) 100%);
  border: 1.5px solid rgba(255, 140, 0, 0.32);
  color: #e65100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 110, 20, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 0;
}

.cab-nav-cell__btn:hover {
  background: #ffffff;
  border-color: #ff9800;
  color: #d84315;
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 152, 0, 0.45);
}

.cab-nav-cell__btn:active {
  transform: scale(0.96);
}

.cab-nav-cell__btn.is-active {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border-color: #ff7a00;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.cab-nav-cell__btn svg {
  display: block;
}

/* Бейдж колокольчика для уведомлений */
.cab-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a00, #ff3344);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 8px rgba(255, 122, 0, 0.7);
  border: 1.5px solid #ffffff;
  box-sizing: border-box;
}

.cab-bell-badge.is-hidden {
  display: none !important;
}

/* Выход из аккаунта (внутри панели Профиль) */
.cab-profile-logout-box {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(255, 240, 240, 0.85);
  border: 1.5px solid rgba(239, 83, 80, 0.35);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.cab-profile-logout-title {
  font-family: var(--main-font);
  font-size: 13.5px;
  font-weight: 800;
  color: #c62828;
  margin: 0;
}

.cab-profile-logout-desc {
  font-size: 11.5px;
  color: #7a5c43;
  margin: 0;
  line-height: 1.4;
  max-width: 340px;
}

/* Переключатели стиля обращения в форме профиля */
.cabinet-style-options {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.cabinet-style-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #5c3e28;
}

.cabinet-style-opt input[type="radio"] {
  accent-color: #ff7a00;
  cursor: pointer;
}

.cabinet-style-badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 140, 0, 0.3);
  transition: all 0.2s ease;
}

.cabinet-style-opt input[type="radio"]:checked + .cabinet-style-badge {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 122, 0, 0.12));
  border-color: #ff7a00;
  color: #d84315;
  font-weight: 800;
}

/* Анимации сборки ника и появления */
@keyframes cabHoloPulse {
  0% {
    box-shadow: 0 4px 16px rgba(220, 110, 20, 0.16);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 152, 0, 0.8), 0 0 10px rgba(255, 183, 77, 0.6);
  }
  100% {
    box-shadow: 0 4px 16px rgba(220, 110, 20, 0.16);
  }
}

@keyframes cabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cab-wz-card,
  .cab-floating-nick-badge,
  .cab-holo-line,
  .cab-nav-cell__btn {
    transition: none !important;
    animation: none !important;
  }
}

/* 4. Контейнер раскрывающихся панелей (Модальный оверлей / Bottom Sheet поверх сцены) */
.cab-panels-container {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cab-panels-container.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.cab-panels-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.cab-panels-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
}

.cab-accordion-panel {
  position: relative;
  width: 100%;
  max-height: calc(86dvh - 20px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: rgba(255, 255, 255, 0.97);
  border: 1.5px solid rgba(255, 152, 0, 0.35);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  animation: cabPanelSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cab-accordion-panel.is-active {
  display: flex;
}

.cab-accordion-panel.is-collapsed {
  display: none !important;
}

@keyframes cabPanelSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cab-panel-inner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 20px 32px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  max-height: calc(86dvh - 30px);
  box-sizing: border-box;
}

.cab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 140, 0, 0.2);
}

.cab-panel-header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cab-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cab-panel-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: #d84315;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.cab-panel-close-btn:hover {
  background: #ff9800;
  color: #ffffff;
  border-color: #ff9800;
  transform: scale(1.08);
}

.cab-panel-title {
  margin: 0;
  font-family: var(--main-font);
  font-size: 15px;
  font-weight: 800;
  color: #2c1a0e;
}

.cab-panel-subtitle {
  margin: -6px 0 2px;
  font-size: 11.5px;
  color: #7a5c43;
  line-height: 1.4;
}

/* Формы и поля */
.cabinet-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cabinet-label {
  font-family: var(--main-font);
  font-size: 11.5px;
  font-weight: 700;
  color: #5c3e28;
}

.cabinet-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  border-radius: 10px;
  padding: 9px 12px;
  color: #2c1a0e;
  font-family: var(--main-font);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(200, 100, 20, 0.06);
}

.cabinet-input:focus {
  background: #ffffff;
  border-color: #ff7a00;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.3);
}

.cabinet-input.is-readonly {
  background: rgba(245, 238, 230, 0.8);
  border-color: rgba(200, 160, 130, 0.3);
  color: #8c7362;
  cursor: not-allowed;
}

.cabinet-input-readonly-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cabinet-readonly-badge {
  position: absolute;
  right: 10px;
  font-size: 9.5px;
  font-weight: 700;
  color: #b08d75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cabinet-input-with-action {
  display: flex;
  gap: 6px;
}

.cabinet-input-with-action .cabinet-input {
  flex: 1;
}

.cabinet-save-field-btn {
  padding: 0 14px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border: none;
  color: #ffffff;
  border-radius: 10px;
  font-family: var(--main-font);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(245, 124, 0, 0.25);
}

.cabinet-save-field-btn:hover {
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.45);
  transform: translateY(-1px);
}

.cabinet-style-options {
  display: flex;
  gap: 8px;
}

.cabinet-style-opt {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.cabinet-style-opt input[type="radio"] {
  display: none;
}

.cabinet-style-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 140, 0, 0.3);
  color: #7a5c43;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cabinet-style-opt input[type="radio"]:checked + .cabinet-style-badge {
  background: #ff9800;
  border-color: #ff9800;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.35);
}

.cabinet-lang-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cabinet-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 140, 0, 0.3);
  color: #7a5c43;
  font-family: var(--main-font, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.cabinet-lang-btn:hover {
  background: #ffffff;
  border-color: #ff9800;
  color: #d97706;
}

.cabinet-lang-btn.is-active,
.cabinet-lang-btn[aria-pressed="true"] {
  background: #ff9800;
  border-color: #ff9800;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.35);
}

.cabinet-divider {
  height: 1px;
  background: rgba(255, 140, 0, 0.18);
  margin: 6px 0;
}

.cabinet-status-msg {
  font-size: 11.5px;
  color: #1b5e20;
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.45);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.35;
  font-weight: 600;
}

.cabinet-status-msg.is-hidden {
  display: none !important;
}

/* Смена пароля */
.cabinet-password-block {
  margin-top: 2px;
}

.cabinet-toggle-pass-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 140, 0, 0.3);
  color: #e65100;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cabinet-toggle-pass-btn:hover {
  background: rgba(255, 140, 0, 0.08);
  border-color: #ff9800;
}

.cabinet-pass-btn-arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
}

.cabinet-toggle-pass-btn.is-open .cabinet-pass-btn-arrow {
  transform: rotate(180deg);
}

.cabinet-password-fields {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 245, 235, 0.85);
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 140, 0, 0.35);
}

.cabinet-password-fields.is-hidden {
  display: none !important;
}

.cabinet-submit-pass-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border: none;
  color: #ffffff;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 124, 0, 0.28);
  transition: all 0.2s ease;
}

.cabinet-submit-pass-btn:hover {
  box-shadow: 0 0 16px rgba(255, 140, 0, 0.5);
  transform: translateY(-1px);
}

.cabinet-error-msg {
  font-size: 11px;
  color: #c62828;
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid rgba(255, 77, 109, 0.4);
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

.cabinet-error-msg.is-hidden {
  display: none !important;
}

.cabinet-success-msg {
  font-size: 11px;
  color: #1b5e20;
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.45);
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

.cabinet-success-msg.is-hidden {
  display: none !important;
}

/* Вкладка 2: Карта изучения */
.cabinet-map-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}

.cabinet-map-title {
  margin: 0;
  font-family: var(--main-font);
  font-size: 15px;
  font-weight: 800;
  color: #2c1a0e;
}

.cabinet-map-subtitle {
  margin: 0;
  font-size: 11.5px;
  color: #7a5c43;
}

.cabinet-overall-progress {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cabinet-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 235, 215, 0.8);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 140, 0, 0.3);
}

.cabinet-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff9800, #ff5722);
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
  transition: width 0.4s ease;
}

.cabinet-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #7a5c43;
  font-weight: 600;
}

.cabinet-map-sections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.cabinet-map-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 140, 0, 0.25);
  border-radius: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(200, 100, 20, 0.06);
}

.cabinet-map-card:hover {
  background: #ffffff;
  border-color: #ff9800;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.2);
}

.cabinet-map-card__info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cabinet-map-card__icon {
  font-size: 16px;
}

.cabinet-map-card__title {
  font-family: var(--main-font);
  font-size: 12.5px;
  font-weight: 700;
  color: #2c1a0e;
}

.cabinet-map-card__nodes {
  font-size: 10.5px;
  color: #7a5c43;
  margin-top: 1px;
}

.cabinet-map-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cabinet-map-badge--available {
  background: rgba(255, 152, 0, 0.15);
  color: #e65100;
  border: 1px solid rgba(255, 152, 0, 0.4);
}

.cabinet-map-badge--updated {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.cabinet-map-notice {
  font-size: 10.5px;
  color: #7a5c43;
  background: rgba(255, 245, 235, 0.85);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 140, 0, 0.3);
  line-height: 1.4;
  margin-top: 4px;
}

/* Вкладка 3: Уведомления */
.cabinet-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.cabinet-notif-title {
  font-family: var(--main-font);
  font-size: 15px;
  font-weight: 800;
  color: #2c1a0e;
}

.cabinet-mark-read-btn {
  background: transparent;
  border: none;
  color: #e65100;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  transition: color 0.2s ease;
}

.cabinet-mark-read-btn:hover {
  color: #b45309;
}

.cabinet-notif-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
}

.cabinet-notif-card {
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 140, 0, 0.22);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(200, 100, 20, 0.05);
}

.cabinet-notif-card.is-unread {
  background: rgba(255, 248, 238, 0.98);
  border-color: #ff9800;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.2);
}

.cabinet-notif-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cabinet-notif-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
}

.cabinet-notif-badge--new {
  background: rgba(46, 204, 113, 0.2);
  color: #1b5e20;
  border: 1px solid rgba(46, 204, 113, 0.45);
}

.cabinet-notif-badge--update {
  background: rgba(255, 152, 0, 0.2);
  color: #e65100;
  border: 1px solid rgba(255, 152, 0, 0.45);
}

.cabinet-notif-badge--system {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.cabinet-notif-card__time {
  font-size: 9.5px;
  color: #8c7362;
}

.cabinet-notif-card__title {
  font-family: var(--main-font);
  font-size: 12.5px;
  font-weight: 700;
  color: #2c1a0e;
  margin: 1px 0;
}

.cabinet-notif-card__desc {
  font-size: 11.5px;
  color: #5c3e28;
  line-height: 1.4;
  margin: 0;
}

.cabinet-channels-box {
  margin-top: 8px;
  background: rgba(255, 245, 235, 0.85);
  border: 1.5px solid rgba(255, 140, 0, 0.25);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cabinet-channels-title {
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 700;
  color: #2c1a0e;
}

.cabinet-channels-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cabinet-channel-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #5c3e28;
  cursor: pointer;
}

.cabinet-channel-toggle input[type="checkbox"] {
  accent-color: #ff7a00;
  cursor: pointer;
}

.cabinet-channels-hint {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: #8c7362;
  line-height: 1.35;
}

/* Вкладка 4: Выход */
.cabinet-logout-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px;
  gap: 12px;
}

.cabinet-logout-icon {
  font-size: 36px;
  filter: drop-shadow(0 0 10px rgba(239, 83, 80, 0.4));
}

.cabinet-logout-title {
  margin: 0;
  font-family: var(--main-font);
  font-size: 17px;
  font-weight: 800;
  color: #2c1a0e;
}

.cabinet-logout-user-info {
  margin: 0;
  font-size: 12.5px;
  color: #e65100;
  font-weight: 700;
}

.cabinet-logout-desc {
  margin: 0;
  font-size: 12px;
  color: #7a5c43;
  max-width: 290px;
  line-height: 1.45;
}

.cabinet-logout-btn {
  margin-top: 8px;
  width: min(230px, 100%);
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef5350, #d32f2f);
  border: none;
  color: #ffffff;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(211, 47, 47, 0.3);
  transition: all 0.2s ease;
}

.cabinet-logout-btn:hover {
  background: linear-gradient(135deg, #f44336, #c62828);
  box-shadow: 0 0 18px rgba(244, 67, 54, 0.55);
  transform: translateY(-1px);
}

/* Действия выхода и общие кнопки действий */
.cab-logout-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
  flex-wrap: wrap;
}

.cab-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 130px;
  box-sizing: border-box;
}

.cab-action-btn--primary {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border: none;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(245, 124, 0, 0.3);
}

.cab-action-btn--primary:hover {
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  box-shadow: 0 0 16px rgba(255, 140, 0, 0.5);
  transform: translateY(-1px);
}

.cab-action-btn--ghost {
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  color: #7a5c43;
}

.cab-action-btn--ghost:hover {
  background: #ffffff;
  border-color: #ff9800;
  color: #e65100;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.15);
}

/* Пустые состояния (Empty states) */
.cab-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 16px;
  background: rgba(255, 248, 238, 0.7);
  border: 1.5px dashed rgba(255, 140, 0, 0.28);
  border-radius: 12px;
  gap: 6px;
  margin: 4px 0;
}

.cab-empty-state.is-hidden {
  display: none !important;
}

.cab-empty-state__icon {
  font-size: 28px;
  line-height: 1;
}

.cab-empty-state__title {
  font-family: var(--main-font);
  font-size: 13.5px;
  font-weight: 800;
  color: #2c1a0e;
}

.cab-empty-state__desc {
  margin: 0;
  font-size: 11.5px;
  color: #7a5c43;
  line-height: 1.45;
  max-width: 340px;
}

/* Список новостей сервиса */
.cab-news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cab-news-card {
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 140, 0, 0.22);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(200, 100, 20, 0.05);
}

.cab-news-card:hover {
  background: #ffffff;
  border-color: #ff9800;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.18);
}

.cab-news-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cab-news-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 152, 0, 0.2);
  color: #e65100;
  border: 1px solid rgba(255, 152, 0, 0.45);
  text-transform: uppercase;
}

.cab-news-card__date {
  font-size: 9.5px;
  color: #8c7362;
}

.cab-news-card__title {
  font-family: var(--main-font);
  font-size: 12.5px;
  font-weight: 700;
  color: #2c1a0e;
  margin: 2px 0 0;
}

.cab-news-card__desc {
  font-size: 11.5px;
  color: #5c3e28;
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   ОБРАТНАЯ СВЯЗЬ: ДИАЛОГ С АДМИНИСТРАЦИЕЙ В ЛИЧНОМ КАБИНЕТЕ
   ========================================================================== */
.cab-feedback-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cab-feedback-thread {
  max-height: 320px;
  min-height: 140px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 250, 244, 0.75);
  border: 1.5px solid rgba(255, 140, 0, 0.22);
  border-radius: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 140, 0, 0.35) transparent;
}

.cab-feedback-thread::-webkit-scrollbar {
  width: 5px;
}

.cab-feedback-thread::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 0, 0.35);
  border-radius: 4px;
}

.cab-feedback-bubble {
  position: relative;
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(200, 100, 20, 0.08);
}

.cab-feedback-bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 12px rgba(245, 124, 0, 0.28);
}

.cab-feedback-bubble--admin {
  align-self: flex-start;
  background: #ffffff;
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  color: #2c1a0e;
  border-bottom-left-radius: 3px;
}

.cab-feedback-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.9;
}

.cab-feedback-bubble--user .cab-feedback-bubble__meta {
  color: rgba(255, 255, 255, 0.92);
}

.cab-feedback-bubble--admin .cab-feedback-bubble__meta {
  color: #b45309;
}

.cab-feedback-bubble__text {
  white-space: pre-wrap;
  margin: 0;
}

.cab-feedback-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.cab-feedback-input-wrap {
  width: 100%;
}

.cab-feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--main-font);
  font-size: 12.5px;
  color: #2c1a0e;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(200, 100, 20, 0.06);
}

.cab-feedback-textarea:focus {
  background: #ffffff;
  border-color: #ff9800;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.3);
}

.cab-feedback-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cab-feedback-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.35;
}

.cab-feedback-status.is-hidden {
  display: none !important;
}

.cab-feedback-status--error {
  color: #c62828;
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid rgba(255, 77, 109, 0.4);
}

.cab-feedback-status--success {
  color: #1b5e20;
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.45);
}

.cab-feedback-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border: none;
  color: #ffffff;
  font-family: var(--main-font);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(245, 124, 0, 0.3);
  transition: all 0.2s ease;
  margin-left: auto;
}

.cab-feedback-send-btn:hover {
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.5);
  transform: translateY(-1px);
}

.cab-feedback-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cab-send-btn-icon {
  font-size: 11px;
  line-height: 1;
}

/* ==========================================================================
   ПАНЕЛЬ УВЕДОМЛЕНИЙ ХЕДЕРА (.notification-panel)
   ========================================================================== */

.notification-panel {
  position: fixed;
  top: max(58px, calc(env(safe-area-inset-top, 0px) + 54px));
  right: clamp(10px, 3.5vw, 24px);
  width: min(330px, calc(100vw - 20px));
  max-height: min(440px, calc(100vh - 80px));
  z-index: 87;
  background: rgba(255, 252, 248, 0.96);
  border: 1.5px solid rgba(255, 140, 0, 0.35);
  box-shadow: 0 16px 36px rgba(180, 80, 20, 0.18), 0 0 20px rgba(255, 140, 0, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.notification-panel.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-8px) scale(0.95) !important;
  pointer-events: none !important;
}

.notification-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  background: rgba(255, 245, 232, 0.96);
  border-bottom: 1.5px solid rgba(255, 140, 0, 0.2);
}

.notification-panel__title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-panel__bell-icon {
  font-size: 14px;
}

.notification-panel__title {
  font-family: var(--main-font);
  font-size: 12.5px;
  font-weight: 800;
  color: #2c1a0e;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.notification-panel__counter {
  background: linear-gradient(135deg, #ff7a00, #ff3344);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(255, 122, 0, 0.4);
}

.notification-panel__counter.is-hidden {
  display: none !important;
}

.notification-panel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-panel__mark-btn {
  background: transparent;
  border: none;
  color: #e65100;
  font-size: 10.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  transition: color 0.2s ease;
  font-weight: 700;
}

.notification-panel__mark-btn:hover {
  color: #b45309;
}

.notification-panel__close-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 140, 0, 0.25);
  color: #7a5c43;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.notification-panel__close-btn:hover {
  background: rgba(255, 75, 75, 0.2);
  color: #d32f2f;
  border-color: rgba(255, 75, 75, 0.4);
}

.notification-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 310px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 140, 0, 0.4) transparent;
}

.notification-panel__list::-webkit-scrollbar {
  width: 4px;
}

.notification-panel__list::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 0, 0.4);
  border-radius: 4px;
}

.notification-panel__footer {
  padding: 8px 12px;
  background: rgba(255, 245, 235, 0.9);
  border-top: 1.5px solid rgba(255, 140, 0, 0.15);
  text-align: center;
}

.notification-panel__to-cabinet-btn {
  background: transparent;
  border: none;
  color: #e65100;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}

.notification-panel__to-cabinet-btn:hover {
  color: #b45309;
  text-decoration: underline;
}

/* Prompt 4: Sync Toast & Progress Badges */
.ng-sync-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(14, 19, 32, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: #e2e8f0;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 99999;
  pointer-events: none;
  text-align: center;
  max-width: 90vw;
}

.ng-sync-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.cabinet-map-badge--inprogress {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.cabinet-map-badge--completed {
  background: rgba(0, 255, 163, 0.15);
  color: #00ffa3;
  border: 1px solid rgba(0, 255, 163, 0.4);
}

.cabinet-map-card.is-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cabinet-map-card.is-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.25);
}

/* ==============================================================
   МАРКИРОВКА «НАРОДНЫЙ ГАЙД. ДЕМО-ВЕРСИЯ» (WELCOME И ЛК)
   ============================================================== */
.welcome-demo-badge {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--main-font, 'Montserrat', sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.cab-demo-badge {
  margin: 14px auto 8px;
  text-align: center;
  font-family: var(--main-font, 'Montserrat', sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

/* ==============================================================
   ЛК: СЕЛЕКТОР И ВАРИАНТЫ ФОНОВ (5 СТАТИЧЕСКИХ + 4 ДИНАМИЧЕСКИХ)
   ============================================================== */
.cab-bg-select-field {
  margin-top: 10px;
  margin-bottom: 12px;
}

.cab-bg-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.cab-bg-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: rgba(14, 26, 44, 0.75);
  border: 1.5px solid rgba(0, 240, 255, 0.18);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  color: #e2e8f0;
}

.cab-bg-opt-btn:hover {
  border-color: rgba(0, 240, 255, 0.55);
  transform: translateY(-1px);
}

.cab-bg-opt-btn.is-active,
.cab-bg-opt-btn[aria-checked="true"] {
  border-color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35), inset 0 0 8px rgba(0, 240, 255, 0.12);
  background: rgba(0, 240, 255, 0.1);
}

.cab-bg-opt-btn__preview {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cab-bg-dyn-icon {
  font-size: 11px;
  color: #00f0ff;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.8));
}

.cab-bg-opt-btn__name {
  font-family: var(--main-font, 'Montserrat', sans-serif);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Миниатюры превью */
.cab-bg-preview--default {
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #090e17 100%);
}
.cab-bg-preview--tech-dark-blue {
  background: radial-gradient(circle at 50% 30%, #133a68 0%, #061324 100%);
}
.cab-bg-preview--tech-purple {
  background: radial-gradient(circle at 50% 30%, #3d1768 0%, #10051e 100%);
}
.cab-bg-preview--tech-graphite {
  background: radial-gradient(circle at 50% 30%, #2b3038 0%, #0f1114 100%);
  border: 1px solid rgba(0, 240, 255, 0.35);
}
.cab-bg-preview--calm-light {
  background: linear-gradient(180deg, #edf2f7 0%, #cbd5e1 100%);
}
.cab-bg-preview--dyn-holo-grid {
  background: #061527 linear-gradient(rgba(0, 240, 255, 0.25) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 240, 255, 0.25) 1px, transparent 1px);
  background-size: 10px 10px;
}
.cab-bg-preview--dyn-particles {
  background: radial-gradient(circle at 50% 40%, #092c4c 0%, #020b14 100%);
}
.cab-bg-preview--dyn-neon-gradient {
  background: linear-gradient(135deg, #091f3a, #28103c, #062b32);
}
.cab-bg-preview--dyn-techno-waves {
  background: radial-gradient(ellipse at 50% 80%, rgba(0, 240, 255, 0.35) 0%, #05101e 80%);
}

/* Фактические фоны для Личного Кабинета (.cabinet-widget) */
/* 1. Default: стандартный нейропанк */
.cabinet-widget[data-cabinet-bg="default"] .cab-neuropunk-bg {
  background: radial-gradient(circle at 50% 30%, rgba(20, 35, 60, 0.6) 0%, rgba(6, 12, 22, 0.95) 100%);
}

/* 2. Тёмно-синий Hi-Tech */
.cabinet-widget[data-cabinet-bg="tech-dark-blue"] .cab-neuropunk-bg {
  background: radial-gradient(circle at 50% 25%, #0f3056 0%, #081a30 55%, #030a14 100%);
}
.cabinet-widget[data-cabinet-bg="tech-dark-blue"] .cab-neuropunk-canvas {
  display: none !important;
}

/* 3. Фиолетовый Hi-Tech */
.cabinet-widget[data-cabinet-bg="tech-purple"] .cab-neuropunk-bg {
  background: radial-gradient(circle at 50% 25%, #351357 0%, #1a082c 55%, #090312 100%);
}
.cabinet-widget[data-cabinet-bg="tech-purple"] .cab-neuropunk-canvas {
  display: none !important;
}

/* 4. Графитовый с неоном */
.cabinet-widget[data-cabinet-bg="tech-graphite"] .cab-neuropunk-bg {
  background: radial-gradient(circle at 50% 25%, #242930 0%, #13161b 60%, #090b0d 100%);
  box-shadow: inset 0 0 80px rgba(0, 240, 255, 0.08);
}
.cabinet-widget[data-cabinet-bg="tech-graphite"] .cab-neuropunk-canvas {
  display: none !important;
}

/* 5. Спокойный светлый */
.cabinet-widget[data-cabinet-bg="calm-light"] .cab-neuropunk-bg {
  background: linear-gradient(180deg, #edf2f7 0%, #e2e8f0 45%, #cbd5e1 100%);
}
.cabinet-widget[data-cabinet-bg="calm-light"] .cab-neuropunk-canvas {
  display: none !important;
}
.cabinet-widget[data-cabinet-bg="calm-light"] .cab-nick-text {
  color: #0f172a !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8), 0 0 12px rgba(255, 255, 255, 0.5) !important;
}
.cabinet-widget[data-cabinet-bg="calm-light"] .cab-demo-badge {
  color: rgba(15, 23, 42, 0.55) !important;
}

/* 6. Динамическая голографическая сетка */
.cabinet-widget[data-cabinet-bg="dyn-holo-grid"] .cab-neuropunk-bg {
  background-color: #040c17;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.12) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: cabHoloGridScroll 22s linear infinite;
}
.cabinet-widget[data-cabinet-bg="dyn-holo-grid"] .cab-neuropunk-canvas {
  display: none !important;
}

@keyframes cabHoloGridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 72px; }
}

/* 7. Световые частицы (Canvas с частицами) */
.cabinet-widget[data-cabinet-bg="dyn-particles"] .cab-neuropunk-bg {
  background: radial-gradient(circle at 50% 30%, #0d2847 0%, #04111f 65%, #02070d 100%);
}
.cabinet-widget[data-cabinet-bg="dyn-particles"] .cab-neuropunk-canvas {
  opacity: 0.85 !important;
  display: block !important;
}

/* 8. Неоновый градиент (плавный дышащий градиент) */
.cabinet-widget[data-cabinet-bg="dyn-neon-gradient"] .cab-neuropunk-bg {
  background: linear-gradient(135deg, #091f3a, #1d0932, #072a31, #130a24);
  background-size: 300% 300%;
  animation: cabNeonGradientShift 14s ease infinite alternate;
}
.cabinet-widget[data-cabinet-bg="dyn-neon-gradient"] .cab-neuropunk-canvas {
  display: none !important;
}

@keyframes cabNeonGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 50% 100%; }
}

/* 9. Техно-волны */
.cabinet-widget[data-cabinet-bg="dyn-techno-waves"] .cab-neuropunk-bg {
  background: radial-gradient(circle at 50% 25%, #081d33 0%, #030c17 100%);
  position: absolute;
}
.cabinet-widget[data-cabinet-bg="dyn-techno-waves"] .cab-neuropunk-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 90%, rgba(0, 240, 255, 0.28) 0%, transparent 65%);
  animation: cabTechnoWavePulse 6s ease-in-out infinite alternate;
  pointer-events: none;
}
.cabinet-widget[data-cabinet-bg="dyn-techno-waves"] .cab-neuropunk-canvas {
  display: none !important;
}

@keyframes cabTechnoWavePulse {
  0% { opacity: 0.45; transform: scaleY(0.9); }
  100% { opacity: 0.9; transform: scaleY(1.1); }
}

/* Reduced motion для фонов ЛК и 3D переворота */
@media (prefers-reduced-motion: reduce) {
  .cabinet-widget[data-cabinet-bg="dyn-holo-grid"] .cab-neuropunk-bg,
  .cabinet-widget[data-cabinet-bg="dyn-neon-gradient"] .cab-neuropunk-bg,
  .cabinet-widget[data-cabinet-bg="dyn-techno-waves"] .cab-neuropunk-bg::after {
    animation: none !important;
  }
}

/* ==============================================================
   USER DIALOGUES & MESSAGES MODAL (Личная переписка и связь с авторами)
   ============================================================== */
.user-dialogs-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(3, 7, 15, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: udFadeIn 0.2s ease-out;
}
@keyframes udFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.user-dialogs-box {
  width: 100%;
  max-width: 520px;
  height: 82vh;
  max-height: 680px;
  background: linear-gradient(175deg, rgba(10, 22, 40, 0.96) 0%, rgba(4, 10, 20, 0.98) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 240, 255, 0.25);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #ffffff;
  font-family: inherit;
}

.ud-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 240, 255, 0.04);
}

.ud-back-btn,
.ud-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #8ea6c7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.ud-back-btn:hover,
.ud-close-btn:hover {
  color: #00f0ff;
  transform: scale(1.1);
}

.ud-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}
.ud-subtitle {
  font-size: 11px;
  color: var(--text-muted, #8ea6c7);
}

.ud-dialogs-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ud-search-bar {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ud-search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: #ffffff;
  font-size: 13px;
  outline: none;
}
.ud-search-input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.ud-dialogs-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ud-dialog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.12);
  cursor: pointer;
  transition: all 0.18s ease;
}
.ud-dialog-item:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.35);
  transform: translateX(2px);
}
.ud-dialog-item.has-unread {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
}

.ud-partner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  flex-shrink: 0;
}

.ud-dialog-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ud-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ud-partner-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ud-dialog-time {
  font-size: 10px;
  color: var(--text-muted, #8ea6c7);
  flex-shrink: 0;
}
.ud-dialog-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ud-last-msg {
  font-size: 12px;
  color: var(--text-muted, #8ea6c7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ud-unread-pill {
  background: #00f0ff;
  color: #030a16;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  flex-shrink: 0;
}

/* Chat view */
.ud-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ud-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ud-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  word-break: break-word;
}
.ud-msg.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(0, 119, 182, 0.35) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}
.ud-msg.theirs {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-bottom-left-radius: 3px;
}

.ud-msg-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  align-self: flex-end;
  margin-top: 2px;
}

.ud-chat-img {
  max-width: 220px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  object-fit: cover;
  cursor: pointer;
}
.ud-chat-audio {
  width: 100%;
  min-width: 200px;
  max-width: 280px;
  height: 36px;
  margin: 4px 0;
}
.ud-chat-video {
  max-width: 260px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: #000000;
  margin: 4px 0;
}

.ud-attachments-strip {
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.ud-att-chip {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ud-att-chip-remove {
  background: none;
  border: none;
  color: #ff4757;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  padding: 0 2px;
}

.ud-chat-error {
  color: #ff4757;
  font-size: 12px;
  padding: 4px 16px;
  background: rgba(255, 71, 87, 0.1);
}

.ud-chat-input-bar {
  padding: 10px 14px;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 240, 255, 0.03);
}
.ud-attach-btn {
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform 0.15s ease;
  user-select: none;
}
.ud-attach-btn:hover {
  transform: scale(1.15);
}
.ud-chat-input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #ffffff;
  font-size: 13px;
  outline: none;
}
.ud-chat-input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}
.ud-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f0ff 0%, #0077b6 100%);
  border: none;
  color: #030a16;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.ud-send-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.ud-loading-state {
  text-align: center;
  color: var(--text-muted, #8ea6c7);
  padding: 24px;
  font-size: 13px;
}

@media (max-width: 480px) {
  .user-dialogs-modal {
    padding: 0;
  }
  .user-dialogs-box {
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
}



