
:root {
  --overlay-font-size: 10px;
  --overlay-padding: 5px;
  }
  @font-face {
  font-family: 'Comic Sans MS';
  src: url('fonts/Comic Sans MS.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  }
  @font-face {
  font-family: 'Muller';
  src: url('fonts/MullerMedium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  }
  body {
  font-family: 'Muller', Arial, sans-serif;
  margin: 0;
  margin-bottom: 60px;
  }
  * {
  font-family: 'Muller', Arial, sans-serif;
  color: #333;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  }
  .cover-item {
  position: relative;
  }
  .page-item, #previewContainer {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  }
  .story-image, .character-overlay, #pagePreview, #characterOverlay {
  pointer-events: none;
  }
    header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #BFD8EB;
  color: #fff;
  padding: 1.25rem 2rem;
  border-radius: 12px;
  margin: 10px;
  }
  .cover-check {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #007bff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  }
  
  .cover-check::after {
  content: '✓';
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  }
  .edit-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  .edit-icon:hover {
    background-color: rgba(255, 255, 255, 1);
  }
  
  .edit-icon svg {
    width: 18px;
    height: 18px;
    color: #333;
  }
  
  .page-item {
    position: relative;
  }
  
  @keyframes fadeInScale {
    0% {
      opacity: 0;
      transform: scale(0.9);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  .page-item {
    opacity: 1;
  }
  
  .page-item .story-image,
  .page-item .character-overlay {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  }
  
  .page-item.animate .story-image,
  .page-item.animate .character-overlay {
    opacity: 1;
    transform: scale(1);
  }
  
  .text-with-background {
    background-color: rgba(255, 255, 255, 0.7);
  }
  
  .page-preview {
  position: relative;
  width: 100%;
  padding-bottom: 142%; /* Соотношение сторон А5 (210:297) */
  overflow: hidden;
  }
  
  .story-image,
  .character-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  .loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    opacity: 1;
    transition: opacity 0.4s ease-out;
    z-index: 10;
  }
  
  .loader::before,
  .loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
  }
  
  .loader::before {
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #FCDCC4;
    border-right-color: #FCDCC4;
    animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  }
  
  .loader::after {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border: 4px solid transparent;
    border-bottom-color: #BFD8EB;
    border-left-color: #BFD8EB;
    animation: loaderSpin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
  }
  
  .loader.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  @keyframes loaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Спиннер в upload-preview (карточки загрузки обложки) */
  .upload-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .upload-preview .loader {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 40px;
    height: 40px;
  }
  
  /* Спиннер в cover-preview (обложки в myComicGrid) */
  .cover-preview .loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  .character-overlay {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }
  
  .character-overlay.loaded {
    opacity: 1;
  }
  
  .text-overlay {
  position: absolute;
  top: var(--overlay-padding);
  left: var(--overlay-padding);
  right: var(--overlay-padding);
  padding: var(--overlay-padding);
  border-radius: 5px;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial', sans-serif; 
  font-size: var(--overlay-font-size);
  font-weight: bold;
  color: white;
  overflow-wrap: break-word;
  max-height: calc(100% - var(--overlay-padding) * 2);
  overflow-y: auto;
  text-align: center;
  display: none;
  }
  
  .text-with-background {
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  text-shadow: none;
  }
  
  .text-without-background {
  background-color: transparent;
  }
  @media (max-width: 768px) {
  :root {
  --overlay-font-size: 8px;
  --overlay-padding: 3px;
  }}
  #app {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 24px 0;
    box-sizing: border-box;
  }

  /* Единые стили для всех секций внутри #app */
  #app > div,
  #app > section {
    width: 100%;
    box-sizing: border-box;
  }

  @media (max-width: 768px) {
    #app {
      padding: 1rem 12px 0;
    }
  }

  #targetAudienceSelection {
  text-align: center;
  padding: 20px;
  }
  
  #targetAudienceSelection h2 {
  margin-bottom: 30px;
  font-size: 28px;
  color: #333;
  }
  #pageSelection h2 {display: flex;
    justify-content: center;}
    .page-selection-container {
      background: #fff;
      border-radius: 8px;
    }
    
    .md-headline {
      font-size: 24px;
      font-weight: 500;
      color: #1f1f1f;
      margin-bottom: 16px;
    }
    
    .md-headline .page-counter {
      display: none;
    }
    
    .page-counter {
      color: #1976d2;
    }
    
    .page-selection-info {
      background: #FCDCC4;
      border-radius: 8px;
      padding: 20px;
      text-align: center;
    }
    
    .page-selection-info .main-message {
      margin: 0 0 24px 0;
      font-size: 18px;
      font-weight: 500;
      color: #2C2C2C;
      line-height: 1.6;
      letter-spacing: 0.15px;
    }
    
    .page-selection-info .steps {
      display: inline-flex;
      gap: 32px;
      list-style: none;
      padding: 0;
      margin: 0;
      flex-wrap: wrap;
      justify-content: center;
    }
    
    .page-selection-info .steps li {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      color: #2C2C2C;
      font-size: 15px;
      position: relative;
      padding: 8px 16px;
      margin: 8px 0;
      background: rgba(255, 255, 255, 0.85);
      border-radius: 24px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.06);
      transition: all 0.2s ease;
    
    }
    
    .page-selection-info .steps li:hover {
      background: rgba(255, 255, 255, 0.95);
      transform: translateY(-1px);
      box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    }
    
    .page-selection-info .steps li::before {
      font-family: 'Material Icons';
      font-size: 24px;
      color: #2C2C2C;
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 32px;
      min-height: 32px;
      background: rgba(0, 0, 0, 0.05);
      border-radius: 50%;
      padding: 4px;
      transition: all 0.2s ease;
    }
    
    .page-selection-info .steps li:hover::before {
      background: rgba(0, 0, 0, 0.1);
      transform: scale(1.1);
    }
    
    .page-selection-info .steps li:nth-child(1)::before {
      content: 'add';
    }

    .page-selection-info .steps li:nth-child(2)::before {
      content: 'create';
    }

    .page-selection-info .steps li:nth-child(3)::before {
      content: 'format_list_numbered';
    }
    

    
    .page-selection-info .steps li:nth-child(4)::before {
      content: 'auto_stories';
    }
    
    .page-selection-info .steps li:not(:last-child)::after {
      content: 'chevron_right';
      font-family: 'Material Icons';
      position: absolute;
      right: -24px;
      color: #2C2C2C;
      opacity: 0.4;
    }
    
    .layout-controls {
      margin-top: 24px;
    }
    
   
    .grid-icon {
      color: #1976d2;
    }
    
    .grid-buttons {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    
    .md-button {
      min-width: 48px;
      height: 48px;
      border: none;
      border-radius: 24px;
      background: #fff;
      color: #1976d2;


      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .md-button:hover {
      background: #1976d2;
      color: #fff;
      box-shadow: 0 4px 8px rgba(25,118,210,0.2);
    }
    
    .md-button:active {
      transform: scale(0.96);
    }
  
    /* Медиа-запрос для мобильных устройств */
    @media (max-width: 768px) {

      .page-selection-info{
        margin: 0;
      }
      .comic-container {
        margin: 0; 
    }
      .page-selection-info .steps {
        flex-direction: column;
        gap: 16px;

        margin: 0 auto;

      }
  
      .page-selection-info .steps li {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 16px;
        margin-bottom: 32px;
        min-width: 120px;
      }
  
      .page-selection-info .steps li::before {
        margin-right: 0;
        margin-bottom: 4px;
        font-size: 24px;
      }
  
      .page-selection-info .steps li span {
        padding-left: 0;
        text-align: center;
      }
  
      .page-selection-info .steps li span::before {
        display: none;
      }
  
      .page-selection-info .steps li:last-child {
        margin-bottom: 0;
      }
  
      .page-selection-info .steps li:not(:last-child)::after {
        content: 'expand_more';
        position: absolute;
        bottom: -32px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 24px;
        opacity: 0.7;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
  
      .page-selection-info .main-message {
        font-size: 16px;

      }
    }







    
/* Скрываем оригинальный счетчик в заголовке */
.md-headline .page-counter {
  display: none;
}

/* Стили для фиксированного счетчика */
.page-counter.fixed {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 16px;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 11;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(25, 118, 210, 0.1);
  color: #1976d2;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap; /* Запрещаем перенос строки */
}

/* Стилизация числа выбранных страниц */
.page-counter.fixed #pageCount {
  font-weight: 600;
  color: #1976d2;
  background: rgba(25, 118, 210, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  text-align: center;
  line-height: 1.2;
  height: 24px;
}

/* Базовые стили кнопок элементов */
.element-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background-color: white;
  margin: 5px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.1s, border 0.1s;
}

/* Активный элемент (обводка при выборе) */
.element-btn.active {
  border: 4px solid #000000;
  transform: scale(1.05);
}

.element-btn.active img {
  opacity: 1 !important;
}

@media (max-width: 768px) {
  .page-counter.fixed {
    bottom: 60px;
    padding: 6px 12px;
    font-size: 14px;
  }
}
  #coverSelection h2 {display: flex;
  justify-content: center;padding-top: 20px;}
  
  .audience-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex: 1;
  }
  .icon {
  width: 70%;
  height: 70%;
  object-fit: contain;
  }
  .audience-btn {
  flex: 1;
  width: 300px;
  max-width: 400px; /* Увеличенная максимальная ширина */
  height: 250px; /* Увеличенная высота */
  border: none;
  border-radius: 20px;
  padding: 20px;
  font-size: 20px; /* Увеличенный размер шрифта */
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  }
  
  .audience-btn:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  }
  
  .audience-btn:active {
  transform: translateY(-5px) scale(0.98);
  }
  
  .audience-btn .emoji {
  font-size: 100px; /* Увеличенный размер эмодзи */
  margin-bottom: 20px;
  }
  
  .female-partner { background-color: #FCDCC4; }
  .male-partner { background-color: #BFD8EB; }
  
  @media (max-width: 768px) {
  #targetAudienceSelection {
  padding: 10px;
  }
  
  .audience-buttons {
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  }
  
  .audience-btn {
  max-width: none;
  width: calc(100% - 20px);
  height: 80px;
  font-size: 18px;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 20px;
  border-radius: 15px;
  margin: 5px 10px;
  }
  
  
  .audience-btn:hover, .audience-btn:active {
  transform: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  }
  
  #characterCreator {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 20px;
  transition: background 0.3s ease;
  }
  
  #characterCreator.male {
  background: linear-gradient(155deg, rgba(249, 217, 195, 1) 0%, rgba(211, 236, 220, 1) 11%, rgba(174, 223, 242, 1) 50%, rgba(242, 195, 191, 1) 100%);
  }
  
  #characterCreator.female {
  background: linear-gradient(155deg, 
  rgba(174, 223, 242, 1) 0%, 
  rgba(211, 236, 220, 1) 11%, 
  rgba(249, 217, 195, 1) 50%, 
  rgba(242, 195, 191, 1) 100%
  );
  }
  
  #categoriesContainer {
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  padding: 10px;
  }
  
  #characterCreator h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  }
  
  .creator-content {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  }
  
  #categoriesContainer,
  #elementsContainer,
  #characterContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }
  
  
  #categories{
  display: grid;
  gap: 10px;
  width: 100%;
  }
  #elements {
  display: grid;
  gap: 10px;
  }
  
  #character {
  width: 300px;
  height: 300px;
  position: relative;
  background-color: white;
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  }
  
  @media (max-width: 768px) {
  .creator-content {
  flex-direction: column;
  }
  
  }
  .category-btn:active,
  .element-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s;
  }
  .category-btn,
  .element-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background-color: white;
  margin: 5px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  }
  
  
  .element-btn.active {
  border: 4px solid #000000;
  transform: scale(1.05);
  }
  
  .element-btn.active img {
  opacity: 1 !important;
  }
  .category-btn:hover,
  .element-btn:hover {
    background-color: #e0e0e0;
  }
  
  .category-btn.active {
    border: 2px solid #000000;
  }
  
  .category-btn svg,
  .element-btn svg {
    width: 50px;
    height: 50px;
  }
  
  .character-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  
  .element-btn.clothing-frame {
    border: 1px solid #ccc;
    padding: 0;
    margin: 5px;
  }
  
  #genderSwitch {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    display: none;
    width: 100%;
  }
  
  #genderSwitch button {
  background: none;
  border: 2px solid #007bff; /* Добавляем рамку для лучшей видимости */
  cursor: pointer;
  padding: 10px 15px; /* Увеличиваем отступы */
  display: flex;
  justify-content: center; /* Центрируем содержимое по горизонтали */
  align-items: center;
  font-family: 'Roboto', sans-serif;
  transition: all 0.3s ease;
  border-radius: 5px;
  width: 100%; /* Кнопка занимает всю ширину родителя */
  }
  
  #genderSwitch button:hover {
    background-color: #0056b3;
  }
  
  #footer {
    background-color: #f8f9fa;
    padding: 10px 0px;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10;
  }
  
  #footer button {
    padding: 10px 0px;
    font-size: 16px;
    cursor: pointer;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    width: 30%;
    max-width: 200px;
    text-align: center;
  }
  
  #footer button:hover {
    background-color: #5a6268;
  }
  
  #coverGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 20px; /* Увеличим отступ между обложками */
  padding: 20px;
  }
  
  .cover-item {
  width: 175px;
  height: 262px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 12px; /* Добавляем скругление углов */
  transition: all 0.3s ease; /* Плавный переход для всех изменений */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Добавляем легкую тень */
  }
  
  .cover-item:hover,
  .cover-item.selected {
  border-color: #007bff;
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Усиливаем тень при наведении и выборе */
  }
  .cover-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px; /* Скругляем углы изображения */
  }
  
  .cover-check {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #007bff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  }
  .cover-check::after {
  content: '✓';
  }
  
  @media (max-width: 768px) {
  #coverGrid {
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 15px;
  }
  #characterCreator.male #categories {
    grid-template-columns: repeat(3, 1fr);
}
  .cover-item {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3; /* Сохраняем пропорции обложки */
  }
  } 
  #pageGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 56px;
  margin-left: -100px;
  margin-right: -100px;
  }
  
  @media (max-width: 1400px) {
    #pageGrid {
      grid-template-columns: repeat(4, 1fr);
      margin-left: -50px;
      margin-right: -50px;
    }
  }
  
  @media (max-width: 1100px) {
    #pageGrid {
      grid-template-columns: repeat(3, 1fr);
      margin-left: 0;
      margin-right: 0;
    }
  }
  
  @media (max-width: 768px) {
    #pageGrid {
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
    }
  }
  
  .page-item {
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
  }
  
  /* Водяной знак для сюжетов */
  .page-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('images/logo.svg');
    background-repeat: repeat;
    background-size: 50px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 5;
    transform: rotate(-25deg);
  }
  
  .page-item img {
  width: 100%;
  border-radius: 8px; /* Добавлено скругление углов */
  }
  
  .page-item .edit-text {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 3px;
    font-size: 12px;
  }
  
  #pageOrder {
    margin-top: 20px;
  }
  
  
  div#characterCreator {
    align-items: center;
  }
  
  .order-item {
    padding: 10px;
    background-color: #f0f0f0;
    margin-bottom: 5px;
    cursor: move;
  }
  
  #previewContainer {
  position: relative;
  width: 100%;
  padding-bottom: 142%; /* Соотношение сторон A5 (210:297) */
  margin: 0 auto;
  overflow: hidden;
  }
  
  /* Водяной знак для превью */
  #previewContainer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('images/logo.svg');
    background-repeat: repeat;
    background-size: 80px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 10;
    transform: rotate(-25deg);
  }
  
  #pagePreview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  #characterOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  
  #textPreview {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 5px;
    border-radius: 5px;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
    font-size: 16px;
    font-weight: bold;
    overflow-wrap: break-word;
    max-height: 80%;
    overflow-y: auto;
    text-align: center;
  }
  
  .text-with-background {
    background-color: rgba(255, 255, 255, 0.7);
    color: #333;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
  }
  
  .text-without-background {
    color: white;
  }
  
  #textInput {
    width: 100%;
    resize: vertical;
  }
  
  @media (max-width: 768px) {
    #coverGrid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0px;
  }
    #characterCreator {
      flex-direction: column;
      align-items: center;
    }
    #categories {
      grid-template-columns: repeat(4, 1fr);
      width: 100%;
      justify-content: center;
      align-items: center;
      justify-items: center;
  }
  

  }
  
  
  
  #textPopup {
    position: fixed;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
  }
  
  #popupContent {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: fadeIn 0.3s ease-out;
  }
  
  @media screen and (max-width: 768px) {
    #popupContent {
      width: 60%;
    }
  }

  @media screen and (max-height: 860px) {
    #popupContent {
      max-width: 240px;
    }
  }
  #popupContent h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
  }
  
  #popupContent #previewContainer {
    margin: 0 auto 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  #popupContent #textInput {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 12px;
    font-size: 14px;
  }
  
  #popupContent .button-container {
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  #popupContent button {
    padding: 8px 8px;
    font-size: 14px;
    cursor: pointer;
    background-color: #BFD8EB;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-weight: bold;
  }
  #popupContent button:hover {
    background-color: #ADD8F9;
  }
  
  #popupContent button:last-child {
    background-color: #FCDCC4;
  }
  
  #popupContent button:last-child:hover {
    background-color: #F9C49C;
  }
  
  #debugPanel {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }
  
  #debugPanel button {
    margin: 5px;
    padding: 5px 10px;
  }
  
  @media (max-height: 600px) {

    #popupContent h3 {
      font-size: 18px;
    }
    #popupContent button {
      padding: 6px 12px;
      font-size: 12px;
    }
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Symbols:wght@700&family=Roboto:wght@400&display=swap');
  
  #genderSwitch {
  margin-top: 10px;
  }
  
  #genderSwitch button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Roboto', sans-serif;
  transition: background-color 0.3s ease;
  border-radius: 5px;
  }
  
  #genderSwitch button:hover {
  background-color: rgba(173, 216, 230, 0.5); /* Значение по умолчанию */
  }
  
  #genderSwitch button.female-hover:hover {
  background-color: #76D7C4;
  }
  
  #genderSwitch button.male-hover:hover {
  background-color: #f9d9c3;
  }
  
  #genderSwitch .icon-container {
  font-size: 32px;
  font-weight: bold;
  font-family: 'Noto Sans Symbols', sans-serif;
  line-height: 1;
  margin-bottom: 5px;
  }
  
  #genderSwitch .icon {
  display: none;
  -webkit-text-stroke: 1px;
  }
  
  #genderSwitch .icon.active {
  display: inline;
  }
  
  #genderSwitch .icon-male {
  color: #4A90E2;
  }
  
  #genderSwitch .icon-female {
  color: #E24A8D;
  }
  
  #genderSwitch .button-text {
  font-size: 14px;
  color: #333;
  }
  
  
  
  .add-to-comic-icon {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
  }
  
  .add-to-comic-icon:hover {
  background-color: rgba(255, 255, 255, 1);
  }
  
  .add-to-comic-icon svg {
  width: 18px;
  height: 18px;
  color: #333;
  }
  
  .page-item.selected .add-to-comic-icon {
    background: #BFD8EB;
  }
  
  .page-item.selected .add-to-comic-icon svg {
  color: white;
  }
  
  .page-item .cross-icon {
  display: none;
  }
  
  .page-item.selected .plus-icon {
  display: none;
  }
  
  .page-item.selected .cross-icon {
  display: block;
  }
  .page-item {
  position: relative;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  border-radius: 12px;
  }
  
  .page-item.selected {
    border: 3px solid #7EBBFE;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  }
  
  .page-item.selected .page-preview::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 1;
  }
  
  /* Кнопки поверх затемнения */
  .page-item.selected .add-to-comic-icon,
  .page-item.selected .edit-icon {
    z-index: 2;
  }
  
  
  #gridControls {
  display: flex;
  align-items: center;
  margin: 20px 0 15px 0;
  }
  
  
  #gridControls button {
  margin-right: 5px;
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  }
  
  #gridControls button:hover {
  background-color: #e0e0e0;
  }
  @media (max-width: 768px) {
  .grid-btn-4, .grid-btn-6, .grid-btn-8 {
  display: none;
  }
  }
  @media (min-width: 769px) {
  .grid-btn-1, .grid-btn-2 {
  display: none;
  }
  }
  
  .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  }
  
  #closePopup.close-button {
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  transition: background-color 0.3s ease;
  }
  
  #closePopup.close-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  }
  
  
  #textInput {
  width: 100%;
  resize: none;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
  overflow-y: auto; /* Добавляем вертикальный скролл при необходимости */
  position: relative; /* Для правильного позиционирования псевдоэлемента */
  }
  
  #textInput::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background-color: transparent;
  pointer-events: none; /* Предотвращает взаимодействие с этим элементом */
  }
  #textInput::-webkit-resizer {
  display: none;
  }
  
  
  .category-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  }
  
  .category-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background-color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
  }
  
  .category-label {
  font-size: 12px;
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  }
  
  @media (max-width: 768px) {
  .category-btn {
  width: 50px;
  height: 50px;
  }
  
  .category-label {
  font-size: 10px;
  }
  }

  
  #myComicGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); 
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 56px;
  margin-left: -100px;
  margin-right: -100px;
  }
  
  @media (max-width: 1400px) {
    #myComicGrid {
      grid-template-columns: repeat(4, 1fr);
      margin-left: -50px;
      margin-right: -50px;
    }
  }
  
  @media (max-width: 1100px) {
    #myComicGrid {
      grid-template-columns: repeat(3, 1fr);
      margin-left: 0;
      margin-right: 0;
    }
  }
  
  @media (max-width: 768px) {
    #myComicGrid {
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
    }
  }
  
  .my-comic-page {
    flex: 0 0 200px;
    position: relative;
    aspect-ratio: 1 / 1.4142;
    border: 2px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    touch-action: pan-y;
    user-select: none;
  }
  
  /* Водяной знак для страниц комикса */
  .my-comic-page::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('images/logo.svg');
    background-repeat: repeat;
    background-size: 50px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 5;
    transform: rotate(-25deg);
  }
  
  /* Скрываем водяной знак при генерации PDF */
  .my-comic-page.generating-pdf::after {
    display: none;
  }
  
  .my-comic-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  }
  
  .sortable-ghost {
  opacity: 0.5;
  }
  
  .cover-page {
  aspect-ratio: auto;
  max-width: 300px;
  margin: 0 auto;
  }
  
  .my-comic-page.sortable-chosen {
  background-color: #fff;
  opacity: 0.8;
  transform: scale(1.02);
}

