﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #0d1117;
    color: #e6edf3;
}

a, .btn-link {
    color: #58a6ff;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* <noscript> summary of the WebAssembly live timing page (App.razor, for crawlers without JavaScript) */
.seo-noscript {
    max-width: 720px;
    margin: 3rem auto;
    padding: 0 1rem;
    text-align: center;
}

/* --- Share dialog (Client/Components/ShareDialog.razor; behaviour in js/app.js) --- */
.olt-share-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid #30363d;
    border-radius: 10px;
    background: #161b22;
    color: #e6edf3;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.olt-share-dialog::backdrop {
    background: rgba(1, 4, 9, 0.7);
}

.olt-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
}

.olt-share-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.olt-share-close {
    border: 0;
    background: transparent;
    color: #8b949e;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.olt-share-close:hover {
    color: #e6edf3;
}

.olt-share-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.olt-share-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 630;
    border: 1px solid #30363d;
    border-radius: 8px;
    background: #0d1117;
}

.olt-share-notice {
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #9e6a03;
    border-radius: 6px;
    background: rgba(187, 128, 9, 0.15);
    color: #e3b341;
    font-size: 0.85rem;
}

.olt-share-link {
    display: flex;
    gap: 8px;
}

.olt-share-link input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 8px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #0d1117;
    color: #e6edf3;
    font-size: 0.85rem;
}

.olt-share-copied {
    margin: -6px 0 0;
    color: #3fb950;
    font-size: 0.8rem;
}

.olt-share-networks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
}

.olt-share-download {
    color: #58a6ff;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
}

.olt-share-download:hover {
    text-decoration: underline;
}

/* ===== Track map views /2d and /3d (Components/TrackMapView.razor, js/trackmap.js, js/track3d.js) =====
   Global: the SVG and canvas are created by the scripts, outside the scoped CSS of the component. Full viewport like /bt. */
/* The track map as an OBS browser source (?obs=1): transparent, no scroll, no cursor; the 3D view fills it */
html:has(body.tm-obs-body), body.tm-obs-body { background: transparent !important; overflow: hidden; cursor: none; }
.tm-page.tm-obs { background: transparent; }
.tm-obs .tm-tower { top: 8px; }
.tm-obs .tm-tower-toggle, .tm-obs .tm-tower-modes { display: none; }

.tm-page {
    position: fixed;
    inset: 0;
    z-index: 5;
    background: #0d1117;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    flex-wrap: wrap;
}

.tm-modes { display: inline-flex; }

.tm-mode, .tm-icon, .tm-link {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #c9d1d9;
    font-size: 0.8rem;
    padding: 2px 10px;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
}

