/* ШРИФТЫ ИГРОВОГО КЛИЕНТА (PT Sans) — нужны, чтобы canvas клиента не падал на дефолт */
@font-face {
    font-family: 'PT Sans';
    src: url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS55F.eot');
    src: url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS55F.eot?#iefix') format('embedded-opentype'),
    url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS55F.svg#my-font-family') format('svg'),
    url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS55F.woff') format('woff'),
    url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS55F.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'PT Sans Bold';
    src: url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS75F.eot');
    src: url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS75F.eot?#iefix') format('embedded-opentype'),
    url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS75F.svg#my-font-family') format('svg'),
    url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS75F.woff') format('woff'),
    url('https://cdn.quarantine-game.ru/client/library/assets/fonts/PTS75F.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* СТРАНИЦА */
html,
body {
    min-height: 100%;
    height: auto;
    margin: 0;
    background: var(--surface-black);
    font-size: 1.0rem;
    font-family: system-ui;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* СТИЛИЗАЦИЯ ИНПУТОВ */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--surface-grey-dark) inset !important;
    background-color: var(--surface-grey-dark) !important;
    background: var(--surface-grey-dark) !important;
    transition: none !important;
}
input::placeholder {
    opacity: 0;
}
body.dom-ready input::placeholder {
    opacity: 1;
}

/* Скрытое поле почты для менеджеров паролей (не display:none — иначе игнорируется) */
.username-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    clip: rect(0 0 0 0);
}

/* ====== СЛОЙ АВТОРИЗАЦИИ ====== */

.navigation a.active {
    text-decoration: underline;
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.15em;
}

/* ЗАГОЛОВОК И ЛОГОТИП */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-wrap: wrap;
    position: relative;
}

/* Заголовок */
.game-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-h1);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    margin-top: var(--spacing-top-h1);
    text-align: center;
    margin-bottom: 0;
    text-transform: uppercase;
    font-weight: 400;
}

/* Логотип */
.logo {
    width: min(444px, calc(100vw - 2.0rem));
    height: auto;
}

/* MAIN */
main {
    box-sizing: content-box;
    flex: 0 1 auto;
    gap: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-top-widget-basic);
    position: relative;
    width: 100%;
}
.auth-container {
    background: var(--background-opacity);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-grey-light);
    border-radius: 1.0rem;
    padding: 1.5rem var(--spacing-horizontal-form-auth);
    width: min(700px, calc(100vw));
    box-sizing: border-box;
    height: 570px;
    box-shadow: 0 10px 30px var(--background-opacity);
    display: flex;
    flex-direction: column;
    position: relative;
    text-align: center;
    justify-content: center;
}

/* Заголовок формы */
.auth-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-section-title);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    text-transform: uppercase;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 1.0rem;
}

/* Переключатель форм */
.switch-link {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-switch-link);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    text-transform: uppercase;
    display: inline-block;
}
.switch-link-anchor {
    color: var(--brand-red-600);
    text-decoration: none;
    transition: all 0.2s;
}
.switch-link-anchor:hover {
    color: var(--brand-red-500);
}
.switch-link-anchor:active {
    color: var(--brand-red-700);
}

/* ФОРМЫ АВТОРИЗАЦИИ, РЕГИСТРАЦИИ, СБРОСА И ИЗМЕНЕНИЯ ПАРОЛЯ */
.auth-form,
.recovery-form {
    display: flex;
    flex-direction: column;
    margin-top: 1.5rem;
}

/* Инпуты */
.login-email-field,
.login-password-field,
.registration-email-field,
.registration-password-field,
.reset-email-field,
.recovery-password-field,
.panel-password-field,
.panel-email-link-field {
    position: relative;
    margin-bottom: 2.0rem;
}
input[type="email"],
input[type="password"],
input[data-password-input] {
    width: 100%;
    box-sizing: border-box;
    padding: 1.0rem;
    border: 1px solid var(--surface-grey-light);
    border-radius: 0.75rem;
    background-color: var(--surface-grey-dark);
    color: var(--text-white);
    filter: var(--shadow-filter);
    transition: all 0.2s;
}
input[type="email"]:hover,
input[type="password"]:hover,
input[data-password-input]:hover {
    border-color: var(--text-white);
}
input[type="email"]:focus,
input[type="password"]:focus,
input[data-password-input]:focus {
    border-color: var(--text-white);
}

