/* Path: Индикаторы_new/css/statistics.css */
:root {
    --statistics-accent: #47afff;
    --statistics-bar-green: #55b946;
    --statistics-bar-yellow: #f8b425;
    --statistics-bar-orange: #f88b25;
    --statistics-bar-red: #f65151;
}

/*
  Typography: scale the whole filters block and the indicators block
  by changing font-size only on the outer containers.
  Inside the blocks we use em (or inherit) for font sizes.
*/
#filters-container,
.statistics-cards-container {
    font-size: 1rem;
}

.statistics-diagram-container {
    position: relative;
    flex: 1;
    height: 100%;
    min-width: 440px;
}

.statistics-diagrams-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.statistics-filter-header {
    display: flex;
    padding: 10px;
    font-size: 1em;
    font-weight: 700;
    flex: 1;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 10px;
    border: none;
}

.filters-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 4px 2px;
}

.filters-header__tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filters-header__tab {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary-color);
    font-size: var(--fs-xxs);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: default;
    line-height: 1;
}

.filters-header__tab.is-active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.45);
    color: #e5f2ff;
}

.filters-header__eyebrow {
    font-size: var(--fs-xxs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.9);
    line-height: 1;
}

.filters-header__title {
    font-size: var(--fs-xl);
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.2px;
    line-height: 1.15;
}

.filters-header__desc {
    font-size: var(--fs-sm);
    color: #9ca3af;
    line-height: 1.35;
    opacity: 0.8;
}

.filters-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filters-header__toggles {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filters-header__returns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.filters-header__returns-label {
    font-size: var(--fs-xxs);
    color: var(--text-secondary-color);
    opacity: 0.9;
    white-space: nowrap;
}

.filters-header__returns-toggle {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary-color);
    font-size: var(--fs-xxs);
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.filters-header__returns-toggle:hover {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.35);
}

.filters-header__returns-toggle:active {
    transform: translateY(1px);
}

.filters-header__returns-toggle.is-on {
    background: rgba(37, 99, 235, 0.25);
    border-color: rgba(37, 99, 235, 0.6);
    color: #ffffff;
}

.filters-header__returns-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.statistics-page-header {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.statistics-page-header__title {
    font-size: var(--fs-xl);
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.2px;
    line-height: 1.15;
    margin: 0;
}

.statistics-page-header__desc {
    font-size: var(--fs-sm);
    color: #9ca3af;
    line-height: 1.35;
    margin: 0;
    opacity: 0.85;
}

#filters-container.card {
    box-shadow: none;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
}

#filters-container .select-input {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #1b2e4b;
    border-radius: 10px;
    padding: 10px 10px;
    font-weight: 600;
    font-size: 1em;
}

#filters-container .select-input:hover {
    border-color: rgba(148, 163, 184, 0.35);
}

#filters-container .select-input:focus-visible {
    outline: none;
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.statistics-filter-options-container {
    display: flex;
    align-items: start;
    flex-direction: column;
    width: 100%;
    padding: 12px 0 8px;
    gap: 10px;
    min-width: 0;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    height: 100%;
    height: 100%;
}

.statistics-filter-option {
    position: relative;
    display: flex;
    font-size: 1em;
    gap: 10px;
    width: 100%;
    margin: 6px 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: none;
}

.statistics-filter-option-label {
    flex: 0 0 34%;
    min-width: 92px;
    max-width: 150px;
    color: #a6abb3;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    opacity: 1;
}

.statistics-filter-option-input {
    flex: 1;
    min-width: 0;
}

.statistics-buttons-row {
    width: 100%;
    max-width: 340px;
    margin: 6px auto 0;
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
}

.statistics-buttons-row > .button-primary,
.statistics-buttons-row > .button-secondary {
    flex: 0 0 auto;
    min-width: 140px;
}

.statistics-filter-option--selected {
    margin-top: 6px;
}

