/* =========================================================================
   konkurs_reiting.css — страница «Рейтинг прогнозистов» (/konkurs-rating)
   Оформление в духе match2.css / hall_of_fame.css: мягкие карточки,
   токены цветов и адаптивная таблица рейтинга.
   ========================================================================= */

.bt-kr {
    --kr-card: #ffffff;
    --kr-ink: #1c2b42;
    --kr-ink-soft: #5d6b81;
    --kr-muted: #8a94a3;
    --kr-line: #e6eaf0;
    --kr-line-soft: #f0f3f8;
    --kr-bg: #f8f9fc;
    --kr-brand: #cc1d14;
    --kr-accent: #ffda33;
    --kr-green: #2f9a4d;
    --kr-blue: #2a5a9f;
    --kr-danger: #b33a24;
    --kr-radius: 18px;
    --kr-radius-sm: 12px;
    --kr-shadow: 0 6px 24px rgba(19, 31, 53, .07);
    --kr-shadow-sm: 0 3px 12px rgba(19, 31, 53, .05);
    width: 100%;
    max-width: 1180px;
    padding-left: 14px;
    padding-right: 14px;
    color: var(--kr-ink);
}

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

.bt-kr p {
    margin: 0 0 12px;
    color: #33415a;
    line-height: 1.65;
}

.bt-kr p:last-child {
    margin-bottom: 0;
}

.bt-kr .breadcrumb {
    margin: 6px 0 10px !important;
    padding-left: 0 !important;
}

/* ---------- Первый экран ---------- */
.bt-kr__hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
    align-items: center;
    gap: 28px;
    padding: 30px 32px;
    border: 1px solid var(--kr-line);
    border-radius: var(--kr-radius);
    background: linear-gradient(135deg, #ffffff 0%, #f7f9fc 58%, #fff8e1 100%);
    box-shadow: var(--kr-shadow);
}

.bt-kr__hero::before,
.bt-kr__hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.bt-kr__hero::before {
    width: 240px;
    height: 240px;
    right: -80px;
    top: -110px;
    background: rgba(255, 218, 51, .22);
}

.bt-kr__hero::after {
    width: 180px;
    height: 180px;
    left: -70px;
    bottom: -110px;
    background: rgba(42, 90, 159, .07);
}

.bt-kr__hero-body,
.bt-kr__hero-art {
    position: relative;
    z-index: 1;
}

.bt-kr__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff3c4;
    color: #6f5500;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.bt-kr__eyebrow::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kr-green);
    box-shadow: 0 0 0 3px rgba(47, 154, 77, .18);
}

.bt-kr__hero h1 {
    margin: 0 0 10px;
    color: var(--kr-ink);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -.015em;
    text-align: left;
}

.bt-kr__lead {
    max-width: 60ch;
    margin: 0 0 18px !important;
    color: var(--kr-ink-soft);
    font-size: 15px;
    line-height: 1.6;
}

.bt-kr__hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bt-kr__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #d7e1f0;
    border-radius: 10px;
    background: #fff;
    color: var(--kr-ink) !important;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-shadow: var(--kr-shadow-sm);
    transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}

.bt-kr__btn:hover {
    transform: translateY(-1px);
    border-color: #c6d4e8;
    box-shadow: 0 6px 16px rgba(19, 31, 53, .1);
}

.bt-kr__btn--primary {
    border-color: var(--kr-brand);
    background: var(--kr-brand);
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(204, 29, 20, .28);
}

.bt-kr__btn--primary:hover {
    border-color: #b41a12;
    background: #b41a12;
    box-shadow: 0 8px 20px rgba(204, 29, 20, .34);
}

.bt-kr__btn:focus-visible,
.bt-kr__contest:focus-visible,
.bt-kr__arrow:focus-visible,
.bt-kr__day-tab:focus-visible,
.bt-kr select:focus-visible {
    outline: 3px solid rgba(42, 90, 159, .35);
    outline-offset: 2px;
}

.bt-kr__hero-art {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bt-kr__hero-art img {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 0;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(19, 31, 53, .12));
}

/* ---------- Панель управления ---------- */
.bt-kr__controls {
    margin-top: 16px;
    padding: 20px 24px;
    border: 1px solid var(--kr-line);
    border-radius: var(--kr-radius);
    background: var(--kr-card);
    box-shadow: var(--kr-shadow-sm);
}