/* Рамка валидации инпута */
input.error {
    outline: 1px solid var(--brand-red-600);
    outline-offset: 1px;
}
input.success {
    outline: 1px solid var(--brand-green-600);
    outline-offset: 1px;
}

/* Переключатель видимости пароля */
.password-toggle {
    position: absolute;
    right: 1.0rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    outline: none;
    background: transparent;
    display: flex;
    cursor: pointer;
    padding: 5px;
}
.password-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-grey-dark);
    transition: all 0.2s;
}
.password-toggle svg:hover {
    color: var(--brand-red-600);
}
.password-toggle .icon-eye-off {
    display: none;
}
.password-toggle.visible .icon-eye {
    display: none;
}
.password-toggle.visible .icon-eye-off {
    display: block;
}

/* Сообщение валидации инпута */
.hint-message {
    position: absolute;
    top: 100%;
    color: var(--text-grey-dark);
    font-size: 0.9rem;
    text-shadow: var(--shadow-text-basic);
    text-align: left;
    pointer-events: none;
}
.hint-message.error {
    color: var(--brand-red-600);
}
.hint-message.success {
    color: var(--brand-green-600);
}

/* Чекбокс */
.checkbox-box {
    position: relative;
}
.checkbox-box input[type="checkbox"] {
    margin: 0;
    background: var(--surface-grey-dark);
    border: 1px solid var(--surface-grey-light);
    border-radius: 0.5rem;
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    display: block;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}
.checkbox-box input:hover {
    border-color: var(--brand-red-600);
}
.checkbox-box input:checked {
    background: var(--brand-red-600);
}
.checkbox-box input:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 35%;
    transform: translate(-50%, -35%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

/* Контейнер чекбокса, текста "Запомнить меня" и ссылки "Не помнишь пароль" */
.remember-me-container {
    display: flex;
    align-items: flex-start;
    gap: 1.0rem;
}

/* Текст "Запомнить меня" */
.remember-text {
    font-size: var(--font-size-checkbox);
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
}

/* Ссылка "Не помнишь пароль" */
.forgot-link {
    font-size: var(--font-size-checkbox);
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    display: flex;
    margin-left: auto;
    text-decoration: underline dashed;
    text-decoration-thickness: 0.05em;
    text-underline-offset: 0.15em;
    cursor: pointer;
    transition: all 0.2s;
}
.forgot-link:hover {
    color: var(--brand-red-600);
}
.forgot-link:active {
    color: var(--brand-red-700);
}

/* Контейнер чекбокса и текста со ссылками "Принимаю политику"" */
.terms-container {
    display: flex;
    align-items: flex-start;
    gap: 1.0rem;
}

/* Текст со ссылками "Принимаю политику" */
.checkbox-label {
    font-size: var(--font-size-checkbox);
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    text-align: left;
}
.checkbox-label a {
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    text-decoration: underline dashed;
    text-decoration-thickness: 0.05em;
    text-underline-offset: 0.15em;
    transition: all 0.2s;
}
.checkbox-label a:hover {
    color: var(--brand-red-600);
}
.checkbox-label a:active {
    color: var(--brand-red-700);
}

/* КНОПКИ */
.button {
    background: linear-gradient(to bottom, var(--brand-red-500), var(--brand-red-600), var(--brand-red-700));
    font-family: 'Roadkill', 'Roadkill Fallback';
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    height: 70px;
    border: none;
    border-radius: 0.75rem;
    font-size: 2.0rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    margin-top: 1.5rem;
    box-shadow:
    inset 4px 4px 8px rgba(255, 255, 255, 0.4),
    inset -4px -4px 8px rgba(0, 0, 0, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.4);
}
.button:hover {
    filter: brightness(1.1);
}
.button:active,
.button.active {
    filter: brightness(0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Сообщение верификации почты и пароля */
.verify-message {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-switch-link);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    text-transform: uppercase;
}
.verify-message.success {
    color: var(--brand-green-600);
}
.verify-message.error {
    color: var(--brand-red-600);
}

/* ВИДЖЕТЫ АВТОРИЗАЦИИ */
.auth-widgets {
    display: flex;
    flex-direction: column;
}

/* Текст */
.auth-buttons-text {
    font-size: var(--font-size-checkbox);
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    margin-top: 1.5rem;
    margin-bottom: 1.0rem;
}

/* Кнопки */
.auth-buttons{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    border: none;
    background: none;
}
.auth-buttons > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 0.875rem;
    background: transparent;
    cursor: pointer;
    transition: filter 0.2s, opacity 0.2s;
}
.auth-buttons > button:hover {
    filter: brightness(1.1);
}
.auth-buttons > button:active {
    filter: brightness(0.9);
}
.auth-buttons > button:disabled {
    cursor: default;
    opacity: 0.65;
}
.icon-auth-ya,
.icon-auth-vk,
.icon-auth-google {
    width: 40px;
    height: 40px;
}

/* КАПЧА */
.captcha-block {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 21.2rem;
    justify-content: center;
    z-index: 10;
    gap: 0.5rem;
    background: var(--surface-black);
    border-radius: 0.75rem;
}
.captcha-message {
    font-size: 0.75rem;
    margin: 0;
    color: var(--text-grey-light);
    text-shadow: var(--shadow-text-basic);
}
.captcha-message.success {
    color: var(--brand-green-600);
}
.captcha-message.error {
    color: var(--brand-red-600);
}

/* ВИДЖЕТ РЕЙТИНГА */
.rating-widget {
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    position: absolute;
    left: 2rem;
    top: 7.5%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.rating-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Иконка VKPLAY */
.vkplay_icon {
    height: 64px;
    width: 64px;
    vertical-align: middle;
    filter: var(--shadow-filter);
}

/* Иконка рейтинга */
.rating-circle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.rating-circle-icon {
    width: 67px;
    height: 64px;
    filter: var(--shadow-filter);
}
.rating-crown-icon {
    position: absolute;
    width: 42px;
    height: 41px;
    top: -35px;
    left: -13px;
    transform: rotate(-4deg);
    pointer-events: none;
    filter: var(--shadow-filter);
}

/* Значение рейтинга */
.rating-value {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-rating-title);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Текст "Оценка игроков" */
.rating-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-rating-title);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    white-space: nowrap;
    text-transform: uppercase;
}