.statistics-diagram-title {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.statistics-table-percent-game {
    display: flex;
    width: calc(100% - 24px);
    align-items: center;
    justify-content: start;
    flex-direction: row;
    gap: 8px;
    margin-top: 16px;
    margin-left: 8px;
    margin-right: 8px;
}

.statistics-siagram-percent-type {
    padding-right: 45%;
}

.statistics-table-percent-game-count-text {
    font-size: 1em;
    color: #fff;
    font-weight: 700;
}

.statistics-table-container {
    color: var(--text-secondary-color);
    font-size: 14px;
    width: calc(100% - 8px);
    max-height: 360px;
    overflow: auto;
    font-family: 'Roboto', sans-serif;
    flex-direction: column;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb-color) var(--scroll-track-color);
}

.statistics-table-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.statistics-table-scroll-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.statistics-table-container table {
    width: 100%;
    border-collapse: collapse;
    flex-grow: 1;
    overscroll-behavior: contain;
}

.statistics-table-container thead {
    position: sticky;
    top: 0;
    z-index: 1;
    user-select: none;
}

.statistics-table-container table th, .table-container table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    text-align: center !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overscroll-behavior: contain;
}

.statistics-table-container table th {
    background: var(--card-color);
    border-bottom: 2px solid rgba(255,255,255,.1);
}

.statistics-table-container table th:first-child, 
.statistics-table-container table td:first-child {
    width: 4%;
    text-align: right;
    padding-right: 4px;
}

.statistics-table-container table th:nth-child(2), 
.statistics-table-container table td:nth-child(2) {
    width: 50%;
    padding-left: 4px;
}

.statistics-table-container table th:nth-child(n+3), 
.statistics-table-container table td:nth-child(n+3) {
    width: 18%;
}

.statistics-table-container table td:nth-child(2) {
    white-space: normal;
    word-wrap: break-word;
    text-overflow: initial;
}

.statistics-table-container table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 0;
}

.statistics-table-container table th::before {
    content: "";
    position: absolute;
    inset: 0; 
    background: var(--card-color);
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
}

.statistics-table-container table th.sortable span {
    margin-left: 5px;
    font-size: 12px;
}

.statistics-table-container table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, .03);
}

.statistics-table-container table tbody td:first-child {
    color: #fff;
    padding: 4px 6px;
    text-align: start;
}

.statistics-table-container table tbody td:nth-child(2) {
    text-align: start;
}

.statistics-table-name-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    text-align: left;
    color: var(--accent-color);
    cursor: pointer;
    text-decoration: underline;
}

.statistics-table-name-link:hover {
    color: var(--accent-hover-color);
}

.statistics-table-name-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.statistics-table-dates-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 0 8px;
    font: inherit;
    color: var(--accent-color);
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.85;
    white-space: nowrap;
}

.statistics-table-dates-btn:hover {
    color: var(--accent-hover-color);
    opacity: 1;
}

.statistics-table-dates-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.match-dates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.match-dates-table th,
.match-dates-table td {
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.match-dates-table th {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    text-align: left;
}

.match-dates-table td {
    color: rgba(255, 255, 255, 0.9);
}

.match-dates-table td.date {
    white-space: nowrap;
    width: 150px;
}

.match-dates-table td.score,
.match-dates-table th.score {
    white-space: nowrap;
    text-align: right;
    width: 160px;
}

.match-dates-table .match-meta {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    margin-bottom: 2px;
}

.match-dates-table .match-teams {
    color: rgba(255, 255, 255, 0.95);
}


.statistics-table-container table tbody td {
    padding: 6px 8px;
    border-bottom:1px solid rgba(255,255,255,.08);
    text-align: center;
}

.statistics-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--input-background-color);
    border-radius: 10px;
}

.statistics-skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

