
/* ============================================
   GENERATION PAGE STARS BALANCE (2025-12-09)
   ============================================ */

/* Баланс звезд в хедере страницы генерации */
.generation-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.generation-form-header .header-title-box {
  flex: 1;
  text-align: center;
}

.generation-form-header .header-title-box h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.generation-stars-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 180, 0, 0.1) 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 20px;
  text-decoration: none;
  color: #ffd700;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.generation-stars-balance:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 180, 0, 0.2) 100%);
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.generation-stars-balance .stars-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.generation-stars-balance .stars-count {
  color: #fff;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
  .generation-stars-balance {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .generation-stars-balance .stars-icon {
    font-size: 14px;
  }
  
  .generation-form-header .header-title-box h2 {
    font-size: 16px;
  }
}

/* ============================================
   PREMIUM LOADING & VIDEO PLAYER (2025-11-24)
   ============================================ */

/* 1. Premium Loading State (Cinema Card) */
.generation-progress-container {
  background: rgba(20, 20, 20, 0.6) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Shimmer Effect Background */
.generation-progress-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: shimmer 3s infinite linear;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -150%; }
  100% { left: 150%; }
}

/* Pulsating Center Icon */
.progress-loader-icon {
  font-size: 64px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(204, 255, 0, 0.4));
  animation: pulse-glow 2s infinite ease-in-out;
}

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

/* Modern Progress Bar */
.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 100px !important;
  height: 6px !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3) !important;
}

.progress-bar {
  background: linear-gradient(90deg, #CCFF00, #00FF88) !important;
  box-shadow: 0 0 15px rgba(204, 255, 0, 0.5) !important;
}

/* Status Text */
.progress-status {
  color: #CCFF00 !important; /* Neon Green */
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  font-size: 14px !important;
  margin-bottom: 8px !important;
}

/* Subtitle with time estimate */
.progress-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
}

.progress-tips {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 24px;
  max-width: 80%;
  line-height: 1.5;
}

/* 2. Premium Video Player Container */
.generation-result-video-wrapper {
  background: #000 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  position: relative !important;
  transition: transform 0.3s ease !important;
}

/* Video Player Controls Customization (Webkit) */
.generation-result-video::-webkit-media-controls-panel {
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent) !important;
}

/* Download Button in Player Context */
.video-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
}

.btn-action-modern {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 44px; /* touch-target ≥44px (PWA-требование) */
}

.btn-action-modern:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-action-modern.primary {
  background: #CCFF00;
  color: #000;
  border: none;
  font-weight: 700;
}

.btn-action-modern.primary:hover {
  background: #b3e600;
  box-shadow: 0 5px 20px rgba(204, 255, 0, 0.3);
}

/* ============================================
   INSUFFICIENT STARS MODAL (2025-12-09)
   Модальное окно недостатка звезд для генерации
   ============================================ */

.insufficient-stars-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.insufficient-stars-content {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 215, 0, 0.1);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.insufficient-stars-content .modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
}

.insufficient-stars-content .modal-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 50%;
  animation: starPulse 2s infinite ease-in-out;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 215, 0, 0.4); }
}

.insufficient-stars-content .modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-align: center;
  letter-spacing: -0.3px;
}

.insufficient-stars-content .modal-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.insufficient-stars-content .modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: rotate(90deg);
}

.insufficient-stars-content .modal-body {
  margin-bottom: 24px;
}