/* Цитаты игроков */
.rating-quote {
    font-size: var(--font-size-text);
    color: var(--text-grey-light);
    text-shadow: var(--shadow-text-basic);
    font-style: italic;
    line-height: 1.6;
    text-wrap: balance;
    word-break: normal;
    overflow-wrap: normal;
}
.rating-quote + .rating-quote {
    margin-top: 1.0rem;
}

/* ВИДЖЕТ НОВОСТЕЙ */
.news-widget {
    width: min(1270px, calc(100vw));
}

/* Заголовок виджета */
.news-widget-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-section-title);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    font-weight: 400;
    text-align: center;
    text-transform: uppercase;
    margin-top: var(--spacing-top-widget-basic);
}

/* Карусель новостей */
.news-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-top: 5px;
}
.carousel-track {
    display: flex;
    gap: 1.0rem;
}

/* Стрелки карусели */
.carousel-arrow {
    position: relative;
    background: var(--background-opacity);
    color: var(--text-white);
    border: 1px solid var(--surface-grey-light);
    filter: var(--shadow-filter);
    width: 2.0rem;
    height: 2.0rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    display: grid;
    flex-shrink: 0;
    place-items: center;
    font-size: 1.0rem;
    line-height: 1;
    box-sizing: border-box;
    transition: all 0.2s;
}
.carousel-arrow.prev {
    margin-top: 5px;
    margin-right: -1.0rem;
}
.carousel-arrow.next {
    margin-top: 5px;
    margin-left: -1.0rem;
}
.carousel-arrow:hover:not(:disabled) {
    border-color: var(--brand-red-600);
}
.carousel-arrow:active:not(:disabled) {
    border-color: var(--brand-red-600);
    color: var(--brand-red-700);
}
.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Карточка новости */
.news-item-preview {
    background: var(--background-opacity);
    backdrop-filter: blur(10px);
    filter: drop-shadow(0 0 2px var(--background-opacity));
    border: 1px solid var(--surface-grey-light);
    border-radius: 1.0rem;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    aspect-ratio: 402 / 452;
}
.news-item-preview:hover {
    transform: translateY(-3px);
    border-color: var(--brand-red-600);
}
.news-item-preview:active {
    border-color: var(--brand-red-700);
}
.news-carousel .news-item-preview {
    flex: 0 0 calc((100% - 2.0rem) / 3);
    box-sizing: border-box;
    max-width: none;
    scroll-snap-align: start;
}

