
  body:not(.modal-ready) > *:not(#difficultyModal) {
  display: none !important;
}
  
      body {
      background-color: #f9fafb;
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      height: fit-content;
    }

    /* Обычное начертание */
    @font-face {
      font-family: 'TwilightC';
      src: url('fonts/twilightc-regular.woff2') format('woff2'),
           url('fonts/twilightc-regular.woff') format('woff');
      font-weight: normal;
      font-style: normal;
    }
    
    /* Курсивное начертание (если есть) */
    @font-face {
      font-family: 'TwilightC';
      src: url('fonts/twilightc-italic.woff2') format('woff2'),
           url('fonts/twilightc-italic.woff') format('woff');
      font-weight: normal;
      font-style: italic;
    }

.allText {
  font-family: 'TwilightC', 'Times New Roman', serif;
  font-style: italic;
  letter-spacing: 0.3px; /*расстояние между буквами */
  word-spacing: 1px; /*расстояние между словами */
  /* user-select: none; /*защита от выделения текста*/
  padding-left: 3%;
  padding-right: 3%;
}
.textStrong {
    display: block; /* перенос строки */
    text-align: center; /*центрирование*/
    font-weight: bold;
    margin-bottom: 3%;
}

.strongMaxi {
    font-size: 7vw;
}
.strongMedium {
    font-size: 5vw;
    margin-top: 1%;
}

.strongMini {
    font-size: 2vw;
    
}

.strongHead {
    font-size: 7vw;
    background: #e4cfb4;
    border: 5px solid #aa8a64;
    padding: 0.5rem;
}

.strongMenu {
    font-size: 3vw;
}

.textSmall {
    hyphens: auto; /* переносы */
    font-size: 3vw;
    text-align: justify; /* по ширине */
    line-height: 1.3; /*межстрочный интервал */
}

.allBox {
    border-radius: 8px; /*закругление углов*/
      position: relative; /* Для наложения контента поверх фона */
      display: flex; /* одна колонка*/
      box-sizing: border-box; /* padding и border не увеличивают объект*/
      gap: 0.1rem; /* отступ между элементами*/
      background-size: cover; /* заполнить фоном контейнер */
      background-position: center;
      align-items: center; /* Выравнивание поперечной оси по центру */
    padding: 0.3;
     
}

.boxColumn {
    
    overflow-y: auto;
    flex-direction: column;
    max-height: 100vh;
    z-index: 10; /*приоритет наложения */
}

.columnBox {
    padding: 0.5rem;
    justify-content: flex-end;
}

.columnCards {
    background: #eee7e7;
    flex-shrink: 0; /*не сжимать*/
    overflow-y: hidden;
    -webkit-tap-highlight-color: transparent; /* для мобильных */
    -webkit-touch-callout: none; /* для iOS */
    -webkit-user-select: none; /* предотвращает выделение */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    justify-content: flex-start;
}

.cardsMaxi {
     scroll-snap-align: center;  /* Центрирование при скролле */
    width: 88vw;
    height: 58vh;
    border: 4px solid #808080;
    
}

.CardsMini {
    width: 100px;
    height: 90px;
    border: 2px solid #808080;
}

.cardsMiniTable {
  cursor: grab; /*курсор перетаскивания*/
  transform: rotateY(180deg); /* Изначально "за спиной" */
  position: relative; /* родитель */
}

.cardsMiniTable::before {
    background: repeating-linear-gradient(
        45deg,
        #A0522D,
        #A0522D 5px,
        #8B4513 5px,
        #8B4513 10px
    ); /*рубашки карт ии*/
    content: "";
    backface-visibility: hidden; /* скрыть рубашку при перевороте */
    z-index: 15;
    position: absolute; /*дочерний */
    height: 100%;
    width: 100%;
}

.boxRowContainer {
        width: 97%;
        flex-direction: row;
}

.containerOneSetting {
    background: #e2e5c8;
    border: 5px solid #aa8a64;
    padding: 0.3rem;
    width: 80vw;
    align-items: flex-start;
}

.containerHandPlayer {
    overflow-x: auto; 
    background: none;
    max-width: 90vw;
    height: 420px;
    scroll-snap-type: x-mandatory; /*снап скроллинг */
   transition: scroll-left 3.5s ease;
   justify-content: flex-start;
}

