

@media (max-width: 520px) {
    .quizContainer {
            width: 100%!important;
        }
        .questionContainer .textContainer p {
            margin-top: .2em!important;
            margin-bottom: .2em!important;
        }
        .answersContainer .answerButton {
            margin: .5em 0 .5em 0!important;
        }

        .answerButton p {
            margin: .4em 0 .4em 0!important;
        }

        .questionContainer .textContainer {
            font-size: 1.1rem!important;
            margin: 0!important;
            text-align: center!important;
        }

        .questionContainer {
            flex-direction: column!important;
        }

        .answersContainer {
            grid-template-columns: repeat(1, 1fr) !important;
            grid-row-gap: 10px!important;
            grid-column-gap: 10px!important;
            margin-top: 0px!important;
        }

        .answersContainer .answerButton {
            margin: 0!important;
        }

}

.quizContentWrapper {
    max-width: 800px;
    margin: 1.5em auto auto auto;
}

.quizContainer {
    position: relative;
    max-width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gameElementWrapper {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gameElementWrapper h3 {
    margin: 24px auto;
}

.gameElementWrapper .shareBlockItemsContainer {
    justify-content: center;
}

.quizContainer .quizImageContainer {
    position: relative;
    max-width: 350px;
    margin: auto;
}

.quizContainer .questionContainer .questionDevider {
    margin: 0 auto 0 auto;
    border-bottom: #e5e5e5 1px solid;
}

.questionContainer {
    display: flex;
    flex-direction: column;
}

.resultWrapper {
    flex-direction: column!important;
}

.quizContainer .quizImageContainer img {
    position: relative;
    width: 100%;
    border-radius: 8px;
}

.quizContainer .quizImageContainer {
    text-align: right;
}

.quizContainer .quizImageContainer figcaption {
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
}

.questionContainer .textContainer {
    text-align: center;
    font-size: 1.3rem;
}

.textContainer .resultText {
    text-align: left;
}

.questionContainer .textContainer p {
    margin: 24px 0;
    /*font-size: 26px;*/

}

.quizContainer .answersContainer {
    display: grid;
    grid-column-gap: 20px;
    grid-row-gap: 20px;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 24px;
}

.quizProgressContainer {
    display: flex;
    justify-content: center;
    padding: 24px 0;
    font-size: 18px;
    font-style: italic;
}

.answerButton {
    border: #E5E5E5 3px solid;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all ease-in-out .1s;
    max-width: 600px;
}

.answerButton p {
    margin: .5em 0 .5em 0;
}

.answerButton.unavailable {
    background: #B2B2B2;
    color: #FFFFFF;
}

.answerButton.answerSelected {
    border: #f6b74f 3px solid;
}

.answerButton.correctAnswer {
    background: #379a12;
    color: #FFFFFF;
}

.answerButton.wrongAnswer {
    background: #D2055B;
    color: #FFFFFF;
}

.quizContainer .gameButtonsContainer {
    display: flex;

}

.gameButtonsContainer .gameButton {
    margin: 0 .5em 0 .5em;
    border: #e2e2e2 1.5px solid;
    border-radius: 8px;
    text-align: center;
    flex: 1;
}

.gameButton p {
    margin: .5em 0 .5em 0;
}

.gameButton.checkBtn {
    color: #16C2CD;
    font-size: 1.5rem;
}

.gameButton.arrowBtn {
    font-size: 1.5rem;
    cursor: pointer;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.gameButton.unavailable {
    background: #e2e2e2;
    color: #FFFFFF;
}

.quizContainer .resultsContainer {
    margin-top: 1rem;
    text-align: center;
}

.resultsContainer .resultHeadline {
    margin-top: 1em;
    font-size: 1.3rem!important;
    font-weight: bold;
}

.resultsContainer .resultScore {
    font-style: italic;
}

.resultsContainer .sharesButtons {
    display: flex;
    margin-bottom: 1em;
}

.sharesButtons .icon-vk,.icon-ok {
    scale: 2.5;
}

.sharesButtons .icon-ok {
    color: #FF7700;
}

.sharesButtons .icon-vk {
    color: #2A5885;
}


.startBtn {
    border: 2px solid #e2e2e2;
    padding: 12px 24px;
    border-radius: 8px;
    background-color: #52da1b;
    cursor: pointer;
    transition: all ease-in-out .4s;
    color: whitesmoke;
    font-size: 32px;
    font-weight: bold;
    margin: auto;
}

.startBtn:hover {
    background-color: #33940e;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-grey);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 8px solid #ccc;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Quiz: show/hide blocks --- */
.quizGameField.is-visible { display: block !important; }
.resultsContainer.is-visible { display: block !important; }

/* --- Next/Finish button: под текст, а не стрелку --- */
.gameButton.nextBtn {
    font-size: 1.2rem;
    cursor: pointer;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    user-select: none;
}

/* disabled состояние уже есть через .unavailable, но добавим запрет кликов */
.gameButton.unavailable {
    pointer-events: none;
}

/* --- Lock answers after выбор --- */
.quizContainer.isLocked .answerButton {
    pointer-events: none;
}

/* --- Fade animation for question switch --- */
.quizFadeOut {
    opacity: 0;
    transition: opacity .25s ease;
}
.quizFadeIn {
    opacity: 1;
    transition: opacity .25s ease;
}

/* --- Similar quizzes container --- */
.similarQuizzesContainer {
    margin-top: 24px;
    text-align: left;
}


/* =========================
   QUIZ GAME FIELD (IMPROVED)
   add to end of styles_udt.css
   ========================= */

/* контейнер игры */
#quizGameField {
    margin: 0 auto;
    margin-top: 1.5em;
    max-width: 760px;

    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;

    padding: 22px 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(6px);
}

/* прогресс сверху */
#quizProgress {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px;
    border-radius: 999px;

    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);

    color: var(--color-white);
    font-weight: 700;
    letter-spacing: 0.2px;

    margin: 0 auto 14px auto;
}

/* центрируем прогресс если он один */
#quizProgressHolder {
    display: flex;
    justify-content: center;
}