.insufficient-stars-content .stars-info {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.insufficient-stars-content .stars-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.insufficient-stars-content .stars-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.insufficient-stars-content .stars-row:first-child {
  padding-top: 0;
}

.insufficient-stars-content .stars-row.shortage {
  background: rgba(255, 77, 77, 0.1);
  margin: 12px -12px -8px;
  padding: 12px;
  border-radius: 12px;
  border-bottom: none;
}

.insufficient-stars-content .stars-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.insufficient-stars-content .stars-value {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.insufficient-stars-content .stars-value::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd93d'%3E%3Cpath d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.insufficient-stars-content .stars-value.required {
  color: #ffd93d;
}

.insufficient-stars-content .stars-value.balance {
  color: #6ec1e4;
}

.insufficient-stars-content .stars-value.balance::after {
  filter: hue-rotate(180deg);
}

.insufficient-stars-content .stars-row.shortage .stars-label {
  color: #ff6b6b;
}

.insufficient-stars-content .stars-row.shortage .stars-value {
  color: #ff6b6b;
}

.insufficient-stars-content .stars-row.shortage .stars-value::after {
  filter: hue-rotate(330deg) saturate(2);
}

.insufficient-stars-content .modal-text {
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.insufficient-stars-content .modal-footer {
  display: flex;
  gap: 12px;
}

.insufficient-stars-content .modal-footer .btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.insufficient-stars-content .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.insufficient-stars-content .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.insufficient-stars-content .btn-primary {
  background: linear-gradient(135deg, #CCFF00 0%, #a8e600 100%);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(204, 255, 0, 0.3);
}

.insufficient-stars-content .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(204, 255, 0, 0.4);
}

.insufficient-stars-content .btn-primary:active {
  transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .insufficient-stars-content {
    padding: 24px 20px;
    margin: 16px;
    max-width: calc(100% - 32px);
  }
  
  .insufficient-stars-content .modal-title {
    font-size: 20px;
  }
  
  .insufficient-stars-content .modal-footer {
    flex-direction: column-reverse;
  }
  
  .insufficient-stars-content .modal-footer .btn {
    padding: 16px;
  }
}

/* ============================================
   SCROLL TO TOP BUTTON (2025-12-29)
   Кнопка "Наверх" для главной страницы
   ============================================ */

.scroll-to-top {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(180, 255, 57, 0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  box-shadow: 
    0 4px 16px rgba(180, 255, 57, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2);
  
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: 
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: rgba(180, 255, 57, 1);
  box-shadow: 
    0 6px 24px rgba(180, 255, 57, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.scroll-to-top:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(180, 255, 57, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.15);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  color: #0b0b0f;
}

/* Touch target for accessibility */
.scroll-to-top::before {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  bottom: -4px;
  left: -4px;
}


/* ============================================================================
   Motion Studio Hub (ms-hub-*) — каталог сценариев на /apps/motion-studio.
   План: docs/development/plan-motion-studio-hub.md. Тёмная витрина в стиле
   референса: kicker + крупный заголовок + сетка карточек с 3 вертикальными
   видео-превью 9:16. Активная карточка — лаймовый акцент; «Скоро» приглушены
   и некликабельны. Только добавление (правило проекта: CSS не переписывать).
   ========================================================================== */

.ms-hub-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.ms-hub-header {
  text-align: center;
  padding: 8px 0 4px;
}

.ms-hub-kicker {
  color: #b4ff39;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ms-hub-title {
  margin: 10px auto 0;
  max-width: 640px;
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--text);
}

.ms-hub-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.ms-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
}

@media (min-width: 768px) {
  .ms-hub-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

.ms-hub-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 14px 14px 16px;
}

.ms-hub-card--active {
  border-color: rgba(180, 255, 57, 0.45);
  box-shadow: 0 0 32px rgba(180, 255, 57, 0.10);
  cursor: pointer;
}

.ms-hub-card--soon {
  opacity: 0.55;
  pointer-events: none;
}

.ms-hub-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(11, 11, 15, 0.72);
  color: var(--muted);
  backdrop-filter: blur(4px);
}

.ms-hub-badge--active {
  background: rgba(180, 255, 57, 0.92);
  color: #0b0b0f;
}

.ms-hub-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ms-hub-preview {
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #101014;
}

.ms-hub-preview video,
.ms-hub-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ms-hub-card-title {
  margin: 12px 2px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.ms-hub-card-desc {
  margin: 6px 2px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.ms-hub-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: #b4ff39;
  color: #0b0b0f;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.ms-hub-btn:hover {
  filter: brightness(1.08);
}

.ms-hub-btn:active {
  transform: scale(0.99);
}

/* ============================================================================
   Motion Studio — Family D «UGC-контент» (сценарий №2): форма аватара,
   гейт утверждения 3 кадров, черновик в плеере. Только ДОБАВЛЕНИЕ (правило
   проекта: CSS не перезаписываем). База ms2-* живёт в styles.css.
   ========================================================================== */

/* Грид из 3 кадров на утверждение (наследует ms2-variants-grid: 2 колонки) */
.ms2-variants-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1279px) { .ms2-variants-grid--3 { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
@media (max-width: 767px) { .ms2-variants-grid--3 { grid-template-columns: 1fr; } }

/* Сегмент-контрол «Автор ролика» (пол) в форме D */
.ms2-form-gender { display: flex; width: 100%; }
.ms2-form-gender .ms2-seg-btn { flex: 1; min-height: 44px; }
/* Family H: сегмент категории (товар | одежда) — та же геометрия, что у пола автора D. */
.ms2-form-category { display: flex; width: 100%; }
.ms2-form-category .ms2-seg-btn { flex: 1; min-height: 44px; }

/* Подсказка под кнопкой «Создать», пока не выбран автор */
.ms2-form-hint { margin-top: 8px; font-size: 12.5px; opacity: 0.65; }

/* Примечание под кадрами: ролик уже оплачен */
.ms2-keyframes-note { margin-top: 12px; font-size: 13px; opacity: 0.7; }


/* ============================================
   PHOTO→VIDEO (2026-07-13)
   Кнопка «Создать видео по фото» в результате фото-формы
   ============================================ */

/* Кнопки результата фото-формы: вертикальный стек по центру */
.video-actions-bar--stacked {
  flex-direction: column;
  align-items: center;
}

/* Контурная акцентная кнопка: лаймовая обводка, белый текст */
.btn-action-modern.accent-outline {
  background: transparent;
  border: 1px solid #CCFF00;
  color: #fff;
  font-weight: 600;
}

.btn-action-modern.accent-outline:hover {
  background: rgba(204, 255, 0, 0.1);
  box-shadow: 0 5px 20px rgba(204, 255, 0, 0.2);
}

/* Лаймовая иконка ▶ внутри контурной кнопки */
.btn-action-modern.accent-outline .btn-icon-accent {
  color: #CCFF00;
}

/* ================================================================
   Приложение «Озвучка текста» (/apps/voiceover)
   Мятный акцент var(--accent) #6ce5b1 — как AI Музыка и Motion Design
   («звуковая» семья приложений). Цена — золото #FFD700 (конвенция проекта).
   ================================================================ */
.vo-page {
  background: #11151e;
  min-height: 100vh;
  padding: 20px 16px 48px;
}

/* ----- Шапка ----- */
.vo-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto 20px;
}

.vo-back-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.vo-back-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 229, 177, 0.08);
}

