body {
  overflow-x: hidden; /* Гарантированно убирает горизонтальный скролл */
  margin: 0; /* Сброс стандартных отступов */
}
html {
    scroll-behavior: smooth;
}
/* Эпические Богатыри на главной */
#epic {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 0px;
  min-height: 550px;
  background: url("../images/misc/stage-background.jpg") center/cover no-repeat;
  position: relative;
  isolation: isolate; /* Для z-index */
  padding-top: 25px;
}
.epicwrap {
  position: relative;
  margin-top: 242px;
  z-index: 2; /* Персонажи над фоном */
}

@media (max-width: 767px) {
    #epic {
        background-position-y: -80px;
        background-size: 237%;
        min-height: 571px;
    }
}
@media (max-width: 445px) {
  #epic {
                background-position-y: -60px;
        background-size: 250%;
              min-height: 500px;
            }
  .epicwrap {
  margin-top: 180px;
}

}
.animation-box-razuhab, .animation-box-krushedub, .animation-box-burelom {
  display: block;
}
/* Все стили для анимации Бурелома на главной странице */
.animation-box-burelom {
  width: 250px;
  height: 250px;
}
.burelom {
  margin: 0 auto;
  position: absolute;
  top: 25px;
  right: -113px;
}

/* Стили для прелоадера Бурелома */
.video-loaded-burelom .video-preloader-burelom {
  opacity: 0;
  pointer-events: none;
}
.burelom-animation video {
  opacity: 0;
}
.burelom-animation.video-loaded-burelom video {
  opacity: 1;
}
.video-preloader-burelom, #burelom-main-page-animation {
    position: absolute;
  }


/* Все стили для анимации Крушедуба на главной странице */
.animation-box-krushedub {
  width: 250px;
  height: 250px;
}

.krushedub {
  margin: 0 auto;
  position: absolute;
  right: 80px;
}
@media (max-width: 767px) {
  .krushedub {
  right: -4px;
}
}
/* Стили для прелоадера Крушедуба */

.video-loaded-krushedub .video-preloader-krushedub {
  opacity: 0;
  pointer-events: none;
}

.krushedub-animation video {
  opacity: 0;
}

.krushedub-animation.video-loaded-krushedub video {
  opacity: 1 !important;
}
.video-preloader-krushedub, #krushedub-main-page-animation {
    position: absolute;
  }
.loading-indicator-krushedub,.loading-indicator-razuhab,.loading-indicator-burelom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 2px solid rgba(166, 191, 212, 0.3);
  border-top: 2px solid #a6bfd4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0.7;
  z-index: 100;
  transition: opacity 0.3s ease;
}

/* Анимация вращения */
@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Скрываем индикатор когда видео загрузилось */
.video-loaded-krushedub .loading-indicator-krushedub, .video-loaded-razuhab .loading-indicator-razuhab, .video-loaded-burelom .loading-indicator-burelom {
  opacity: 0;
  pointer-events: none;
}

/* Все стили для анимации Разухаба на главной странице */

.animation-box-razuhab {
  width: 250px;
  height: 250px;
}
.razuhab {
  margin: 0 auto;
  position: absolute;
  left: 40px;
  top: -48px;
}
@media (max-width: 767px) {
  .razuhab {
  left: -4px;
}
}

/* Стили для прелоадера Разухаба */
.video-loaded-razuhab .video-preloader-razuhab {
  opacity: 0;
  pointer-events: none;
}

.razuhab-animation video {
  opacity: 0;
}

.razuhab-animation.video-loaded-razuhab video {
  opacity: 1;
}

.video-preloader-razuhab, #razuhab-main-page-animation {
  position: absolute;
}

.burelom-name-mainpage {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) rotate(-5deg); /* Центрируем и поворачиваем */
  color: #a6bfd4;
  z-index: 99;
  font-size: 18px;
  font-weight: 600;
}
.krushedub-name-mainpage {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(10deg); /* Центрируем и поворачиваем */
  color: #a6bfd4;
  z-index: 99;
  font-size: 18px;
  font-weight: 600;
}
.razuhab-name-mainpage {
  position: absolute;
  top: 21px;
  left: 50%;
  transform: translateX(-50%) rotate(5deg); /* Центрируем и поворачиваем */
  color: #a6bfd4;
  z-index: 99;
  font-size: 18px;
  font-weight: 600;
}

