/* Основной контейнер для зон */
body {
    background: url(https://www.fossil.org.il/wp-content/themes/fossiles/images/home_main_section.jpg);
}
#game-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
/* Отключение выделения элементов в зоне game-container */
#game-container {
    user-select: none; /* Отключение выделения мышкой */
    -webkit-user-select: none; /* Для браузеров на основе WebKit */
    -moz-user-select: none; /* Для Firefox */
    -ms-user-select: none; /* Для IE и Edge */
}

/* Зоны окаменелостей и живых существ */
#fossil-zone, #creature-zone{ 
    flex: 1;
    padding: 10px;
    /* border: 1px solid #3e8d8a; */
    border-color: transparent;
    box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
    background-color: white;
    width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 2.5rem;
    /* background: #c2fbd7; */
    border-radius: 24px;
    position: relative;
    box-shadow: rgba(0, 0, 0, .1) 0 1px 2px 0;
    cursor: pointer;
    /* margin-top: 3em; */
    font-size: 19px;
    /* text-align: left; */
}
#fossil-zone.correct{
    max-width: 50%;
}

#creature-zone {
    /* border-color: #f44336; */
}

/* Заголовки */
/* h3 {
    text-align: center;
    color: #3C3C3C;
    margin-bottom: 5px;
    line-height: 1;
    font-size: 2.125em;
    text-rendering: optimizeLegibility;
    font-weight: 700;
} */
h3 {
    color: #3e8d8a;
    font-size: 28px;
    font-weight: 600;
    border-bottom: 1px solid #3e8d8a;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
p.center, p.center-align{
    text-align: center;
    color: #3C3C3C;
    margin-bottom: 20px;
    line-height: 1;
    font-size: 1.5em;
    text-rendering: optimizeLegibility;
    font-weight: 100;
}
h2{
    font-size: 2rem;
}

/* Элементы внутри зон */
.game-board {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.droppable, .draggable {
    max-width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* border: 2px solid #ccc; */
    border-radius: 5px;
}

/* Изображения внутри перетаскиваемых и зон */
.droppable img, .draggable img {
    width: 100%;
    height: auto;
    padding: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
    cursor: grab;
}
.droppable.correct img{
    max-width: 50%;
}

.draggable:hover img {
    transform: scale(1.1);
    opacity: 0.9;
}

.live-image {
    display: block;
    width: 100%;
    margin-top: 10px;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

/* Плавное появление изображения */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивный дизайн для небольших экранов */
@media (max-width: 768px) {
    #game-container {
        flex-direction: column;
        align-items: center;
    }

    #fossil-zone, #creature-zone {
        max-width: 100%;
        margin-bottom: 20px;
    }
     /* Уменьшение размера картинок и расстояния между ними на маленьких экранах */
    .droppable, .draggable {
        width: 100px;
        height: 100px;
        margin: 3px; /* Сократили расстояние между элементами */
    }

    .game-board {
        gap: 3px; /* Еще меньшее расстояние на маленьких экранах */
    }
}


/* Правильный ответ: анимация зеленой подсветки */
.correct {
    animation: correct-highlight 1s ease forwards;
}

@keyframes correct-highlight {
    0% {
        background-color: transparent;
        border-color: #3e8d8a;
    }
    50% {
        background-color: rgba(76, 175, 80, 0.2);
    }
    100% {
        background-color: transparent;
        border-color: #3e8d8a;
    }
}

/* Неправильный ответ: анимация красной подсветки */
.incorrect {
    animation: incorrect-highlight 0.5s ease forwards;
}

@keyframes incorrect-highlight {
    0% {
        background-color: transparent;
        border-color: #f44336;
    }
    50% {
        background-color: rgba(244, 67, 54, 0.2);
    }
    100% {
        background-color: transparent;
        border-color: #f44336;
    }
}

/* Стили для конфетти */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Попапы (общее) */
/* Стили для попапа с информацией */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    /*border: 2px solid #4caf50;*/
    padding: 0;
    z-index: 1000;
    width: 80%; /* Ширина окна */
    max-width: 500px; /* Максимальная ширина */
    max-height: 80vh; /* Максимальная высота - 80% высоты экрана */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow-y: hidden; /* Вертикальная прокрутка при необходимости */
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 20px;
}

.popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup-content {
    text-align: center;
}

