/* Импорт шрифтов */
/* Google Fonts загружаются асинхронно через HTML, @import удален для неблокирующей загрузки */

/* Основной сброс */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Светлая тема - фоны */
  --background-dark: #f5f5fa; /* Цвет фона страницы */
  --surface-dark: #FFFFFF; /* Белый для поверхностей */
  --surface-light: #FAFAFA; /* Очень светло-серый для карточек */
  
  /* Акцентные цвета из примеров */
  --accent-color: #4A90E2; /* Синий акцент (из примеров) */
  --accent-hover: #357ABD; /* Темнее синий для ховера */
  --button-primary: #4A90E2; /* Основной цвет кнопок */
  --button-hover: #357ABD; /* Цвет кнопок при наведении */
  
  /* Цвета текста для светлой темы */
  --text-primary: #1A1A1A; /* Темно-серый/черный */
  --text-secondary: #666666; /* Серый */
  --text-muted: #999999; /* Светло-серый */
  
  /* Дополнительные цвета */
  --error-color: #FF4545; /* Красный */
  --success-color: #00B300; /* Зеленый */
  --overlay-dark: rgba(0, 0, 0, 0.5); /* Полупрозрачный черный */
  --card-gradient: linear-gradient(to bottom, #FFFFFF, #FAFAFA);

  /* Дополнительные декоративные цвета */
  --rating-star: #FFA500; /* Оранжевый для звезд рейтинга */
  --divider-color: #E0E0E0; /* Светло-серый для разделителей */
  --hover-overlay: rgba(74, 144, 226, 0.1); /* Синий оверлей для ховера */
  
  /* Цвета для категорий из примеров */
  --category-teal: #17A2B8; /* Бирюзовый для категорий */
  --category-orange: #FF6B35; /* Оранжевый */
  --category-red: #C92A2A; /* Красный */
  
  /* Дополнительные цвета из примеров */
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

body {
  background: var(--background-dark);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  padding: 0;
}

/* Sticky AdSense (mobile only) */
.sticky-adsense-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
}

.sticky-adsense-host > * {
  pointer-events: auto;
}

.sticky-adsense-host[hidden] {
  display: none !important;
}

/* Крестик над баннером, ближе к полосе */
.sticky-adsense-close-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 10px 2px;
  flex: 0 0 auto;
}

.sticky-adsense-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.98);
  color: #111;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.sticky-adsense-close:active {
  transform: scale(0.98);
}

/* Полоса с рекламой: 100% ширины, 120px высоты (mobile sticky 2) */
.sticky-adsense-bar {
  width: 100%;
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 -8px 28px rgba(0,0,0,0.14);
  box-sizing: border-box;
  overflow: hidden;
  flex: 0 0 auto;
}

.sticky-adsense-inner {
  width: 100%;
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-adsense-inner ins.adsbygoogle {
  display: inline-block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 120px !important;
  min-height: 120px !important;
  max-height: 120px !important;
  box-sizing: border-box;
  vertical-align: top;
}

body.has-sticky-ad {
  /* 120px полоса + крестик ~36px + небольшой зазор */
  padding-bottom: 168px;
}

@media (min-width: 1024px) {
  .sticky-adsense-host {
    display: none !important;
  }
  body.has-sticky-ad {
    padding-bottom: 0;
  }
}

/* Контейнер теста */
.container {
  max-width: 800px;
  width: 100%;
  margin: 40px auto;
  background: var(--surface-dark);
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  text-align: center;
  border: 1px solid var(--divider-color);
}

/* Страница теста: боковые рекламные блоки (desktop only) */
.test-page-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}

.test-side-ad-shell {
  display: none;
  flex-shrink: 0;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  height: 600px;
  max-height: 600px;
  overflow: hidden;
}

.test-side-ad-shell .test-side-ad {
  width: 200px;
  height: 600px;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .test-side-ad-shell {
    display: block;
    margin-top: 40px; /* выравниваем по высоте с .container */
  }
  /* чтобы центральный контейнер не распирал флекс */
  .test-page-layout .container {
    margin: 40px 0;
  }
}

@media (max-width: 1023px) {
  .test-page-layout {
    display: block;
  }
}

/* Картинки */
img {
  max-width: 100%;
  border-radius: 8px;
  margin: 15px 0;
  height: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Кнопки в контейнере теста */
.container button {
  margin: 12px 0;
  padding: 14px 28px;
  width: auto;
  min-width: 200px;
  border: none;
  border-radius: 10px;
  background: var(--accent-color);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0;
}

.container button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Кнопка поделиться */
.share-btn {
  background: var(--success-color);
}

.share-btn:hover {
  background: #16a34a;
}

/* Скрытые элементы */
.hidden {
  display: none;
}

/* Прогресс-бар */
.progress {
  width: 100%;
  background: #E0E0E0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 30px 0;
}

.progress-bar {
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Заголовки в контейнере теста */
.container h1 {
  font-size: 32px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  line-height: 1.3;
}

/* Вопросы */
.container h2 {
  margin-bottom: 20px;
  font-size: 28px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.container h3 {
  font-size: 22px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  margin: 30px 0 15px 0;
}

.description {
  margin-bottom: 20px;
  color: #2C2C2C;
  text-align: left;
  line-height: 1.7;
  font-weight: 400;
  font-size: 16px;
}

/* Ответы с картинками */
#answers button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  background: var(--surface-dark);
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  border: 2px solid var(--divider-color);
  border-radius: 12px;
  transition: all 0.2s ease;
  padding: 16px 20px;
  margin: 12px 0;
  width: 100%;
  box-sizing: border-box;
}

#answers button:hover {
  background: var(--hover-overlay);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

#answers button:active {
  background: var(--hover-overlay);
  border-color: var(--accent-color);
  transform: translateY(0);
}

#answers button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface-light);
}