/* Энциклопедия Эпических Богатырей */
/* Стили для контента попапа Эпических Богатырей */
.popup-description-epic {
  margin-bottom: 30px;
  text-align: center;
}

.popup-description-epic p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #d4f1ff;
  margin: 0;
}

/* Сетка персонажей Эпических Богатырей */
.characters-grid-epic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-top: 20px;
}

/* Карточка персонажа Эпических Богатырей */
.character-card-epic {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(90, 185, 234, 0.3);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.character-card-epic:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(90, 185, 234, 0.3);
  border-color: rgba(90, 185, 234, 0.6);
}

/* Изображение персонажа Эпических Богатырей */
.character-image-epic {
  margin-bottom: 15px;
}

.character-image-epic img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #5ab9ea;
  transition: transform 0.3s ease;
}

.character-card-epic:hover .character-image-epic img {
  transform: scale(1.05);
}

/* Информация о персонаже Эпических Богатырей */
.character-info-epic h3 {
  color: #5ab9ea;
  font-size: 1.4rem;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.character-role-epic {
  color: #a8e6cf;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 5px 0;
}

.character-instrument-epic {
  color: #d4f1ff;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

/* Адаптация для планшетов */
@media (max-width: 992px) {
  .characters-grid-epic {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .character-card-epic {
    padding: 15px;
  }
  
  .character-image-epic img {
    width: 100px;
    height: 100px;
  }
  
  .character-info-epic h3 {
    font-size: 1.2rem;
  }
}

/* Адаптация для мобильных - 1 карточка в ряд */
@media (max-width: 767px) {
  .characters-grid-epic {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .character-card-epic {
    padding: 15px;
    flex-direction: row;
    text-align: left;
    align-items: center;
  }
  
  .character-image-epic {
    margin-bottom: 0;
    margin-right: 15px;
    flex-shrink: 0;
  }
  
  .character-image-epic img {
    width: 80px;
    height: 80px;
  }
  
  .character-info-epic {
    flex: 1;
  }
  
  .character-info-epic h3 {
    font-size: 1.1rem;
  }
  
  .character-role-epic,
  .character-instrument-epic {
    font-size: 0.85rem;
  }
  
  .popup-description-epic p {
    font-size: 1rem;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
  .popup-content {
    padding: 20px;
  }
  
  .character-card-epic {
    padding: 12px;
  }
  
  .character-image-epic img {
    width: 70px;
    height: 70px;
  }
  
  .character-info-epic h3 {
    font-size: 1rem;
  }
}

  
/* Затемнение нижней части */
#epic::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  z-index: 1;
}
/* Свечение прожекторов */
#epic::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 50%, rgba(255, 200, 0, 0.1), transparent 60%);
  pointer-events: none;
}
/*Разухаб*/
.animation-box-razuhab {
  /* width: 250px;
  height: 224px; */
}
.razuhab {
  /* background: url("../images/projects/epic/razuhab/ss4.png") top left;
  margin: 0 auto;
  position: absolute;
  left: -34px;
  animation: razuhab infinite 2.4s steps(60); */
}
/*Барабан у Бурелома*/
.drum {
  /* width: 135px;
  height: 65px;
  position: absolute;
  bottom: -18px;
  left: 57px; */
}


/*Анимации*/

@keyframes razuhab {
  /* 0% {
    background-position: 0;
  }
  100% {
    background-position: 15000px;
  } */
}

.smoke-layer-1, .smoke-layer-2 {
  position: absolute;
  bottom: 0;
  pointer-events: none;
  z-index: 3;
}
.smoke-layer-1 {
  opacity: 0.4;
  animation: floatSmoke 15s infinite ease-in-out;
  width: 45%;
  right: 250px;
}
.smoke-layer-2 {
  opacity: 0.7;
  animation: floatSmoke 20s infinite ease-in-out reverse;
  width: 40%;
  left: 185px;
}
@keyframes floatSmoke {
  0%, 100% {
    transform: translateX(5%);
  }
  50% {
    transform: translateX(-5%);
  }
}
@media all and (max-width:995px) {
  .smoke-layer-2, .smoke-layer-1 {
    width: 75%;
  }
}
@media all and (max-width:574px) {
  .smoke-layer-2, .smoke-layer-1 {
    width: 170%;
  }
  .smoke-layer-1 {
    right: 50px;
  }
  .smoke-layer-2 {
    left: -140px;
  }
}





/* Slides Epic */
/* Стили для свайпера */
.swiper {
  padding: 20px 0;
}

.swiper-slide, .swiper-slide-mortal{
  width: 100%;
  max-width: 700px; /* Ограничение ширины для десктопа */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.swiper-slide:hover {
  transform: scale(1.02);
}

.slide-image {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9; /* Дефолтное соотношение */
}

/* Оверлей с кнопкой play */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.video-overlay:hover {
  opacity: 1;
}

.play-button {
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}

.video-overlay:hover .play-button {
  transform: scale(1.1);
}

/* Адаптация для мобильных */
@media (max-width: 767px) {
  .slide-image {
    aspect-ratio: 4/3; /* Вертикальное соотношение */
  }
  
  .play-button {
    width: 60px;
    height: 60px;
  }
  
  .swiper-slide {
    max-width: 100%;
  }
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1000px;
}

.modal video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  cursor: pointer;
  position: fixed; /* Фиксируем относительно viewport */
  top: max(20px, env(safe-area-inset-top)); /* Учет "безопасной зоны" */
  right: max(20px, env(safe-area-inset-right));
  z-index: 1001;
  font-size: 35px;
  text-shadow: 0 0 5px rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items:baseline;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 767px) {
  .modal-content {
    width: 95%;
  }
  
  .modal video {
    aspect-ratio: 9/16; /* Вертикальное видео */
  }
}

/* Plyr */
.plyr {
  border-radius: 8px;
  margin: 0 auto;
  width: 100%;
}

.plyr__video-embed {
  /*padding-bottom: 56.25%;  16:9 aspect ratio */
  position: relative;
}

.plyr__video-embed iframe {
  border: none;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

@media (max-width: 767px) {
  .plyr__video-embed {
    /*padding-bottom: 177.78%;  9:16 aspect ratio */
  }
}

/* Обновленные стили для Plyr с постером */
.plyr-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.plyr--video .plyr__poster {
  background-size: cover;
}

/* Улучшаем отображение постера на мобильных */
@media (max-width: 767px) {
  .plyr--video {
    height: 80vh;
    height: 100%;
  }
  
  .plyr__poster {
    background-position: center center;
  }
}

/* Добавьте в ваш styles.css */
.plyr__control--overlaid {
  background: rgba(0, 179, 255, 0.8) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
}

.plyr__control--overlaid svg {
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
}
/* Жёсткий сброс для контейнера и Canvas */
#animation_container {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

#canvas {
    height: auto !important;
    display: block !important;
}

.m-u {
    max-width: 1280px;
    margin: 0 auto;
}

/* Фон для всей секции (на всю ширину) */
#mortal-underwater {
    background: linear-gradient(to bottom, 
        #5ab9ea 0%,       /* Светло-голубой (поверхность) */
        #398ab9 30%,      /* Средний голубой */
        #1d4e89 70%,     /* Глубокий синий */
        #0c2d4d 100%      /* Темно-синий (дно) */
    );
    padding: 0 0 20px 0;      /* Отступы снизу */
}

/* Контейнер с ограничением по ширине (1280px) */
.m-u {
    max-width: 1280px;
    margin: 0 auto;
    background: transparent !important; /* Убираем фон, т.к. он уже в родителе */
    overflow: hidden;
}

/* Canvas — растягиваем на всю ширину контейнера */
#canvas {
    background: transparent !important; /* Фон не нужен, т.к. градиент уже в секции */
    display: block !important;

}

/* Если canvas должен быть полупрозрачным (чтобы градиент просвечивал) */
#animation_container {
    background: transparent !important;
    /*mix-blend-mode: multiply;  Опционально: для красивого смешивания с фоном */
}