.statistics-skeleton-content {
    height: 100%;
    width: 100%;
    background: transparent;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.statistics-piechart-container {
    flex: 6;
    display: flex;
    flex-direction: column;
    min-width: 370px;
	min-height: 370px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

.statistics-diagram {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.statistics-diagram-item {
    flex: 1;
    width: 100%;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.statistics-diagram-legend {
    width: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2em;
    flex-wrap: wrap;
    flex-direction: column;
}

.statistics-diagram-no-data {
    position: absolute;
    inset: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-size: 1.8em;
    color: var(--lose-color);
    z-index: 200;
    padding: 0 16px;
    box-sizing: border-box;
}

.statistics-load-indicator-container {
    position: absolute;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.statistics-piechart-legend {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
    width: 100%;
    font-size: 14px;
    margin-top: 16px;
}

.statistics-space-card {
    min-width: 440px;
    padding: 16px;
    height: 570px;
}

.statistics-card-filter-height {
    height: 100%;
    align-self: stretch;

    /* min-height: 620px; */
}

.statistics-card-market-height {
    min-height: 620px;
}

.statistics-card-bookmaker-height {
    min-height: 570px;
}

@media (max-width: 1470px) {
    .statistics-space-card {
        display: none;
    }

    /* .statistics-card-filter-height {
        min-height: 580px;
    } */

    .statistics-card-market-height {
        min-height: 570px;
    }

    .statistics-card-bookmaker-height {
        min-height: 530px;
    }
}

@media (min-width: 1470px) {
    .statistics-space-card {
        display: block;
    }

    /* .statistics-card-filter-height {
        min-height: 620px;
    } */

    .statistics-card-market-height {
        min-height: 620px;
    }
    
    .statistics-card-bookmaker-height {
        min-height: 570px;
    }
}

.statistics-selected-filters  {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    color: #9ea3ab;
    text-align: left;
    font-size: 12px;
    line-height: 1.35;
}

.statistics-selected-filters-wrap {
    margin-top: auto;
    box-sizing: border-box;
    padding-top: 12px;
}

.absolute-filters {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    box-sizing: border-box;
    width: calc(100% - 32px);
}

.statistics-mode-buttons {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
}

.statistics-mode-buttons > .button-primary,
.statistics-mode-buttons > .button-secondary {
    flex: 1;
}

@media (max-width: 520px) {
    .statistics-buttons-row {
        flex-direction: column;
        align-items: stretch;
    }

    .statistics-buttons-row > .button-primary,
    .statistics-buttons-row > .button-secondary {
        width: 100%;
        min-width: 0;
    }
}


.traffic-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 300px;
}

.traffic-summary__toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.traffic-summary__title-wrap {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

body.indicator-traffic .traffic-summary__title-wrap {
    align-items: center;
    gap: 10px;
}

.traffic-summary__title {
    font-size: clamp(18px, 0.8vw + 12px, 24px);
    font-weight: 700;
    line-height: 1.1;
}

body.indicator-traffic .traffic-summary__title {
    flex: 0 0 auto;
    font-size: 18px;
    white-space: nowrap;
}

body.indicator-traffic .traffic-summary__category-summary {
    flex: 1 1 320px;
    justify-content: flex-start;
}

body.indicator-traffic .traffic-summary__category-summary .statistics-category-percent-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 7px;
    border: 1px solid rgba(72, 150, 255, .42);
    border-radius: 8px;
    background: rgba(21, 44, 78, .72);
    color: var(--text-primary-color);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

body.indicator-traffic .traffic-summary__category-summary .statistics-category-percent-chip__label {
    color: var(--text-secondary-color);
}

body.indicator-traffic .traffic-summary__category-summary .statistics-category-percent-chip__value {
    color: var(--win-color);
}

.traffic-summary__meta {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary-color);
    font-size: clamp(13px, 0.4vw + 12px, 16px);
    line-height: 1.2;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(124, 159, 231, .24);
    background: rgba(8, 22, 56, 0.56);
}

.traffic-summary__content {
    border: 1px solid rgba(124, 159, 231, .24);
    border-radius: 14px;
    padding: 16px;
    background: rgba(8, 22, 56, 0.56);
}


.traffic-summary__sort-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.traffic-summary__sort-buttons > button {
    min-width: 110px;
}

.traffic-summary-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.traffic-summary-breadcrumb__item {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    font-weight: 400;
    line-height: 1.35;
    padding: 0;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.traffic-summary-breadcrumb__item.is-current {
    color: #ffffff;
    font-weight: 600;
    cursor: default;
}

.traffic-summary-breadcrumb__sep {
    color: var(--text-secondary-color);
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    line-height: 1.35;
}

#trafficSummaryTable {
    margin-top: 8px;
}

#trafficSummaryTable table tbody td:nth-child(3) {
    color: #4cff8a;
    font-weight: 700;
}

.traffic-summary-table__name-link {
    text-decoration: none;
    font-weight: 500;
}

.traffic-summary-table__name-leaf {
    color: var(--accent-color);
}

#trafficSummaryTable .is-mid {
    color: #ffd95f !important;
}

#trafficSummaryTable .is-low {
    color: #ff8c8c !important;
}

.traffic-summary-table__empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--text-secondary-color);
    font-size: 16px;
}

