
/* Сброс стандартных настроек */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основная страница */
body {
    min-height: 100vh;
    background-color: #210d16;
    color: #f4e8d0;
    font-family: Georgia, serif;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 24px;
}

/* Главная область сайта */
.game-container {
    width: 100%;
    max-width: 1200px;
    min-height: 690px;

    background-color: #321521;
    border: 2px solid #b89450;
    border-radius: 14px;

    padding: 40px;
    text-align: center;
}

/* Заголовок */
.intro h1 {
    color: #d6b36a;
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 20px;
}

/* Обычный текст */
.intro p {
    color: #f4e8d0;
    font-size: clamp(16px, 2vw, 21px);
}

/* Настройки для телефонов */
@media (max-width: 600px) {
    body {
        padding: 12px;
        align-items: stretch;
    }

    .game-container {
        min-height: calc(100vh - 24px);
        padding: 28px 16px;
        border-radius: 10px;
    }

    .intro h1 {
        margin-bottom: 14px;
    }
}
/* Кнопка начала */
.start-button {
    margin-top: 30px;
    padding: 14px 42px;

    background-color: #8b2938;
    color: #f4e8d0;

    border: 2px solid #d6b36a;
    border-radius: 8px;

    font-family: Georgia, serif;
    font-size: 20px;

    cursor: pointer;
    transition: 0.2s;
}

/* Эффект при наведении */
.start-button:hover {
    background-color: #a83b4b;
    transform: scale(1.05);
}
/* Блок теста */
.quiz {
    display: none;
    margin-top: 20px;
}

/* Заголовок вопроса */
.quiz h2 {
    color: #d6b36a;
    font-size: 30px;
    margin-bottom: 30px;
}

/* Контейнер вариантов ответа */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

/* Кнопки ответов */
.answer-button {
    padding: 15px;
    background-color: #503044;
    color: #f4e8d0;
    border: 1px solid #b89450;
    border-radius: 8px;
    font-family: Georgia, serif;
    font-size: 18px;
    cursor: pointer;
}

/* Кнопка Далее */
.next-button {
    margin-top: 30px;
    padding: 12px 35px;
    background-color: #8b2938;
    color: #f4e8d0;
    border: 2px solid #d6b36a;
    border-radius: 8px;
    font-family: Georgia, serif;
    font-size: 18px;
    cursor: pointer;
}

/* Выбранный вариант */
.answer-button {
    transition: background-color 0.2s, border-color 0.2s;
}

/* Выделение выбранного ответа */
.answer-button.selected {
    border: 2px solid #d6b36a;
    background-color: #684052;
}

/* Засыхание неправильного ответа */
.answer-button.dried {
    animation: dryAnswer 0.8s forwards;
    cursor: not-allowed;
}

@keyframes dryAnswer {
    0% {
        background-color: #503044;
        color: #f4e8d0;
        opacity: 1;
    }

    100% {
        background-color: #24191f;
        color: #796b67;
        border-color: #49353a;
        opacity: 0.55;
    }
}

/* Сообщение об ошибке */
#answer-message {
    margin-top: 20px;
    color: #d6b36a;
    font-size: 17px;
    min-height: 22px;
}

/* Неактивная кнопка Далее */
.next-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* Экран с печатями */
.seal-panel {
    display: none;
    margin-top: 10px;
    width: 100%;
}