/* Стили для эффекта каустики */
.caustics-overlay {
    position: absolute; /* Позиционируем абсолютно внутри .m-u */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/images/misc/caustics.png') center/cover no-repeat;
    opacity: 0.6; /* Регулируем прозрачность */
    z-index: 900; /* Выше фона, но ниже canvas (у него z-index: 2) */
    pointer-events: none; /* Чтобы не блокировал клики */
    mix-blend-mode: overlay; /* Режим наложения (можно использовать 'screen' или 'soft-light') */
}
.mortal-underwater-title img {width: 772px;}
@media (max-width: 1000px) {
.mortal-underwater-title img {width: 350px;}
}
.mortal-underwater-title {
    position: absolute; /* Позиционируем абсолютно внутри .m-u */
  top: 0;  /* Смещаем верхний край на 50% от родителя */
  left: 50%; /* Смещаем левый край на 50% от родителя */
  transform: translate(-50%, -10%); /* Смещаем назад на половину своей ширины и высоты */
    z-index: 5; /* Выше фона, но ниже canvas (у него z-index: 2) */
    pointer-events: none; /* Чтобы не блокировал клики */
}

/* Делаем .m-u относительным контейнером */
.m-u {
    position: relative; /* Чтобы caustics-overlay позиционировался относительно него */
}

