/* Interactive race strategy board (race-result.html only). */
.race-strategy-shell {
    margin: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 20px;
    background:
        radial-gradient(circle at 82% 0%, rgba(245, 5, 55, 0.10), transparent 32%),
        linear-gradient(155deg, rgba(20, 22, 31, 0.99), rgba(8, 10, 15, 0.99));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.strategy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px 18px;
}

.strategy-kicker {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.strategy-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 2px solid #ff173c;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 0 5px rgba(255, 23, 60, 0.12);
}

.strategy-icon::before,
.strategy-icon::after {
    content: "";
    position: absolute;
    background: #ff173c;
}

.strategy-icon::before {
    width: 3px;
    height: 11px;
    left: 12px;
    top: 2px;
    transform: rotate(18deg);
    transform-origin: 50% 100%;
}

.strategy-icon::after {
    width: 9px;
    height: 3px;
    left: 12px;
    top: 13px;
    transform: rotate(-25deg);
    transform-origin: 0 50%;
}

.strategy-title {
    color: #f7f8fc;
    font-size: clamp(22px, 2.1vw, 31px);
    line-height: 1.05;
    margin: 0 0 7px;
    letter-spacing: -0.035em;
}

.strategy-subtitle {
    color: #959bab;
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
}

.strategy-race-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    color: #dce0e9;
    background: rgba(255, 255, 255, 0.035);
    font: 700 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-transform: uppercase;
    white-space: nowrap;
}

.strategy-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0 26px 18px;
}

@media (min-width: 1100px) {
    .strategy-summary {
        padding-right: 310px;
    }
}

.strategy-stat {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.strategy-stat span {
    display: block;
    margin-bottom: 3px;
    color: #7f8799;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.strategy-stat strong {
    display: block;
    overflow: hidden;
    color: #f2f4f8;
    font-size: 16px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strategy-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    border-bottom: 1px solid rgba(255, 255, 255, 0.075);
    background: rgba(255, 255, 255, 0.018);
}

.compound-legend,
.weather-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 15px;
}

.compound-key,
.weather-key {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #aeb3c0;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.compound-dot {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: var(--compound);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.weather-line-key {
    width: 20px;
    height: 3px;
    border-radius: 3px;
    background: var(--weather-colour);
}

.strategy-scroll-hint {
    display: none;
    margin: 0;
    padding: 11px 24px 0;
    color: #81889a;
    font-size: 11px;
}

.strategy-board-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: #454b5d #10131a;
    scrollbar-width: thin;
}

.strategy-board {
    --label-width: 86px;
    min-width: 1030px;
    padding: 20px 26px 22px;
    position: relative;
}

.strategy-weather {
    display: grid;
    grid-template-columns: var(--label-width) minmax(0, 1fr);
    align-items: stretch;
    margin-bottom: 20px;
}

