:root {
    --bg: #efefef;
    --card: #ffffff;
    --text: #1c1e21;
    --muted: #6a6a6a;
    --primary: #d25a0b;
    --primary-dark: #b34d09;
    --teal: #08596d;
    --danger: #b70404;
    /* ширина контейнера: телефон <768, планшет 768–1023, десктоп ≥1024 */
    --container: 640px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 12px 12px 48px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #333333;
    color: #fff;
    border-bottom: 1px solid #ffb435;
    box-shadow: 0 2px 0 #ec8d00;
}

.topbar .brand {
    color: #fff;
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-weight: 700;
    text-decoration: none;
    margin-right: auto;
}

.topbar .user {
    color: #d1d5db;
    font-size: 0.85rem;
}

.topbar .toplink {
    color: #d1d5db;
    font-size: 0.85rem;
    text-decoration: none;
}

.topbar .toplink:hover {
    color: #ffffff;
    text-decoration: underline;
}

.linklike {
    background: none;
    border: 0;
    color: var(--teal);
    text-decoration: underline;
    cursor: pointer;
    padding: 6px;
    font-size: 0.85rem;
}

.linklike:hover {
    color: var(--primary-dark);
}

.linkdanger {
    color: var(--danger);
}

.linkdanger:hover {
    color: #7f1111;
}