/* Убедимся, что canvas выше НЕ каустики */
#animation_container {
    position: relative;
    z-index: 2 !important;
}

/* Исправление для контейнера свайпера */
.swiper-mortal-underwater {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Важно! Для обработки событий */
.swiper-wrapper {
  touch-action: pan-y;
  pointer-events: auto !important;
}

.swiper-slide {
  pointer-events: none; /* Отключаем для слайда */
}

/* Разрешаем события для контента внутри слайда */
.swiper-slide > * {
  pointer-events: auto;
}

/* Пагинация */
.swiper-pagination-mortal {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}



.swiper-container-mortal {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.swiper-wrapper-mortal {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  transition-property: transform;
  box-sizing: content-box;
  touch-action: pan-y;
}

.swiper-slide-mortal {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  transition-property: transform;
  pointer-events: none;
}

.swiper-slide-mortal > * {
  pointer-events: auto;
}

.swiper-pagination-mortal {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  z-index: 10;
}





/* Стили для кнопок навигации Mortal Underwater */
.swiper-button-prev-mortal,
.swiper-button-next-mortal {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  z-index: 10;
  cursor: pointer;
  background-size: 40px 40px;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  background-color: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swiper-button-prev-mortal {
  left: 10px;
  right: auto;
}

.swiper-button-next-mortal {
  right: 10px;
  left: auto;
}

/* Иконки для кнопок (можно использовать свои) */
.swiper-button-prev-mortal::after,
.swiper-button-next-mortal::after {
  content: '';
  display: block;
  width: 15px;
  height: 15px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
}

.swiper-button-prev-mortal::after {
  transform: rotate(45deg);
  margin-left: 5px;
}

.swiper-button-next-mortal::after {
  transform: rotate(-135deg);
  margin-right: 5px;
}








/*Kioria*/
/* Секция Kioria 1 */
#kioria1 {
    position: relative;
    width: 100%;
    overflow: hidden;
/*    background: linear-gradient(to bottom, 
        #1a1a2e 0%,      
        #16213e 50%,      
        #0f3460 100%     
    );*/
    background: linear-gradient(to bottom, 
        #d4f1ff 0%,       /* Воздушный голубой */
        #a8e6cf 50%,      /* Мятный */
        #dcedc8 100%      /* Светло-зелёный */
    );
        padding: 0 0 45px 0;
    isolation: isolate;
}

.kioria-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 400px; /* Отступ сверху для десктопа */
}

.kioria-game-iframe {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 600px;
    overflow: hidden;
    z-index: 2;
}

.kioria-game-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.kioria-game-iframe iframe html body {
        background-color: transparent!important;
}

/* Эффекты фона (опционально) */
#kioria1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 85%;
    background: url('/images/misc/kioria1BG.png') center/cover no-repeat;
    opacity: 1;
    z-index: 1;
}
@media all and (min-width:1900px) {
  /* #kioria1::before {
    background: url('/images/misc/kioria1BG.png') center/contain no-repeat; 
  } */ 
}