#answers button.selected {
  background: rgba(74, 144, 226, 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

#answers button img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0;
}

/* Картинка вопроса */
#question-image {
  max-height: 250px;
  object-fit: cover;
}

/* Картинка результата */
#result-image {
  max-height: 300px;
  object-fit: cover;
}

/* Кнопка "Пройти ще раз" */
#restart-btn {
  background: var(--accent-color);
  color: #ffffff;
  width: auto !important;
  min-width: 200px;
  margin: 30px auto !important;
  font-size: 16px !important;
  padding: 14px 28px !important;
  display: block !important;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3) !important;
}

#restart-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4) !important;
  transform: translateY(-2px);
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px;
    margin: 10px auto;
  }

  #start-screen {
    padding: 15px 0;
  }

  #start-screen h1 {
    font-size: 24px;
    margin-bottom: 15px;
  }

  #start-screen p {
    font-size: 16px;
    margin-bottom: 20px;
    gap: 6px;
  }

  #start-screen p .material-symbols-rounded {
    font-size: 20px;
  }

  #start-screen img {
    margin: 20px 0;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  button {
    font-size: 14px;
    padding: 12px;
    margin: 8px 0;
  }

  #answers button img {
    width: 40px;
    height: 40px;
  }

  .description {
    margin-bottom: 12px;
    font-size: 14px;
  }
}

/* Top Banner */
.top-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 16px 0 32px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.banner-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.banner-text {
  color: #FFFFFF;
  font-size: 14px;
  text-align: center;
  margin: 0;
  line-height: 1.6;
  font-weight: 400;
}

/* Фиксированный Header - белая панель */
.site-header {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 20px;
  margin-top: -25px;
  margin-bottom: 40px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.header-container {
  max-width: 100%;
  margin: 0;
  padding: 11px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-dark);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--divider-color);
  min-height: 50px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo-image {
  height: calc(90% - 22px);
  max-height: 45px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  background: transparent;
}

.logo:hover .logo-image {
  opacity: 0.8;
}

.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  line-height: 1;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  body {
    padding: 0 !important;
  }

  .top-banner {
    padding: 0 0 28px;
    margin: 0;
  }

  .banner-container {
    padding: 0;
  }

  .banner-text {
    font-size: 12px;
    line-height: 1.5;
    padding: 0 16px;
  }

  .site-header {
    padding: 0;
    margin-top: -20px;
    width: 100%;
  }

  .header-container {
    padding: 6px 12px;
    max-width: 100%;
    width: 100%;
    min-height: 44px;
  }

  .logo-image {
    height: calc(90% - 12px);
    max-height: 36px;
  }

  .logo-text {
    font-size: 16px;
  }
  
  .logo {
    gap: 8px;
  }
}

/* Контент с отступом */
.site-content {
  padding: 0 20px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Контейнер категорий - 3 колонки на десктопе */
.categories-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* На странице категории контейнер становится обычным блоком */
.categories-container.category-page-container {
  display: block;
}

/* AdSense: горизонтальные блоки только на desktop (главная) */
.adsense-home-desktop.home-ad-slot {
  grid-column: 1 / -1;
  display: none;
  width: 100%;
  max-width: 100%;
  max-height: 300px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 12px 0;
  margin: 0;
  text-align: center;
  min-height: 1px;
}

@media (min-width: 1024px) {
  .adsense-home-desktop.home-ad-slot {
    display: block;
  }
}

/* AdSense: мобильные блоки после каждой категории — только <1024px */
.adsense-home-mobile.home-ad-slot-mobile {
  grid-column: 1 / -1;
  display: none;
  width: 100%;
  max-width: 100%;
  max-height: 300px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 12px 0;
  margin: 0;
  text-align: center;
  min-height: 1px;
}

@media (max-width: 1023px) {
  .adsense-home-mobile.home-ad-slot-mobile {
    display: block;
  }
}

/* Блок категории */
.category-block {
  background: var(--surface-dark);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: none;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background-blend-mode: overlay;
}

/* Очень светлый однотонный фон блока категории */
.category-block[data-category-color="#9B59B6"] {
  background-color: rgba(155, 89, 182, 0.06);
}

.category-block[data-category-color="#E67E22"] {
  background-color: rgba(230, 126, 34, 0.06);
}

.category-block[data-category-color="#3498DB"] {
  background-color: rgba(52, 152, 219, 0.06);
}

.category-block[data-category-color="#1ABC9C"] {
  background-color: rgba(26, 188, 156, 0.06);
}

.category-block[data-category-color="#E74C3C"] {
  background-color: rgba(231, 76, 60, 0.06);
}

.category-block[data-category-color="#F39C12"] {
  background-color: rgba(243, 156, 18, 0.06);
}

.category-block[data-category-color="#16A085"] {
  background-color: rgba(22, 160, 133, 0.06);
}

.category-block[data-category-color="#8E44AD"] {
  background-color: rgba(142, 68, 173, 0.06);
}


.category-block:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.category-header {
  margin-bottom: 28px;
}

.category-browse-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 500;
}

.category-title {
  margin: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.category-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.category-hash {
  font-weight: 700;
  font-size: 20px;
  margin-right: 2px;
}

.category-name {
  color: var(--text-primary);
}

.category-link:hover {
  color: var(--accent-hover);
}

/* Контейнер тестов в категории - вертикальная колонка */
.category-tests {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* Упрощенная карточка теста */
.test-card-mini {
  display: flex;
  flex-direction: row;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  width: 100%;
  align-items: flex-start;
}

.test-card-mini:hover {
  transform: none;
  box-shadow: none;
  opacity: 0.8;
}

.test-card-image {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  overflow: hidden;
  background: var(--surface-dark);
  display: block;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
}

.test-card-image .image-wrapper {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  position: relative;
}

.test-card-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 8px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.test-card-content {
  padding: 0 0 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 80px;
  min-height: 80px;
}

.test-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 auto 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-top: 2px;
}

.test-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-top: auto;
  padding-top: 4px;
  gap: 12px;
}

