:root {
    --color-theme-info: #af263d;
    --color-theme-info-hover: #8a182b;
}

html {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: none;
}

li {
    list-style: none;
}

a {
    text-decoration: none;
}

ul {
    padding: 0;
}

* {
    margin: 0;
    padding: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ebebeb;
    font-family: 'Manrope', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

/* контейнер для фоновых слов */
.background-text {
    position: fixed;
    inset: 0;
    z-index: -2;
    color: rgba(0, 0, 0, 0.05);
    font-family: 'PollyRounded', sans-serif;
    font-size: 64px;
    line-height: 1.3;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    margin-left: -80px;
}

/* каждую строку делаем flexом, чтобы слова тянулись */
.background-text div {
    display: flex;
    flex-wrap: nowrap;
}

/* сдвигаем каждую вторую строку для шахматного эффекта */
.background-text div:nth-child(even) {
    transform: translateX(80px);
}

.logo {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;

}

.logo img {
    height: 80px;
    opacity: 0.9;
}


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

    background: #ffffff;
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 20px 30px;
    width: 80%;
    min-height: 500px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.main-block {
    width: 100%;
}
header.page-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* центрируем h1 */
}

header.page-header h1 {
    font-size: 40px;
    margin: 0;
    text-align: center;
    font-family: 'Misto';
}

header.page-header .back-btn {
    position: absolute;
    /* фиксируем слева */
    left: 0px;
}

.breadcrumbs {
    display: flex;
    font-size: 14px;
    margin-bottom: 5px;
}

.breadcrumbs__item {
    padding-right: 5px;
    font-size: 14px;
}

.breadcrumbs__item a {
    color: rgb(82, 14, 88) !important;
    opacity: 0.5;
}

.breadcrumbs__item a:hover {
    color: #465b8f !important;
    opacity: 1;
}

button {
    border: none;
}

.input {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    background: #ebebeb;
    color: #333;
}

input,
button,
select,
textarea {
    color: #333;
}

/* Контейнер */
.container-wrapper {
    overflow-x: auto;
    /* горизонтальный скролл */
}

.container {
    margin: 0 auto;
    max-height: 80vh;
    /* максимум 80% от высоты окна */
    overflow-y: auto;
    /* вертикальный скролл при переполнении */
    overflow-x: hidden;
    /* горизонтальный скролл не нужен */
}

/* Заголовки */
h1,
h2,
h3 {
    margin: 0 0 10px 0;
}

header.page-header h1 {
    font-size: 64px;
}
.question-block h3 {
    font-size: 48px;
    font-weight: 500;
    text-align: center;
}
.option-btn {
    font-size: 30px;
}

/* Карты для раундов/вопросов */
.card {
    background-color: #fbf5fe;
    border-radius: 10px;
    border: 1px solid #e6deeb;
    padding: 15px;
    margin-top: 15px;
}

/* Контейнер с инфо и кнопками */
.card-header {
    display: flex;
    justify-content: space-between;
    /* 🔥 инфо влево, кнопки вправо */
    align-items: center;
    /* 🔥 выравнивание по вертикали */
    gap: 20px;
    /* небольшое расстояние между ними */
}

/* Левая часть */
.card-info h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.card-info p {
    margin: 5px 0 0;
    color: #666;
}