/* Закрытие попапа */
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #000;
}

/* Стиль для изображений в попапе */
#fossil-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Разделение между изображениями */
}

#fossil-images img {
    max-width: 45%; /* Максимальная ширина каждого изображения */
    max-height: 200px; /* Ограничение по высоте */
    height: auto; /* Автоматическая подгонка по высоте */
    object-fit: contain; /* Чтобы изображение не выходило за рамки */
}

.popup-image {
    max-width: 300px;
    max-height: 200px;
    width:auto;
    height:auto;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Кнопки в попапе */
.popup-button {
    position: sticky;
    bottom: 0;
    background-color: #3e8d8a;
    color: white;
    padding: 10px 20px;
    margin-top: 20px;
    /* margin-bottom: 10px; */
    border: none;
    cursor: pointer;
    /* border-radius: 20px; */
    transition: background-color 0.3s ease, transform 0.2s ease;
     width: 100%; /* Кнопка будет на всю ширину */
    z-index: 10; /* Убедимся, что кнопка выше остального контента */
}

.popup-button:hover {
    background-color: #3e8d8a;
    transform: scale(1.05);
}

/* Эффекты для окон победы */
/* Стиль для окна Congratulations */
#win-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    /* border: 2px solid #3e8d8a; */
    padding: 20px;
    z-index: 1000;
    width: 400px; /* Увеличим ширину */
    max-width: 90%; /* Сделаем его адаптивным */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    border-radius: 10px; /* Закруглим углы */
}

#win-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Заголовок Congratulations */
#win-popup h1 {
    color: #3e8d8a;
    font-size: 2rem; /* Уменьшим размер заголовка */
    margin-bottom: 20px;
    text-align: center;
}

/* Текст в попапе */
#win-popup p {
    font-size: 1.2rem; /* Немного увеличим шрифт */
    text-align: center;
    margin-bottom: 20px;
}

/* Стиль кнопки закрытия */
/* #close-popup,  */
#restart-game {
    background-color: #3e8d8a;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    display: block;
    margin: 0 auto; /* Центрируем кнопку */
}

#close-popup:hover {
    background-color: #3e8d8a; /* Изменение цвета кнопки при наведении */
}


/* Эффект при наведении на кнопки */
#close-popup, .popup-button {
    transition: all 0.3s ease;
}

#close-popup:hover, .popup-button:hover {
    background-color: #3e8d8a;
    transform: scale(1.05);
    color:#ffffff;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: hsl(0, 100%, 50%);
    top: 0;
    left: 50%;
    animation: fall 5s linear infinite;
    z-index: 1000;
    pointer-events: none;
    transform: rotate(45deg);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}
/* הודעה למשתמש לסובב את המסך */
#rotate-message {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    font-size: 1.2rem;
    text-align: center;
    z-index: 2000;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
    width: 80%;
}

/* מציג את ההודעה במצב Portrait במכשירים עם רוחב קטן מ-768px */
@media screen and (max-width: 768px) and (orientation: portrait) {
    /* #rotate-message {
        display: block;
    } */
    .popup{
        width:90%;
    }
    .popup-image{
        max-width: 200px;
        max-height: 200px;
    }
}

/* מסתיר את ההודעה במצב Landscape */
@media screen and (orientation: landscape) {
    #rotate-message {
        display: none;
    }
}

.draggable {
    cursor: grab; /* Значок перетаскивания до начала перетаскивания */
}

.draggable:active {
    cursor: grabbing; /* Значок перетаскивания, когда элемент захвачен */
}

/* Контейнер прогресс-бара */
.progress-container {
    display: none; 
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    position:relative;
}

/* Полоса прогресса */
.progress-bar {
    height: 30px;
    width: 0;
    background-color: #4caf50;
    border-radius: 25px;
    text-align: center;
    line-height: 30px;
    color: white;
    font-weight: bold;
    transition: width 0.4s ease;
}
#progress-star {
    position: absolute;
    left: 20px; /* Смещение звездочки в конце */
    top: 5px;
    font-size: 20px;
    color: gold;
    /* position: absolute;
    left: 50%;
    top: 15px; */
}
#popup-star{
    font-size: 60px;
    color: gold;
}
/* Стили для всплывающего сообщения возле курсора */
.fossil-warning {
    position: absolute;
    background-color: rgba(255, 69, 58, 0.9); /* Красный фон с полупрозрачностью */
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    z-index: 1000; /* Чтобы сообщение отображалось поверх других элементов */
    pointer-events: none; /* Чтобы сообщение не мешало взаимодействию с другими элементами */
}
.popup-head {
    color: #3e8d8a;
    font-size: 28px;
    font-weight: 600;
    border-bottom: 0px solid #ccc;
    margin-top: 35px;
    margin-bottom: 20px;
    /* box-shadow:rgba(0, 0, 0, 0.08) 0px 4px 12px */
}