.vo-header-titles { min-width: 0; }

.vo-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 4px 0 6px;
}


.vo-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
}

/* ----- Раскладка ----- */
.vo-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

.vo-col-form, .vo-col-stage { min-width: 0; }

/* ----- Форма ----- */
.vo-form {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.vo-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 140px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.vo-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.vo-textarea::placeholder { color: rgba(255, 255, 255, 0.3); }

.vo-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vo-counter {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.vo-counter--limit { color: var(--danger); }

.vo-price {
  font-size: 15px;
  font-weight: 700;
  color: #FFD700;
  font-variant-numeric: tabular-nums;
}

.vo-submit-btn {
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #4de8a0);
  color: #112013;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(108, 229, 177, 0.24);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.vo-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(108, 229, 177, 0.3);
}

.vo-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.vo-error {
  font-size: 13px;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
}

/* ----- Мятный акцент для переиспользованного VoicePicker -----
   Глобальные правила пикера лаймовые (styles.css, «Говорящая голова»);
   здесь переопределяем только внутри .vo-form — компонент не форкаем. */
.vo-form .voice-card:hover,
.vo-form .voice-play-btn:hover,
.vo-form .voice-picker-toggle:hover,
.vo-form .voice-picker-toggle.open {
  border-color: var(--accent);
}

.vo-form .voice-card.selected {
  border-color: var(--accent);
  background: rgba(108, 229, 177, 0.10);
}

.vo-form .voice-card:focus-visible,
.vo-form .voice-picker-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.vo-form .voice-play-btn.playing {
  background: var(--accent);
  border-color: var(--accent);
  color: #111827;
}

/* ----- Прогресс ----- */
.vo-progress-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.vo-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(108, 229, 177, 0.15);
  border-top-color: var(--accent);
  animation: vo-spin 0.9s linear infinite;
}

@keyframes vo-spin { to { transform: rotate(360deg); } }

.vo-stage-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.vo-progress-hint {
  font-size: 13px;
  color: var(--muted);
}

/* ----- Результат ----- */
.vo-result {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(108, 229, 177, 0.18);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vo-result--error { border-color: rgba(255, 107, 107, 0.25); }

.vo-result-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.vo-result-meta {
  font-size: 13px;
  color: var(--muted);
}

.vo-refund-note {
  font-size: 13px;
  color: var(--accent);
}

.vo-audio-player {
  width: 100%;
  height: 40px;
  border-radius: 10px;
}

.vo-audio-player--compact { height: 34px; }

.vo-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.vo-download-btn, .vo-secondary-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.vo-download-btn {
  background: rgba(108, 229, 177, 0.08);
  border: 1px solid rgba(108, 229, 177, 0.2);
  color: var(--accent);
}

.vo-download-btn:hover:not(:disabled) { background: rgba(108, 229, 177, 0.16); }
.vo-download-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.vo-secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.vo-secondary-btn:hover { border-color: var(--accent); }

/* ----- Гостевой CTA ----- */
.vo-guest-cta {
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(108, 229, 177, 0.25);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.vo-guest-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.vo-guest-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.vo-guest-btn {
  align-self: stretch;
  max-width: 220px;
}

/* ----- История ----- */
.vo-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.vo-history-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.vo-history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.vo-history-card:hover { border-color: rgba(108, 229, 177, 0.2); }

.vo-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.vo-history-voice {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.vo-history-duration {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.vo-history-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
  word-break: break-word;
}

/* ----- Адаптив ----- */
@media (max-width: 900px) {
  .vo-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .vo-page { padding: 16px 12px 40px; }
  .vo-title { font-size: 22px; }
  .vo-form { padding: 14px; }
  .vo-result-actions > * { flex: 1 1 140px; }
  .vo-guest-btn { max-width: none; }
}

/* ===== Мягкий лимит символов textarea (формы генерации) =====
   Классы ставит generation-form/limitedTextarea.js. :focus дублируем явно —
   иначе зелёная рамка фокуса из styles.css перебьёт красную. */
.form-textarea.is-over-limit,
.scene-textarea.is-over-limit,
.form-textarea.is-over-limit:focus,
.scene-textarea.is-over-limit:focus {
  border-color: var(--danger);
}

.textarea-counter {
  font-variant-numeric: tabular-nums;
}

.textarea-counter--over {
  color: var(--danger);
}

.textarea-limit-hint {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.textarea-limit-hint[hidden] {
  display: none;
}

/* Сцены мульти-шота: margin-bottom textarea переносим на обёртку, чтобы счётчик
   прижимался к полю, а отступ до строки длительности сохранялся */
.scene-card .limited-textarea {
  margin-bottom: 10px;
}

.scene-card .limited-textarea .scene-textarea {
  margin-bottom: 4px;
}

/* Клип: paywall для PRO-шаблона (locked=true) — вместо кнопки генерации.
   Тот же габарит, что у .btn-generate-large, но нейтральный градиент «PRO». */
.generation-form-clip-page .btn-clip-pro-paywall {
  width: 100%;
  min-height: 48px;
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25);
}

/* Клип: подсказка под кнопкой, когда звёзд меньше стоимости */
.generation-form-clip-page .generation-balance-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-warning, #ffd93d);
  text-align: center;
}

/* Блок «Для вас» на главной (RecoBlock): 6 карточек 9:16. Узкий телефон — 3 ряда
   по 2, телефон и планшет — 2 ряда по 3, десктоп — 1 ряд из 6 (при 3 колонках
   блок на десктопе был бы ~1400px). Скелет держит место до ответа — без CLS. */
.reco-block .reco-block-title {
  text-transform: uppercase;
}

.reco-block-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 400px) {
  .reco-block-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) {
  .reco-block-grid {
    gap: 12px;
  }
}

@media (min-width: 960px) {
  .reco-block-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
  }
}

.reco-block-skeleton {
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--card) 25%, rgba(255, 255, 255, 0.06) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: reco-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes reco-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reco-block-skeleton {
    animation: none;
  }
}

/* ===== Клипы: несколько фото пользователя (1–5) — docs/development/plan-clip-multi-photo.md ===== */
/* До 5 полей фото переносятся на узких экранах (320px) */
.generation-form-clip-page .clip-photo-slots {
  flex-wrap: wrap;
}

/* «Убрать фото»: видимая кнопка 20px, зона нажатия 44×44 (PWA touch target) */
.generation-form-clip-page .slot-remove-btn::before {
  content: '';
  position: absolute;
  inset: -12px;
}

.generation-form-clip-page .clip-photo-slots-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(204, 255, 0, 0.8);
}

/* Превью шаблона в форме клипа. Карточка держит высоту через aspect-ratio, а
   height: 100% у видео внутри Safari (iPhone, Mac), по всей видимости, не считает
   определённой — ролик не получал размер, не запускался, и был виден чёрный фон
   карточки. Растягиваем видео по карточке абсолютно. Без aspect-ratio карточка
   высоту не получит — там остаётся прежняя вёрстка. */
@supports (aspect-ratio: 1) {
  .generation-form-clip-page .template-mini-card .template-mini-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}
