/* Стили для body и html */
html,
body {
    height: 100%;
    font-family: Arial, sans-serif;
}

/* Основной контейнер страницы */
.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2c0101;
}

/* Контейнер для фона и эмблем */
.background-container {
    position: relative;
    width: 1440px;
    /* Фиксированная ширина макета */
    max-width: 100%;
    /* Не больше 100% ширины экрана */
    height: auto;
    margin: 0 auto;
    /* Центрирование */
}

/* Само фоновое изображение */
.background-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Контейнер для эмблем - абсолютное позиционирование относительно фона */
.emblems-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Общие стили для всех эмблем */
.emblem {
    position: absolute;
    width: 4.16%;
    /* 60px / 1440px ≈ 4.16% */
    height: auto;
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease-in-out;
}

/* Эффект при наведении на эмблему */
.emblem:hover {
    transform: scale(1.5);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    z-index: 2;
}

/* Позиционирование эмблем в ПРОЦЕНТАХ относительно ширины 1440px */
.emblem-1 {
    top: 30%;
    left: 16%;
    /* 230px / 1440px ≈ 16% */
}

.emblem-2 {
    top: 30%;
    left: 48%;
    /* 691px / 1440px ≈ 48% */
}

.emblem-3 {
    top: 30%;
    right: 16%;
    /* 230px / 1440px ≈ 16% */
}

.emblem-4 {
    bottom: 10%;
    /* 100px / 1440px ≈ 7% */
    left: 27%;
    /* 389px / 1440px ≈ 27% */
}

.emblem-5 {
    bottom: 10%;
    /* 100px / 1440px ≈ 7% */
    right: 25%;
    /* 360px / 1440px ≈ 25% */
}

/* ----------------------------------------------------------------- */

/* Стили для анимации перехода */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8B0000 0%, #FF0000 50%, #8B0000 100%);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}

.transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Анимация исчезания страницы */
.page.fade-out {
    animation: pageFadeOut 1.2s ease-in-out forwards;
}

@keyframes pageFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    50% {
        transform: scale(1.1);
        filter: blur(5px);
    }

    100% {
        opacity: 0;
        transform: scale(1.3);
        filter: blur(15px);
    }
}

/* Анимация для эмблемы при клике */
.emblem-clicked {
    animation: emblemExplode 1s ease-in-out forwards;
    z-index: 10000 !important;
}

@keyframes emblemExplode {
    0% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
        opacity: 1;
    }

    30% {
        transform: scale(2.5);
        filter: brightness(3) drop-shadow(0 0 30px rgba(255, 0, 0, 1));
        opacity: 0.8;
    }

    60% {
        transform: scale(4);
        filter: brightness(5) drop-shadow(0 0 50px rgba(255, 215, 0, 1));
        opacity: 0.5;
    }

    100% {
        transform: scale(8);
        filter: brightness(8) drop-shadow(0 0 80px rgba(255, 255, 255, 1));
        opacity: 0;
    }
}

/* ----------------------------------------------------------------- */
.page1 {
    margin: 0;
    padding: 0;
    /* background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%); */
    background: url(../images/room_in_castle.webp) no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.back-button {
    display: inline-block;
    margin: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #8B0000 0%, #FF0000 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1000;
}

/* Контейнер для гробов */
.coffins-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
}

/* Общие стили для всех гробов */
.coffin {
    position: absolute;
    width: 150px;
    height: auto;
    z-index: 1;
}

.coffin-1 {
    bottom: 5%;
    right: 30%;
}

.coffin-2 {
    bottom: 0;
    right: 2%;
    transition: all 3s ease-in-out;
    /* Плавное движение */
}

/* Класс для анимации */
.coffin-2.move-to-coffin1 {
    bottom: 2%;
    right: 20%;
}

/* ----------------------------------------------------------------- */
.header-container {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
}

.back-button {
    display: inline-block;
    padding: 15px 20px;
    background: linear-gradient(135deg, #8B0000 0%, #FF0000 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.book-input {
    padding: 15px 20px;
    border-radius: 5px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    min-width: 300px;
    transition: opacity 0.5s ease;
}

.book-input::placeholder {
    color: #727070;
    font-style: italic;
}

.check-button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* ----------------------------------------------------------------- */
.result-message {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    margin-left: 15px;
    animation: fadeInOut 2s ease;
}

.result-message.correct {
    background: #4CAF50;
    color: white;
}

.result-message.incorrect {
    background: #f44336;
    color: white;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    20% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ----------------------------------------------------------------- */
.score-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 10px;
    border: 2px solid gold;
}

.score-title {
    color: white;
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.score-value {
    color: gold;
    font-weight: bold;
}