.popup-content {
    max-height: calc(80vh - 80px); /* Устанавливаем максимальную высоту попапа */
    overflow-y: auto; /* Позволяем скроллить содержимое попапа */
}

/* פס הגלילה עצמו */
.popup-content::-webkit-scrollbar {
    width: 8px; /* רוחב פס הגלילה */
}

/* צבע פס הגלילה */
.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1; /* צבע הרקע של פס הגלילה */
}

/* הידית של פס הגלילה */
.popup-content::-webkit-scrollbar-thumb {
    background-color: #f1f1f1; /* צבע הידית */
    border-radius: 10px; /* קצוות מעוגלים */
    border: 2px solid #f1f1f1; /* מרחב פנימי */
}

/* פס הגלילה בעת ריחוף */
.popup-content::-webkit-scrollbar-thumb:hover {
    background-color: #f1f1f1; /* כהה יותר בעת ריחוף */
}

/* עיצוב פס הגלילה עבור Firefox */
.popup-content {
    scrollbar-width: thin; /* רוחב פס הגלילה */
    scrollbar-color: #f1f1f1 #f1f1f1; /* צבע פס הגלילה ורקעו */
}

#fossil-info-text {
    text-align: right;
    padding: 0 30px;
}
h4{
    font-size:1rem;
    font-weight:700;
}
/* Адаптивный дизайн для мобильных устройств */
@media (max-width: 600px) {
    .popup {
        width: 90%; /* Увеличиваем ширину на мобильных */
        max-width: 90%; /* Максимальная ширина также 90% */
        max-height: 70vh; /* Уменьшаем максимальную высоту до 70% высоты экрана */
    }

    .popup-content h2 {
        font-size: 18px; /* Уменьшаем размер заголовка на мобильных */
    }

    .popup-image {
        max-width: 80px; /* Уменьшаем размер изображений для мобильных */
        max-height: 80px;
    }

    .popup-button {
        font-size: 12px; /* Уменьшаем размер кнопки */
        padding: 8px 15px; /* Более компактные отступы */
        
    }

    .popup-content {
        overflow-y: visible;
    }
}

/* Анимация пульсации */
@keyframes star-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2); /* Увеличение размера */
    }
    100% {
        transform: scale(1);
    }
}

/* Применение пульсации к звезде */
.pulsating {
    display: inline-block;
    animation: star-pulse 1s infinite; /* Пульсация каждые 1 секунду */
    font-size: 2rem; /* Размер звезды (можете настроить под себя) */
}
#game-container {
    overflow: visible;
    position: relative; /* Убедитесь, что контейнер находится в потоке страницы */
}
.draggable.dragging {
    pointer-events: none; /* Отключение взаимодействия с другими элементами во время перетаскивания */
}
.draggable {
    touch-action: none; /* Отключает скроллинг при перетаскивании */
}

.droppable.correct {
    border: 2px solid green; /* Добавьте зеленую границу для правильного дропа */
}

.droppable.incorrect {
    border: 2px solid red; /* Добавьте красную границу для неправильного дропа */
}

.draggable.dragging {
    opacity: 0.5; /* Сделайте перетаскиваемый элемент полупрозрачным */
}


/**/

@media screen and (max-width: 1024px) and (orientation: landscape) {
    #game-container {
        flex-direction: row; /* Выстроим зоны в один ряд */
        justify-content: center;
        align-items: flex-start;
        padding: 10px; /* Добавим отступы */
    }

    #fossil-zone, #creature-zone {
        width: 45%; /* Зададим фиксированную ширину для обеих зон */
        margin-bottom: 0;
        margin-right: 2%; /* Отступ между зонами */
    }

    .game-board {
        justify-content: center;
    }
}