/* Картинка новости */
.news-preview-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 400 / 225;
    display: block;
    opacity: 0;
}
.news-preview-image.loaded {
    animation: imageFadeIn 1.0s ease-in-out forwards;
}
@keyframes imageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Заголовок новости */
.news-preview-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: var(--font-size-news-title);
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    margin: 1.0rem 1.5rem 0;
    font-weight: 400;
    text-transform: uppercase;
}

/* Дата новости */
.news-preview-date {
    font-size: var(--font-size-news-date);
    color: var(--text-grey-dark);
    text-shadow: var(--shadow-text-basic);
    margin: 1.0rem 1.5rem 0;
}

/* Текст новости */
.news-preview-text {
    font-size: var(--font-size-text);
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    margin: 0.5rem 1.5rem 0;
    flex-grow: 1;
}

/* Читать далее */
.news-preview-read-more {
    font-size: var(--font-size-text);
    color: var(--text-white);
    text-shadow: var(--shadow-text-basic);
    text-decoration: underline dashed;
    text-decoration-thickness: 0.05em;
    text-underline-offset: 0.15em;
    margin: 0 1.5rem 1.5rem;
    transition: all 0.2s;
}
.news-preview-read-more:hover {
    color: var(--brand-red-600);
}
.news-preview-read-more:active {
    color: var(--brand-red-700);
}

/* ====== СЛОЙ ИГРЫ ====== */
#game-screen {
    position: relative;
    height: var(--game-viewport-height, 100vh);
    display: flex;
    flex-direction: column;
    background: var(--surface-black);
}

/* ТОПБАР */
.topbar {
    position: relative;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.0rem;
    background: var(--surface-black);
    z-index: 2;
}