.containerHandAi {
    height: 200px;
    flex-wrap: wrap;
    justify-content: center; /* Выравнивание главной оси по центру */
}

.containerModal {
    flex-wrap: wrap; /* перенос элементов*/
    overflow-y: auto;
    overflow-x: hidden;
    height: fit-content;
    max-height: 100vh;
    align-items: flex-start; /* поперечнач ось к началу */
    padding-bottom: 4rem;
    justify-content: center; /* Выравнивание главной оси по центру */
   }
.allModal {
    background: white;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 100vh;
    z-index: -1; /* временно ниже, но см. ниже — нужно поднять */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.allModal.active {
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 9999; /* 🔥 Важно: выше всего */
    opacity: 1;
}

.modalSettings {
    background: rgba(0,0,0,0.7) url('https://a.imgfoto.host/2025/09/27/1000019297.webp') center/cover no-repeat;
}
.Open { 
    visibility: visible; /*открывает сохраненный hidden */
}

.modalMessage {
    
}

.boxMessage {
    display: none;
  justify-content: center;
  width: 100px;
    max-width: 90vw;
    height: fit-content; /*растяривается по содержимому */
    z-index: 60;
}

.boxMessage.active {
    display: flex; /* Или block, inline-flex, в зависимости от желаемого layout'а. flex - хороший выбор. */
    /* Если вы хотите анимацию появления, как у allModal, добавьте opacity и transition */
    opacity: 1;
    z-index: 60; /* Убедитесь, что z-index достаточен для отображения поверх других элементов.
                    60 может быть мало, если другие элементы имеют больший z-index.
                    Рассмотрите увеличение, например, до 1060 или больше, если нужно. */
    /* Если хотите центрирование, как у allModal.active */
    position: fixed; /* Если еще не задано через HTML/другие стили */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6); /* Полупрозрачный фон, как у .modal */
}

.containerTable {
    flex-wrap: wrap;/* перенос элементов*/
    transform-style: preserve-3d;
    overflow-y: auto;
    min-height: 10vh;
    max-height: 30vh;
    height: fit-content;
    justify-content: flex-start;
    padding: 0.3rem;
    padding-left: 3%;
    margin: 0.5rem;
    gap: 0.4rem;
}

.tableCenter {
    background: #c2c2c2;
    border: 2px solid #808080;
    perspective: 1000px; /* глубина анимации? */
}

.tablePlayer {
    background: #83a889;
    border: 2px solid #45854a; 
}

.tableAi {
    background: #e3a1a1;
    border: 2px solid #b05656; 
}

.allImg {
    pointer-events: none; /* перетаскивать нажатием */
    object-fit: contain; /* сохранение пропорций при масштабировании */
    width: 94%;
    border-radius: 8px ; /*закругление углов*/
    justify-content: center; 
    padding: 3%;
    padding-bottom: 0rem;
}

.containerButtons {
    background: white;
    position: fixed;       /* Фиксируем позицию относительно окна браузера */
    bottom: -4vh;             /* Прижимаем к нижнему краю */
    left: 0;               /* Растягиваем на всю ширину */
    z-index: 300;
    height: 15vh;
    width: 100%;
}
    
.boxButtons {
    display: block;
    background: #b85e2e;
    width: 50vw;
    color: white;
    cursor: pointer; /* курсор "палец"*/
    font-family: 'TwilightC', 'Times New Roman', serif;
  font-style: italic;
  letter-spacing: 0.3px; /*расстояние между буквами */
  word-spacing: 1px; /*расстояние между словами */
  font-weight: bold;
    border: 5px solid #808156; 
    padding: 0.7rem; /* внутренние отступы от границ */
    margin-bottom: 6%;
    -webkit-tap-highlight-color: transparent; /* для мобильных */
    -webkit-touch-callout: none; /* для iOS */
    -webkit-user-select: none; /* предотвращает выделение */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-align: center;
}

.buttonsMini {
    padding: 0.3rem;
    margin-bottom: 3%;
    width: fit-content;
}

.caravanButton {
    display: none;
}

.allSelect {
    border: 5px solid #ffe100 !important;
    transition: all 0.4s ease;
}