/* Адаптация для планшетов */
@media (max-width: 992px) {
    .kioria-wrap {
        padding-top: 290px;
    }
    
    .kioria-game-iframe {
        height: 500px;
    }
    #kioria1::before {
    height: 68%;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .kioria-wrap {
        padding-top: 185px;
    }
    
    .kioria-game-iframe {
        width: 100%;
        height: 400px;
    }
    #kioria1::before {
    height: 60%;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .kioria-wrap {
        padding-top: 150px;
    }
    
    .kioria-game-iframe {
        height: 259px; 
    }
    #kioria1::before {
    height: 50%;
    }
}

/* Футер */
footer {
    background: linear-gradient(to right, #3a4a6b, #6b7b9b);
    padding: 30px 0;
    text-align: center;
    color: white;
}

footer p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 300;
}

footer a {
    display: inline-block;
    transition: transform 0.3s ease;
}

footer a:hover {
    transform: scale(1.1);
    opacity: 0.9;
}
@media (max-width: 768px) {
  footer p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 300;
  }
    #kioria1 {
        padding: 0 0 0 0;
    }
}

.loading-kioria {
    position: absolute;
    width: 45%;
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    background: rgb(255 255 255 / 70%);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 0.9rem;
    z-index: 10;
    transition: opacity 0.7s ease;
    opacity: 0;
}
.loading-kioria.vis {
    opacity: 1;
}

.kioria-game-iframe.loaded .loading-kioria {
    opacity: 0;
    pointer-events: none;
}
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 0 0 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



.epic-title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 40%);
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: color-dodge;
  opacity: 0.6;
}
.epic-title video {
  width: 450px;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 2s;
}

@media (max-width: 1000px) {
  .epic-title video {
    width: 350px;
  }
  /* .epic-title .epic-title-fallback {
    width: 350px;
  } */
  .epic-title {
      mix-blend-mode: hard-light;
    }
}

.epic-title video.epic-title-ready {
  opacity: 1;
}

.slide-caption {
  /* position: absolute;
  bottom: 20px;
  left: 0; */
  width: 100%;
  padding: 0;
  z-index: 2;
  color:aliceblue;
  opacity: 0.5;
}

.song-title {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  font-weight: 400;
}

.song-author {
  font-size: 1rem;
  opacity: 0.8;
  margin: 0;
}
.music-epic {
  font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    color: #93a9bb;
    opacity: 0.7;
    text-align: center;
}

@media (max-width: 767px) {
  .song-title {
    font-size: 1rem;
    text-align: center;
  }
  .music-epic {
    font-size: 0.9rem;
    display: block;
  }
  .slide-caption {
    bottom: 10px;
  }
}
.swiper-horizontal .swiper-pagination-epic.swiper-pagination-bullets {
  bottom: 42px;
}

/* Контейнер для иконки помощи */
.epic-help-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10; /* Чтобы было поверх других элементов */
  cursor: pointer;
  transition: all 0.7s ease;
  opacity: 0.8;
}

.epic-help-icon {
  width: 55px;
  height: 55px;
  object-fit: contain;
}

.epic-help-container:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .epic-help-container {
    bottom: 0px;
    right: 10px;
    top: unset;
    opacity: 0.4;
  }
  .epic-help-icon {
    width: 42px;
    height: 42px;
  }
}