/* Кнопка МЕНЮ */
.menu-button {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: 1.5rem;
    color: var(--text-white);
    display: flex;
    align-items: center;
    margin-left: auto;
    text-transform: uppercase;
    padding: 0;
    gap: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.menu-button:hover {
    color: var(--brand-red-600);
}
.menu-button:active {
    color: var(--brand-red-700);
}
.menu-button svg {
    width: 30px;
    height: 30px;
    transition: all 0.2s;
    fill: var(--text-white);
}
.menu-button:hover svg {
    fill: var(--brand-red-600);
}
.menu-button:active svg {
    fill: var(--brand-red-700);
}

.menu-email-link-badge {
    position: absolute;
    top: -0.15rem;
    right: -0.2rem;
    width: 0.65rem;
    height: 0.65rem;
    border: 2px solid var(--surface-black);
    border-radius: 50%;
    background: var(--brand-green-500);
    box-shadow: 0 0 0.75rem color-mix(in srgb, var(--brand-green-500) 70%, transparent);
}

.email-link-nudge {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 1rem;
    width: min(350px, calc(100vw - 2rem));
    box-sizing: border-box;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--brand-green-500) 55%, transparent);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--surface-black) 92%, var(--brand-green-700));
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.55);
    color: var(--text-white);
    z-index: 4;
    animation: emailLinkNudgeIn 0.2s ease-out;
}
.email-link-nudge::before {
    content: '';
    position: absolute;
    right: 1.5rem;
    bottom: 100%;
    border: 0.5rem solid transparent;
    border-bottom-color: color-mix(in srgb, var(--surface-black) 92%, var(--brand-green-700));
}
.email-link-nudge-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: 1.15rem;
    text-transform: uppercase;
}
.email-link-nudge-text {
    margin-top: 0.45rem;
    color: var(--text-grey-light);
    line-height: 1.35;
}
.email-link-nudge-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.9rem;
}
.email-link-nudge-button {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    border: 0;
    border-radius: 0.6rem;
    color: var(--text-white);
    cursor: pointer;
    font-weight: 600;
}
.email-link-nudge-button.primary {
    flex: 1;
    background: var(--brand-green-600);
}
.email-link-nudge-button.secondary {
    background: transparent;
    color: var(--text-grey-light);
}
.email-link-nudge-button:hover {
    filter: brightness(1.12);
}
.email-link-nudge-button:focus-visible {
    outline: 2px solid var(--text-white);
    outline-offset: 2px;
}
@keyframes emailLinkNudgeIn {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ПРЕЛОДЕР */
.game-loading {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: 2.0rem;
    color: var(--text-white);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
    z-index: 1;
    pointer-events: none;
}

/* Анимация точек */
.game-loading .loading-dots {
    display: inline-flex;
    gap: 2px;
}
.game-loading .loading-dots span {
    opacity: 0;
    animation: loadingDot 1.2s infinite;
    will-change: transform, opacity;
}
.game-loading .loading-dots span:nth-child(1) {
    animation-delay: 0s;
}
.game-loading .loading-dots span:nth-child(2) {
    animation-delay: .2s;
}
.game-loading .loading-dots span:nth-child(3) {
    animation-delay: .4s;
}
@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ИГРОВАЯ ОБЛАСТЬ */
#game-root {
    flex: 1;
    height: calc(var(--game-viewport-height, 100vh) - var(--topbar-height));
    background: var(--surface-black);
    position: relative;
    overflow: hidden;
}

/* Оверлей затемнения */
.scrim {
    position: fixed;
    inset: 0;
    background: var(--background-opacity);
    z-index: 2;
    display: none;
}
.scrim.show {
    display: block;
}

/* БОКОВОЕ МЕНЮ */
.sidepanel {
    position: fixed;
    top: 0;
    right: 0;
    height: var(--game-viewport-height, 100vh);
    width: min(455px, 95vw);
    background: var(--surface-black);
    color: var(--text-white);
    transform: translateX(100%);
    transition: all 0.2s;
    z-index: 2;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 0 1.0rem 1.0rem;
    font-size: 0.9rem;
}
.sidepanel.open {
    transform: translateX(0);
}

/* Блок заголовка */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
}

/* Заголовок МЕНЮ */
.panel-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: 1.5rem;
    text-transform: uppercase;
}

/* Кнопка Закрыть МЕНЮ */
.panel-close {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
}
.panel-close svg {
    width: 25px;
    height: 25px;
    fill: var(--text-white);
    transition: all 0.2s;
}
.panel-close svg:hover {
    fill: var(--brand-red-600);
}
.panel-close svg:active {
    fill: var(--brand-red-700);
}