@media (max-width: 720px) {
    .traffic-summary__title-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    body.indicator-traffic .traffic-summary__title-wrap {
        align-items: flex-start;
    }

    body.indicator-traffic .traffic-summary__category-summary {
        width: 100%;
    }

    .traffic-summary__meta { white-space: normal; }

    .traffic-summary__sort-buttons {
        flex-wrap: wrap;
    }

}

.statistics-load-circle {
    position: absolute;
    z-index: 9999;
    width: 400px;
    height: 400px;
}

.statistics-traffic-indicator-head {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
}

.statistics-arrow {
    font-size: 10px;
    line-height: 1;
}

.statistics-traffic-indicator-bar-row {
    display: grid;
    grid-template-columns: 50px 1fr 58px 58px;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    height: 28px;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    border-radius: 8px;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.statistics-traffic-indicator-bar-row:not(.statistics-traffic-indicator-table-head):hover,
.statistics-traffic-indicator-bar-row:not(.statistics-traffic-indicator-table-head):focus-visible {
    background: rgba(49, 108, 218, .18);
    box-shadow: inset 0 0 0 1px rgba(91, 152, 255, .55), 0 0 0 1px rgba(91, 152, 255, .22);
    transform: translateY(-1px);
}

.statistics-traffic-indicator-bar-row:not(.statistics-traffic-indicator-table-head):active {
    transform: translateY(0);
    box-shadow: inset 0 0 0 1px rgba(91, 152, 255, .65);
}

.statistics-traffic-indicator-bar-coef {
    display: inline-block;
    text-align: center;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    min-width: 44px;
}

.statistics-traffic-indicator-bar-pct {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
    color: #fff;
}

.statistics-traffic-indicator-bar-games {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
    color: #fff;
}

.statistics-traffic-indicator-table-head {
    width: calc(100% - 14px);
    margin-left: 7px;
    margin-right: 7px;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 2;
    background: transparent;
    padding-bottom: 0;
}

.statistics-traffic-indicator-bar-bg {
    height: 16px;
    border-radius: 8px;
    background: var(--input-background-color);
    position: relative;
    overflow: hidden;
    display: flex;
    min-width: 0;
}

.statistics-traffic-indicator-bar-fill-line {
    height: 100%;
    border-radius: 8px 0 0 8px;
    transition: width .6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 0 3px rgba(0,0,0,.6);
    white-space: nowrap;
    font-size: 12px;
}

.statistics-traffic-indicator-bars-wrap {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px 6px 4px;
    border: 1px solid rgba(124, 159, 231, .24);
    border-radius: 12px;
    background-color: rgba(8, 22, 56, 0.56);
    background-image: repeating-linear-gradient(
        to right,
        transparent,
        transparent calc(10% - 1px),
        rgba(255,255,255,.04) calc(10% - 1px),
        rgba(255,255,255,.04) 10%
    );
}

.statistics-traffic-indicator-sort-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    gap: 12px;
    width: auto;
    flex-wrap: nowrap;
}

.statistics-card-traffic-indicator-height,
.statistics-card-traffic-indicator-height-filter {
    height: 100%;
    /* min-height: 550px; */
}

.statistics-filter-range-option-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.statistics-filter-range-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
}

/* Стили для графика количества игр */
.statistics-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.statistics-chart-header h2 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    color: #fff;
}