.my-comic-page.sortable-ghost {
  opacity: 0.3;
  background-color: #f0f0f0;
  border: 2px dashed #999;
}

.my-comic-page.sortable-drag {
  cursor: grabbing;
  opacity: 0.9;
}
  .sortable-ghost {
  opacity: 0.5;
  }
  
  .my-comic-page {
  cursor: default;
  }
  
  /* Drag handle для перетаскивания сюжетов */
  .drag-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    touch-action: none;
    animation: dragPulse 2.5s ease-in-out infinite;
  }
  
  /* Спиннер для myComicGrid */
  .my-comic-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: auto;
    z-index: 15;
    opacity: 1;
    transition: opacity 0.3s ease;
  }
  
  .my-comic-loader::before,
  .my-comic-loader::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
  }
  
  .my-comic-loader::before {
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid transparent;
    border-top-color: #FCDCC4;
    border-right-color: #FCDCC4;
    animation: loaderSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  }
  
  .my-comic-loader::after {
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid transparent;
    border-bottom-color: #BFD8EB;
    border-left-color: #BFD8EB;
    animation: loaderSpin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
  }
  
  .my-comic-loader.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  /* Скрываем drag-handle и контролы пока спиннер крутится */
  .my-comic-page:has(.my-comic-loader:not(.hidden)) .drag-handle,
  .my-comic-page:has(.my-comic-loader:not(.hidden)) .my-comic-controls {
    opacity: 0;
    pointer-events: none;
  }
  
  /* Контент скрыт пока грузится */
  .my-comic-page .page-preview.loading {
    opacity: 0;
  }
  
  .my-comic-page .page-preview {
    transition: opacity 0.3s ease;
  }
  
  @keyframes dragPulse {
    0%, 100% {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    }
  }
  
  .drag-handle:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
    animation: none;
  }
  
  .drag-handle:active,
  .drag-handle.pressed {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }
  
  .drag-handle svg {
    width: 24px;
    height: 24px;
    color: #666;
  }
  
  .sortable-chosen .drag-handle {
    cursor: grabbing;
  }
  
  /* Стили для обложек в myComicGrid */
  .my-comic-cover {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .my-comic-cover:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  }
  
  .my-comic-cover::after {
    /* Убираем водяной знак с обложек */
    display: none;
  }
  
  .my-comic-cover .cover-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  }
  
  .my-comic-cover .cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .my-comic-cover .cover-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #BFD8EB;
    color: #2c3e50;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    z-index: 10;
  }
  
  /* Кнопка удаления обложки (слева внизу) */
  .my-comic-cover .cover-remove-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.3s ease;
  }
  
  .my-comic-cover .cover-remove-btn:hover {
    background-color: rgba(255, 255, 255, 1);
  }
  
  .my-comic-cover .cover-remove-btn svg {
    width: 18px;
    height: 18px;
    color: #333;
  }
  
  /* Кнопка редактирования обложки (справа внизу) */
  .my-comic-cover .cover-edit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.3s ease;
  }
  
  .my-comic-cover .cover-edit-btn:hover {
    background-color: rgba(255, 255, 255, 1);
  }
  
  .my-comic-cover .cover-edit-btn svg {
    width: 18px;
    height: 18px;
    color: #333;
  }
  
  /* Placeholder для пустой обложки */
  .my-comic-cover.cover-placeholder {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    border: 2px dashed #9fb3c8;
  }
  
  .my-comic-cover.cover-placeholder:hover {
    border-color: #627d98;
    background: linear-gradient(135deg, #e3e8ee 0%, #c9d6e3 100%);
  }
  
  .cover-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: #627d98;
    text-align: center;
    padding: 20px;
  }
  
  .cover-placeholder-content svg {
    width: 48px;
    height: 48px;
    stroke: #9fb3c8;
  }
  
  .cover-placeholder-content span {
    font-size: 14px;
    font-weight: 500;
  }
  
  .my-comic-cover.cover-placeholder:hover .cover-placeholder-content svg {
    stroke: #627d98;
  }
  
  /* Текст для кастомных обложек без превью */
  .cover-placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #627d98;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    padding: 20px;
  }
  
  .cover-placeholder-text small {
    font-weight: 400;
    opacity: 0.7;
    margin-top: 4px;
  }
  
  /* Текст на обложке в myComicGrid */
  .cover-text-overlay {
    position: absolute;
    left: 5%;
    right: 5%;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    z-index: 5;
    pointer-events: none;
  }
  
  .cover-text-overlay.top {
    top: 8%;
  }
  
  .cover-text-overlay.bottom {
    bottom: 15%; /* Над меткой "Передняя" */
  }
  
  .cover-text-overlay.dark-bg {
    background: rgba(0, 0, 0, 0.6);
    text-shadow: none;
  }
  
  .cover-text-overlay:not(.dark-bg) {
    background: rgba(255, 255, 255, 0.8);
  }
  
  /* Иконка для кастомной обложки без превью */
  .custom-cover-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: #627d98;
    text-align: center;
    background: linear-gradient(135deg, #e8f4f8 0%, #d1e7dd 100%);
  }
  
  .custom-cover-icon svg {
    width: 40px;
    height: 40px;
    stroke: #627d98;
  }
  
  .custom-cover-icon span {
    font-size: 12px;
    font-weight: 500;
  }

  /* Мобильная адаптация обложек */
  @media (max-width: 768px) {
    .my-comic-cover .cover-label {
      font-size: 10px;
      padding: 3px 8px;
    }
    
    .cover-placeholder-content svg {
      width: 36px;
      height: 36px;
    }
    
    .cover-placeholder-content span {
      font-size: 12px;
    }
    
    .cover-text-overlay {
      font-size: 8px;
      padding: 2px 4px;
      -webkit-line-clamp: 2;
    }
    
    .cover-text-overlay.bottom {
      bottom: 12%;
    }
    
    .custom-cover-icon svg {
      width: 32px;
      height: 32px;
    }
    
    .custom-cover-icon span {
      font-size: 10px;
    }
  }

  /* Нумерация страниц в myComicGrid */
  .page-number {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #BFD8EB;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    z-index: 10;
    min-width: 24px;
    text-align: center;
  }
  
  @media (max-width: 768px) {
    .page-number {
      font-size: 12px;
      padding: 3px 10px;
      bottom: 6px;
    }
  }
  
  .cover-option {
  display: inline-block;
  margin: 10px;
  cursor: pointer;
  }
  
  .cover-option input[type="radio"] {
  display: none;
  }
  
  .cover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  height: 250px;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s ease;
  }
  
  .cover-card img {
  width: 100px;
  height: 100px;
  margin-bottom: 10px;
  }
  
  .cover-option input[type="radio"]:checked + .cover-card {
  border-color: #007bff;
  box-shadow: 0 0 10px rgba(0,123,255,0.5);
  }
  
  #selectedCoverPreview {
  margin-top: 20px;
  text-align: center;
  }
  
  #selectedCoverPreview img {
  max-width: 300px;
  max-height: 400px;
  border: 2px solid #ddd;
  border-radius: 10px;
  }
  
  
  #coverOptions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  }
  
  .cover-option {
  margin: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  }
  
  .cover-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: #f0f0f0;
  height: 100%; /* Ensure full height usage */
  }
  
  .cover-emoji {
  font-size: 48px;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
  }
  
  .cover-card span:not(.cover-emoji) {
  font-size: 14px;
  }
  .cover-option:hover .cover-card {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  background-color: #e0e0e0;
  }
  
  .cover-option:hover .cover-emoji {
  transform: scale(1.1);
  }
  .cover-option input:checked + .cover-card {
  background-color: #d0d0d0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  @media (max-width: 768px) {
  #coverOptions {
  flex-direction: column;
  align-items: center;
  }
  
  .cover-option {
  width: 100%;
  max-width: 300px; /* Adjust based on your preference */
  }
  
  .cover-emoji {
  font-size: 36px;
  }
  
  .cover-card span:not(.cover-emoji) {
  font-size: 12px;
  }
  }
  
  .custom-file-upload {
  border: 1px solid #ccc;
  display: inline-block;
  padding: 6px 12px;
  cursor: pointer;
  background-color: #f8f9fa;
  border-radius: 4px;
  transition: background-color 0.3s;
  }
  
  .custom-file-upload:hover {
  background-color: #e2e6ea;
  }
  
  #customCoverUpload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  }
  
  #fileInfo {
  margin-top: 10px;
  font-size: 0.9em;
  color: #666;
  text-align: center;
  width: 100%;
  }
  
