.pitch-chart-wrapper .chart-controls.cs-pitch-chart-filter,
.stats-content-area .pitch-chart-wrapper .chart-controls.cs-pitch-chart-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 16px;
    padding: 12px 12px 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pitch-chart-wrapper .cs-pitch-chart-filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    color: #000;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-option.is-active {
    background: #000;
    border-color: #000;
    color: #fff;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-option:focus-visible {
    outline: 2px solid #16b7eb;
    outline-offset: 2px;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-option .pitch-type-indicator {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    display: inline-block;
    border-radius: 50%;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-option .pitch-type-name {
    display: inline;
    color: inherit;
    line-height: 1.2;
    text-align: left;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-option.is-active .pitch-type-name {
    color: #fff;
}

.pitch-chart-wrapper .cs-pitch-chart-filter-select {
    display: none !important;
}

.pitch-chart-wrapper .cs-league-avg-toggle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0 auto 12px;
}

.pitch-chart-wrapper .cs-league-avg-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    color: #000;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
}

.pitch-chart-wrapper .cs-league-avg-toggle-button.is-active {
    background: #000;
    border-color: #000;
    color: #fff;
}

.pitch-chart-wrapper .cs-league-avg-toggle-button:focus-visible {
    outline: 2px solid #16b7eb;
    outline-offset: 2px;
}

.pitch-chart-wrapper .cs-league-avg-toggle-button:disabled {
    cursor: default;
    color: #777;
    background: #fff;
    border-color: #d0d0d0;
}

.pitch-chart-wrapper .cs-league-avg-swatch {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 50%;
    border: 1.5px solid #16b7eb;
    background-color: rgba(22, 183, 235, 0.16);
    background-image: repeating-linear-gradient(
        -45deg,
        #16b7eb,
        #16b7eb 1.5px,
        transparent 1.5px,
        transparent 4px
    );
}

.pitch-chart-wrapper .cs-league-avg-swatch-mlb {
    background-image:
        repeating-linear-gradient(45deg, #16b7eb, #16b7eb 1.5px, transparent 1.5px, transparent 4px),
        repeating-linear-gradient(-45deg, #16b7eb, #16b7eb 1.5px, transparent 1.5px, transparent 4px);
}

@media (prefers-reduced-motion: reduce) {
    .pitch-chart-wrapper .cs-pitch-chart-filter-option,
    .pitch-chart-wrapper .cs-league-avg-toggle-button {
        transition: none;
    }
}

/* Keep the movement chart square so an inch is the same length on both axes. */
.stats-content .pitch-chart-wrapper canvas,
.stats-content-area .pitch-chart-wrapper canvas,
.stats-content-area.chart-display-mode .pitch-chart-wrapper canvas {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    max-width: 500px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}