.test-views,
.test-duration {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.test-duration .material-symbols-rounded {
  font-size: 20px;
  width: 20px;
  height: 20px;
  font-variation-settings: 'FILL' 1;
  color: #9B59B6; /* Фиолетовый */
}

.test-views .material-symbols-rounded {
  font-size: 20px;
  width: 20px;
  height: 20px;
  font-variation-settings: 'FILL' 1;
  color: #FF3333; /* Яркий красный */
}

/* Пустые слоты для сохранения высоты */
.test-card-empty {
  min-height: 80px;
  visibility: hidden;
  pointer-events: none;
}

/* Кнопка "Показать еще" - простой текст */
.category-show-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: var(--accent-color);
  text-decoration: none;
  border-radius: 0;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s ease;
  margin-top: 8px;
  align-self: center;
}

.category-show-more:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
  color: var(--accent-hover);
  text-decoration: underline;
}

.category-show-more .material-symbols-rounded {
  font-size: 16px;
}

/* Адаптивность */
@media (max-width: 1200px) {
  .categories-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .site-content {
    padding: 0 8px 32px;
    max-width: 100%;
  }

  .categories-container {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0;
  }

  .category-block {
    padding: 20px 8px;
  }

  .category-tests {
    gap: 14px;
  }

  .category-browse-label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .category-title {
    font-size: 18px;
  }

  .test-card-image {
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
  }

  .test-card-content {
    height: 100px;
    min-height: 100px;
    padding: 0 0 0 12px;
  }

  .test-card-title {
    font-size: 16px;
    padding-top: 2px;
  }

  .test-card-meta {
    font-size: 17px;
    gap: 12px;
    padding-right: 8px;
    padding-left: 0;
  }

  .test-views .material-symbols-rounded,
  .test-duration .material-symbols-rounded {
    font-size: 22px;
    width: 22px;
    height: 22px;
  }

  .test-views,
  .test-duration {
    font-size: 17px;
    gap: 10px;
  }

  .test-card-meta {
    font-size: 11px;
    gap: 10px;
    padding-bottom: 2px;
  }

  .test-views .material-symbols-rounded,
  .test-time .material-symbols-rounded {
    font-size: 12px;
  }
}

/* Подвал */
.site-footer {
  background: #f8f8f8;
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
  color: #777;
  font-size: 14px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Блок «Поділитися результатом» — круглі іконки без тексту */
.share-buttons-wrap {
  margin: 20px 0 8px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 4px;
}

.share-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.share-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.share-icon-btn img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  pointer-events: none;
  display: block;
}

.share-icon-btn__ms {
  font-size: 22px !important;
  color: #fff;
  line-height: 1;
}

.share-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0.95;
}

.share-icon-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.share-icon-btn--x { background: #000000; }
.share-icon-btn--facebook { background: #1877f2; }
.share-icon-btn--telegram { background: #229ed9; }
.share-icon-btn--whatsapp { background: #25d366; }
.share-icon-btn--linkedin { background: #0a66c2; }
.share-icon-btn--tumblr { background: #36465d; }
.share-icon-btn--reddit { background: #ff4500; }
.share-icon-btn--instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.share-icon-btn--tiktok { background: #000000; }

/* Стили для start-screen */
#start-screen {
  text-align: center;
  padding: 20px 0;
}

#start-screen h1 {
  font-size: 32px;
  margin-bottom: 25px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

#start-screen p {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 10px;
  color: #2C2C2C;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#start-screen p .material-symbols-rounded {
  font-size: 24px;
  font-variation-settings: 'FILL' 1;
  color: var(--accent-color);
}

#start-screen img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

#start-btn {
  width: auto !important;
  min-width: 200px;
  margin: 30px auto !important;
  font-size: 16px !important;
  padding: 14px 28px !important;
  display: block !important;
  background: var(--accent-color) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3) !important;
}

#start-btn:hover {
  background: var(--accent-hover) !important;
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4) !important;
  transform: translateY(-2px);
}

#embed-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.3s ease;
  margin: 10px 0;
  width: auto !important;
}

#embed-btn:hover {
  background-color: rgba(245, 197, 24, 0.1);
  box-shadow: 0 0 15px rgba(245, 197, 24, 0.2);
}

#embed-btn .material-symbols-rounded {
  font-size: 18px;
  color: var(--accent-color);
}

/* Модальное окно для embed-кода */
.embed-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.embed-modal-content {
  position: relative;
  background: var(--surface-dark);
  margin: 50px auto;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  border: 1px solid var(--accent-color);
  box-shadow: 0 0 30px rgba(75, 59, 88, 0.3);
}

.embed-modal h3 {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 20px;
}

.embed-code {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-family: monospace;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.embed-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 24px;
  transition: color 0.3s ease;
}

.embed-close:hover {
  color: var(--accent-color);
}

@media (max-width: 600px) {
  .embed-modal-content {
    margin: 20px auto;
    padding: 15px;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
  }
}

/* Стили для оценки теста */
.test-rating {
  margin: 40px 0;
  padding: 30px;
  background: var(--surface-dark);
  border-radius: 16px;
  text-align: center;
  display: none;
  border: 1px solid var(--divider-color);
  box-shadow: var(--card-shadow);
}