.statistics-metric {
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

.statistics-metric-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(---text-secondary-color);
    cursor: pointer;
}

.statistics-metric-label input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--statistics-accent);
    border-radius: 50%;
    transition: all 0.2s;
}

.statistics-metric-label input:checked {
    background: var(--statistics-accent);
    border-color: var(--accent-color);
}

.statistics-info-btn {
    position: relative;
    z-index: 1003;
    cursor: pointer;
    pointer-events: auto;
    flex: 0 0 auto;

    width: 24px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 10px;
    line-height: 20px;

    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(74, 163, 248, 0.8);
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    box-sizing: border-box;
}

.statistics-info-btn:hover {
    background: rgba(148, 163, 184, 0.24);
}

.statistics-chart-content {
    position: relative;
    background: var(--input-background-color);
    border-radius: 10px;
    padding: 28px 16px 210px;
    overflow: hidden;
}

.statistics-grid {
    position: absolute;
    transform: scale(1, -1);
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 0;
}

.statistics-grid-line {
    position: absolute;
    left: 48px;
    right: 16px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.statistics-grid-label {
    position: absolute;
    left: 8px;
    font-size: 12px;
    color: var(--text-secondary-color);
    transform: translateY(50%);
    transform: scale(1, -1);
}

.statistics-bars {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 180px;
    padding: 0 16px;
}

.statistics-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ------------------------------------------------------------
   Game-count histogram:
   Bars + day cards must share the same column geometry.
   Use CSS grid with fractional columns (no fixed px widths).
------------------------------------------------------------ */
.statistics-game-count-chart-content .statistics-bars,
.statistics-game-count-chart-content .statistics-day-cards {
    display: grid;
    grid-template-columns: repeat(var(--statistics-cols, 7), minmax(0, 1fr));
    gap: 8px;
}

.statistics-game-count-chart-content .statistics-bars {
    justify-items: center;
    align-items: flex-end;
}

.statistics-game-count-chart-content .statistics-day-cards {
    /* Align inner content with .statistics-bars:
       chart has padding-left/right:16px AND bars have padding-left/right:16px */
    padding: 8px 16px;
    justify-items: stretch;
    align-items: start;
}

.statistics-game-count-chart-content .statistics-col,
.statistics-game-count-chart-content .statistics-day-card {
    width: 100% !important;
    min-width: 0;
}

.statistics-bar {
    width: 26px;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: filter 0.2s;
    background: var(--accent-color);
    display: flex;
    justify-content: center;
}

.statistics-bar-hover {
    filter: brightness(1.1);
}

.statistics-bar-value {
    position: absolute;
    top: -20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    width: 100%;
    min-width: 120px;
    margin: auto 0;
    text-align: center;
    vertical-align: middle;
}

.statistics-bar-label {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary-color);
}

.statistics-mean-line {

    fill: none;
    stroke: var(--statistics-bar-green);
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(39, 255, 230, 0.5));
}

.statistics-mean-point {
    fill: var(--statistics-bar-green);
    stroke: var(--card-color);
    stroke-width: 1.6;
    cursor: pointer;
}

.statistics-legend {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 132px;
    display: flex;
    justify-content: center;
    gap: 32px;
    font-size: 15px;
    color: var(--text-secondary-color);
    z-index: 2;
}

