.season-race__subtitle {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.season-race__title {
    font-size: 16px;
    font-weight: 700;
}

.season-race__chart-panel {
    overflow: visible;
}

.season-race__chart-scroll {
    flex: 1 1 auto;
    min-width: 0;
}

.season-race__body {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: flex-start;
}

.season-race__chart {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.season-race__svg {
    display: block;
    width: 100%;
    height: auto;
}

.season-race__axis-label {
    fill: #888;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.season-race__grid-line {
    stroke: #e5e5e5;
    stroke-width: 1;
}

.season-race__grid-line--vertical {
    stroke-dasharray: 4 4;
}

.season-race__axis-tick {
    fill: #777;
    font-size: 11px;
}

.season-race__team-line {
    fill: none;
    stroke-width: 2.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.55;
    transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.season-race__team-line.is-highlighted {
    opacity: 1;
    stroke-width: 4.25;
}

.season-race__team-line.is-dimmed {
    opacity: 0.1;
}

.season-race__team-point {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.season-race__tooltip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 6px 10px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    transform: translate(-50%, -120%);
}

.season-race__legend {
    flex: 0 0 150px;
    max-width: 150px;
    overflow: visible;
}

.season-race__legend--aligned {
    position: relative;
}

.season-race__legend--aligned .season-race__legend-item {
    position: absolute;
    left: 0;
    right: 0;
    margin: 0;
    transform: translateY(-50%);
}

.season-race__legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 4px 5px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.season-race__legend-item:hover,
.season-race__legend-item.is-highlighted {
    background: rgba(46, 204, 113, 0.1);
}

.season-race__legend-item.is-dimmed {
    opacity: 0.35;
}

.season-race__legend-item img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.season-race__legend-name {
    font-size: 12px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="dark"] .season-race__grid-line {
    stroke: #3a3a3a;
}

html[data-theme="dark"] .season-race__axis-label {
    fill: #9a9a9a;
}

html[data-theme="dark"] .season-race__axis-tick {
    fill: #b0b0b0;
}

html[data-theme="dark"] .season-race__tooltip {
    background: #2a2a2a;
    border-color: #444;
    color: #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .season-race__legend-item:hover,
html[data-theme="dark"] .season-race__legend-item.is-highlighted {
    background: rgba(46, 204, 113, 0.15);
}

@media (max-width: 991px) {
    .season-race__chart-panel {
        overflow: hidden;
    }

    .season-race__chart-scroll {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .season-race__body {
        flex-direction: column;
        flex-wrap: wrap;
    }

    .season-race__legend,
    .season-race__legend--aligned {
        position: static;
        flex-basis: auto;
        max-width: none;
        height: auto !important;
        min-height: 0 !important;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .season-race__legend--aligned .season-race__legend-item,
    .season-race__legend-item {
        position: static;
        transform: none;
        flex: 1 1 calc(50% - 4px);
        margin-bottom: 0;
    }
}