.weather-axis-title {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #737b8e;
    font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.strategy-weather-svg {
    display: block;
    width: 100%;
    height: 132px;
    overflow: visible;
}

.weather-grid {
    stroke: rgba(255, 255, 255, 0.09);
    stroke-width: 1;
}

.weather-label {
    fill: #777f90;
    font: 700 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.weather-track-line,
.weather-air-line {
    fill: none;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.weather-track-line {
    stroke: #ff8a00;
}

.weather-air-line {
    stroke: #35b7df;
}

.weather-rain {
    fill: rgba(53, 183, 223, 0.12);
}

.strategy-table-head,
.strategy-driver-row,
.strategy-lap-axis {
    display: grid;
    grid-template-columns: var(--label-width) minmax(0, 1fr);
}

.strategy-table-head {
    align-items: end;
    min-height: 26px;
    color: #747b8b;
    font: 800 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.strategy-table-head > span:last-child {
    text-align: center;
}

.strategy-driver-row {
    position: relative;
    min-height: 30px;
    align-items: center;
    border-radius: 7px;
    transition: background 140ms ease;
}

.strategy-driver-row:hover,
.strategy-driver-row:focus-within,
.strategy-driver-row.is-active {
    background: rgba(255, 255, 255, 0.055);
}

.strategy-driver-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 10px 0 2px;
    color: #d6dae3;
    font: 800 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.strategy-driver-label i {
    width: 4px;
    height: 16px;
    border-radius: 3px;
    background: var(--team-colour);
    box-shadow: 0 0 12px color-mix(in srgb, var(--team-colour) 50%, transparent);
}

.strategy-driver-label small {
    margin-left: auto;
    color: #656d7e;
    font-size: 9px;
    font-style: normal;
}

.strategy-timeline {
    height: 20px;
    position: relative;
    border-radius: 4px;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent calc(10% - 1px),
            rgba(255, 255, 255, 0.07) calc(10% - 1px),
            rgba(255, 255, 255, 0.07) 10%
        ),
        rgba(255, 255, 255, 0.025);
}

.strategy-stint {
    position: absolute;
    top: 2px;
    bottom: 2px;
    min-width: 2px;
    overflow: hidden;
    border: 0;
    border-radius: 3px;
    background: var(--compound);
    color: var(--compound-text, #071018);
    cursor: help;
    font: 900 9px/16px ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
    white-space: nowrap;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.22);
}

.strategy-stint:hover,
.strategy-stint:focus-visible {
    z-index: 4;
    outline: 2px solid rgba(255, 255, 255, 0.78);
    outline-offset: 1px;
    filter: brightness(1.13);
}

.strategy-pit {
    position: absolute;
    z-index: 3;
    top: -2px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #11151d;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95));
    transform: translateX(-50%);
    pointer-events: none;
}

.strategy-lap-axis {
    min-height: 37px;
    align-items: start;
}

.strategy-axis-track {
    height: 30px;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.strategy-axis-tick {
    position: absolute;
    top: -1px;
    width: 1px;
    height: 7px;
    background: rgba(255, 255, 255, 0.24);
    transform: translateX(-50%);
}

.strategy-axis-tick span {
    position: absolute;
    top: 11px;
    left: 50%;
    color: #737b8c;
    font: 700 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    transform: translateX(-50%);
}

.strategy-axis-name {
    color: #777f91;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.strategy-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 26px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.075);
    color: #747c8f;
    font-size: 11px;
    line-height: 1.5;
}

.strategy-footer a {
    color: #39c9e8;
    text-decoration: none;
}

.strategy-footer a:hover {
    text-decoration: underline;
}

.strategy-tooltip {
    position: fixed;
    z-index: 10020;
    width: max-content;
    max-width: 260px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    color: #c9ced8;
    background: rgba(9, 11, 17, 0.97);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.48);
    font-size: 11px;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transform: translate(12px, -110%);
    transition: opacity 100ms ease;
}

.strategy-tooltip.is-visible {
    opacity: 1;
}

.strategy-tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: 12px;
}

.strategy-empty {
    padding: 34px 26px;
    color: #8e95a5;
    text-align: center;
}

@media (max-width: 900px) {
    .strategy-head {
        padding: 20px 18px 15px;
    }

    .strategy-race-chip {
        display: none;
    }

    .strategy-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 18px 15px;
    }

    .strategy-toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 18px;
    }

    .strategy-scroll-hint {
        display: block;
        padding-inline: 18px;
    }

    .strategy-board {
        padding-inline: 18px;
    }

    .strategy-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-inline: 18px;
    }
}

@media (max-width: 560px) {
    .race-strategy-shell {
        margin-bottom: 24px;
        border-radius: 15px;
    }

    .strategy-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .strategy-icon::before {
        left: 10px;
        height: 10px;
    }

    .strategy-icon::after {
        left: 10px;
        top: 12px;
    }

    .strategy-title {
        font-size: 21px;
    }

    .strategy-summary {
        gap: 7px;
    }

    .strategy-stat {
        padding: 10px 11px;
    }

    .strategy-stat strong {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .strategy-driver-row,
    .strategy-tooltip {
        transition: none;
    }
}