.loading-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeInOverlay 0.3s ease-out;
}

.loading-content {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 90%;
  animation: slideUpContent 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-content h2 {
  margin: 0 0 2rem 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.3px;
}
  
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top-color: #FCDCC4;
  border-radius: 50%;
  margin: 0 auto 2rem;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
  
.loading-progress {
  margin-top: 1rem;
}
  
.progress-bar {
  width: 100%;
  height: 8px;
  background: #f3f3f3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
  
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #FCDCC4 0%, #FFE8D8 100%);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 2s infinite;
}
  
.progress-text {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  letter-spacing: 0.2px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

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

  
  .color-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  }
  
  .color-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: #f8f9fa;
  color: #495057;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  }
  
  .color-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  background: #e9ecef;
  }
  
  .color-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .color-btn.active {
  background: #4263eb;
  color: white;
  }
  
  .color-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  }
  
  .color-btn:hover::before {
  animation: shine 1.5s;
  }
  
  @keyframes shine {
  100% {
      transform: translateX(100%);
  }
  }
  .color-selection {
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 500px;
  }
  
  .color-selection h4 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 18px;
  text-align: center;
  }
  
  

  .logo a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  }
  
  nav {
  display: flex;
  align-items: center;
  }
  
  nav ul {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
  }
  
  nav li {
  margin: 0;
  display: flex;
  align-items: center;
  }
  
  nav a {
  color: black;
  text-decoration: none;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
  padding: 0.5rem 0; /* Добавляем padding вместо height */
  }
  
  nav a:hover {
  opacity: 1;
  }
  
  .order-button {
  background-color: #FCDCC4;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  text-transform: uppercase;
  }
  
  .order-button:hover {
  background-color: #007bff85;;
  }
  
  .main {
  padding: 20px;
  text-align: center;
  }
  
  .main-content {
  max-width: 800px;
  margin: 0 auto;
  }
  
  .main h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  }
  
  .main p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  }
  
  .btn-primary {
background-color: #FCDCC4;
  color: #000;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  }
  
  
  @media (max-width: 768px) {
  nav {
  display: none;
  position: fixed; /* Фиксированное позиционирование */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0; /* На весь экран */
  background-color: #BFD8EB;
  padding: 2rem;
  z-index: 100;
  }
  
  nav.active {
  display: flex;
  justify-content: center;
  align-items: center;
  }
  
  nav ul {
  flex-direction: column;
  gap: 2rem; /* Увеличенные отступы между пунктами */
  align-items: center;
  width: 100%;
  }
  
  nav li {
  width: 100%;
  text-align: center;
  }
  
  nav a {
  display: block;
  padding: 1rem;
  font-size: 1.2rem; /* Увеличенный размер шрифта */
  border-radius: 8px;
  transition: background-color 0.3s;
  }
  
  nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  }
  
  .order-button {
  margin-top: 1rem;
  width: 100%;
  max-width: 200px; /* Ограничение ширины кнопки */
  text-align: center;
  padding: 1rem;
  }
  nav {
  transition: opacity 0.3s ease;
  opacity: 0;
  }
  
  nav.active {
  opacity: 1;
  }
  }
  .hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 10px;
  z-index: 101; /* Поверх меню */
  }
  
  .hamburger span {
  display: block;
  width: 30px;
  height: 3px;
  background-color: black;
  border-radius: 3px;
  transition: 0.3s;
  }
  .hamburger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  }
  
  .hamburger.active span:nth-child(2) {
  opacity: 0;
  }
  
  .hamburger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  }
  @media (max-width: 768px) {
  header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  border-radius: 0;
  z-index: 100;
  margin: 0;
  }
  
  .hamburger {
  display: flex;
  }
  body {
  padding-top: 60px; /* Высота вашей шапки */
  }
  }
  
  
  .steps-container {
  margin: 2.5rem 0;
  padding: 20px;
  background: #FFFFFF;
  border-radius: 16px;
  }
  
  .steps-container h2 {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 32px;
  font-weight: 600;
  color: #2D2D2D;
  }
  
  .steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  }
  
  .step-item {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px 20px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }
  
  .step-number {
position: absolute;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  background: #FCDCC4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  font-weight: 600;
  font-size: 20px;
  line-height: 0;

  }
  
  .step-item h3 {
  font-size: 24px;
  font-weight: 600;
  color: #2D2D2D;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  }
  
  .step-item p {
  font-size: 16px;
  line-height: 1.6;
  color: #4A4A4A;
  margin: 0;
  }
  
  .delivery-note {
  font-size: 14px;
  color: #666;
  display: block;
  margin-top: 0.5rem;
  }
  
  .delivery-link {
  color: #F99245;
  text-decoration: none;
  }
  
  .delivery-link:hover {
  text-decoration: underline;
  }
  
  @media (max-width: 768px) {
  .steps-grid {
  grid-template-columns: 1fr;
  }
  
  .steps-container {
  padding: 1.5rem;
  margin: 1.5rem 0;
  }
  
  .steps-container h2 {
  font-size: 24px;
  margin-bottom: 2rem;
  }
  
  .step-item h3 {
  font-size: 20px;
  }
  
  .step-number {
  width: 36px;
  height: 36px;
  top: -18px;
  left: -18px;
  font-size: 18px;
  }
  }
  
  .logo {
    display: flex;
    align-items: center;
  }
  
  .logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
    gap: 15px; /* Расстояние между логотипом и текстом */
  }
  
  .logo a:hover {
    opacity: 0.8;
  }
  
  .logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
  }
  
  .logo-text {
    display: flex;
    flex-direction: column;
    color: #333; /* Цвет текста */
  }
  
  .logo-text span {
    font-family: 'Arial', sans-serif; /* Можете заменить на ваш шрифт */
    line-height: 1.2;
  }
  
  .logo-text span:first-child {
    font-size: 20px;
    font-weight: 600;
  }
  
  .logo-text .subtitle {
    font-size: 14px;
    color: #666; /* Цвет подзаголовка */
    font-style: italic;
  }


  .sortable-chosen {
    background-color: rgba(33, 150, 243, 0.1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
    transition: all 0.3s ease;
  }
  
  .sortable-ghost {
    opacity: 0.5;
  }


.mobile-only {
  display: none;
}







.upload-icon-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  /* Удалены свойства opacity и transition */
}