.tm-mode:first-child { border-radius: 4px 0 0 4px; }
.tm-mode:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.tm-mode.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.tm-icon, .tm-link { border-radius: 4px; }
.tm-icon { padding: 2px 8px; }
.tm-circuit { color: #c9d1d9; font-size: 0.85rem; font-weight: 600; }

/* The progress of a replayed session at the bottom of the track map (Components/ReplayControls), like a video */
.tm-replay-strip {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; padding: 0.35rem 1rem 0.45rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.tm-has-replay .tm3d-controls { bottom: 3.2rem; }
.tm-note {
    color: #8b949e;
    font-size: 0.75rem;
    margin-right: auto;
}

.tm-stage {
    position: relative;
    flex: 1;
    min-height: 0;
}

.tm-empty {
    color: #8b949e;
    font-size: 0.95rem;
    padding: 48px 24px;
    text-align: center;
}

.tm-svg { width: 100%; height: 100%; display: block; }
.tm-track-edge { fill: none; stroke: #30363d; stroke-width: 9; stroke-linejoin: round; }
.tm-track { fill: none; stroke: #6e7681; stroke-width: 6; stroke-linejoin: round; }
.tm-line { stroke: #fff; stroke-width: 2.4; }
.tm-sector { fill: #a371f7; }

.tm-car circle { fill: #c9d1d9; stroke: #0d1117; stroke-width: 0.8; }
.tm-car text { fill: #0d1117; font-weight: 700; font-family: system-ui, sans-serif; pointer-events: none; }
.tm-car.tm-p1 circle { fill: #ffd700; }
.tm-car.tm-p2 circle { fill: #c0c0c0; }
.tm-car.tm-p3 circle { fill: #cd7f32; }
.tm-car.tm-followed circle { fill: #2ea043; stroke: #fff; stroke-width: 1.2; }
.tm-car.tm-followed text { fill: #fff; }

.tm3d-canvas { width: 100%; height: 100%; display: block; background: #0d1117; outline: none; }

.tm3d-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    color: #8b949e;
    font-size: 0.9rem;
    pointer-events: none;
}

.tm3d-logo {
    width: min(260px, 60%);
    height: auto;
}

/* Controls of the 3D view: over the bottom of the view */
.tm3d-controls {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    padding: 6px 8px;
    background: rgba(13, 17, 23, 0.82);
    border: 1px solid #30363d;
    border-radius: 8px;
    z-index: 2;
}

.tm3d-views { display: inline-flex; flex-wrap: wrap; }
.tm3d-views .tm-mode { border-radius: 0; border-left-width: 0; padding: 4px 10px; }
.tm3d-views .tm-mode:first-child { border-radius: 4px 0 0 4px; border-left-width: 1px; }
.tm3d-views .tm-mode:last-child { border-radius: 0 4px 4px 0; }
.tm-icon.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }

.tm3d-driver {
    background: #161b22;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-size: 0.8rem;
    padding: 3px 6px;
    max-width: 220px;
}

.tm3d-help {
    position: absolute;
    right: 12px;
    bottom: 64px;
    width: min(420px, calc(100% - 24px));
    max-height: calc(100% - 120px);
    overflow: auto;
    padding: 14px 16px;
    background: rgba(13, 17, 23, 0.94);
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 0.85rem;
    z-index: 3;
}

.tm3d-help h2 { font-size: 1rem; margin: 0 0 8px; }
.tm3d-help h3 { font-size: 0.85rem; margin: 12px 0 4px; color: #e6edf3; }
.tm3d-help p, .tm3d-help ul { margin: 0 0 6px; }
.tm3d-help ul { padding-left: 18px; }
.tm3d-help kbd { background: #30363d; border-radius: 3px; padding: 0 5px; color: #e6edf3; }
.tm3d-help-close { position: absolute; top: 8px; right: 8px; }

/* Mini live timing of the track map views (TrackMapView.razor) */
.tm-tower {
    position: absolute;
    top: 44px;
    left: 8px;
    bottom: 8px;
    width: 300px;
    max-width: calc(100% - 16px);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    z-index: 2;
}

.tm-tower.is-closed { width: auto; bottom: auto; }

.tm-tower-head { display: flex; align-items: flex-start; gap: 6px; }
.tm-tower-modes { pointer-events: auto; display: inline-flex; margin-bottom: 4px; border: 1px solid #30363d; border-radius: 4px; overflow: hidden; }
.tm-tower-mode {
    background: rgba(13, 17, 23, 0.82);
    border: 0;
    color: #8b949e;
    font-size: 0.75rem;
    padding: 1px 8px;
    cursor: pointer;
}
.tm-tower-mode + .tm-tower-mode { border-left: 1px solid #30363d; }
.tm-tower-mode.active { background: #1f6feb; color: #fff; }
.tm-tower-clock {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px auto;
    padding: 1px 8px;
    background: rgba(13, 17, 23, 0.82);
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e6edf3;
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.tm-tower-clock:not(:has(span)) { display: none; }
.tm-tower-clock .text-center { display: inline; }
.tm-tower-clock .text-center span { font-size: 0.8rem; line-height: 1.5; color: #e6edf3; }
.tm-tower-laps { color: #e6edf3; letter-spacing: 0.02em; }

.tm-tower-toggle {
    pointer-events: auto;
    align-self: flex-start;
    background: rgba(13, 17, 23, 0.82);
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 0.75rem;
    padding: 1px 8px;
    margin-bottom: 4px;
    cursor: pointer;
}

.tm-tower-rows {
    pointer-events: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: 100%;
    background: rgba(13, 17, 23, 0.82);
    border: 1px solid #30363d;
    border-radius: 6px;
    scrollbar-width: thin;
}

.tm-tower-row button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 2px 8px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: #e6edf3;
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.tm-tower-row button:hover { background: rgba(255, 255, 255, 0.06); }
.tm-tower-row.is-followed button { background: rgba(31, 111, 235, 0.35); }
.tm-tower-row { position: relative; }
/* Position change: the colour stays while the row slides (0.6 s) and 2 s after, then fades (4 s in all, RANK_HIGHLIGHT_MS of trackmap.js) */
.tm-tower-row.tm-gained button { animation: tmRankGained 4s linear; }
.tm-tower-row.tm-lost button { animation: tmRankLost 4s linear; }
@keyframes tmRankGained { 0%, 65% { background-color: rgba(34, 197, 94, 0.55); box-shadow: inset 3px 0 0 #22c55e; } 100% { background-color: transparent; box-shadow: inset 3px 0 0 transparent; } }
@keyframes tmRankLost { 0%, 65% { background-color: rgba(239, 68, 68, 0.45); box-shadow: inset 3px 0 0 #ef4444; } 100% { background-color: transparent; box-shadow: inset 3px 0 0 transparent; } }
.tm-t-pos { width: 20px; text-align: right; color: #8b949e; flex: none; }
.tm-t-num { width: 34px; font-weight: 700; flex: none; }
.tm-t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tm-t-last { width: 62px; text-align: right; flex: none; }
.tm-t-last.is-overall { color: #d2a8ff; }
.tm-t-last.is-personal { color: #3fb950; }
.tm-t-last.is-slower { color: #e3b341; }
.tm-t-gap { width: 62px; text-align: right; flex: none; }
.tm-t-gap.is-overall { color: #d2a8ff; }
.tm-t-sectors { display: inline-flex; gap: 2px; flex: none; }
.tm-t-sector { width: 9px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.tm-t-sector.is-overall { background: #a371f7; }
.tm-t-sector.is-personal { background: #2ea043; }
.tm-t-sector.is-slower { background: #d29922; }
.tm-tower-row.is-off button { color: #8b949e; }
.tm-tower-row.is-off button:disabled { cursor: default; }
.tm-t-status { width: 31px; text-align: center; flex: none; font-size: 0.68rem; font-weight: 700; color: #8b949e; border: 1px solid #484f58; border-radius: 3px; line-height: 1.3; }
.tm-t-badge { width: 16px; height: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; font-size: 0.66rem; font-weight: 800; line-height: 1; }
.tm-t-badge.tm-best { background: #8957e5; color: #fff; }
.tm-t-badge.tm-n-warning { background: #e3b341; color: #000; }
.tm-t-badge.tm-n-investigation { background: #e3b341; color: #000; }
.tm-t-badge.tm-n-penalty { background: #f85149; color: #fff; }
.tm-t-badge.tm-n-blackflag, .tm-t-badge.tm-n-disqualified { background: #000; color: #fff; border: 1px solid #f85149; }
.tm-t-badge.tm-n-technical { background: #f0883e; color: #000; }
.tm-t-badge.tm-n-info { background: #388bfd; color: #fff; }
.tm-t-badge.tm-n-disqualified { width: auto; padding: 0 2px; }
.tm3d-note { color: #e3b341; font-size: 0.8rem; white-space: nowrap; }

/* The session is over or none is open: a banner over the view */
.tm-waiting {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    z-index: 3;
    padding: 18px 28px;
    background: rgba(13, 17, 23, 0.88);
    border: 1px solid #30363d;
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
    max-width: calc(100% - 32px);
}
.tm-waiting-title { color: #e6edf3; font-size: 1.15rem; font-weight: 600; }
.tm-waiting-sub { color: #8b949e; font-size: 0.85rem; margin-top: 4px; }

@media (max-width: 640px) {
    .tm-tower { width: 230px; }
    .tm-t-last { display: none; }
}