.statistics-dot-value,
.statistics-dot-mean {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.statistics-dot-value {
    background: var(--statistics-accent);
}

.statistics-dot-mean {
    background: var(--statistics-bar-green);
}

.statistics-day-cards {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: var(--card-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    display: flex;
    justify-content: space-around;
    gap: 8px;
    z-index: 2;
    border-radius: 0 0 10px 10px;
}

.statistics-day-card {
    background: var(--input-background-color);
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    color: var(--text-secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 160px;
}

.statistics-day-card-hover {
    box-shadow: 0 0 0 2px var(--statistics-accent);
}

.statistics-day-card-week-data {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 86px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 8px;
}

.statistics-day-badge {
    display: block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 8px;
    text-align: center;
}


.statistics-card-line {
    display: flex;
    justify-content: space-between;
    white-space: nowrap;
    width: calc(100% - 8px);
}

.statistics-card-label {
    flex: 0 0 auto;
    text-align: left;
    min-width: 30px;
    padding-right: 4px;
}

.statistics-card-value {
    flex: 0 0 auto;
    font-weight: bold;
    display: inline-block;
    min-width: 54px;
}


.statistics-tooltip {
    position: fixed;
    display: flex;
    flex-direction: column;
    background: var(--card-color);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -6px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 99;
    max-width: 360px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.statistics-tooltip-show {
    opacity: 1;
    transform: translate(-50%, -12px);
}

.statistics-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: var(--card-color);
}

.statistics-tooltip b {
    color: var(--statistics-accent);
}

.statistics-input-dropdown {
    font-size: 1em;
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
}

.statistics-table-header-line {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: canter;
    box-sizing: border-box;
    gap: 8px;
    position: relative;
}


.table-mode-input {
    flex: none;
    width: auto;
    margin-left: 8px;
}

.statistics-table-header-line h2 {
    flex-grow: 1;
    margin: 0;
    color: var(--text-secondary-color);
    text-align: center;
}

/* Bookmaker/Market titles: color by coefficient direction */
#market-diagram-header h2,
#market-table-container .statistics-table-header-line h2 {
    color: var(--down, var(--lose-color));
}

#bookmaker-diagram-header h2,
#bookmaker-table-container .statistics-table-header-line h2 {
    color: var(--up, var(--win-color));
}

.statistics-bookmaker-market-card-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.statistics-bookmaker-market-card-container {
    display: flex;
    position: relative;
    gap: 16px;
    width: 100%;
    height: 100%;
}

.statistics-cards-container {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 440px;
    min-height: 440px;
}

.statistics-game-count-chart-content {
    --statistics-cols: 7;
    padding: 42px 16px 210px;
}

.statistics-pie-legend {
    height: 100px;
    display: flex;
    align-items: flex-end;
}

@media (max-width: 1470px) {
    .statistics-bookmaker-market-card-container {
        flex-direction: column;
    }

    .statistics-bookmaker-market-header-container {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px 20px;
    }
    
    .statistics-bars {
        padding: 0 8px 0 16px;
    }
    
    .statistics-bar {
        width: 20px;
    }

    .statistics-day-cards {
        bottom: 8px;
    }

    .statistics-chart-header {
        align-items: flex-start;
    }

    .statistics-traffic-indicator-head {
        font-size: .8889em;
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    #filters-container,
    .statistics-cards-container {
        font-size: 1.1rem;
    }

    .statistics-filter-options-container {
        min-width:440px;
    }

    .statistics-card-label {
        min-width: 44px;
    }
    .statistics-diagram {
        flex-direction: column;
    }

    .statistics-card-market-height {
        min-height: 1060px;
    }

    .statistics-piechart-container {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .statistics-traffic-indicator-head {
        width: 100%;
        flex-direction: column; 
        align-items: flex-start;    
    }

    .statistics-card-traffic-indicator-height {
        min-height: 590px;
    }
}

/* ===== Match dates modal (Bookmaker / Market) ===== */
.modal-overlay.match-dates-overlay {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    border-radius: 0 !important;
}

.modal-container.match-dates-modal {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
}

.modal-container.match-dates-modal .modal-title {
    padding: 20px 24px 12px;
    margin: 0 !important;
}

.modal-container.match-dates-modal .modal-close-btn {
    align-items: center;
    border-radius: 8px;
    display: flex;
    height: 32px;
    justify-content: center;
    line-height: 1;
    top: 18px;
    right: 18px;
    font-size: 24px;
    width: 32px;
    z-index: 2;
}

.modal-container.match-dates-modal .modal-content {
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: var(--text-secondary-color) !important;
}

.match-dates-root {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.match-dates-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 0 24px 16px;
    color: var(--text-secondary-color);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 13px;
}

.badge-outcome {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    background: rgba(44, 100, 213, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(44, 100, 213, 0.3);
}

.summary-separator {
    width: 1px;
    height: 16px;
    background: rgba(148, 163, 184, 0.18);
}

.match-dates-total {
    color: var(--text-color);
}

.match-dates-empty {
    padding: 16px 24px 20px;
    color: var(--text-secondary-color);
}

.match-dates-root .match-dates-table {
    margin: 12px 24px 20px;
    width: calc(100% - 48px);
}

.match-list {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Keep the series results dialog inside the viewport and scroll its content as one surface. */
body.indicator-series .series-match-dates-overlay {
    align-items: center !important;
    padding: 16px !important;
    overflow: hidden !important;
}

body.indicator-series .series-match-dates-overlay .match-dates-modal {
    width: min(720px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100dvh - 32px) !important;
    min-height: 0 !important;
    margin: auto !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

body.indicator-series .series-match-dates-overlay .match-dates-modal .modal-title {
    flex: 0 0 auto;
}

body.indicator-series .series-match-dates-overlay .match-dates-modal .modal-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

body.indicator-series .series-match-dates-overlay .match-dates-root {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
}

body.indicator-series .series-match-dates-overlay .match-list {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    scrollbar-gutter: auto;
}

.match-list::-webkit-scrollbar { width: 6px; }
.match-list::-webkit-scrollbar-track { background: var(--card-color); }
.match-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.match-row {
    display: grid;
    /* Grid: ColorStrip | Date | MatchInfo | Score */
    grid-template-columns: 4px minmax(82px, 96px) minmax(0, 1fr) auto;
    gap: 16px;
    padding: 14px 24px 14px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    transition: background 0.15s;
    align-items: center;
}

.match-row:last-child { border-bottom: none; }
.match-row:hover { background-color: rgba(255, 255, 255, 0.03); }

/* Status bar (Win/Loss/Return/Pending) */
.status-strip {
    width: 100%;
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.match-row.win .status-strip { background-color: var(--win-color); box-shadow: 2px 0 8px rgba(49, 155, 54, 0.25); }
.match-row.loss .status-strip { background-color: var(--lose-color); }
.match-row.return .status-strip { background-color: var(--return-color); }
.match-row.pending .status-strip { background-color: #334155; }

/* Date column */
.date-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-left: 12px;
}

.date-day { font-size: 14px; font-weight: 600; color: var(--text-color); }
.date-time { font-size: 12px; color: var(--text-secondary-color); font-variant-numeric: tabular-nums; }

.match-archive-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 7px;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.16);
    color: rgba(147, 197, 253, 1);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
}

.match-archive-link:hover,
.match-archive-link:focus-visible {
    border-color: rgba(147, 197, 253, 0.72);
    background: rgba(37, 99, 235, 0.26);
    color: rgba(219, 234, 254, 1);
    text-decoration: none;
    outline: none;
}

/* Info column */
.info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.league-name {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary-color);
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Teams (target team highlighting) */
.teams-name {
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.teams-name.match-link:hover,
.teams-name.match-link:focus-visible {
    color: rgba(147, 197, 253, 1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.team-name.is-target {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.team-name.is-opponent {
    color: var(--text-secondary-color);
    font-weight: 400;
}

.vs {
    color: #475569;
    font-size: 12px;
    margin: 0 2px;
}

.match-odds-line {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-secondary-color);
    font-variant-numeric: tabular-nums;
}

.match-odds-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.match-odds-stack .match-odds-line {
    margin-top: 0;
}

.match-odds-sep {
    color: rgba(148, 163, 184, 0.55);
}


.match-odds-open {
    color: var(--text-secondary-color);
}

.match-odds-close {
    color: #cfd8ea;
    font-weight: 700;
}

.match-odds-close.is-up {
    color: var(--win-color);
}

.match-odds-close.is-down {
    color: var(--lose-color);
}

/* Score column */
.score-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    min-width: 76px;
    padding-left: 8px;
}

.main-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    background: var(--input-background-color);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-variant-numeric: tabular-nums;
}

.match-row.win .main-score { color: var(--win-color); border-color: rgba(49, 155, 54, 0.35); }
.match-row.loss .main-score { color: var(--lose-color); border-color: rgba(198, 40, 40, 0.35); }
.match-row.return .main-score { color: var(--return-color); border-color: rgba(158, 158, 158, 0.3); }

.match-row.pending .main-score {
    color: var(--text-secondary-color);
    border: none;
    background: transparent;
    padding: 0;
}

.half-score {
    font-size: 11px;
    color: var(--text-secondary-color);
    font-family: monospace;
    white-space: nowrap;
}

/* Mobile */
@media (max-width: 500px) {
    .modal-overlay.match-dates-overlay {
        padding: 14px;
    }

    .modal-container.match-dates-modal {
        width: min(100%, 360px) !important;
    }

    .modal-container.match-dates-modal .modal-title {
        padding: 18px 66px 10px 18px;
        font-size: 19px !important;
    }

    .modal-container.match-dates-modal .modal-close-btn {
        top: 8px;
        right: 8px;
    }

    .modal-container.match-dates-modal .modal-content {
        max-height: calc(100dvh - 94px);
    }

    body.indicator-series .series-match-dates-overlay {
        padding: 10px !important;
    }

    body.indicator-series .series-match-dates-overlay .match-dates-modal {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
    }

    .match-dates-summary {
        gap: 8px;
        padding: 0 18px 14px;
    }

    body.indicator-series .series-match-dates-overlay .series-summary-help {
        width: auto;
        min-width: 44px;
        min-height: 44px;
        margin-left: 0;
        padding: 0 12px;
        font-size: 16px;
        cursor: pointer;
    }

    body.indicator-series .series-match-dates-overlay .series-summary-help-panel {
        margin: 0 18px 12px;
    }

    body.indicator-series .series-match-dates-overlay .series-odds-legend {
        margin: 10px 18px 0;
    }

    .match-row {
        grid-template-columns: 4px 54px 1fr auto;
        gap: 12px;
        padding-right: 12px;
    }

    .date-day { font-size: 12px; }
    .league-name { display: none; }
}

/* While modal is opened, hide large "no data" message so it doesn't bleed under overlay */
body.is-modal-open .statistics-diagram-no-data {
    visibility: hidden;
}

/* Strength Line onboarding tour */
.sl-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0); /* default: dim is handled by the highlight shadow */
}

/* Fallback dim for steps without a target element */
.sl-tour-overlay.sl-tour-overlay--dim {
    background: rgba(0, 0, 0, 0.72);
}

.sl-tour-highlight {
    position: fixed;
    border-radius: 12px;
    /* Stronger focus on the highlighted control */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
    border: 2px solid rgba(63, 131, 248, 0.9);
    pointer-events: none;
    z-index: 100001;
}

.sl-tour-tooltip {
    position: fixed;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: #121c2b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 14px 12px;
    color: #e9f1ff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 100002;
}

.sl-tour-tooltip__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sl-tour-tooltip__title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
}

.sl-tour-tooltip__close {
    background: transparent;
    border: none;
    color: rgba(233, 241, 255, 0.8);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}

.sl-tour-tooltip__close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sl-tour-tooltip__text {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(233, 241, 255, 0.92);
}

.sl-tour-tooltip__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.sl-tour-tooltip__counter {
    font-size: 12px;
    color: rgba(233, 241, 255, 0.65);
    white-space: nowrap;
}

.sl-tour-tooltip__step {
    font-size: 12px;
    color: rgba(233, 241, 255, 0.65);
}

.sl-tour-tooltip__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sl-tour-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sl-tour-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
}

.sl-tour-btn--primary {
    background: #2c6cf6;
    border-color: #2c6cf6;
}

.sl-tour-btn--primary:hover {
    background: #1f5ae0;
    border-color: #1f5ae0;
}

.sl-tour-btn:focus {
    outline: 2px solid rgba(44, 108, 246, 0.65);
    outline-offset: 2px;
}

.sl-tour-btn:disabled {
    opacity: 0.55;
    cursor: default;
}