.upload-icon {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  padding: 10px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon svg {
  width: 24px;
  height: 24px;
}

.upload-icon:hover {
  background: rgba(255, 255, 255, 1);
}

.delivery-section {
  padding: 20px;
  text-align: center;
}

.delivery-section h2 {
  font-size: 2.25rem;
  margin-bottom: 48px;
  color: #2c3e50;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.delivery-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.benefit-item {
  padding: 32px 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 
              0 10px 15px -5px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.benefit-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #F99245;
  opacity: 0.8;
}




.benefit-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 
              0 15px 25px -8px rgba(0,0,0,0.1);
  background: linear-gradient(145deg, #ffffff, #f8f9ff);
}

.benefit-item h3 {
  margin: 0 0 16px 0;
  background: linear-gradient(120deg, #2c3e50, #3498db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.benefit-item p {
  color: #5f6368;
  line-height: 1.6;
  margin: 0;
  font-size: 1rem;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 968px) {
  .delivery-benefits {
    grid-template-columns: 1fr;
    max-width: 500px;
    gap: 16px;
  }

  .delivery-section {
    padding: 40px 20px;
  }

  .delivery-section h2 {
    font-size: 1.75rem;
    margin-bottom: 32px;
  }

  .benefit-item {
    padding: 24px 20px;
    text-align: center;
  }

  .benefit-item:hover {
    transform: none;
  }

  .benefit-item h3 {
    font-size: 1.125rem;
    margin-bottom: 12px;
  }

  .benefit-item p {
    font-size: 0.9375rem;
  }
}

.team-section {
  padding: 20px;
  background: linear-gradient(135deg, rgba(252, 220, 196, 0.2), rgba(191, 216, 235, 0.2));
  border-radius: 12px;
}

.team-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 64px;
  color: #2c3e50;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.team-grid-mobile {
  display: none;
}

/* Добавляем стили для контейнера пользовательского места */
.user-spot-container {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

.team-member {
  text-align: center;
  transition: transform 0.3s ease;
}

.team-member:hover {
  transform: translateY(-8px);
}

.member-images {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px;
  border-radius: 20px;
  overflow: hidden;
}

.member-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease;
}

.comic-image {
  opacity: 1;
}

.real-image {
  opacity: 0;
}

.team-member:hover .comic-image {
  opacity: 0;
}

.team-member:hover .real-image {
  opacity: 1;
}

.team-member h3 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: #FF8548;
  font-weight: 600;
}