/* Блок контента */
.panel-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Секция */
.panel-section {
    display: flex;
    flex-direction: column;
    gap: 1.0rem;
    margin-top: 1.0rem;
}
.panel-section + .panel-section {
    padding-top: 1.0rem;
    position: relative;
}
.panel-section + .panel-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    right: -8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Заголовок секции */
.panel-section-title {
    font-family: 'Roadkill', 'Roadkill Fallback';
    font-size: 1.1rem;
    text-transform: uppercase;
}
.panel-section-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Секция Профиль */
.panel-profile-body {
    display: grid;
    grid-template-columns: 115px 1fr;
    color: var(--text-grey-light);
}

/* Подтверждение почты */
.panel-profile-email {
    display: flex;
    flex-direction: column;
}
.panel-profile-email .unlinked {
    color: var(--brand-red-600);
}
.panel-profile-email-warning {
    margin: 1.0rem 0;
}
.panel-profile-email-status {
    color: var(--brand-red-600);
    text-transform: uppercase;
}
.panel-profile-email-hint {
    margin-bottom: 0.5rem;
    color: var(--text-grey-light);
}

/* Секция Привязка почты */
.panel-email-link-body,
.panel-email-link-form {
    display: flex;
    flex-direction: column;
}
.panel-email-link-text {
    color: var(--text-grey-light);
    margin-bottom: 0.5rem;
}
.panel-email-link-recommended {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-green-600) 35%, transparent);
    color: var(--brand-green-500);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.panel-email-link.nudge-target {
    border-radius: 0.75rem;
    animation: emailLinkTargetPulse 0.8s ease-out;
}
@keyframes emailLinkTargetPulse {
    50% {
        box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--brand-green-500) 30%, transparent);
    }
}
.panel-email-link-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 480px) {
    .email-link-nudge {
        right: 0.5rem;
        width: calc(100vw - 1rem);
    }
    .email-link-nudge-actions {
        flex-direction: column;
    }
    .panel-email-link-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .email-link-nudge,
    .panel-email-link.nudge-target {
        animation: none;
    }
}

/* Секция Пароль */
.panel-password-section {
    display: flex;
    flex-direction: column;
}

/* Секция Поддержка */
.panel-support-body {
    display: flex;
    flex-direction: column;
}
.panel-support-text {
    display: flex;
    flex-direction: column;
    color: var(--text-grey-light);
    margin-bottom: 0.5rem;
}

/* Секция Ссылки */
.panel-links-body {
    display: flex;
    flex-direction: column;
}

/* Ссылка */
.panel-link {
    color: var(--text-white);
    text-decoration: underline dashed;
    text-decoration-thickness: 0.05em;
    text-underline-offset: 0.15em;
    transition: all 0.2s;
    font-size: 1.0rem;
    margin-bottom: 0.5rem;
}
.panel-link:hover {
    color: var(--brand-red-600);
}
.panel-link:active {
    color: var(--brand-red-700);
}