.test-rating h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.rating-stars {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 15px;
}

.star {
  font-size: 32px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  user-select: none;
}

.star:hover,
.star.active {
  color: var(--accent-color);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.rating-message {
  color: var(--accent-color);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rating-message.visible {
  opacity: 1;
}

@media (max-width: 600px) {
  #start-screen p {
    font-size: 16px;
    gap: 6px;
  }

  #start-screen p .material-symbols-rounded {
    font-size: 20px;
  }
}

.test-card .btn {
  background: var(--button-primary);
  color: var(--text-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  margin-top: auto;
}

.test-card .btn:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

.question-navigation {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: nowrap;
  margin-top: 20px;
  gap: 10px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 20px;
  background-color: var(--surface-light);
  color: var(--text-primary);
  border: 2px solid var(--accent-color);
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
  background-color: var(--hover-overlay);
  box-shadow: 0 0 15px rgba(245, 197, 24, 0.2);
}

.nav-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  background-color: #eef2ff; /* более заметный светлый фон */
  border-color: #c7d2fe;     /* светлый контрастный бордер */
  color: #6b7280;            /* серый текст */
}

.nav-btn .material-symbols-rounded {
  font-size: 20px;
  color: inherit; /* иконка того же цвета, что и текст кнопки */
}

.in-test-ad-gate {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--divider-color);
  background: var(--surface-light);
}

.in-test-ad-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--text-primary);
}

.in-test-ad-wrap {
  max-height: 300px;
  overflow: hidden;
  margin-bottom: 14px;
}

#in-test-ad-continue-btn {
  margin-left: auto;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
}

@media (min-width: 769px) {
  #in-test-ad-continue-btn {
    min-width: 200px;
  }
}

#in-test-ad-continue-counter {
  font-weight: 700;
}

#in-test-ad-continue-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .in-test-ad-wrap {
    width: min(100%, 300px);
    max-width: 300px;
    max-height: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .container h2 {
    font-size: 17px;
    line-height: 1.35;
  }

  #question-description.description {
    font-size: 13px;
    line-height: 1.6;
  }

  .question-navigation {
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .question-navigation #back-btn {
    flex: 0 1 auto;
    max-width: 40%;
    min-width: 0;
    padding: 10px 10px;
    font-size: 14px;
  }

  .question-navigation .nav-btn {
    padding: 10px 14px;
    font-size: 15px;
  }

  .question-navigation #back-btn.nav-btn {
    padding: 10px 10px;
  }

  #in-test-ad-continue-btn {
    margin-left: 0;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* --- Стили для multiple choice (чекбоксы) --- */
.multi-checkbox-label {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 16px;
  border: 1px solid var(--divider-color);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface-light);
  transition: all 0.2s ease;
  font-size: 1.1em;
  color: var(--text-primary);
}

.multi-checkbox-label.selected {
  border-color: var(--accent-color);
  background: var(--hover-overlay);
}

.multi-checkbox {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  accent-color: var(--accent-color);
}

.multi-checkbox-label img {
  max-height: 28px;
  margin-right: 8px;
  vertical-align: middle;
}

.submit-multi-btn {
  margin-top: 16px;
  padding: 10px 24px;
  font-size: 1.1em;
  background: var(--accent-color);
  color: #000000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  text-align: center;
  display: block;
  width: 100%;
}

.submit-multi-btn:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

/* Language switcher */
.site-header .header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.lang-switcher {
	display: flex;
	align-items: center;
	margin-left: auto;
}
.lang-switcher select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background: var(--surface-light);
	border: 1px solid var(--divider-color);
	border-radius: 12px;
	height: 40px;
	line-height: 24px;
	padding: 8px 40px 8px 14px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--text-primary);
	cursor: pointer;
	transition: border-color .2s, box-shadow .2s, background .2s, color .2s;
	outline: none;
}
.lang-switcher select:hover {
	border-color: var(--accent-color);
	box-shadow: 0 4px 14px rgba(0,0,0,.08), 0 0 0 3px var(--hover-overlay);
}
.lang-switcher select:focus {
	border-color: var(--accent-color);
	box-shadow: 0 0 0 3px var(--hover-overlay);
	background: var(--surface-light);
}
.lang-switcher::after {
	content: '\25BE';
	margin-left: -30px;
	pointer-events: none;
	color: var(--text-secondary);
	font-size: 0.9rem;
}
.lang-switcher select option {
	background: var(--surface-light);
	color: var(--text-primary);
}
@media (max-width: 600px) {
	.lang-switcher select {
		height: 38px;
		padding: 8px 34px 8px 12px;
		font-size: .95rem;
	}
}

/* Custom language dropdown */
.lang-switcher { position: relative; }
.lang-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 8px 16px; /* больше место справа под стрелку */
	min-width: 180px; /* было 220px */
	border: 1px solid var(--divider-color);
	border-radius: 12px;
	background: var(--surface-light);
	color: var(--text-primary);
	font-size: 1rem;
	cursor: pointer;
	transition: border-color .2s, box-shadow .2s;
	white-space: nowrap; /* не переносить */
}
.lang-current { white-space: nowrap; }
.lang-list {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	min-width: 180px; /* было 220px */
	background: var(--surface-light);
	border: 1px solid var(--divider-color);
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(0,0,0,.18);
	padding: 8px 0;
	z-index: 50;
}
.lang-item {
	list-style: none;
	padding: 10px 14px;
	font-size: 1rem;
	color: var(--text-primary);
	cursor: pointer;
	white-space: nowrap;
}
.lang-item:hover { background: var(--hover-overlay); }
@media (max-width: 400px) {
	.lang-trigger { min-width: 168px; }
	.lang-list { min-width: 168px; }
}