.team-member p {
  font-size: 1.1rem;
  color: #5f6368;
  margin: 0;
  font-weight: 500;
}

/* Добавим уникальные акценты для каждого члена команды */
/* Владимир - голубой */
.team-member:nth-child(1) .member-images {
  box-shadow: 8px 8px 0 rgba(191, 216, 235, 0.6);
}

/* Любовь - персиковый */
.team-member:nth-child(2) .member-images {
  box-shadow: 8px 8px 0 rgba(252, 220, 196, 0.6);
}

/* Вадим - голубой */
.team-member:nth-child(3) .member-images {
  box-shadow: 8px 8px 0 rgba(191, 216, 235, 0.6);
}

/* Олеся - персиковый */
.team-member:nth-child(4) .member-images {
  box-shadow: 8px 8px 0 rgba(252, 220, 196, 0.6);
}

/* Игорь - голубой */
.team-member:nth-child(5) .member-images {
  box-shadow: 8px 8px 0 rgba(191, 216, 235, 0.6);
}

/* Добавляем стили для пустого места пользователя */
.team-member.user-spot .member-images {
  background: rgba(255, 255, 255, 0.8);
  border: 3px dashed #FF8548;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.team-member.user-spot .member-images::before {
  content: "?";
  font-size: 72px;
  color: #FF8548;
  opacity: 0.5;
}