/* Секция логаута */
.panel-logout {
    display: flex;
    flex-direction: column;
    padding-top: 1.0rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Кнопки бокового меню */
.panel-button {
    font-family: 'Roadkill', 'Roadkill Fallback';
    color: var(--text-white);
    text-shadow: var(--shadow-text-brand);
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow:
    inset 4px 4px 8px rgba(255, 255, 255, 0.4),
    inset -4px -4px 8px rgba(0, 0, 0, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.4);
}
.panel-button:hover {
    filter: brightness(1.1);
}
.panel-button:active,
.panel-button.active {
    filter: brightness(0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.panel-button.green {
    background: linear-gradient(to bottom, var(--brand-green-500), var(--brand-green-600), var(--brand-green-700));
}
.panel-button.blue {
    background: linear-gradient(to bottom, #0099ee, #0088cc, #006699);
}
.panel-button.red {
    background: linear-gradient(to bottom, var(--brand-red-500), var(--brand-red-600), var(--brand-red-700));
}
.panel-button.grey {
    background: linear-gradient(to bottom, var(--surface-grey-light), var(--surface-grey-dark));
}
.panel-button svg {
    width: 25px;
    height: 25px;
}

/* ===== СЛОЙ ТОСТА ===== */
.toast {
    position: fixed;
    top: 5.0rem;
    right: 2.5rem;
    margin-left: 2.5rem;
    background: color-mix(in srgb, var(--brand-green-600) 50%, transparent);
    backdrop-filter: blur(10px);
    color: var(--text-white);
    padding: 1.5rem 1.5rem;
    border-radius: 1.0rem;
    box-shadow: 0 10px 20px var(--background-opacity);
    z-index: 4;
    font-size: var(--font-size-toast);
    display: none;
    align-items: center;
    gap: 1.0rem;
    animation: slideIn .2s ease forwards;
    will-change: transform, opacity;
}
.toast.show {
    display: inline-flex;
}
.toast.error {
    background: color-mix(in srgb, var(--brand-red-600) 50%, transparent);
}
.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.panel-close {
    margin: 0;
    padding: 0;
}
.panel-close svg {
    width: 20px;
    height: 20px;
}
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ====== МЕДИА ЗАПРОСЫ ====== */
@media (max-width: 1440px) {
    /* Позиционирование виджета рейтинга на экранах до 1440px */
    .auth-container {
        order: 1;
    }
    .rating-widget {
        position: static;
        order: 2;
        max-width: 100%;
        width: min(700px, calc(100vw - 2.0rem));
        text-align: center;
        align-items: center;
        margin-top: var(--spacing-top-widget-rating);
    }
    .news-widget {
        order: 3;
    }
}

@media screen and (min-width: 769px) and (max-width: 1280px) {
    /* 2 карточки новостей */
    .news-widget {
        max-width: 852px;
    }
    .news-carousel .news-item-preview {
        flex: 0 0 calc((100% - 1rem) / 2);
        scroll-snap-align: start;
    }
    .carousel-track {
        gap: 1.0rem;
    }
}

@media screen and (max-width: 768px) {
    /* 1 карточка новостей */
    .news-widget {
        max-width: 434px;
    }
    .news-carousel .news-item-preview {
        flex: 0 0 calc(100% - 0rem);
        scroll-snap-align: start;
    }

    /* Уменьшение кнопок */
    .button {
        font-size: 1.8rem;
        height: 60px;
    }
}

@media screen and (max-width: 480px) {
    /* Уменьшение кнопок */
    .button {
        font-size: 1.6rem;
        height: 50px;
    }

    /* Позиционирование стрелок карусели */
    .carousel-arrow.prev {
        margin-right: -2.0rem;
    }
    .carousel-arrow.next {
        margin-left: -2.0rem;
    }
}

@media screen and (max-width: 440px) {
    /* Позиционирование капчи */
    .captcha-block {
        top: 22.3rem;
    }
}

@media screen and (max-width: 360px) {
    /* Позиционирование капчи */
    .captcha-block {
        top: 22.6rem;
    }
}

/* === FOUC-фикс: начальное состояние формы до первого setAuthMode() === */
html.auth-static input::placeholder { opacity: 1; } /* перебивает гейтинг плейсхолдеров */

html.auth-static-login #authForm,
html.auth-static-registration #authForm { display: flex !important; } /* перебивает inline display:none; flex-direction:column из .auth-form */

/* Режим "Вход" — зеркало setAuthMode('login') */
html.auth-static-login .registration-email-field,
html.auth-static-login .reset-email-field,
html.auth-static-login .registration-password-field,
html.auth-static-login .terms-container { display: none; }

/* Режим "Регистрация" — зеркало setAuthMode('registration') */
html.auth-static-registration .login-email-field,
html.auth-static-registration .reset-email-field,
html.auth-static-registration .login-password-field,
html.auth-static-registration .remember-me-container { display: none; }
html.auth-static-registration #authForm .button.login { display: none; }
html.auth-static-registration #authForm .button.registration { display: inline-block !important; } /* перебивает .hidden */