/* Списки внутри карточки */
.card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.card li:last-child {
    border-bottom: none;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    /* ✅ разрешаем перенос на новую строку */
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.actions_item {
    justify-content: right;
}

.actions form {
    display: inline-block;
    margin: 0;
}


/* Модальные окна */
.modal {
    display: none;
    /* скрыта по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
}

.modal-header {
    font-weight: bold;
    margin-bottom: 10px;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* Модальное окно */
.modal {
    display: none;
    /* по умолчанию скрыто */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.messages {
    position: fixed;
    width: auto;
    padding: 10px;
    top: 60px;
    right: 2rem;
    box-shadow: 1px 7px 14px -5px rgba(0, 0, 0, 0.2);
    background: #fff;
    z-index: 1000;
}

.messages_success {
    border-left: #FFC007 solid 5px;
}

.messages_error {
    border-left: red solid 5px;
}

.messages_success .messages__icon {
    color: #FFC007;
}

.messages_error .messages__icon {
    color: red;
}

.messages__icon {
    font-size: 24px;
    padding: 10px;
    vertical-align: middle;
}

.messages__text {
    vertical-align: middle;
}

textarea:focus,
input:focus {
    outline: none;
    /* убираем стандартную обводку */
    box-shadow: inset 0 0 0 2px #d4d4d4;
    /* внутренняя обводка */
}

.field__label {
    display: block;
    color: #5e5873;
    font-size: .857rem;
    margin-top: 15px;
    margin-bottom: 0.2857rem;
}

.btn {
    cursor: pointer;
    display: inline-block;
    height: 42px;
    /* одинаковая высота */
    margin: 10px 0;

    border-radius: 12px;
    background: var(--color-theme-info);
    color: white;
    font-size: 15px;
    outline: none;
    text-align: center;
    cursor: pointer;
    vertical-align: middle;
    padding: 10px 20px;
    user-select: none;
    font-weight: 900;
    box-shadow: 0px 0px 5px 0px rgba(158, 197, 255, 0.5);
}

.btn_full {
    width: 100%;
}

.btn_small {
    height: 30px;
    padding: 5px 10px;
}

.btn_theme_danger {
    background-color: #ef4444;
}

.btn:hover {
    cursor: pointer;
    background: var(--color-theme-info-hover);
}

.btn_theme_danger:hover {
    cursor: pointer;
    background: #922323;
}

.btn_theme_info {
    background: var(--color-theme-info);
    color: white;
}

.btn_theme_info:hover {
    background: var(--color-theme-info-hover);
}


.btn_theme_modal {
    cursor: pointer;
    width: auto;
    display: inline;
    border: 0;
    background: transparent;
}

.btn_theme_modal:hover {
    border: 0;
    background: transparent;
}

.back-btn {
    color: #a3a3a3;
    text-decoration: none;
    font-size: 12px;
}

.winner-block {
    font-size: 48px;
    text-align: center;
}
/* Варианты в одну строку */
.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.option-item .input {
    flex: 1;
}

.correct-label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

h3 {
    margin-top: 15px;
    font-size: 14px;
}

.profile-info p {
    margin-top: 10px;
}

.question-image {
    margin-bottom: 10px;
    display: flex;
    justify-content: center; /* горизонтальное центрирование */
}

.question-image img {
    display: block;
    width: 100%;
    max-width: 500px;
    max-height: 350px; /* фиксированная высота блока */
    object-fit: cover; /* обрезаем картинку */
    object-position: center; /* центрируем область обрезки */
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* ----- Варианты ответов ----- */
.question-options {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
    margin: 40px 0;
}

.option {
    position: relative;
}

.option input[type="radio"] {
    display: none;
}

.option-btn {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid var(--color-theme-info);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-btn:hover {
    background: #e6e2ff;
}

/* Активное состояние */
.option input[type="radio"]:checked+.option-btn {
    background: var(--color-theme-info);
    color: #ffffff;
    border-color: var(--color-theme-info);
    transform: scale(1.03);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* 🔍 Поиск */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
}

/* 🔢 Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: #e0e0e0;
}

.page-btn.active {
    background: #007bff;
    color: #fff;
    font-weight: 600;
}

.page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.question-instructions {
    text-align: center;
    margin: 10px 0px;
    font-size: 48px;
}

.answers-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.answers-table th,
.answers-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.answers-table th {
    background-color: #f1f1f1;
    font-weight: 600;
}

.answers-table tr.correct td {
    background-color: #e8fff1;
    color: #0a7c3a;
    font-weight: 600;
}

.answers-table tr.incorrect td {
    background-color: #ffeaea;
    color: #b80000;
    font-weight: 600;
}

.answers-table tr:nth-child(even) {
    background-color: #fafafa;
}

.answers-table tr:hover {
    background-color: #f0f0f0;
}

.results-container {
    margin-top: 10px;
    width: 100%;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px 6px;
    /* небольшой зазор между строками */
    overflow: hidden;
}

.results-table thead tr {
    background: #f1f1f1ff;
}

.results-table th {
    text-align: left;
    font-weight: 600;
    color: #333;
    padding: 12px 16px;
}

.results-table tbody tr {
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.results-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.results-table td {
    padding: 14px 16px;
    vertical-align: middle;
    color: #333;
    background-color: #fcfcfcff;
    /* background-color: #ccccccff; */
}

/* Цвет для ответов игрока */
.player-answer {
    font-weight: 600;
    transition: background 0.2s ease;
}

.player-answer.correct {
    background: #e8fff1;
    color: #0a7c3a;
}

.player-answer.incorrect {
    background: #ffeaea;
    color: #b80000;
}

.player-answer.correct:hover {
    background: #ddf8e8;
}

.player-answer.incorrect:hover {
    background: #ffd9d9;
}

.timer {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 10px;
    color: var(--color-theme-info);
}

.lobby-players {
    margin: 16px 0;
    text-align: center;
}

.players-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.player-item {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 10px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.player-name {
    font-size: 16px;
}
.player-role {
    color: #666;
    font-size: 13px;
}

.answers-list {
    list-style: none;
    padding: 0;
}

.answers-list li {
    background: #f9f9f9;
    margin: 4px 0;
    padding: 6px 10px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .results-container {
        padding: 0px;
    }

    .results-table th,
    .results-table td {
        padding: 10px;
        font-size: 10px;
    }
}

@media screen and (max-width: 960px) {
    main {
        padding: 20px 30px;
        width: 80%;
        min-height: 100px;
    }

    .player-answer {
        font-size: 10px;
    }

    .search-form {
        flex-direction: column;
    }

    header.page-header h1 {
        font-size: 18px;
    }

    .btn {
        height: 28px;
        margin: 5px 0;
        border-radius: 12px;
        font-size: 12px;
        padding: 5px 10px;
    }

    .actions {
        gap: 7px;
    }

    .input {
        margin: 10px 0;
        padding: 7px 15px;
        font-size: 12px;
    }

    .input::placeholder {
        font-size: 12px;
    }

    .card {
        padding: 10px;
        margin-top: 10px;
    }

    .card-info h3 {
        font-size: 14px;
    }

    .card-info p {
        font-size: 12px;
        margin: 3px 0;
    }

    .option-btn {
        font-size: 12px;
        padding: 7px 14px;
    }

    .background-text {
        font-size: 40px;
        line-height: 1.2;
    }

    .logo {
        top: 40px;
    }
    .logo img {
        height: 40px;
        opacity: 0.9;
    }
    .question-block h3 {
        font-size: 16px;
        font-weight: 600;
    }
    .option-btn {
        font-size: 14px;
    }
    .question-options {
        gap: 10px;
        margin: 10px 0;
    }

    .player-name {
        font-size: 12px;
    }
    .player-role {
        font-size: 10px;
    }
    .question-instructions {
        font-size: 16px;
    }
    .winner-block {
        font-size: 16px;
    }
    .timer {
        font-size: 14px;
    }
}