/* текст вопроса */
#questionText {
    margin: 0;
    margin-top: 8px;
    margin-bottom: 18px;

    text-align: center;
    color: var(--color-white);

    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
}

/* контейнер вариантов */
#answersCont {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;

    margin-top: 8px;
    margin-bottom: 18px;
}

/* на узких экранах — в столбик */
@media (max-width: 560px) {
    #quizGameField {
        padding: 18px 14px;
        border-radius: 16px;
    }

    #answersCont {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #questionText {
        font-size: 1.2rem;
    }
}

/* кнопка-ответ */
.answerButton {
    user-select: none;
    cursor: pointer;

    padding: 14px 14px;
    border-radius: 14px;

    background-color: rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.14);

    color: var(--color-white);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.25;

    transition: transform .15s ease, background-color .25s ease, border-color .25s ease, opacity .25s ease;
}

/* hover (только если не disabled) */
.answerButton:hover {
    transform: translateY(-1px);
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
}

/* выбранный (PERSONALITY и до подсветки TRIVIA) */
.answerButton.answerSelected {
    background-color: rgba(255, 127, 0, 0.16);
    border-color: rgba(255, 127, 0, 0.50);
    box-shadow: 0 8px 18px rgba(255, 127, 0, 0.18);
}

/* недоступные после выбора */
.answerButton.unavailable {
    cursor: default;
    opacity: 0.55;
    transform: none;
}

/* TRIVIA: правильный/неправильный */
.answerButton.correctAnswer {
    background-color: rgba(18, 175, 90, 0.18);
    border-color: rgba(18, 175, 90, 0.65);
    box-shadow: 0 8px 18px rgba(18, 175, 90, 0.18);
}

.answerButton.wrongAnswer {
    background-color: rgba(235, 60, 60, 0.18);
    border-color: rgba(235, 60, 60, 0.65);
    box-shadow: 0 8px 18px rgba(235, 60, 60, 0.16);
}

/* кнопка Next/Finish */
#nextQuestion {
    width: 100%;
    border: none;
    cursor: pointer;

    padding: 14px 16px;
    border-radius: 14px;

    background-color: rgba(255, 127, 0, 0.26);
    border: 1px solid rgba(255, 127, 0, 0.45);

    color: var(--color-white);
    font-weight: 800;
    font-size: 1.1rem;

    transition: .25s ease-in-out all;
}

/* hover */
#nextQuestion:hover {
    background-color: rgba(255, 127, 0, 0.34);
    border-color: rgba(255, 127, 0, 0.60);
}

/* disabled (у тебя это класс unavailable) */
#nextQuestion.unavailable {
    cursor: default;
    opacity: 0.55;
    background-color: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.12);
}

/* более мягкая анимация смены вопроса (если используешь quizFadeIn/quizFadeOut) */
.quizFadeOut {
    opacity: 0.0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}

.quizFadeIn {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .25s ease, transform .25s ease;
}


/* RESULT CARD (AJAX) */

.quizResultCard {
    max-width: 760px;
    margin: 0 auto;
    margin-top: 0;

    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;

    padding: 18px 18px 16px 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(6px);
}

.quizResultCardImageWrap {
    aspect-ratio: 16/9;
    width: 100%;
    margin-bottom: 14px;
}

.quizResultCardImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.quizResultCardTitle {
    margin: 0 0 10px 0;
    color: var(--color-white);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
}

.quizResultCardText {
    color: var(--color-semi-white);
    font-size: 1.08rem;
    line-height: 1.65;
}

.quizResultCardMeta {
    margin-top: 12px;
    color: var(--color-semi-white);
    font-weight: 800;
}

.quizResultCardMetaValue {
    color: var(--color-white);
}

.quizShareBlock {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.quizShareTitle {
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 10px;
}

.quizShareButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quizShareBtn {
    text-decoration: none;
    cursor: pointer;

    color: var(--color-semi-white);
    background-color: rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.14);

    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 800;

    transition: .25s ease-in-out all;
}

.quizShareBtn:hover {
    background-color: rgba(255, 127, 0, 0.18);
    border-color: rgba(255, 127, 0, 0.35);
    color: var(--color-white);
}


/* Image loading state (перекрываем существующий .loading-overlay, чтобы по умолчанию был скрыт) */
#imgContainer .loading-overlay {
  display: none;
}

/* Когда идёт загрузка новой картинки */
#imgContainer.is-loading .loading-overlay {
  display: flex;
}

/* Чтобы не показывать старую картинку под спиннером */
#imgContainer.is-loading img {
  visibility: hidden;
}