/* Большой пергамент */
.parchment-panel {
    width: 100%;
    max-width: 1180px;
    min-height: 780px;
    margin: 0 auto;

    padding: 175px 35px 85px;

    background-image: url("images/parchment/parchment-square.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;

    color: #4b3023;
}

/* Заголовок */
.parchment-panel h2 {
    color: #5b3025;
    font-size: clamp(26px, 4vw, 36px);
    margin-bottom: 12px;
}

.parchment-panel p {
    font-size: 18px;
    margin-bottom: 35px;
}

/* Печати в один ряд */
.seals {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;

    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    gap: 10px;
}

/* Кнопки */
.seal-button {
    flex: 1;
    min-width: 0;
    max-width: 170px;
    min-height: 190px;
    padding: 8px 5px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    background: transparent;
    border: none;
    color: #4b3023;

    font-family: Georgia, serif;
    font-size: 17px;
    cursor: pointer;
    transition: transform 0.2s;
}

.seal-button img {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

/* Шахматное расположение */
.seal-button:nth-child(even) {
    margin-top: 55px;
}

.seal-button:nth-child(odd) {
    margin-top: 0;
}

.seal-button span {
    line-height: 1.3;
    max-width: 150px;
    text-align: center;
}

.seal-button:hover {
    transform: translateY(-6px) scale(1.05);
}

@media (max-width: 600px) {
    .parchment-panel {
        min-height: 780px;
        padding: 155px 18px 55px;
        background-size: 100% 100%;
    }

    .parchment-panel h2 {
    font-size: 19px;
    line-height: 1.3;
    max-width: 280px;
    margin: 0 auto 10px;
}

    .parchment-panel p {
        font-size: 14px;
        line-height: 1.4;
        margin: 0 auto 20px;
        max-width: 260px;
    }

    .seals {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: px 12px;
        max-width: 300px;
        margin: 0 auto;
    }

    .seal-button {
        width: 100%;
        min-height: 105px;
        max-width: none;
        margin-top: 0 !important;
        padding: 4px;
        gap: 5px;
        font-size: 14px;
    }

    .seal-button img {
        width: 78px;
        height: 78px;
    }

    .seal-button span {
        max-width: 130px;
        line-height: 1.2;
    }

    .seal-button:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        width: 145px;
    }

    .seal-button:hover {
        transform: none;
    }
}
/* Экран письма */
.letter-screen {
    display: none;
    width: 100%;
    margin-top: 20px;
}

/* Закрытое письмо */
.letter-closed {
    text-align: center;
}

.letter-closed h2,
.letter-open h2 {
    color: #d6b36a;
    font-size: 32px;
    margin-bottom: 15px;
}

.letter-closed p {
    color: #f4e8d0;
    font-size: 18px;
}

.open-letter-button {
    display: block;
    width: 300px;
    max-width: 80%;
    margin: 25px auto 10px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.25s;
}

.open-letter-button img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.open-letter-button:hover {
    transform: scale(1.05);
}

.letter-hint {
    color: #d6b36a !important;
    font-size: 15px !important;
}

/* Открытое письмо */
.letter-open {
    display: none;
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

.letter-parchment {
    display: block;
    width: 100%;
    height: auto;
}

.letter-text {
    position: absolute;
    top: 38%;
    left: 15%;
    width: 70%;
    color: #4b3023;
    font-family: Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
}

.letter-text h2 {
    color: #5b3025;
    text-align: center;
}

/* Кнопка возврата */
.back-button {
    margin-top: 25px;
    padding: 12px 30px;
    background-color: #8b2938;
    color: #f4e8d0;
    border: 2px solid #d6b36a;
    border-radius: 8px;
    font-family: Georgia, serif;
    font-size: 17px;
    cursor: pointer;
}

.back-button:hover {
    background-color: #a83b4b;
}

/* Телефоны */
@media (max-width: 600px) {
    .letter-closed h2,
    .letter-open h2 {
        font-size: 25px;
    }

    .letter-text {
        top: 32%;
        left: 12%;
        width: 76%;
        font-size: 14px;
        line-height: 1.5;
    }

    .back-button {
        width: 100%;
        max-width: 280px;
    }
}
/* Анимация закрытия письма */
.letter-closing {
    animation: letterClose 0.4s ease forwards;
}

@keyframes letterClose {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.92);
    }
}

/* Анимация появления пергамента */
.letter-appearing {
    animation: letterOpen 0.7s ease forwards;
}