.team-member.user-spot:hover .member-images {
  background: rgba(255, 133, 72, 0.1);
}

/* Медиа-запросы для адаптивности */
@media (max-width: 1200px) {
  .member-images {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 1360px) {
  /* Скрываем десктопную версию */
  .team-grid,
  .user-spot-container {
    display: none;
  }
  
  /* Показываем мобильную версию с 6 элементами в grid */
  .team-grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 500px;
    margin: 0 auto;
    justify-items: center;
  }
}

@media (max-width: 768px) {
  .team-grid-mobile {
    gap: 20px;
    max-width: 450px;
  }
  
  .team-section {
    padding: 32px 10px;
  }

  .team-section h2 {
    font-size: 1.8rem;
    margin-bottom: 32px;
  }

  .member-images {
    width: 160px;
    height: 160px;
  }
  
  .team-member h3 {
    font-size: 1.2rem;
  }
  
  .team-member p {
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .team-grid-mobile {
    gap: 12px;
    max-width: 100%;
    padding: 0 5px;
  }
  
  .member-images {
    width: 140px;
    height: 140px;
  }
  
  .team-member h3 {
    font-size: 1.1rem;
  }
  
  .team-member p {
    font-size: 0.85rem;
  }
}


.faq-section {
  padding: 20px;
}
/* Добавим класс для имитации наведения */
.team-member.hover-effect .comic-image {
  opacity: 0;
}

.team-member.hover-effect .real-image {
  opacity: 1;
}

.team-member.hover-effect {
  transform: translateY(-8px);
}

.chat-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.chat-message {
  margin-bottom: 20px;
  max-width: 70%;
}

.chat-message.user {
  margin-right: auto;
  background: #FCDCC4;
  border-radius: 15px 15px 15px 0;
  padding: 10px 15px;
}

.chat-message.admin {
  margin-left: auto;
  background: #e3f2fd;
  border-radius: 15px 15px 0 15px;
  padding: 10px 15px;
}


html {
  scroll-behavior: smooth;
}



.mobile-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.mobile-popup-content {
  background: #BFD8EB;
  padding: 20px;
  border-radius: 0 0 20px 20px;
  max-height: 80vh;
  overflow-y: auto;
}

@media (max-width: 384px) {
  .mobile-popup-content {
    padding: 0;
    padding-top: 20px;
  }
}



.close-popup {
  border: none;
  background: none;
  padding: 8px;
  cursor: pointer;
}

@media (max-width: 768px) {
  #elementsContainer {
    display: none;
  }
}