.allDisabled {
    background: #b8b8b8;
    pointer-events: none; /* не нажать */
    opacity: 0.5; /* прозрачность */
}

.allReqs {
    display: flex; /* одна колонка*/
    flex-direction: column; /* колонка вертикально */
    padding: 0.5rem;
    border-top: 1px dashed grey;
    border-bottom: 1px dashed grey;
    height: fit-content;
    align-items: flex-start; /* поперечнач ось к началу */
    width: 94%;
}

.allReqsTrue {
    color: #9ca3af; /* серый — выполненные требования */
    text-decoration: line-through;
}

.allReqsDisable {
    color: red;
}


	.hidden {
      display: none !important;
    }
.difficulty-params__item {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  width: 90vw;
}

 /* Стили для модального окна сложности */
#difficultyModal ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

#difficultyModal li {
  margin-bottom: 0.25rem;
}

#currentDifficultyLabel {
  font-size: 0.9rem;
  color: #4b5563;
}
 
.bg-blue { background-color: #bfdbfe !important; } /* светло-синий */
.bg-purple { background-color: #ddd6fe !important; } /* лиловый */
.bg-orange { background-color: #fde047 !important; } /* светло-оранжевый */
    
    .coin-modal.active { visibility: visible; }
    .coin-box {
      background: white; padding: 2rem;
      border-radius: 1rem; max-width: 400px;
      width: 90%; text-align: center;
    }
    .coin-box input {
      padding: 0.5rem; font-size: 1rem;
      width: 100px; margin: 1rem 0;
    }
    /* Статистика каравана */
    .caravan-stats {
      font-size: 0.9rem;
      display: flex;
      gap: 1rem;
      margin-bottom: 1rem;
    }

/* Анимация появления */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Анимация при наведении */
.ai-card-back:hover .ai-card-back-inner {
    transform: rotateY(20deg);
}

 /* Анимация переворота карты */
@keyframes flipIn {
  from { 
    transform: rotateY(90deg); 
    opacity: 0; 
  }
  to { 
    transform: rotateY(0); 
    opacity: 1; 
  }
}

@keyframes flipCardAnimation {
    0% {
        transform: rotateY(0deg);
    }
    49% {
        /* В этот момент рубашка почти перпендикулярна, но еще видна */
        /* transform: rotateY(88deg); Не нужно, анимация управляется ключевыми кадрами */
    }
    50% {
        /* Момент "ребра" карты, визуально минимальная видимость */
        /* transform: rotateY(90deg); */
    }
    51% {
        /* После этого начинает появляться лицевая сторона */
        /* transform: rotateY(92deg); */
    }
    100% {
        transform: rotateY(180deg);
    }
} 

 /*____________________*/
  

.fulfilled {
  color: #9ca3af; /* серый — выполненные требования */
  text-decoration: line-through;
}

  
	.bg-blue { background-color: #bfdbfe !important; } /* светло-синий */
.bg-purple { background-color: #ddd6fe !important; } /* лиловый */
.bg-orange { background-color: #fde047 !important; } /* светло-оранжевый */

	

    .button {
      background: #6366f1;
      color: white;
      border: none;
      padding: 0.75rem 1.5rem;
      border-radius: 9999px;
      cursor: pointer;
      font-weight: bold;
      font-size: 1rem;
      transition: background 0.3s ease;
    }
    .button:hover {
      background: #4f46e5;
    }
    .button.disabled {
      background: #d9a744;
    }
    

    .coin-modal {
      position: fixed; top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.6); display: flex;
      align-items: center; justify-content: center;
      visibility: hidden; z-index: 50;
    }
    .coin-modal.active { visibility: visible; }
    .coin-box {
      background: white; padding: 2rem;
      border-radius: 1rem; max-width: 400px;
      width: 90%; text-align: center;
    }
    .coin-box input {
      padding: 0.5rem; font-size: 1rem;
      width: 100px; margin: 1rem 0;
    }
    /* Статистика каравана */
    .caravan-stats {
      font-size: 0.9rem;
      display: flex;
      gap: 1rem;
      margin-bottom: 1rem;
    }



/* Анимация появления */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Стили для карт ИИ */
.ai-cards-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.ai-card-back {
    width: 50px;
    height: 90px;
    position: relative;
    perspective: 1000px;
    cursor: pointer;
}

.ai-card-back-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #8B4513; /* Коричневый фон */
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: all 0.6s ease;
}

.ai-card-back-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 5%;
    background: repeating-linear-gradient(
        45deg,
        #A0522D,
        #A0522D 5px,
        #8B4513 5px,
        #8B4513 10px
    );
    border-radius: 3px;
    opacity: 0.7;
}

/* Анимация при наведении */
.ai-card-back:hover .ai-card-back-inner {
    transform: rotateY(20deg);
}

  
 /* Анимация переворота карты */
@keyframes flipIn {
  from { 
    transform: rotateY(90deg); 
    opacity: 0; 
  }
  to { 
    transform: rotateY(0); 
    opacity: 1; 
  }
}



/* === НОВЫЕ СТИЛИ ДЛЯ АНИМАЦИИ ПЕРЕВОРОТА === */
/* Они дополняют существующие стили */

/* Контейнер для переворачивающейся карты */
.flip-card-container {
    width: 100px; /* Должно совпадать с .board-card-face-down */
    height: 90px; /* Должно совпадать с .board-card-face-down */
    position: relative;
    transform-style: preserve-3d;
    /* transition управляется через JS для точного контроля */
}

/* Общий стиль для передней и задней сторон */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100px;
    height: 90px;
    backface-visibility: hidden;
    border-radius: 8px; /* Как у .board-card-face-down */
    display: flex;
    
    overflow: hidden;
    left: 0;
    backface-visibility: hidden; /* Убедимся, что обратная сторона скрыта */
}

/* Рубашка карты */
.flip-card-front {
    background: #8B4513; /* Фон рубашки */
    z-index: 2; /* Рубашка сверху по умолчанию */
    /* Используем тот же паттерн, что и в .board-card-face-down::before */
}

.flip-card-front::before {
    content: "";
    position: absolute;
    width: 100px;
    height: 90px;
    background: repeating-linear-gradient(45deg, #A0522D, #A0522D 5px, #8B4513 5px, #8B4513 10px);
    border-radius: 3px;
    opacity: 0.7;
}

/* Лицевая сторона карты */
.flip-card-back {
    transform: rotateY(180deg); /* Изначально "за спиной" */
    z-index: 1; /* Лицо снизу по умолчанию */
    /* Стили для содержимого карты будут применяться динамически */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-size: 0.3rem; /* Размер шрифта как у .board-card small */
    overflow: hidden;
}

/* Анимация переворота */
.flip-animation {
    animation: flipCardAnimation 1.5s ease-in-out forwards;
}

@keyframes flipCardAnimation {
    0% {
        transform: rotateY(0deg);
    }
    49% {
        /* В этот момент рубашка почти перпендикулярна, но еще видна */
        /* transform: rotateY(88deg); Не нужно, анимация управляется ключевыми кадрами */
    }
    50% {
        /* Момент "ребра" карты, визуально минимальная видимость */
        /* transform: rotateY(90deg); */
    }
    51% {
        /* После этого начинает появляться лицевая сторона */
        /* transform: rotateY(92deg); */
    }
    100% {
        transform: rotateY(180deg);
    }
}

/* Стили для карт с рубашкой */
.board-card-face-down {
  width: 100px;
  height: 90px;
  background: #8B4513;
  border-radius: 8px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: default;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.board-card-face-down::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  background: repeating-linear-gradient(
    45deg,
    #A0522D,
    #A0522D 5px,
    #8B4513 5px,
    #8B4513 10px
  );
  border-radius: 3px;
  opacity: 0.7;
}


    .hidden {
      display: none;
    }
    /* Результаты каравана */
    .caravan-result-content h3,
    .caravan-robbed-content h3 {
      font-size: 1.25rem;
      margin-bottom: 1rem;
    }
	

  #passbutton {
  background: #98cc8d;
}
#passbutton:hover {
  background: #98cc8d;
}
#passbutton.disable {
    background: #d14d4d !important;
    opacity: 0.7;
}

#aipassbutton {
  background: #98ba93;
  cursor: not-allowed;
  pointer-events: none;
}
#aipassbutton.disable {
  background: #d1d5db !important;
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}