.bt-kr__section-label {
    display: block;
    margin: 0 0 8px;
    color: var(--kr-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bt-kr__contests {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bt-kr__contest {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid var(--kr-line);
    border-radius: 999px;
    background: #f8f9fc;
    color: #33415a;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.bt-kr__contest:hover {
    border-color: #c6d4e8;
    background: #f1f5fb;
}

.bt-kr__contest.current {
    border-color: var(--kr-brand);
    background: var(--kr-brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(204, 29, 20, .24);
}

.bt-kr__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.bt-kr__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.bt-kr__field > span {
    color: var(--kr-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bt-kr select {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 34px 9px 12px;
    border: 1px solid #dbe2ec;
    border-radius: 10px;
    background-color: #fff;
    color: var(--kr-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.bt-kr select:focus {
    outline: 0;
    border-color: var(--kr-blue);
    box-shadow: 0 0 0 3px rgba(42, 90, 159, .13);
}

.bt-kr__field--month select {
    min-width: 150px;
}

.bt-kr__field--year select {
    min-width: 100px;
}

.bt-kr__arrow {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid #d7e1f0;
    border-radius: 50%;
    background: #fff;
    color: var(--kr-ink);
    font-family: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--kr-shadow-sm);
    transition: background .15s ease, border-color .15s ease;
}

.bt-kr__arrow:hover {
    border-color: #c6d4e8;
    background: #f8fbff;
}

.bt-kr__prize {
    min-height: 42px;
    padding: 9px 16px;
    font-size: 13px;
}

.bt-kr__sponsor {
    display: flex;
    align-items: center;
    margin-left: auto;
    min-height: 42px;
}

.bt-kr__sponsor img {
    display: block;
    width: auto;
    max-width: 170px;
    max-height: 40px;
    object-fit: contain;
}

/* ---------- Режим «по дням» ---------- */
.bt-kr__days {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--kr-line-soft);
}

.bt-kr__days.is-visible {
    display: flex;
}

.bt-kr__day-tab {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--kr-line);
    border-radius: 999px;
    background: #f8f9fc;
    color: #33415a;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.bt-kr__day-tab.current {
    border-color: var(--kr-blue);
    background: #edf5ff;
    color: var(--kr-blue);
}

.bt-kr__calendar {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.bt-kr__calendar img {
    display: block;
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1px solid var(--kr-line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    cursor: pointer;
}

.bt-kr__current-date {
    display: none;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff3c4;
    color: #6f5500;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.bt-kr__date-input {
    position: absolute;
    top: 36px;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* ---------- Результаты ---------- */
.bt-kr__results {
    margin-top: 16px;
    padding: 22px 24px;
    border: 1px solid var(--kr-line);
    border-radius: var(--kr-radius);
    background: var(--kr-card);
    box-shadow: var(--kr-shadow);
}

.bt-kr__results-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.bt-kr__title {
    position: relative;
    margin: 0 0 8px;
    padding-left: 14px;
    color: var(--kr-ink);
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
    text-align: left;
}

.bt-kr__title::before {
    content: "";
    position: absolute;
    left: 0;
    top: .18em;
    bottom: .18em;
    width: 4px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--kr-brand), var(--kr-accent));
}

.bt-kr__subtitle {
    margin: 0 !important;
    color: var(--kr-ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.bt-kr__status {
    min-height: 20px;
    margin: 0;
    color: var(--kr-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: right;
}

.bt-kr__status[hidden] {
    display: none;
}

.bt-kr__status.is-error {
    color: var(--kr-danger);
}

.bt-kr__table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--kr-line);
    border-radius: 14px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    transition: opacity .15s ease;
}

.bt-kr__table-scroll.is-loading {
    opacity: .55;
    pointer-events: none;
}

.bt-kr__scroll-hint {
    display: none;
    margin: 10px 0 0 !important;
    color: var(--kr-muted);
    font-size: 12px;
    line-height: 1.45;
}

/* ---------- Таблица ---------- */
#tableDataReitingkonkurs {
    width: 100%;
    min-width: 820px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

#tableDataReitingkonkurs thead th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--kr-line);
    background: #f6f8fc;
    color: var(--kr-ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: normal;
}

#tableDataReitingkonkurs thead th.col-tipster {
    padding-left: 12px;
    text-align: left;
}

#tableDataReitingkonkurs tbody td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--kr-line-soft);
    color: #33415a;
    font-size: 13.5px;
    line-height: 1.35;
    text-align: center;
    vertical-align: middle;
}

#tableDataReitingkonkurs tbody tr:last-child td {
    border-bottom: 0;
}

#tableDataReitingkonkurs tbody tr:nth-child(even) td {
    background: #fbfcfe;
}

#tableDataReitingkonkurs tbody tr:hover td {
    background: #f5f8fd;
}

#tableDataReitingkonkurs tbody td.center {
    color: var(--kr-ink);
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#tableDataReitingkonkurs tbody td a {
    color: var(--kr-blue);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Автор: аватар + имя в одну строку. */
#tableDataReitingkonkurs tbody td.tipster {
    min-width: 200px;
    text-align: left;
}

#tableDataReitingkonkurs tbody td.tipster > a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    color: var(--kr-ink) !important;
    font-size: 13.5px;
    font-weight: 750;
    line-height: 1.3;
    text-align: left;
    text-decoration: none !important;
}