.close-popup {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s;
}

.close-popup:hover {
  background: #e0e0e0;
}

.close-popup svg {
  width: 16px;
  height: 16px;
  stroke: #666;
}

.mobile-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 10px;
}

.mobile-popup-header h3 {
  margin: 0;
  font-size: 18px;
}

@media (min-width: 768px) {
  #categories {
      grid-template-columns: repeat(2, 1fr); /* 2 колонки для десктопа */
  }
  
}



.testimonials {
  padding: 20px;
  border-radius: 12px;
  background-color: #f8f9fa;
}

.testimonials-header {
  text-align: center;
  margin-bottom: 40px;
}

.testimonials-heading {
  font-size: 18px;
  color: #666;
  margin-bottom: 10px;
}

.testimonials-subheading {
  font-size: 32px;
  color: #0066ff;
  margin: 0;
}

.testimonials-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.testimonial-card {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
}

.quote-icon {
  font-size: 48px;
  color: #0066ff;
  position: absolute;
  opacity: 0.2;
}

.quote-left {
  top: 20px;
  left: 10px;
}

.quote-right {
  bottom: 20px;
  right: 10px;
}

.testimonial-text {
  margin: 20px 0;
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  margin-top: 20px;
}

.author-name {
  font-weight: bold;
  margin: 0;
  color: #333;
}

.author-title {
  color: #666;
  margin: 5px 0 0;
  font-size: 14px;
}








.hair-style-selection {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.style-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.style-btn {
  padding: 10px 20px;
  border: 2px solid #ccc;
  border-radius: 5px;
  background: white;
  cursor: pointer;
}

.style-btn.active {
  background: #4CAF50;
  color: white;
  border-color: #45a049;
}

.color-spectrum {
  padding: 20px;
  border-radius: 10px;
  background: #f5f5f5;
}

.preset-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.color-preset {
  width: 40px;
  height: 40px;
  border: 2px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
}

.color-preset.active {
  border-color: #000;
  transform: scale(1.1);
}

#customColorPicker {
  width: 100%;
  height: 40px;
  margin-top: 10px;
}

.hair-preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}