/* Navigation Menu - Desktop */
.main-nav.desktop-nav {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-left: auto;
	margin-right: 16px;
}

.main-nav.desktop-nav .nav-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-radius: 10px;
	text-decoration: none;
	color: var(--text-primary);
	font-size: 15px;
	font-weight: 500;
	transition: all 0.2s ease;
	white-space: nowrap;
	background: transparent;
	border: 1px solid transparent;
}

.main-nav.desktop-nav .nav-link:hover {
	background: var(--hover-overlay);
	color: var(--accent-color);
	border-color: var(--accent-color);
}

.main-nav.desktop-nav .nav-link .material-symbols-rounded {
	font-size: 20px;
	font-variation-settings: 'FILL' 0;
	transition: all 0.2s ease;
}

.main-nav.desktop-nav .nav-link:hover .material-symbols-rounded {
	font-variation-settings: 'FILL' 1;
	color: var(--accent-color);
}

.main-nav.desktop-nav .nav-item {
	position: relative;
}

.main-nav.desktop-nav .resources-trigger {
	background: none;
	border: none;
	color: var(--text-primary);
	text-decoration: none;
	font-size: 1rem;
	font-weight: 500;
	padding: 8px 12px;
	border-radius: 8px;
	transition: all 0.2s ease;
	white-space: nowrap;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
}

.main-nav.desktop-nav .resources-trigger:hover {
	background: var(--hover-overlay);
	color: var(--accent-color);
}

.main-nav.desktop-nav .resources-trigger .material-symbols-rounded {
	font-size: 20px;
	transition: transform 0.2s ease;
}

.main-nav.desktop-nav .resources-trigger[aria-expanded="true"] .material-symbols-rounded {
	transform: rotate(180deg);
}

.nav-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: var(--surface-light);
	border: 1px solid var(--divider-color);
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(0,0,0,.3);
	padding: 8px;
	min-width: 280px;
	z-index: 1000;
}

.nav-dropdown * {
	color: inherit;
}

.nav-dropdown .dropdown-item-content,
.nav-dropdown .dropdown-item-title {
	font-size: 0.95rem !important;
	color: var(--text-primary) !important;
}

.dropdown-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--text-primary);
	transition: all 0.2s ease;
	margin-bottom: 4px;
	font-size: 1rem;
	width: 100%;
	min-width: 0;
}

/* Элементы БЕЗ подменю выравниваем по центру - иконка и текст на одном уровне */
.dropdown-item:not(.dropdown-item-with-submenu) {
	align-items: center !important;
	min-height: 48px;
}

/* Элементы С подменю выравниваем сверху */
.dropdown-item.dropdown-item-with-submenu {
	align-items: flex-start !important;
}

.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-icon {
	align-self: center !important;
	flex-shrink: 0;
	margin-top: 0 !important;
}

.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-content {
	justify-content: center;
	display: flex;
	flex-direction: column;
}

.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-title {
	line-height: 1.4 !important;
	margin: 0 !important;
	padding: 0 !important;
	margin-bottom: 0 !important;
	display: block;
}

.dropdown-item * {
	box-sizing: border-box;
}

.dropdown-item:hover {
	background: var(--hover-overlay);
}