#tableDataReitingkonkurs tbody td.tipster > a:hover {
    color: var(--kr-blue) !important;
}

#tableDataReitingkonkurs .icon-profile {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 50%;
    background: #f1f4f8;
}

#tableDataReitingkonkurs .icon-profile img {
    display: block;
    width: 42px !important;
    height: 42px !important;
    max-width: 42px;
    max-height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

#tableDataReitingkonkurs .icon-profile .txt-stat {
    position: absolute;
    top: auto;
    right: -4px;
    bottom: -4px;
    min-width: 26px;
    padding: 2px 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--kr-green);
    color: #fff !important;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: .04em;
    text-align: center;
}

.bt-kr__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 28px 24px;
    color: var(--kr-ink-soft);
    text-align: center;
}

.bt-kr__empty strong {
    color: var(--kr-ink);
    font-size: 16px;
    font-weight: 800;
}

.bt-kr__empty span {
    font-size: 13px;
    line-height: 1.5;
}

/* ---------- Адаптив ---------- */
@media screen and (max-width: 1024px) {
    .bt-kr__hero {
        grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
        gap: 20px;
        padding: 26px;
    }

    .bt-kr__sponsor {
        margin-left: 0;
    }
}

@media screen and (max-width: 900px) {
    .bt-kr__hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .bt-kr__hero-art {
        justify-content: flex-start;
    }

    .bt-kr__hero-art img {
        max-width: 260px;
    }
}

@media screen and (max-width: 640px) {
    .bt-kr {
        padding-left: 10px;
        padding-right: 10px;
    }

    .bt-kr__hero {
        gap: 14px;
        padding: 20px 18px;
        border-radius: 14px;
    }

    .bt-kr__hero h1 {
        font-size: clamp(26px, 8vw, 34px);
    }

    .bt-kr__lead {
        font-size: 14px;
    }

    .bt-kr__hero-art img {
        max-width: 220px;
    }

    .bt-kr__controls,
    .bt-kr__results {
        padding: 18px 15px;
        border-radius: 14px;
    }

    .bt-kr__contests {
        gap: 6px;
        margin-bottom: 14px;
    }

    .bt-kr__contest {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .bt-kr__toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .bt-kr__field--month select,
    .bt-kr__field--year select {
        min-width: 0;
    }

    .bt-kr__arrow {
        display: none;
    }

    .bt-kr__prize {
        width: 100%;
    }

    .bt-kr__sponsor {
        justify-content: flex-start;
        margin-left: 0;
    }

    .bt-kr__days {
        align-items: stretch;
        flex-direction: column;
    }

    .bt-kr__calendar {
        margin-left: 0;
    }

    .bt-kr__results-head {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .bt-kr__status {
        text-align: left;
    }

    .bt-kr__scroll-hint {
        display: block;
    }

    #tableDataReitingkonkurs {
        min-width: 430px;
        font-size: 12.5px;
    }

    #tableDataReitingkonkurs thead th {
        padding: 9px 6px;
        font-size: 9.5px;
    }

    #tableDataReitingkonkurs tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    #tableDataReitingkonkurs tbody td.tipster {
        min-width: 145px;
    }

    #tableDataReitingkonkurs .icon-profile {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }

    #tableDataReitingkonkurs .icon-profile img {
        width: 32px !important;
        height: 32px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bt-kr__btn,
    .bt-kr__contest,
    .bt-kr__arrow,
    .bt-kr__day-tab,
    .bt-kr select,
    .bt-kr__table-scroll {
        transition: none !important;
    }
}