.skin-colors {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px auto;
  max-width: 800px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.skin-color-card {
  flex: 0 0 150px;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skin-color-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.skin-color-card.selected {
  border-color: #7EBBFE;
  box-shadow: 0 0 15px rgba(126, 187, 254, 0.5);
}

.skin-color-card img {
  width: 100%;
  height: auto;
  display: block;
}

.comic-types {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 24px auto;
  max-width: 800px;
  padding: 0 16px;
}

.comic-type-card {
  flex: 1;
  max-width: 320px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(191, 216, 235, 0.3),
              0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 2px solid transparent;
}

.comic-type-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(191, 216, 235, 0.4),
              0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: #BFD8EB;
}

.comic-type-card:last-child:hover {
  border-color: #FCDCC4;
}

.preview-carousel {
  position: relative;
  width: 100%;
  /* Динамический padding: от 100% (1025px) до 142% (1920px) */
  padding-top: clamp(100%, calc(100% + (142 - 100) * (100vw - 1025px) / (1920 - 1025)), 142%);
  background: #fafafa;
}

.carousel-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1.05);
  will-change: opacity, transform;
}

.preview-image.active {
  opacity: 1;
  transform: scale(1);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #333;
  z-index: 2;
  will-change: transform, box-shadow;
}

.carousel-btn:hover {
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.15);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.92);
  transition-duration: 0.3s;
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

.comic-type-info {
  padding: 24px 32px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(247,247,247,0.5) 100%);
}

.comic-type-info h3 {
  margin: 0 0 16px;
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.price {
  color: #444;
  margin: 12px 0 20px;
  font-weight: 500;
  white-space: nowrap;
}

/* Выбор формата комикса (полный/1 страница) */
.comic-format-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
}

.format-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.format-option:hover {
  border-color: #78BCF0;
  background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fc 100%);
  box-shadow: 0 2px 8px rgba(120, 188, 240, 0.25);
  transform: translateY(-2px);
}

.format-option:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(120, 188, 240, 0.25);
}

.format-label {
  font-size: 0.95em;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.format-price {
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.select-type-btn {
  background: #BFD8EB;
  border: none;
  padding: 10px 32px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1em;
  margin-top: auto;
}

.select-type-btn:hover {
  background: #78BCF0;
}


.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.indicator.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}

@media (max-width: 1024px) {
  .comic-types {
    gap: 20px;
    padding: 0 20px;
  }
  
  .comic-type-card {
    max-width: 280px;
  }
  
  .skin-color-card {
    flex: 0 0 120px;
  }
}

@media (max-height: 920px) {
  .skin-color-card {
    flex: 0 0 110px;
  }
}

@media (max-width: 768px) {
  .comic-types-title {
    margin-top: 30px;
  }
  
  .comic-types {
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
  }
  
  .skin-color-card {
    flex: 0 0 100px;
  }
  
  .comic-type-card {
    max-width: 100%;
  }
  
  .comic-type-card .preview-carousel {
    padding-top: 50%;
    max-height: none;
  }
  
  .comic-type-card .preview-carousel img {
    object-fit: cover;
  }
  
  .comic-type-info {
    padding: 16px;
  }
  
  .comic-type-info h3 {
    margin-bottom: 8px;
  }
  
  .price {
    margin-bottom: 12px;
  }
  
  .select-type-btn {
    padding: 12px 28px;
    font-size: 16px;
  }
}






.policy-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 40px;
}

h2 {
  color: #2c3e50;
  margin-bottom: 20px;
}

section {
  margin-bottom: 40px;
}

ul {
  padding-left: 20px;
  margin-bottom: 20px;
}



p {
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .policy-container {
      padding: 20px;
  }
}

.team-member-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}



.controls-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 16px 0;
}

.control-buttons {
  display: inline-flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
  border-radius: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  font-weight: 500;
}

.control-btn:hover {
  background: rgba(25, 118, 210, 0.08);
  color: #1976d2;
}

.control-btn.active {
  background: #e3f2fd;
  color: #1976d2;
}

.control-btn svg {
  width: 20px;
  height: 20px;
  transition: all 0.2s ease;
}

.control-btn:hover svg,
.control-btn.active svg {
  stroke: #1976d2;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.grid-menu {
  transform-origin: center top;
}

.tags-menu {
  transform-origin: center top;
}

.tag-btn,
.grid-btn {
  text-align: left;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  font-weight: 500;
  width: 100%;
}

.tag-btn:hover,
.grid-btn:hover {
  background: rgba(25, 118, 210, 0.08);
  color: #1976d2;
}

.tag-btn.active,
.grid-btn.active {
  background: #e3f2fd;
  color: #1976d2;
}

/* Анимация для выпадающих меню */
@keyframes dropdownShow {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu.show {
  animation: dropdownShow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Стили для адаптивного отображения кнопок сетки */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  /* Уменьшаем размеры на мобильных */
  .control-buttons {
    gap: 8px;
    padding: 6px;
  }
  
  .control-btn {
    padding: 6px 16px;
  }
  
  .dropdown-menu {
    min-width: 160px;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* Активное состояние для текущего выбора сетки */
.grid-btn.current {
  background: #e3f2fd;
  color: #1976d2;
}

#successPaymentBlock, #paymentBlock {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.success-payment-content, .failed-payment-content {
    max-width: 600px;
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.order-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.order-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #eee;
}

.new-comic-btn, .retry-btn, .back-btn {
    background: #FCDCC4;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.2s;
}

.new-comic-btn:hover, .retry-btn:hover, .back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.signature {
    font-style: italic;
    margin-top: 20px;
    color: #666;
}

.save-note {
    color: #666;
    font-size: 0.9em;
    margin: 10px 0;
}



      .certificate-block {
  margin: 3rem 0;
  padding: 4rem 2rem;
  background: url('../images/certificate.png');
  
  background-position: center;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.certificate-content {
  max-width: 350px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 16px;
  margin-top: 60px;
}

.certificate-block h2 {
  color: #1A1A1A;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.certificate-description {
  color: #4A4A4A;
  margin-bottom: 2rem;
}

.btn-secondary {
  background: white;
  border: none;
  color: #1A1A1A;
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.material-icons {
  font-size: 20px;
}

/* Медиа-запросы для мобильных устройств */
@media screen and (max-width: 768px) {
  .certificate-block {
    margin: 2rem 0;
    padding: 2rem 1rem;
    border-radius: 16px;
  }

  .certificate-content {
    max-width: 100%;
    padding: 0rem;
    margin-top: 70px;
  }

  .certificate-block h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .btn-secondary {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .material-icons {
    font-size: 18px;
  }
}

/* Для очень маленьких экранов */
@media screen and (max-width: 320px) {
  .certificate-block {
    padding: 1.5rem 0.8rem;
  }

  .certificate-content {
    padding: 0.8rem;
  }

  .certificate-block h2 {
    font-size: 1rem;
  }

  .certificate-description {
    font-size: 0.9rem;
  }
}