.dropdown-item-icon {
	color: var(--accent-color);
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	min-height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Для элементов с подменю иконка сверху */
.dropdown-item.dropdown-item-with-submenu .dropdown-item-icon {
	align-self: flex-start;
	margin-top: 2px;
}

/* Для элементов без подменю иконка по центру */
.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-icon {
	align-self: center !important;
	margin-top: 0 !important;
}

/* Для элементов без подменю заголовок выравниваем */
.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-title {
	line-height: 1.4;
	margin-top: 0;
	padding-top: 0;
}

.dropdown-item-icon .material-symbols-rounded {
	font-size: 24px;
	line-height: 1;
}

.dropdown-item-content {
	flex: 1;
	min-width: 150px;
	color: var(--text-primary);
	display: flex;
	flex-direction: column;
	width: auto;
	overflow: visible;
	justify-content: flex-start;
}

/* Для элементов без подменю контент выравниваем по центру */
.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-content {
	justify-content: center !important;
	align-items: flex-start;
	align-self: center;
}

.dropdown-item-title {
	font-weight: 500;
	font-size: 0.95rem !important;
	margin-bottom: 4px;
	margin-top: 0;
	padding-top: 0;
	color: var(--text-primary) !important;
	display: block !important;
	line-height: 1.4;
	white-space: normal;
	opacity: 1 !important;
	visibility: visible !important;
	width: 100%;
	height: auto;
	min-height: 1.4em;
	overflow: visible;
	text-overflow: clip;
	padding: 0;
}

/* Для элементов без подменю немного увеличиваем line-height */
.dropdown-item:not(.dropdown-item-with-submenu) .dropdown-item-title {
	line-height: 1.5;
}

.dropdown-item-submenu {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 8px;
	padding-left: 12px;
}

.dropdown-item-submenu a {
	color: var(--text-secondary);
	font-size: 0.875rem;
	text-decoration: none;
	padding: 4px 8px;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.dropdown-item-submenu a:hover {
	color: var(--accent-color);
	background: var(--hover-overlay);
}

/* Mobile Menu */
.mobile-menu-trigger {
	display: none;
	background: none;
	border: none;
	color: var(--text-primary);
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	transition: all 0.2s ease;
	margin-right: 8px;
}

.mobile-menu-trigger:hover {
	background: var(--hover-overlay);
	color: var(--accent-color);
}

.mobile-menu-trigger .material-symbols-rounded {
	font-size: 24px;
}

.mobile-menu {
	position: fixed;
	top: 0;
	right: 0;
	width: 100%;
	max-width: 320px;
	height: 100%;
	z-index: 10001;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	transform: translateX(100%);
}

.mobile-menu.active {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

.mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

.mobile-menu-content {
	position: relative;
	background: var(--surface-dark);
	height: 100%;
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-menu-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	border-bottom: 1px solid var(--divider-color);
}

.mobile-menu-header h2 {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0;
}

.mobile-menu-close {
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	transition: all 0.2s ease;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mobile-menu-close:hover {
	background: var(--hover-overlay);
	color: var(--text-primary);
}

.mobile-menu-close .material-symbols-rounded {
	font-size: 24px;
}

.mobile-menu-nav {
	flex: 1;
	overflow-y: auto;
	padding: 16px 0;
}

.mobile-menu-item {
	display: block;
	color: var(--text-primary) !important;
	text-decoration: none;
	padding: 12px 20px;
	font-size: 1rem;
	transition: all 0.2s ease;
	border-left: 3px solid transparent;
	font-weight: 500;
}

.mobile-menu-item a {
	color: inherit;
	text-decoration: none;
}

.mobile-menu-item:hover {
	background: var(--hover-overlay);
	border-left-color: var(--accent-color);
}

.mobile-menu-item-trigger {
	width: 100%;
	background: none;
	border: none;
	color: var(--text-primary) !important;
	text-align: left;
	padding: 12px 20px;
	font-size: 1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: all 0.2s ease;
	border-left: 3px solid transparent;
	font-weight: 500;
	font-family: inherit;
}

.mobile-menu-item-trigger:hover {
	background: var(--hover-overlay);
	border-left-color: var(--accent-color);
}

.mobile-menu-item-trigger .material-symbols-rounded {
	font-size: 20px;
	transition: transform 0.2s ease;
}

.mobile-menu-item-trigger[aria-expanded="true"] .material-symbols-rounded {
	transform: rotate(180deg);
}

.mobile-menu-submenu {
	background: var(--surface-light);
	padding: 8px 0;
}

.mobile-menu-subitem {
	display: flex;
	align-items: center !important;
	gap: 12px;
	color: var(--text-primary) !important;
	text-decoration: none;
	padding: 10px 20px 10px 40px;
	font-size: 0.95rem;
	transition: all 0.2s ease;
	font-weight: 400;
	opacity: 1 !important;
	visibility: visible !important;
	line-height: 1.5;
}

.mobile-menu-subitem span.material-symbols-rounded {
	flex-shrink: 0 !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1 !important;
	vertical-align: middle;
	align-self: center;
}

.mobile-menu-subitem-text {
	flex: 1;
	display: inline-block;
	color: inherit !important;
	opacity: 1 !important;
	visibility: visible !important;
	font-size: inherit;
	font-weight: inherit;
	line-height: 1.5;
	margin: 0;
	padding: 0;
	align-self: center;
}

.mobile-menu-subitem:hover {
	background: var(--hover-overlay);
	color: var(--accent-color);
}

.mobile-menu-subitem.mobile-menu-subitem-nested {
	padding-left: 60px;
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.mobile-menu-subitem .material-symbols-rounded {
	font-size: 20px !important;
	flex-shrink: 0;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px;
	min-height: 20px;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	vertical-align: middle;
}

.mobile-menu-subitem-text {
	flex: 1;
	display: inline-block;
	color: inherit !important;
	opacity: 1 !important;
	visibility: visible !important;
	font-size: inherit;
	font-weight: inherit;
}

@media (max-width: 768px) {
	.main-nav.desktop-nav {
		display: none;
	}
	
	.mobile-menu-trigger {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-left: 2px;
		padding: 4px !important;
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
	}
	
	.mobile-menu-trigger .material-symbols-rounded {
		font-size: 20px !important;
	}
	
	.header-container {
		justify-content: space-between;
	}
	
	.header-actions {
		display: flex;
		align-items: center;
		gap: 2px;
		margin-left: auto;
	}
	
	.header-actions .search-trigger,
	.header-actions .lang-trigger {
		padding: 4px !important;
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
	}
	
	.header-actions .search-trigger .material-symbols-rounded,
	.header-actions .lang-trigger .material-symbols-rounded {
		font-size: 20px;
	}
}

@media (min-width: 769px) {
	.mobile-menu-trigger {
		display: none;
	}
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.header-actions .search-trigger,
.header-actions .lang-trigger {
	background: none !important;
	border: none !important;
	padding: 8px !important;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	color: var(--text-secondary);
	border-radius: 8px;
	width: 40px !important;
	height: 40px !important;
	min-width: 40px !important;
	gap: 0 !important;
	font-size: 0 !important;
}

.header-actions .search-trigger:hover,
.header-actions .lang-trigger:hover {
	background: var(--hover-overlay) !important;
	color: var(--accent-color);
}

.header-actions .search-trigger .material-symbols-rounded,
.header-actions .lang-trigger .material-symbols-rounded {
	font-size: 24px;
}

/* Language Modal */
.lang-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lang-modal.active {
	opacity: 1;
	visibility: visible;
}

.lang-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
}

.lang-modal-content {
	position: relative;
	background: var(--surface-light);
	border-radius: 16px;
	width: 90%;
	max-width: 500px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	z-index: 1;
	transform: scale(0.95);
	transition: transform 0.3s ease;
}

.lang-modal.active .lang-modal-content {
	transform: scale(1);
}

.lang-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px;
	border-bottom: 1px solid var(--divider-color);
}

.lang-modal-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0;
}

.lang-modal-close {
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	width: 36px;
	height: 36px;
}

.lang-modal-close:hover {
	background: var(--hover-overlay);
	color: var(--text-primary);
}

.lang-modal-close .material-symbols-rounded {
	font-size: 24px;
}

.lang-modal-body {
	padding: 8px;
	overflow-y: auto;
	max-height: calc(80vh - 80px);
}

.lang-modal-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lang-modal-item {
	padding: 12px 16px;
	cursor: pointer;
	border-radius: 8px;
	transition: all 0.2s ease;
	margin: 4px 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.lang-modal-item:hover {
	background: var(--hover-overlay);
}

.lang-modal-item.active {
	background: var(--hover-overlay);
	border-left: 3px solid var(--accent-color);
}

.lang-modal-item-name {
	font-weight: 500;
	color: var(--text-primary);
	font-size: 1rem;
}

.lang-modal-item-native {
	font-size: 0.875rem;
	color: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 768px) {
	.main-nav {
		display: none;
	}
	
	.lang-modal-content {
		width: 95%;
		max-height: 90vh;
	}
	
	.lang-modal-header {
		padding: 20px;
	}
	
	.lang-modal-title {
		font-size: 1.25rem;
	}
	
	.lang-modal-body {
		max-height: calc(90vh - 70px);
	}
}

@media (max-width: 600px) {
	.header-container {
		flex-wrap: wrap;
	}
	
	.main-nav {
		order: 3;
		width: 100%;
		margin: 8px 0 0 0;
		justify-content: center;
	}
}

/* Resources Page */
.resources-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

.resources-container h1 {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 24px;
}

.resources-intro {
	font-size: 1.125rem;
	color: var(--text-secondary);
	line-height: 1.6;
}

@media (max-width: 768px) {
	.resources-container {
		padding: 24px 16px;
	}
	
	.resources-container h1 {
		font-size: 2rem;
	}
}

/* ============================================
   СТРАНИЦА КАТЕГОРИИ
   ============================================ */

/* Заголовок страницы категории */
.category-page-header {
	background: var(--surface-dark);
	border-radius: 16px;
	padding: 32px;
	margin-bottom: 32px;
	box-shadow: var(--card-shadow);
	text-align: center;
	position: relative;
	width: 100%;
	max-width: 100%;
}

.category-page-browse-label {
	font-size: 13px;
	color: var(--text-secondary);
	margin-bottom: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.category-page-title {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 16px 0;
	line-height: 1.2;
}

.category-page-hash {
	color: var(--accent-color);
	margin-right: 4px;
}


.category-page-badge {
	display: inline-block;
	background: var(--surface-light);
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 14px;
	color: var(--text-secondary);
	margin-bottom: 16px;
}

.category-page-description {
	font-size: 16px;
	color: var(--text-secondary);
	line-height: 1.6;
	margin: 0;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}

/* Сетка карточек тестов категории */
/* ============================================
   НОВЫЕ КАРТОЧКИ ТЕСТОВ НА СТРАНИЦЕ КАТЕГОРИИ
   ============================================ */

.cat-tests-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-bottom: 32px;
}

.cat-test-card {
	background: var(--surface-dark);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--card-shadow);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.cat-test-card:hover {
	box-shadow: var(--card-shadow-hover);
	transform: translateY(-2px);
}

.cat-test-image-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.cat-test-title-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.cat-test-title-link:hover .cat-test-title {
	color: var(--accent-color);
}

/* Контейнер изображения с отступами */
.cat-test-image-container {
	position: relative;
	width: calc(100% - 24px);
	margin: 12px 12px 0 12px;
	height: 200px;
	min-height: 200px;
	max-height: 200px;
	overflow: hidden;
	background: var(--surface-light);
	border-radius: 8px;
	display: flex;
	align-items: stretch;
}

.cat-test-image-container img,
.cat-test-image {
	width: 100% !important;
	height: 100% !important;
	min-height: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block !important;
	border-radius: 8px;
	margin: 0 !important;
	box-shadow: none !important;
	vertical-align: top !important;
}

/* Overlay бейдж с рейтингом - отступает от краев изображения */
.cat-test-overlay-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 10;
	display: none;
}

.cat-test-overlay-badge:has(.cat-test-rating:not(:empty)) {
	display: block;
}

.cat-test-rating {
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(8px);
	border-radius: 6px;
	padding: 6px 10px;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	line-height: 1;
}

.cat-test-rating:empty {
	display: none;
}

.cat-test-rating::before {
	content: '★';
	color: #FFA500;
	margin-right: 2px;
	font-size: 12px;
}

/* Тело карточки */
.cat-test-body {
	padding: 16px 20px 20px 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.cat-test-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 10px 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Теги */
.cat-test-tags {
	margin: 0 0 12px 0;
	padding: 0;
	font-size: 13px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.cat-test-tags-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cat-test-tags-list > *:not(:last-child) {
	margin-right: 12px;
}

.cat-test-tag {
	display: inline-flex;
	align-items: center;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.cat-test-tag:hover {
	opacity: 0.8;
}

.cat-test-tag-hash {
	font-weight: 700;
	margin-right: 2px;
	font-size: 14px;
}

.cat-test-tag-text {
	color: var(--text-primary);
	font-weight: 500;
}

.cat-test-desc {
	font-size: 14px;
	color: #2C2C2C;
	line-height: 1.6;
	margin: 0 0 16px 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	min-height: 1.6em; /* Минимальная высота для одной строки */
}

/* Кнопка "Начать" */
.cat-test-start-btn {
	background: var(--accent-color) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 12px 24px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	cursor: pointer;
	transition: all 0.2s ease;
	margin: 0 auto 16px auto !important;
	align-self: center;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-decoration: none !important;
	position: relative;
	z-index: 10;
	text-transform: none;
	letter-spacing: 0;
	white-space: nowrap;
	width: auto !important;
	min-width: auto !important;
	max-width: none !important;
}

/* Разделительная линия */
.cat-test-separator {
	border: none;
	border-top: 1px dashed #E0E0E0;
	margin: 16px 0;
	width: 100%;
}

/* Метаданные внизу - время слева, просмотры справа */
.cat-test-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 15px;
	font-weight: 600;
	margin-top: auto;
	padding-top: 4px;
}

.cat-test-views,
.cat-test-duration {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--text-primary);
}

.cat-test-duration .material-symbols-rounded {
	font-size: 20px;
	width: 20px;
	height: 20px;
	font-variation-settings: 'FILL' 1;
	color: #9B59B6; /* Фиолетовый */
}

.cat-test-views .material-symbols-rounded {
	font-size: 20px;
	width: 20px;
	height: 20px;
	font-variation-settings: 'FILL' 1;
	color: #FF3333; /* Яркий красный */
}

/* Адаптивность для страницы категории */
@media (max-width: 1200px) {
	.cat-tests-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

@media (max-width: 768px) {
	.category-page-header {
		padding: 24px 8px;
		margin-bottom: 24px;
	}
	
	.category-page-title {
		font-size: 2rem;
	}
	
	.cat-tests-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 0;
	}
	
	.cat-test-body {
		padding: 16px;
	}
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ПОИСКА
   ============================================ */

.search-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 768px) {
	.search-modal {
		align-items: flex-start;
		padding-top: 20px;
	}
	
	.search-modal-content {
		margin-top: 0;
		border-radius: 16px;
		width: 100%;
		max-width: 100%;
		max-height: calc(100vh - 40px);
	}
}

.search-modal.active {
	opacity: 1;
	visibility: visible;
}

.search-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
}

.search-modal-content {
	position: relative;
	background: var(--surface-dark);
	border-radius: 16px;
	width: 90%;
	max-width: 600px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	z-index: 1;
	transform: scale(0.95);
	transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
	transform: scale(1);
}

.search-modal-header {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px 24px 0 24px;
}

.search-modal-close {
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	width: 44px;
	height: 44px;
}

.search-modal-close:hover {
	background: var(--hover-overlay);
	color: var(--text-primary);
}

.search-modal-close .material-symbols-rounded {
	font-size: 32px;
}

.search-modal-body {
	padding: 24px;
	overflow-y: auto;
	max-height: calc(80vh - 80px);
}

.search-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 12px;
}

.search-input {
	width: 100%;
	padding: 14px 50px 14px 16px;
	border: 2px solid var(--divider-color);
	border-radius: 12px;
	font-size: 16px;
	color: var(--text-primary);
	background: var(--surface-light);
	transition: all 0.2s ease;
}

.search-input:focus {
	outline: none;
	border-color: var(--accent-color);
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-submit {
	position: absolute;
	right: 8px;
	background: var(--accent-color);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.search-submit:hover {
	background: var(--accent-hover);
	transform: scale(1.05);
}

.search-submit .material-symbols-rounded {
	font-size: 20px;
	color: #ffffff !important;
}

.search-hint {
	font-size: 13px;
	color: var(--text-secondary);
	margin: 0 0 24px 0;
	text-align: center;
}

.search-quick-results {
	margin-bottom: 24px;
}

.search-results-header {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 12px;
}

.search-results-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.search-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: 8px;
	background: var(--surface-light);
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	color: inherit;
}

.search-result-item:hover {
	background: var(--hover-overlay);
	transform: translateX(4px);
}

.search-result-image {
	width: 60px;
	height: 60px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.search-result-content {
	flex: 1;
	min-width: 0;
}

.search-result-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0 0 4px 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.search-result-title mark {
	background: var(--accent-color);
	color: #ffffff;
	padding: 0 2px;
	border-radius: 2px;
}

.search-result-desc {
	font-size: 12px;
	color: var(--text-secondary);
	margin: 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.search-result-desc mark {
	background: var(--accent-color);
	color: #ffffff;
	padding: 0 2px;
	border-radius: 2px;
}

.search-popular {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--divider-color);
}

.search-popular-header {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 12px;
}

.search-popular-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.search-popular-tag-hash.tag-color-0 { color: #9B59B6; }
.search-popular-tag-hash.tag-color-1 { color: #E67E22; }
.search-popular-tag-hash.tag-color-2 { color: #3498DB; }
.search-popular-tag-hash.tag-color-3 { color: #1ABC9C; }
.search-popular-tag-hash.tag-color-4 { color: #E67E22; }
.search-popular-tag-hash.tag-color-5 { color: #E74C3C; }
.search-popular-tag-hash.tag-color-6 { color: #3498DB; }
.search-popular-tag-hash.tag-color-7 { color: #E91E63; }

.tag-color-0 { color: #9B59B6; }
.tag-color-1 { color: #E67E22; }
.tag-color-2 { color: #3498DB; }
.tag-color-3 { color: #1ABC9C; }
.tag-color-4 { color: #E67E22; }
.tag-color-5 { color: #E74C3C; }
.tag-color-6 { color: #3498DB; }
.tag-color-7 { color: #E91E63; }

.search-popular-tag {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 16px;
	background: none;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	gap: 2px;
}

.search-popular-tag:hover {
	opacity: 0.8;
}

.search-popular-tag-hash {
	font-weight: 700;
	margin-right: 2px;
	font-size: 14px;
}

.search-popular-tag-text {
	color: var(--text-primary);
	font-weight: 500;
}

/* Подсветка найденных слов в результатах поиска */
.cat-test-title mark,
.cat-test-desc mark {
	background: var(--accent-color);
	color: #ffffff;
	padding: 0 2px;
	border-radius: 2px;
	font-weight: 600;
}