@keyframes letterOpen {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Экран музыки */
.music-screen {
    display: none;
    width: 100%;
    margin-top: 20px;
}

/* Пергамент музыки */
.music-parchment {
    width: 100%;
    max-width: 1100px;
    min-height: 800px;
    margin: 0 auto;
    padding: 175px 45px 70px;

    background-image: url("images/parchment/parchment-square.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;

    color: #4b3023;
}

.music-parchment h2 {
    color: #5b3025;
    font-size: clamp(26px, 4vw, 36px);
    margin-bottom: 12px;
}

.music-parchment p {
    font-size: 18px;
    margin-bottom: 35px;
}

/* Стойка с мечами */
.music-rack {
    width: 100%;
    max-width: 850px;
    min-height: 300px;
    margin: -10px auto 0;

    background-image: url("images/weapons/sword-rack.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

/* Отдельный меч */
.song-button {
    position: relative;
    width: 100%;
    height: 45px;
    padding: 4px 15px;

    display: flex;
    align-items: center;

    background: transparent;
    border: none;
    cursor: pointer;

    color: #4b3023;
    font-family: Georgia, serif;
    font-size: 14px;

    transition: transform 0.2s;
}

.song-button img {
    display: none;
}

.song-button span {
    position: absolute;
    left: 42%;
    width: 30%;

    text-align: center;
    white-space: nowrap;

    color: #fff0bd;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: normal;
    letter-spacing: 0.3px;

    -webkit-text-stroke: 0;

    text-shadow:
        1px 1px 2px #32101a,
        0 0 5px #32101a;

    z-index: 2;
}

/* Выравнивание названий по лезвиям */
.song-button:nth-child(2) span {
    transform: translateY(-5px);
}

.song-button:nth-child(3) span {
    transform: translateY(-10px);
}

.song-button:nth-child(4) span {
    transform: translateY(-18px);
}

.song-button:nth-child(5) span {
    transform: translateY(-26px);
}

.song-button:hover {
    transform: scale(1.03);
}

/* Телефоны */
@media (max-width: 600px) {
    .music-parchment {
        min-height: 650px;
        padding: 130px 12px 55px;
    }

    .music-parchment p {
        font-size: 16px;
    }

    .music-rack {
    width: 100%;
    max-width: 340px;
    min-height: 250px;
    margin: 0 auto;
    background-size: contain;
    }

    .song-button {
        height: 48px;
        font-size: 14px;
        gap: 8px;
    }

    .song-button img {
        width: 60px;
        height: 38px;
    }
}

/* Индикатор играющей песни */
.song-button.active span {
    color: #ffe08a;
    text-shadow:
        0 0 5px #8b2938,
        0 0 10px #d6b36a;
}

.song-button.active span::after {
    content: "  ▶";
    color: #8b2938;
    font-size: 13px;
}

.song-button.paused span::after {
    content: "  Ⅱ";
}
/* Экран мем-квеста */
.quest-screen {
    display: none;
    width: 100%;
    margin-top: 20px;
}

/* Пергамент квеста */
.quest-parchment {
    width: 100%;
    max-width: 1100px;
    min-height: 800px;
    margin: 0 auto;
    padding: 175px 45px 70px;

    background-image: url("images/parchment/parchment-square.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;

    color: #4b3023;
}

.quest-parchment h2 {
    color: #5b3025;
    font-size: clamp(26px, 4vw, 36px);
    margin-bottom: 15px;
}

#quest-progress {
    font-size: 17px;
    margin-bottom: 20px;
}

#quest-question {
    font-size: 22px;
    margin-bottom: 20px;
}

#quest-image {
    display: block;
    width: 100%;
    max-width: 450px;
    height: 260px;
    object-fit: contain;
    margin: 0 auto 25px;
}

.quest-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 650px;
    margin: 0 auto;
}

.quest-answers .answer-button {
    width: 100%;
    min-height: 55px;
}

#quest-message {
    min-height: 25px;
    margin-top: 15px;
    font-size: 16px;
}

#quest-finale {
    max-width: 750px;
    margin: 0 auto;
    padding-top: 50px;
    line-height: 1.8;
    color: #6b292d;
    text-shadow: 0 1px 1px #f4dca8;
}