.epic-help-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  opacity: 0;
  visibility: hidden; /* Скрываем без display: none */
  transition: opacity 1.3s ease, visibility 1.3s ease;
}

.epic-help-popup.active {
  opacity: 1;
  visibility: visible; /* Показываем */
}

.popup-content {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #030406d4;
  padding: 30px;
  max-width: 1000px;
  width: 90%;
  border: 2px solid #5ab9ea59;
  color: darkgray;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
@media (max-width: 767px) {
.popup-content {
    padding: 5px;}
}

.popup-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: none;
  border: none;
  color: darkgray;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 5px 10px;
  line-height: 1;
}

.popup-close:hover {
  color: #5ab9ea;
}

.popup-body {
  padding: 20px 0;
  max-height: 70vh;
  overflow-y: auto;
}

.popup-content {
  transform: translate(-50%, -50%) scale(0.95);
  transition: transform 0.3s ease;
}

.epic-help-popup.active .popup-content {
  transform: translate(-50%, -40%) scale(1);
}
.epic-help-popup {
  pointer-events: none; /* Отключаем взаимодействие когда скрыто */
}

.epic-help-popup.active {
  pointer-events: auto; /* Включаем обратно */
}

/* Карточка энциклопедии персонажей */
.character-encycl-card {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.encycl-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.encycl-link:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
}

.encycl-icon img {
    transition: transform 0.3s ease;
    width: 56px;
    height: 56px;
}

.encycl-link:hover .encycl-icon img {
    transform: rotate(5deg) scale(1.1);
}

.encycl-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
}

.encycl-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

/* Скрываем мобильный текст по умолчанию */
.encycl-mobile-text {
    display: none;
    font-weight: 600;
    font-size: 12px;
    margin-top: 4px;
}

/* Адаптация для планшетов и мобильных */
@media (max-width: 992px) {
    .character-encycl-card {
        top: 20px;
        right: 50%;
        transform: translateX(50%);
        left: auto;
    }
    
    .encycl-text {
        display: none; /* Скрываем текст */
    }
    
    /* Показываем мобильный текст */
    .encycl-mobile-text {
        display: block;
    }
    
    .encycl-icon img {
        width: 77px;
        height: 77px;
    }
    
    .encycl-link {
        padding: 15px;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }
}

/* Дополнительная адаптация для очень маленьких экранов */
@media (max-width: 480px) {
    .character-encycl-card {
        top: 10px;
    }
    
    .encycl-icon img {
        width: 80px;
        height: 80px;
    }
    
    .encycl-link {
        padding: 12px;
    }
    
    .encycl-mobile-text {
        font-size: 11px;
    }
}

/* Стили для модального окна персонажей Kioria 1 */
.kioria1-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
}

.kioria1-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 1200px;
    width: 90%;
    color: white;
    position: relative;
}

.kioria1-character-modal h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    color: #a8e6cf;
}

.kioria1-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.kioria1-modal-close:hover {
    color: #a8e6cf;
}

.kioria1-characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.kioria1-character-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kioria1-character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 230, 207, 0.2);
}

.kioria1-character-card img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #a8e6cf;
}

.kioria1-character-card h3 {
    margin: 10px 0;
    color: #a8e6cf;
    font-size: 1.4rem;
}

.kioria1-character-card p {
    color: #d4f1ff;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .kioria1-modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
    }
    
    .kioria1-character-modal h2 {
        font-size: 1.45rem;
    }
    
    .kioria1-characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .kioria1-character-card {
        padding: 15px;
    }
    
    .kioria1-character-card img {
        width: 200px;
        height: 200px;
    }
}

/* Делаем кнопку похожей на ссылку */
#kioria1-openCharactersModal {
    background: #bbd7ff4f;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 11px;
    margin: 0;
}




/* ====================== */
/* СТИЛИ ИКОНКИ КОММЕНТАРИЕВ НА СЛАЙДАХ */
/* ====================== */