.card {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Карточка текущей игры: название, статус, даты и таймеры */
.game-info {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #ffe0a3;
    background: linear-gradient(180deg, #fffaf0, #fff7e6);
    color: #4a3200;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.game-info-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.game-info-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.game-info-status {
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffe9b8;
    color: #7a4d00;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.game-info-status-live {
    background: #e3f6e8;
    color: #1d6b3a;
}

.game-info-status-test {
    background: #e5eefc;
    color: #1f4f9a;
}

.game-info-status-finished,
.game-info-status-archived {
    background: #ececec;
    color: #555;
}

.game-info-rows {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.game-info-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: .95rem;
}

.game-info-row > span:first-child {
    color: #8a6a1f;
}

.game-info-timer {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.game-info a {
    color: #7a4d00;
    text-decoration: underline;
}

.game-info a:hover {
    color: #4a3200;
}

@media (max-width: 767px) {
    .game-info-row {
        flex-direction: column;
        gap: 1px;
    }
}

/* справка: предупреждение о регистре */
.help-note {
    background: #fff6e8;
    border-left: 3px solid var(--primary);
    padding: 8px 10px;
}

/* Справка: оглавление и разделы */
.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.help-toc a {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    color: var(--teal);
    font-size: 0.85rem;
    text-decoration: none;
}

.help-toc a:hover {
    border-color: var(--primary);
    background: #fff6e8;
}

.help-section {
    margin-top: 22px;
}

.help-section h2 {
    color: var(--teal);
    scroll-margin-top: 80px;
}

.help-section ul,
.help-section ol {
    padding-left: 22px;
}

.help-section li {
    margin-bottom: 6px;
}

h1 {
    font-size: 1.25rem;
    margin: 0.2em 0 0.4em;
}

h2 {
    font-size: 1.05rem;
    margin: 0 0 0.5em;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    border: 2px solid transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    animation: flash-pop .18s ease-out;
}

.flash-icon {
    flex: none;
    font-size: 1.15rem;
    line-height: 1.2;
}

.flash-success {
    background: #dcfce7;
    color: #14532d;
    border-color: #22c55e;
    box-shadow: 0 2px 12px rgba(34, 197, 94, .28);
}

.flash-error {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #ef4444;
    box-shadow: 0 2px 12px rgba(239, 68, 68, .25);
}

.flash-info {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #3b82f6;
    box-shadow: 0 2px 12px rgba(59, 130, 246, .25);
}

@keyframes flash-pop {
    from {
        transform: translateY(-4px) scale(.98);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.banner {
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
}

.banner-info {
    background: #dbeafe;
}

.banner-error {
    background: #fee2e2;
}

.banner-success {
    background: #dcfce7;
}

.task-refresh-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px solid var(--warm-line);
    border-radius: 9px;
    background: var(--warm);
    color: var(--text);
    font-size: 11px;
}

.task-refresh-banner[hidden] {
    display: none;
}

.task-refresh-banner span {
    min-width: 0;
}

@media (max-width: 480px) {
    .task-refresh-banner {
        align-items: flex-start;
        flex-direction: column;
    }
}

.score {
    margin: 10px 0 4px;
}

.progressbar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin: 6px 0 14px;
}

.progressbar span {
    display: block;
    height: 100%;
    background: var(--primary);
}

.timer {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    padding: 8px 10px;
    border-radius: 8px;
    margin: 8px 0;
    font-variant-numeric: tabular-nums;
}

.timer-warning {
    background: #ffedd5;
    font-weight: 600;
}

.hint {
    background: var(--card);
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.hint-closed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hint-body {
    margin-top: 6px;
}

.answer-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.code-input {
    font-size: 1.15rem;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 100%;
}

.code-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(210, 90, 11, 0.15);
}

.bonus-input {
    padding: 9px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-width: 0;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9rem;
    background: #e5e7eb;
    color: #111827;
}

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

.row-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.bonus-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.codes {
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Панель принятых кодов — в стиле бонусов */
.codes-panel {
    margin-top: 10px;
    padding: 8px 12px;
    border-left: 4px solid var(--sr-line-1, #ffb435);
    background: #fff9e6;
    border-radius: .25rem;
}

.codes-panel summary {
    cursor: pointer;
    font-weight: 700;
}

.codes-empty {
    padding: 9px 0 2px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.code-chips {
    margin-top: 6px;
}

.code-chip {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: .22em .7em;
    background: #ffffff;
    border: 1px solid var(--sr-line-1, #ffb435);
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.3;
}

.code-chip .code-weight {
    color: #7a4d00;
    font-weight: 600;
}

.login-card {
    max-width: 380px;
    margin: 8vh auto 0;
}

.login-card h1 {
    color: var(--teal);
}

/* Вход через основной сайт */
.oauth-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.oauth-sep::before,
.oauth-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.btn-oauth {
    background: #08596d;
    color: #ffffff;
}

.btn-oauth:hover {
    background: #064654;
}

/* Профиль */
.profile-card {
    max-width: 720px;
    margin: 24px auto;
}

.profile-card h1 {
    color: var(--teal);
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex: 0 0 64px;
}

.profile-avatar-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.profile-facts {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 12px;
    margin: 0 0 18px;
}

.profile-facts dt {
    color: #6b7280;
}

.profile-facts dd {
    margin: 0;
}

.profile-h2 {
    font-size: 1rem;
    color: var(--teal);
    margin: 20px 0 8px;
}

.profile-inline-form {
    margin: 6px 0 0;
}

@media (max-width: 639.98px) {
    .profile-facts {
        grid-template-columns: 1fr;
    }
}

.form-row {
    margin-bottom: 10px;
}

.form-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.form-row input {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.field-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
}

.inline {
    display: inline;
}

/* состав команды на странице «Моя команда» */
.team-roster {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.team-roster-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    background: #fff;
}

.team-avatar-wrap {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
}

.team-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    border: 1px solid rgba(0, 0, 0, .06);
}

.team-avatar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--teal);
    background: linear-gradient(145deg, #e8f7f7, #d9eeee);
}

.team-member-main {
    flex: 1 1 190px;
    min-width: 0;
}

.team-member-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-weight: 700;
    line-height: 1.25;
}

.team-member-login {
    margin-top: 1px;
    font-size: .78rem;
    color: #6b7280;
}

.team-member-meta {
    margin-top: 1px;
    font-size: .78rem;
    color: #8a94a6;
}

.team-captain-badge {
    display: inline-flex;
    align-items: center;
    padding: .1em .55em;
    border: 1px solid #ffb435;
    border-radius: 999px;
    background: #fff3d6;
    color: #7a4d00;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
    text-transform: lowercase;
}

.team-member-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding-left: 64px;
}

.team-roster-empty {
    padding: 10px 0;
}

@media (min-width: 700px) {
    .team-member-actions {
        width: auto;
        padding-left: 0;
        flex-direction: column;
        align-items: flex-end;
    }
}

.team-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.team-list li {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid #eef0f3;
}

.team-list li:last-child {
    border-bottom: 0;
}

/* картинки в описаниях заданий и подсказок не вылезают за экран */
.task-body img,
.hint-body img {
    max-width: 100%;
    height: auto;
}

.sr-impersonate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .4rem .8rem;
    background: #fff3cd;
    border-bottom: 1px solid #ffe08a;
    color: #7a5b00;
    font-size: .9rem;
}

.sr-impersonate form { margin: 0; }

.sr-impersonate button {
    border: 0;
    border-radius: .25rem;
    padding: .25rem .6rem;
    background: #7a5b00;
    color: #fff;
    cursor: pointer;
}

/* Уведомления командам */
.player-notices { margin-bottom: .75rem; }

.notice {
    border-left: 4px solid #17a2b8;
    background: #f3fafc;
    border-radius: .25rem;
    padding: .5rem .75rem;
    margin-bottom: .5rem;
}

.notice-warning { border-left-color: #e0a800; background: #fff9e6; }
.notice-urgent { border-left-color: #dc3545; background: #fdecee; }

.notice-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.notice-task { text-transform: none; }

.notice-toggle { font-size: .8rem; color: #6c757d; text-decoration: underline; }

.notice-body { margin: .25rem 0; }

.notice-ack { margin: 0; }
.notice-ack button { padding: .1rem .6rem; }

.notice-updated { font-size: .8rem; color: #856404; }

.notice.is-collapsed .notice-body { display: none; }

.player-notices-acked { margin-top: .5rem; }

.notice.is-acked {
    font-size: .85rem;
    color: #6c757d;
    border-left-width: 3px;
    padding: .35rem .6rem;
    opacity: .85;
}

.notice-acked-mark { font-weight: 600; margin-right: .25rem; }

.notice-modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.notice-modal {
    background: #fff;
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

.notice-modal-title { font-weight: 700; color: #dc3545; margin-bottom: .5rem; }

.notice-modal-actions { display: flex; justify-content: flex-end; margin-top: .75rem; }

/* Тестовый прогон: предупреждающая полоса на игровом экране */
.sr-test-strip {
    background: repeating-linear-gradient(45deg, #ffc107 0 14px, #212529 14px 28px);
    color: #fff;
    text-align: center;
    font-weight: 700;
    letter-spacing: .12em;
    padding: 7px 10px;
    font-size: .9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

/* Анонс боевой игры перед формой входа */
.login-game-banner {
    max-width: 380px;
    margin: 8vh auto 0;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff7e6;
    border: 1px solid #ffe0a3;
    color: #7a4d00;
    text-align: center;
}

.login-game-banner + .login-card {
    margin-top: 12px;
}

.login-game-banner .login-game-title {
    font-weight: 700;
    font-size: 1.02rem;
    margin-bottom: 4px;
}

.login-game-banner .login-game-forum {
    margin-top: 6px;
    font-weight: 600;
}

.login-game-banner .login-game-forum a {
    color: inherit;
    text-decoration: underline;
}

.login-game-banner .login-game-forum a:hover {
    color: #4a3200;
}

/* Бейджи команды и игрока на игровых экранах */
.sr-team-badge,
.sr-player-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    line-height: 1.25;
    white-space: nowrap;
}

.sr-team-badge {
    padding: .28em .8em;
    border: 1px solid var(--sr-line-1, #ffb435);
    background: #fff3d6;
    color: #7a4d00;
    font-size: 1.05rem;
    font-weight: 700;
}

.sr-player-badge {
    margin-left: 4px;
    padding: .24em .6em;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

/* Полученные бонусы на экране задания */
.bonus-item {
    font-weight: 600;
}

/* Журнал команды: серый спойлер внизу экрана задания */
.team-journal {
    margin: 14px 0 4px;
    background: #f4f4f6;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    padding: 8px 12px;
}

.team-journal summary {
    cursor: pointer;
    color: #5c5c66;
    font-size: .95rem;
    font-weight: 600;
}

.team-journal-list {
    list-style: none;
    margin: 8px 0 4px;
    padding: 0;
    font-size: .9rem;
    color: #3f3f46;
}

.team-journal-list li {
    padding: 4px 0;
    border-top: 1px solid #e7e7ec;
}

.team-journal-list li:first-child {
    border-top: 0;
}

.team-journal-time {
    color: #8a8a94;
    margin-right: 6px;
    font-variant-numeric: tabular-nums;
}

.team-journal-icon {
    margin-right: 4px;
}

/* ─── Классический адаптив: три класса устройств ─────────────────────────
   телефон < 768 · планшет 768–1023 (одна колонка) · десктоп ≥ 1024        */

@media (min-width: 768px) {
    :root {
        --container: 720px;
    }

    .container {
        padding: 16px 16px 56px;
    }

    .login-card,
    .login-game-banner {
        max-width: 440px;
    }
}

/* Планшеты и небольшие ноутбуки: подсказки остаются справа, если
   для них хватает места. Иначе они уезжали под задание на второй строке. */
@media (min-width: 768px) and (max-width: 1023.98px) {
    :root {
        --container: 960px;
    }

    .task-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(250px, 290px);
        column-gap: 18px;
        align-items: start;
    }

    .task-main {
        grid-column: 1;
        grid-row: 1;
    }

    .task-side {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .task-play {
        grid-column: 1;
        grid-row: 2;
    }

    .task-layout > .team-journal {
        grid-column: 1 / -1;
    }

    .task-main > :first-child,
    .task-play > :first-child {
        margin-top: 0;
    }

    body.page-player-game-task-single {
        --container: 720px;
    }

    body.page-player-game-task-single .task-layout {
        display: block;
    }
}

@media (min-width: 1024px) {
    :root {
        --container: 1080px;
    }

    h1 {
        font-size: 1.5rem;
    }

    /* экран задания: слева задание и ввод, справа подсказки, журнал — под ними */
    .task-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
        column-gap: 20px;
        align-items: start;
    }

    .task-main {
        grid-column: 1;
        grid-row: 1;
    }

    .task-side {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .task-play {
        grid-column: 1;
        grid-row: 2;
    }

    .task-layout > .team-journal {
        grid-column: 1 / -1;
    }

    .task-main > :first-child,
    .task-play > :first-child {
        margin-top: 0;
    }

    /* «Моя команда»: постоянная команда слева, команда в игре справа */
    .team-columns {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 20px;
        align-items: start;
    }

    /* если боковая колонка пуста (нет игры / нет подсказок) — одна узкая колонка */
    body.page-player-team-index-single,
    body.page-player-game-task-single {
        --container: 720px;
    }

    body.page-player-team-index-single .team-columns,
    body.page-player-game-task-single .task-layout {
        display: block;
    }

    /* страницы из одной карточки на десктопе не растягиваем */
    body.page-player-game-help {
        --container: 820px;
    }

    body.page-player-game-waiting,
    body.page-player-game-finished,
    body.page-player-game-no-team,
    body.page-player-game-no-game,
    body.page-player-game-skip-confirm,
    body.page-account-auth-login,
    body.page-account-auth-register,
    body.page-account-auth-forgot,
    body.page-account-auth-reset {
        --container: 640px;
    }
}

/* ============================================================
   Публичный каталог команд и общие секции истории
   ============================================================ */

.teams-head {
    margin: 0 0 16px;
}

.teams-head--view {
    margin-bottom: 18px;
}

.teams-eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.teams-head h1 {
    margin: 0;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.teams-subtitle {
    max-width: 680px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.teams-back {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.teams-back:hover { text-decoration: underline; }

.teams-search {
    margin-bottom: 14px;
    padding: 10px 12px;
}

.teams-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.teams-search-form input[type="text"] {
    flex: 1 1 210px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #d9dee4;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
}

.teams-clear {
    color: var(--muted);
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.teams-directory {
    display: grid;
    gap: 12px;
}

.team-directory-card {
    display: block;
    padding: 15px;
    border: 1px solid #e4e7eb;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .035);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.team-directory-card:hover {
    transform: translateY(-2px);
    border-color: #c8d4da;
    box-shadow: 0 10px 24px rgba(17, 24, 39, .07);
}

.team-directory-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.team-directory-avatars {
    display: flex;
    align-items: center;
    min-height: 32px;
}

.team-mini-avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin-left: -8px;
    border: 2px solid #fff;
    font-size: 10px;
}

.team-directory-avatars .team-mini-avatar:first-child { margin-left: 0; }

.team-mini-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #eef3f5;
    color: #5e707b;
    font-size: 9px;
    font-weight: 700;
}

.team-directory-open {
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.team-directory-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 9px 0 2px;
}

.team-directory-title-row .team-directory-title {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.team-directory-title-row .team-directory-open {
    margin-left: auto;
}

.team-directory-title {
    margin: 9px 0 2px;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -.025em;
}

.team-directory-motto {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
}

.team-directory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #62707a;
    font-size: 11px;
}

.team-directory-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}

.team-directory-stats span {
    padding: 5px 8px;
    border-radius: 8px;
    background: #f4f7f8;
    color: #5c6a74;
    font-size: 10px;
}

.team-directory-stats b {
    margin-right: 2px;
    color: var(--teal);
    font-size: 12px;
}

.team-directory-foot {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #edf0f2;
    color: #8a96a0;
    font-size: 10px;
}

.team-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
    color: var(--muted);
    font-size: 11px;
}

.team-pager a {
    color: var(--teal);
    font-weight: 700;
    text-decoration: none;
}

.team-pager a:hover { text-decoration: underline; }

/* --- секции страницы команды --- */

.team-jump {
    position: sticky;
    top: 68px;
    z-index: 6;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 6px;
    margin: 0 0 16px;
    border: 1px solid rgba(228, 231, 235, .95);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(9px);
    box-shadow: 0 5px 18px rgba(17, 24, 39, .05);
}

.team-jump a {
    flex: 1;
    min-width: 125px;
    padding: 7px 10px;
    border-radius: 7px;
    color: #46545e;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.team-jump a:hover { background: #f1f6f7; color: var(--teal); }
.team-jump span { margin-right: 5px; color: var(--primary); }

.team-section {
    margin: 0 0 20px;
    border: 1px solid rgba(17, 24, 39, .06);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 9px 24px rgba(17, 24, 39, .055);
    scroll-margin-top: 76px;
}

.team-section--team { background: #f8fbfc; }
.team-section--game { background: #fffaf4; }
.team-section--history { background: #f6f8f9; }

.team-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    color: #fff;
}

.team-section--team .team-section-head { background: linear-gradient(120deg, #08596d, #0d7d91 58%, #0b6b7d); }
.team-section--game .team-section-head { background: linear-gradient(120deg, #9a3e06, #d25a0b 58%, #e16b14); }
.team-section--history .team-section-head { background: linear-gradient(120deg, #20363c, #08596d 62%, #0b7184); }

.team-section-num {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.team-section-head h2 {
    margin: 0;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 19px;
    line-height: 1.1;
}

.team-section-head p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, .7);
    font-size: 10px;
}

.team-section-icon {
    margin-left: auto;
    font-size: 22px;
    opacity: .9;
}

.team-section-body { padding: 14px; }

.team-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 20px;
    border-radius: 14px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 86% 12%, rgba(255, 157, 46, .2), transparent 27%),
        radial-gradient(circle at 76% 90%, rgba(34, 211, 238, .15), transparent 30%),
        linear-gradient(135deg, #073f4d, #08596d 48%, #0a6f83);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}

.team-hero-main { min-width: 0; }
.team-hero-kicker {
    color: #8ed8e4;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.team-hero-title {
    position: relative;
    z-index: 1;
    margin: 5px 0 2px;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.team-hero-motto {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 500px;
    color: #d3edf1;
    font-size: 12px;
}

.team-hero-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 13px;
}

.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #e7f6f8;
    font-size: 9px;
}

.team-chip b { color: #fff; }

.team-hero-side {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 9px;
}

.team-logo {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.team-hero-logo {
    width: 78px;
    height: 78px;
    border: 3px solid rgba(255, 255, 255, .35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

.team-directory-logo {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.team-logo-preview {
    width: 64px;
    height: 64px;
    border: 2px solid var(--line);
}

.team-logo-profile {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    margin-right: 10px;
    border: 2px solid var(--line);
}

.team-logo-editor {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 12px;
}

.team-hero-avatars {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    padding-left: 9px;
}

.team-hero-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin-left: -9px;
    border: 2px solid #08596d;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.team-hero-avatars .team-hero-avatar:first-child { margin-left: 0; }

.team-hero-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.team-roster-card { margin-top: 12px; }
.team-roster-card h2 { margin-top: 0; }

.team-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 12px;
}

.team-stat {
    position: relative;
    padding: 13px 12px;
    border: 1px solid #e4e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.team-stat::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e8f4f6;
}

.team-stat:nth-child(2)::after { background: #fff1cf; }
.team-stat:nth-child(3)::after { background: #fde5d4; }
.team-stat:nth-child(4)::after { background: #e8f7ee; }
.team-stat-icon { position: relative; z-index: 1; font-size: 16px; }
.team-stat-value {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 5px;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 25px;
    line-height: 1;
    letter-spacing: -.04em;
}

.team-stat-label {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.team-history-card { margin-bottom: 12px; }
.team-history-card h2 { margin-top: 0; }

.team-achievements {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.team-achievement {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px;
    border: 1px solid #e4e7eb;
    border-radius: 11px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease;
}

.team-achievement:hover { transform: translateY(-2px); border-color: #cbd5dd; }

.team-medal {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff1cf, #ffd88b);
    font-size: 16px;
}

.team-achievement b { font-size: 11px; }
.team-achievement-game { display: block; font-size: 11px; font-weight: 700; line-height: 1.2; }
.team-achievement .muted { display: block; margin-top: 1px; }

.team-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.team-history-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 100px 74px 18px;
    gap: 8px;
    align-items: center;
    padding: 9px 2px;
    border-bottom: 1px solid #edf0f2;
    font-size: 11px;
}

.team-history-row:last-child { border-bottom: 0; }
.team-history-row:hover { background: #fbfcfd; }

.team-history-date { color: var(--muted); font-size: 9px; }
.team-history-game { min-width: 0; }
.team-history-game a {
    display: block;
    overflow: hidden;
    color: var(--teal);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.team-history-game a:hover { text-decoration: underline; }
.team-history-game .small { display: block; margin-top: 1px; }
.team-history-rank { text-align: center; color: #4d5b65; white-space: nowrap; }
.team-history-medal { margin-right: 2px; font-size: 13px; }
.team-history-points { text-align: right; color: #3f4b55; font-weight: 700; }
.team-history-arrow { color: #aab4bd; text-align: right; text-decoration: none; }

.team-history-status {
    display: inline-flex;
    padding: 3px 5px;
    border-radius: 999px;
    background: #f1f3f5;
    color: #7b8792;
    font-size: 8px;
    white-space: nowrap;
}

.team-history-note {
    margin: 10px 2px 0;
    color: #87939d;
    font-size: 9px;
}

.team-empty {
    padding: 14px;
    border: 1px dashed #cfd8df;
    border-radius: 10px;
    background: rgba(255, 255, 255, .55);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 760px) {
    .team-section-body { padding: 10px; }
    .team-section-head { padding: 11px 13px; }
    .team-section-head h2 { font-size: 17px; }
    .team-hero { grid-template-columns: 1fr; padding: 17px; }
    .team-hero-side { align-items: flex-start; }
    .team-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-achievements { grid-template-columns: 1fr; }
    .team-history-row {
        grid-template-columns: 52px minmax(0, 1fr) 58px 18px;
    }
    .team-history-rank { text-align: left; }
    .team-history-points { grid-column: 2; grid-row: 2; text-align: left; font-size: 9px; }
    .team-history-arrow { grid-column: 4; grid-row: 1 / span 2; }
    .team-jump a { min-width: 105px; }
}

/* ============================================================
   Стартовая, профиль и справка — 27.10.2026
   ============================================================ */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 13px;
}

.page-head h1 {
    margin: 1px 0 0;
    color: var(--teal);
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

@media (max-width: 639.98px) {
    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--teal);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ghost-btn:hover {
    border-color: var(--teal);
    color: var(--primary);
}

.start-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: min(100%, 720px);
    min-height: calc(100vh - 190px);
    margin: 0 auto;
    padding: 28px 0 44px;
    text-align: center;
}

.start-page--empty {
    min-height: calc(100vh - 220px);
}

.start-brand {
    margin: 0;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 800;
    line-height: .96;
    letter-spacing: -.055em;
}

.start-brand span { color: var(--primary); }
.start-brand small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-family: Verdana, Arial, sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.start-tagline {
    max-width: 490px;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
}

.start-game {
    width: min(100%, 680px);
    max-width: 680px;
    margin: 0;
    padding: 14px 18px;
    border: 1px solid var(--warm-line, #ffe0a3);
    border-radius: 14px;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 140, 0, .14), transparent 30%),
        linear-gradient(135deg, var(--warm, #fff7ed), var(--card, #fff));
    text-align: left;
}

.start-game-top {
    display: flex;
    align-items: center;
    gap: 11px;
}

.start-game-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 11px;
    font-weight: 800;
}

.start-game-main { flex: 1; min-width: 0; }
.start-game-title { font-weight: 700; font-size: 15px; }
.start-game-meta { margin-top: 2px; color: var(--muted); font-size: 10px; }
.start-game-status { margin-top: 9px; }

.start-auth {
    width: min(100%, 420px);
    padding: 20px;
    margin: 0;
    text-align: left;
}

.start-auth h2 {
    margin: 0 0 4px;
    color: var(--teal);
    font-size: 20px;
    text-align: center;
}

.start-auth > p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.start-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
    color: var(--muted);
    font-size: 10px;
}

.start-sep::before,
.start-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.start-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}

.start-links a {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.start-links a:hover { border-color: var(--teal); }

.start-footnote {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.start-empty {
    width: min(100%, 560px);
    margin: 0;
    text-align: center;
}

.start-empty h1 { color: var(--teal); }
.start-empty p { color: var(--muted); font-size: 12px; }
.start-empty .start-links { margin-top: 12px; }

/* --- профиль --- */

.profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 22px;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(circle at 87% 10%, rgba(255, 157, 46, .2), transparent 28%),
        radial-gradient(circle at 76% 90%, rgba(34, 211, 238, .13), transparent 32%),
        linear-gradient(135deg, #073f4d, #08596d 48%, #0a6f83);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}

.profile-avatar {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    border: 3px solid rgba(255,255,255,.8);
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}

.profile-avatar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255,255,255,.16);
    font-size: 32px;
    font-weight: 800;
}

.profile-hero-main { flex: 1; min-width: 210px; }
.profile-hero-main h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); }
.profile-hero-kicker {
    color: #8ed8e4;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.profile-hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.profile-actions .ghost-btn {
    border-color: rgba(255,255,255,.22);
    background: rgba(255,255,255,.08);
    color: #fff;
    box-shadow: none;
}
.profile-actions .ghost-btn:hover { background: rgba(255,255,255,.15); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #e7f6f8;
    font-size: 9px;
}
.chip b { color: #fff; }

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    gap: 14px;
    margin-top: 14px;
    align-items: start;
}

.profile-team-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.profile-team-name {
    margin: 0;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 21px;
    line-height: 1.1;
}

.profile-team-motto { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.profile-team-members { margin-top: 8px; color: var(--muted); font-size: 10px; }

.profile-grid .team-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 13px 0;
}

.profile-grid .team-stat {
    padding: 11px 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--soft);
}

.profile-grid .team-stat-icon { font-size: 14px; }
.profile-grid .team-stat-value {
    display: block;
    margin-top: 3px;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 22px;
    line-height: 1;
}
.profile-grid .team-stat-label { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.profile-grid .team-stat::after {
    display: none;
}

.profile-games h3 { margin: 0 0 6px; font-size: 14px; }
.mini-game {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 48px 16px;
    gap: 7px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--line);
    font-size: 11px;
}
.mini-game:first-of-type { border-top: 0; }
.mini-game-date { color: var(--muted); font-size: 9px; }
.mini-game-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--teal); text-decoration: none; }
.mini-game-title:hover { text-decoration: underline; }
.mini-game-place { text-align: center; color: var(--muted); }
.mini-game-arrow { color: var(--muted); text-align: right; text-decoration: none; }

.profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.profile-link { color: var(--teal); font-size: 10px; font-weight: 700; text-decoration: none; }
.profile-link:hover { text-decoration: underline; }

.account-list { margin: 0; padding: 0; list-style: none; }
.account-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    font-size: 11px;
}
.account-list li:first-child { border-top: 0; padding-top: 0; }
.account-label { color: var(--muted); }
.account-value { text-align: right; }
.account-value a { color: var(--teal); text-decoration: none; }
.account-value a:hover { text-decoration: underline; }

.quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.quick-link:first-of-type { border-top: 0; padding-top: 0; }
.quick-link:hover { color: var(--primary); }

.status-badge {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}
.status-ok { background: #dcfce7; color: #166534; }
.status-warn { background: #fef3c7; color: #92400e; }
.status-muted { background: #f1f3f5; color: #6b7280; }

/* --- справка --- */

.help-hero {
    padding: 24px;
    margin: 0 0 14px;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 15%, rgba(255, 157, 46, .18), transparent 28%),
        radial-gradient(circle at 80% 92%, rgba(34, 211, 238, .12), transparent 30%),
        linear-gradient(135deg, #073f4d, #08596d 48%, #0a6f83);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.help-hero h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.help-hero p { max-width: 650px; margin: 7px 0 0; color: #d3edf1; font-size: 12px; }
.help-hero-kicker { color: #8ed8e4; font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.help-hero-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.help-hero-links a {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}
.help-hero-links a:hover { background: rgba(255,255,255,.16); }

.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}
.help-toc a {
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}
.help-toc a:hover { background: var(--teal-soft, #e8f4f6); }

.help-section {
    margin: 0 0 11px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--card);
    scroll-margin-top: 84px;
}
.help-section h2 {
    margin: 0 0 8px;
    color: var(--teal);
    font-size: 18px;
    letter-spacing: -.015em;
}
.help-section p { margin: 0 0 9px; font-size: 12px; }
.help-section p:last-child { margin-bottom: 0; }
.help-section ul, .help-section ol { margin: 7px 0 10px; padding-left: 20px; font-size: 12px; }
.help-section li { margin-bottom: 5px; }

.help-note {
    padding: 10px 12px;
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: var(--warm, #fff7ed);
    color: var(--text);
    font-size: 11px;
}

.help-cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.help-cta a {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.help-cta a:hover { border-color: var(--teal); }

@media (max-width: 760px) {
    .start-page { min-height: auto; padding: 24px 0 38px; }
    .start-auth { padding: 16px; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-hero { padding: 19px; }
    .profile-avatar { width: 72px; height: 72px; flex-basis: 72px; }
    .team-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .help-hero { padding: 20px; }
    .help-section { padding: 14px; }
    .mini-game { grid-template-columns: 48px minmax(0, 1fr) 42px 14px; }
}

/* Вступление в постоянную команду с публичной карточки */
.join-card {
    margin: 12px 0 16px;
    border-left: 4px solid var(--primary);
}

.join-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.join-card-head h2 {
    margin: 2px 0 0;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 19px;
}

.join-badge {
    flex: none;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff1d9;
    color: #9a4a00;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.join-badge-ok {
    background: #dcfce7;
    color: #166534;
}

.join-note {
    margin: 8px 0 11px;
    color: var(--muted);
    font-size: 11px;
}

.join-form {
    margin: 0;
}

@media (max-width: 639.98px) {
    .join-card-head {
        display: block;
    }

    .join-badge {
        display: inline-block;
        margin-top: 7px;
    }
}

/* ============================================================
   Экран задания: спокойный игровой режим без лишних панелей
   ============================================================ */

.task-summary {
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
    overflow: hidden;
}

.task-summary > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.task-summary > summary::-webkit-details-marker { display: none; }
.task-summary > summary::marker { content: ''; }

.task-summary-title {
    display: -webkit-box;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.task-step-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}

.task-summary-timer {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--warm-line);
    border-radius: 7px;
    background: var(--warm);
    color: #9a3412;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.task-summary-timer.is-warning {
    border-color: #f0a0a0;
    background: #fff0f0;
    color: var(--danger);
}

.task-summary-chevron {
    flex: none;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    transition: transform .18s ease;
}

.task-summary[open] .task-summary-chevron {
    transform: rotate(180deg);
}

.task-summary-body {
    padding: 11px 15px 14px;
    border-top: 1px solid var(--line);
}

.task-team-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 0 11px;
}

.task-summary-finish {
    color: var(--muted);
    font-size: 10px;
}

.task-summary-finish b {
    color: var(--teal);
    font-variant-numeric: tabular-nums;
}

.task-team-line .sr-team-badge {
    padding: 4px 9px;
    font-size: 10px;
}

.task-timing {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.task-timer {
    display: flex;
    flex: 1 1 190px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    font-variant-numeric: tabular-nums;
}

.task-timer-label {
    color: #9a6a3d;
    font-size: 9px;
    line-height: 1.3;
}

.task-timer b {
    color: #9a3412;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
}

.task-timer-warning {
    color: var(--danger);
    font-size: 9px;
    font-weight: 700;
}

.task-timer-game {
    border: 1px solid var(--line);
    background: var(--soft);
}

.task-timer-game .task-timer-label {
    color: var(--muted);
}

.task-timer-game b {
    color: var(--teal);
    font-size: 16px;
}

.task-score-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
}

.task-score-percent {
    color: var(--teal);
    font-weight: 700;
}

.task-summary .progressbar {
    height: 5px;
    margin: 6px 0 0;
    background: var(--soft);
}

.task-body {
    padding: 18px 20px;
    border-left: 3px solid var(--teal);
    font-size: 13px;
    line-height: 1.65;
}

.task-body-kicker {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hints {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.hints-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.hints-kicker {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hints-head h2 {
    margin: 1px 0 0;
    font-size: 16px;
}

.hints-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
}

.hints .hint {
    margin: 6px 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
    box-shadow: none;
}

.hints .hint-open summary {
    color: var(--teal);
    font-weight: 700;
}

.hints .hint-body {
    margin-top: 8px;
    font-size: 11px;
}

.hints .hint-closed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
    align-items: center;
}

.hints .hint-closed > div:first-child {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.hints .hint-closed > div:first-child .muted {
    font-size: 9px;
}

.hints .hint-closed > .btn {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding: 4px 8px;
    font-size: 9px;
}

.hints .hint-closed > div.muted.small {
    grid-column: 1 / -1;
}

.hints .hint-confirm {
    grid-column: 1 / -1;
    padding-top: 2px;
}

.answer-card {
    padding: 11px 14px;
}

.answer-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.answer-row .code-input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    margin: 0;
    padding: 9px 11px;
    font-size: 14px;
}

.answer-submit {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 16px;
    white-space: nowrap;
}

.answer-card .row-buttons {
    gap: 6px;
    margin-top: 6px;
}

.answer-card .bonus-input {
    padding: 7px 9px;
    font-size: 11px;
}

.answer-card .btn-small {
    padding: 7px 10px;
    font-size: 10px;
}

.answer-help-link {
    margin-left: auto;
    color: var(--muted);
    font-size: 9px;
    text-decoration: none;
    white-space: nowrap;
}

.answer-help-link:hover {
    color: var(--teal);
    text-decoration: underline;
}

@media (max-width: 1023.98px) {
    .task-summary > summary {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "step timer chevron" "title title title";
        column-gap: 8px;
        row-gap: 6px;
    }

    .task-summary .task-step-badge { grid-area: step; }
    .task-summary-timer { grid-area: timer; justify-self: start; }
    .task-summary-title { grid-area: title; white-space: normal; }
    .task-summary-chevron { grid-area: chevron; justify-self: end; }
}

@media (max-width: 639.98px) {
    .task-summary {
        border-radius: 13px;
    }

    .task-summary > summary {
        padding: 10px 12px;
    }

    .task-summary-title {
        font-size: 16px;
    }

    .task-summary-body {
        padding: 10px 12px 13px;
    }

    .task-timing {
        display: grid;
        grid-template-columns: 1fr;
    }

    .task-timer {
        flex-basis: auto;
    }

    .task-body {
        padding: 15px;
    }

    .answer-card {
        padding: 11px 12px;
    }

    .answer-row {
        flex-wrap: wrap;
    }

    .answer-submit {
        width: auto;
        padding: 8px 14px;
    }

    .answer-help-link {
        margin-left: 0;
    }
}

/* Большие изображения внутри задания: собственный скролл + просмотр */
.task-image {
    margin: 14px 0 4px;
}

.task-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
    cursor: zoom-in;
}

.task-image-preview:hover {
    border-color: var(--teal);
}

.task-image-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 500px;
    height: auto;
    background: #fff;
}

.task-image-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 9px;
}

.task-image-open {
    flex: none;
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    color: var(--teal);
    font: 700 9px Verdana, Arial, sans-serif;
    cursor: pointer;
}

.task-image-open:hover {
    border-color: var(--teal);
}

.task-image-viewer[open] {
    display: flex;
    flex-direction: column;
}

.task-image-viewer {
    width: min(1120px, calc(100vw - 24px));
    height: min(92vh, 900px);
    padding: 0;
    border: 1px solid #3b4a51;
    border-radius: 14px;
    background: #0b1114;
    color: #e7eef2;
    overflow: hidden;
}

.task-image-viewer::backdrop {
    background: rgba(0, 0, 0, .74);
    backdrop-filter: blur(3px);
}

.task-image-viewer-head {
    display: flex;
    flex: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 11px;
    border-bottom: 1px solid #2b353b;
}

.task-image-viewer-head h2 {
    flex: 1;
    min-width: 140px;
    margin: 0;
    overflow: hidden;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #34434a;
    border-radius: 6px;
    background: #172026;
    color: #c9d8de;
    font: 700 10px Verdana, Arial, sans-serif;
    cursor: pointer;
}

.task-viewer-btn:hover {
    border-color: #ff8c2a;
    color: #ffc06a;
}

.task-viewer-close {
    font-size: 18px;
}

.task-viewer-zoom {
    min-width: 43px;
    color: #91a6b0;
    font-size: 9px;
    text-align: center;
}

.task-image-viewer-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: none;
    user-select: none;
    background: #11191d;
    text-align: center;
}

.task-image-viewer-scroll img {
    display: block;
    width: auto;
    max-width: none;
    height: auto;
    margin: 18px auto;
    background: #fff;
    box-shadow: 0 5px 22px rgba(0, 0, 0, .35);
}

@media (max-width: 639.98px) {
    .task-image-preview img {
        max-height: 300px;
    }

    .task-image-caption {
        display: block;
        line-height: 1.45;
    }

    .task-image-open {
        margin-top: 5px;
    }

    .task-image-viewer {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        border-radius: 10px;
    }

    .task-image-viewer-head h2 {
        flex-basis: 100%;
        min-width: 0;
    }
}

/* ============================================================
   Ожидание игры и «заявка команды не найдена»
   ============================================================ */

.game-wait-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 720px;
    min-height: calc(100vh - 190px);
    margin: 0 auto;
    padding: 20px 0 40px;
}

.game-info {
    margin: 0 0 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.game-info-head {
    align-items: flex-start;
    gap: 12px;
}

.game-info-kicker {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.game-info-title {
    margin-top: 2px;
    color: var(--text);
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.game-info-status {
    padding: 4px 8px;
    border: 1px solid var(--warm-line);
    border-radius: 999px;
    background: var(--warm);
    color: #9a4a00;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: none;
}

.game-info-status-live {
    border-color: #86d9a0;
    background: #dcfce7;
    color: #166534;
}

.game-info-status-test {
    border-color: #a8c8ee;
    background: #e5eefc;
    color: #1f4f9a;
}

.game-info-status-finished,
.game-info-status-archived {
    border-color: var(--line);
    background: var(--soft);
    color: var(--muted);
}

.game-info-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.game-info-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--soft);
    font-size: 11px;
}

.game-info-row > span:first-child {
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.game-info-row.muted,
.game-info-row--forum {
    grid-column: 1 / -1;
}

.game-info-timer {
    color: var(--primary);
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.game-info a {
    color: var(--teal);
    text-decoration: none;
}

.game-info a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.wait-card {
    padding: 18px 20px;
}

.wait-kicker {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.wait-card-head h1 {
    margin: 2px 0 0;
    color: var(--text);
    font-family: Tahoma, Verdana, sans-serif;
    font-size: clamp(24px, 3.2vw, 32px);
    line-height: 1.12;
    letter-spacing: -.03em;
}

.wait-team {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 9px 0 0;
}

.wait-lead {
    margin: 12px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.wait-note {
    margin: 12px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: var(--warm);
    font-size: 11px;
    line-height: 1.5;
}

.wait-note--info {
    border-left-color: var(--teal);
    background: var(--teal-soft);
}

.wait-note--warning {
    border-left-color: #d99a14;
    background: #fff8e4;
}

.wait-note--danger {
    border-left-color: var(--danger);
    background: #fff0f0;
}

.wait-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 14px 0;
    padding: 14px;
    border: 1px solid var(--warm-line);
    border-radius: 12px;
    background: var(--warm);
}

.wait-countdown-label {
    color: #9a6a3d;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.wait-countdown b {
    color: #9a3412;
    font-family: Tahoma, Verdana, sans-serif;
    font-size: 30px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.wait-countdown-date {
    color: var(--muted);
    font-size: 9px;
}

.wait-captain-hint {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--warm-line);
    border-radius: 9px;
    background: var(--warm);
    font-size: 12px;
    line-height: 1.5;
}

.wait-captain-kicker {
    color: #9a6a3d;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.wait-captain-hint h2 {
    margin: 3px 0 7px;
    color: var(--text);
    font-size: 15px;
}

.wait-captain-hint p {
    margin: 0 0 6px;
}

.wait-captain-members {
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 600;
}

.wait-captain-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.wait-captain-help {
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.wait-captain-help:hover {
    color: var(--primary);
    text-decoration: underline;
}

.wait-info {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.wait-info-label {
    flex: none;
    color: var(--muted);
}

.wait-info-value {
    text-align: right;
}

.wait-apply-form {
    margin: 10px 0 0;
}

.wait-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.wait-link {
    color: var(--teal);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.wait-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

@media (min-width: 1024px) {
    body.page-player-game-waiting,
    body.page-player-game-no-team {
        --container: 720px;
    }
}

@media (max-width: 767.98px) {
    .game-wait-page {
        min-height: auto;
        padding: 16px 0 32px;
    }
}

@media (max-width: 639.98px) {
    .game-info {
        padding: 14px;
        border-radius: 13px;
    }

    .game-info-title {
        font-size: 17px;
    }

    .game-info-rows {
        grid-template-columns: 1fr;
    }

    .wait-card {
        padding: 15px;
    }

    .wait-info {
        display: block;
    }

    .wait-info-value {
        display: block;
        margin-top: 3px;
    }

    .wait-countdown b {
        font-size: 26px;
    }
}

/* Ожидание и «заявка не найдена»: лист по высоте контента, без пустого экрана */
body.page-player-game-waiting .game-wait-page,
body.page-player-game-no-team .game-wait-page {
    min-height: auto;
    justify-content: flex-start;
    padding: 12px 0 10px;
}

body.page-player-game-waiting .player-sheet,
body.page-player-game-no-team .player-sheet {
    padding-bottom: 16px;
}

/* Ожидание и «заявка не найдена»: лист по контенту, но по центру экрана */
body.page-player-game-waiting.player-body,
body.page-player-game-no-team.player-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-player-game-waiting .player-sheet,
body.page-player-game-no-team .player-sheet {
    margin-top: auto;
    margin-bottom: auto;
}