#quest-finale p {
    font-size: 24px;
    margin-top: 20px;
}
#quest-finale h2 {
    color: #8b2938;
    text-shadow: 1px 1px 2px #e5bd75;
}
/* Телефоны */
@media (max-width: 600px) {
    .quest-parchment {
        min-height: 740px;
        padding: 130px 15px 55px;
    }

    #quest-question {
        font-size: 19px;
    }

    #quest-image {
        height: 210px;
    }

    .quest-answers {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #quest-finale {
        padding-top: 25px;
    }

    #quest-finale p {
        font-size: 16px;
    }
}
/* Положение кнопки Далее в мем-квесте */
#quest-next {
    position: static;
    display: block;
    width: 180px;
    margin: 25px auto 0;
    transform: none;
    opacity: 1;
}

#quest-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* Экран ежедневных посланий */
.rose-screen {
    display: none;
    width: 100%;
    margin-top: 20px;
}

.rose-parchment {
    width: 100%;
    max-width: 1100px;
    min-height: 800px;
    margin: 0 auto;
    padding: 175px 45px 70px;
    background-image: url("images/parchment/parchment-square.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    color: #4b3023;
    text-align: center;
}

.rose-parchment h2 {
    color: #8b2938;
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 25px;
}

.rose-parchment p {
    max-width: 650px;
    margin: 0 auto 25px;
    font-size: 21px;
    line-height: 1.7;
}

.daily-rose {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
    margin: 20px auto;
    transition: transform 0.3s;
}

.daily-rose:hover {
    transform: scale(1.08);
}

.rose-link {
    display: inline-block;
    margin-top: 15px;
    padding: 15px 30px;
    background: #8b2938;
    color: #f4e8d0;
    text-decoration: none;
    border-radius: 8px;
    font-family: Georgia, serif;
    font-size: 18px;
    transition: background 0.2s;
}

.rose-link:hover {
    background: #a83b4b;
}

@media (max-width: 600px) {
    .rose-parchment {
        min-height: 740px;
        padding: 130px 20px 55px;
    }

    .rose-parchment p {
        font-size: 17px;
    }

    .daily-rose {
        width: 180px;
        height: 180px;
    }

    .rose-link {
        font-size: 16px;
        padding: 13px 20px;
    }
}
/* Экран личного послания */
.message-screen {
    display: none;
    width: 100%;
    margin-top: 20px;
}

.message-parchment {
    width: 100%;
    max-width: 1100px;
    min-height: 800px;
    margin: 0 auto;
    padding: 175px 45px 70px;
    background-image: url("images/parchment/parchment-square.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    color: #4b3023;
    text-align: center;
}

.message-parchment h2 {
    color: #8b2938;
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 25px;
}

.message-parchment p {
    max-width: 650px;
    margin: 0 auto 30px;
    font-size: 21px;
    line-height: 1.7;
}

#message-input {
    display: block;
    width: 100%;
    max-width: 650px;
    min-height: 200px;
    margin: 30px auto 20px;
    padding: 18px;
    resize: vertical;
    background: rgba(255, 244, 215, 0.65);
    border: 2px solid #a88755;
    border-radius: 8px;
    color: #4b3023;
    font-family: Georgia, serif;
    font-size: 18px;
    line-height: 1.5;
    outline: none;
}

#message-input:focus {
    border-color: #8b2938;
}

#message-input::placeholder {
    color: #92795f;
}

#message-status {
    min-height: 30px;
    margin: 10px auto 0;
    font-size: 19px;
    font-weight: bold;
    color: #8b2938;
    text-shadow: 0 1px 1px #f4dca8;
    position: relative;
    z-index: 2;
}

@media (max-width: 600px) {
    .message-parchment {
        min-height: 740px;
        padding: 130px 20px 55px;
    }

    .message-parchment p {
        font-size: 17px;
    }

    #message-input {
        min-height: 180px;
        font-size: 16px;
    }
}
@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

#message-status.show-status {
    animation: messageAppear 0.7s ease forwards;
}