/* Ссылка с иконкой комментариев */
.comment-icon-link {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 37, 68, 0.85);
  border-radius: 6px;
  text-decoration: none;
  color: #a5d2ff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(165, 210, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Иконка */
.comment-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2.2;
  transition: transform 0.3s ease;
}

/* Счетчик комментариев */
.comment-count {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  min-width: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

/* Состояние hover */
.comment-icon-link:hover {
  background: rgba(45, 119, 180, 0.9);
  color: #ffffff;
  border-color: rgba(165, 210, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 18px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(165, 210, 255, 0.2),
    0 0 15px rgba(165, 210, 255, 0.15);
}

.comment-icon-link:hover .comment-icon {
  transform: scale(1.1);
}

.comment-icon-link:hover .comment-count {
  transform: scale(1.1);
}

/* Состояние active */
.comment-icon-link:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Анимация появления */
@keyframes fadeInCommentIcon {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.comment-icon-link {
  animation: fadeInCommentIcon 0.4s ease-out 0.5s both;
}

/* Анимация для счетчика при обновлении */
@keyframes countPulse {
  0%, 100% {
    transform: scale(1);
    color: #a5d2ff;
  }
  50% {
    transform: scale(1.3);
    color: #ffffff;
  }
}

.comment-count.updated {
  animation: countPulse 0.5s ease;
}

/* ====================== */
/* АДАПТИВНОСТЬ */
/* ====================== */

@media (max-width: 992px) {
  .comment-icon-link {
    top: 12px;
    right: 12px;
    padding: 7px 10px;
  }
  
  .comment-icon {
    width: 16px;
    height: 16px;
  }
  
  .comment-count {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .comment-icon-link {
    top: 10px;
    right: 10px;
    padding: 6px 8px;
    gap: 5px;
  }
  
  .comment-icon {
    width: 14px;
    height: 14px;
  }
  
  .comment-count {
    font-size: 11px;
    min-width: 14px;
  }
}

@media (max-width: 480px) {
  .comment-icon-link {
    top: 8px;
    right: 8px;
    padding: 5px 6px;
  }
  
  .comment-icon {
    width: 12px;
    height: 12px;
  }
  
  .comment-count {
    font-size: 10px;
  }
}

/* ====================== */
/* ПРИНЦИП НАВЕДЕНИЯ НА СЛАЙД */
/* ====================== */

/* Показываем иконку комментариев только при наведении на слайд */
.swiper-slide:not(:hover) .comment-icon-link {
  opacity: 0.7;
  transform: scale(0.95);
}

.swiper-slide:hover .comment-icon-link {
  opacity: 1;
  transform: scale(1);
}

/* Для мобильных устройств (тап) */
@media (hover: none) and (pointer: coarse) {
  .swiper-slide .comment-icon-link {
    opacity: 1;
    transform: scale(1);
  }
  
  /* Увеличиваем область тапа для мобильных */
  .comment-icon-link {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
}

/* ====================== */
/* ТЕМНАЯ ТЕМА (опционально) */
/* ====================== */

@media (prefers-color-scheme: dark) {
  .comment-icon-link {
    background: rgba(0, 20, 40, 0.9);
    border-color: rgba(165, 210, 255, 0.2);
  }
  
  .comment-icon-link:hover {
    background: rgba(30, 90, 140, 0.95);
    border-color: rgba(165, 210, 255, 0.4);
  }
}

/* ====================== */
/* ДОСТУПНОСТЬ */
/* ====================== */

.comment-icon-link:focus {
  outline: 2px solid rgba(165, 210, 255, 0.6);
  outline-offset: 2px;
}

.comment-icon-link:focus:not(:focus-visible) {
  outline: none;
}

/* Скринридеры */
.comment-icon-link .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* В ваш CSS */
.comment-count {
  transition: all 0.3s ease;
}

.comment-count.loading {
  opacity: 0.5;
  animation: pulse 1.5s infinite;
}

.comment-count.from-cache {
  opacity: 0.8;
}

.comment-count.updated {
  animation: pop 0.5s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}