:root {
    --bg: #08090c;
    --bg-2: #0d0f14;
    --card: #12151c;
    --card-2: #161a23;
    --line: #232936;
    --text: #eef1f6;
    --muted: #9aa3b2;
    --dim: #727b8b;
    --orange: #f3582f;
    --orange-rgb: 243, 88, 47;
    --green: #3cff82;
    --runner: #4f8df9;
    --hunter: #ff4b42;
    --radius: 16px;
    --max: 1120px;
    --display: "Archivo", system-ui, sans-serif;
    --body: system-ui, -apple-system, "Segoe UI", sans-serif
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px
}

body {
    margin: 0;
    background: radial-gradient(900px 520px at 85% -8%, rgba(var(--orange-rgb), .09), transparent 62%), radial-gradient(700px 460px at 3% 10%, rgba(79, 141, 249, .06), transparent 58%), var(--bg);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased
}

a {
    color: inherit
}

.wrap {
    width: min(var(--max), calc(100% - 48px));
    margin-inline: auto
}

.skip {
    position: fixed;
    z-index: 100;
    left: 16px;
    top: -80px;
    background: var(--orange);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    transition: top .2s
}

.skip:focus {
    top: 12px
}

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    background: rgba(8, 9, 12, .82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px)
}

.header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 44px
}

.wordmark {
    display: inline-flex;
    align-items: baseline;
    text-decoration: none;
    font-family: var(--display);
    font-weight: 900;
    letter-spacing: -.06em;
    line-height: 1
}

.wordmark i {
    font-size: 23px;
    transform: skew(-9deg)
}

.wordmark span {
    font-size: 7px;
    letter-spacing: .24em;
    color: var(--dim);
    margin-left: 8px
}

.desktop-nav {
    display: flex;
    gap: 26px
}

.desktop-nav a {
    color: var(--muted);
    font-family: var(--display);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.desktop-nav a:hover {
    color: var(--text)
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px
}

.live-pill,
.online-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--display);
    font-size: 13px;
    font-weight: 700
}

.live-pill {
    padding: 7px 14px;
    border: 1px solid rgba(60, 255, 130, .45);
    border-radius: 999px;
    text-decoration: none;
    background: rgba(60, 255, 130, .04)
}

.live-pill span,
.online-count span,
.connection.is-live span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 9px var(--green);
    animation: pulse 2s ease-in-out infinite
}

.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--orange);
    color: white;
    border-radius: 9px;
    padding: 9px 18px;
    font-family: var(--display);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: filter .15s, transform .15s
}

.play-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px)
}

.menu-button,
.mobile-nav {
    display: none
}

.hero {
    padding: 78px 0 68px
}

.eyebrow {
    margin: 0 0 13px;
    color: var(--orange) !important;
    font-family: var(--display);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .2em;
    text-transform: uppercase
}

.hero h1,
.section-heading h2 {
    margin: 0;
    font-family: var(--display);
    font-weight: 850;
    letter-spacing: -.04em;
    line-height: 1.06
}

.hero h1 {
    font-size: clamp(48px, 7vw, 78px);
    max-width: 800px
}

.intro {
    max-width: 680px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 2vw, 19px)
}

.connection {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 42px 0 28px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--muted);
    font-size: 12.5px
}

.connection span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dim)
}

.connection b {
    font-weight: 650
}

.connection.is-error span {
    background: var(--hunter)
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px
}

.stat-grid article {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 21px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius)
}

.stat-grid strong {
    font-family: var(--display);
    font-size: 36px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums
}

.stat-grid span {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13.5px
}

section {
    padding: 70px 0
}

.live-section,
.results-section {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(13, 15, 20, .58)
}

.section-heading {
    margin-bottom: 38px
}

.section-heading h2 {
    font-size: clamp(32px, 4vw, 46px)
}

.section-heading>p:last-child,
.section-heading>div>p:last-child {
    max-width: 650px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px
}

.split-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px
}

.online-count {
    padding-bottom: 6px;
    color: var(--muted);
    white-space: nowrap
}

.active-matches {
    display: grid;
    gap: 22px
}

.empty-state {
    min-height: 420px;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(rgba(8, 9, 12, .7), rgba(8, 9, 12, .7)), repeating-radial-gradient(circle at center, transparent 0 48px, rgba(79, 141, 249, .07) 49px 50px)
}

.empty-state h3 {
    margin: 23px 0 4px;
    font: 800 19px var(--display)
}

.empty-state p {
    margin: 0;
    color: var(--muted)
}

.radar {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 8px rgba(60, 255, 130, .08), 0 0 30px var(--green)
}

.match-console {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card)
}

.console-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 22px 25px;
    border-bottom: 1px solid var(--line)
}

.driver {
    min-width: 0
}

.driver.right {
    text-align: right
}

.driver-role {
    display: block;
    color: var(--dim);
    font: 750 10px var(--display);
    letter-spacing: .15em;
    text-transform: uppercase
}

.driver strong {
    display: block;
    margin-top: 2px;
    font: 800 20px var(--display);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.driver.chaser strong {
    color: var(--hunter)
}

.driver.runner strong {
    color: var(--runner)
}

.versus {
    text-align: center
}

.versus b {
    display: block;
    font: 850 24px var(--display);
    font-variant-numeric: tabular-nums
}

.versus span {
    color: var(--dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em
}

.console-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px
}

.map-wrap {
    position: relative;
    min-height: 420px;
    background: #0b0e13
}

.chase-map {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px
}

.roads path {
    stroke: #353d4d;
    stroke-width: 14
}

.roads path:nth-child(even) {
    stroke: #2b323f;
    stroke-width: 8
}

.districts text {
    fill: #596273;
    font: 700 11px var(--display);
    letter-spacing: .22em
}

.route-chaser,
.route-runner {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .88
}

.route-chaser {
    stroke: var(--hunter)
}

.route-runner {
    stroke: var(--runner)
}

.map-marker circle {
    stroke: #fff;
    stroke-width: 2
}

.map-marker text {
    fill: white;
    font: 800 10px var(--display);
    text-anchor: middle;
    dominant-baseline: middle
}

.telemetry {
    padding: 24px;
    background: var(--card-2);
    border-left: 1px solid var(--line)
}

.telemetry h3 {
    margin: 0 0 22px;
    font: 800 13px var(--display);
    letter-spacing: .15em;
    text-transform: uppercase
}

.metric {
    display: flex;
    align-items: end;
    justify-content: space-between;
    padding: 13px 0;
    border-top: 1px solid var(--line)
}

.metric span {
    color: var(--muted);
    font-size: 13px
}

.metric b {
    font: 800 18px var(--display);
    font-variant-numeric: tabular-nums
}

.capture {
    margin-top: 22px
}

.capture-head {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px
}

.capture-track {
    height: 7px;
    margin-top: 9px;
    border-radius: 10px;
    background: #ffffff0e;
    overflow: hidden
}

.capture-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--hunter);
    box-shadow: 0 0 15px rgba(255, 75, 66, .4);
    transition: width .5s ease
}

.table-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card)
}

.table-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 21px 24px 15px
}

.table-title h3 {
    margin: 0;
    font: 800 18px var(--display)
}

.table-title span {
    color: var(--dim);
    font-size: 12px
}

.leader-row {
    display: grid;
    grid-template-columns: 44px 1fr auto 80px;
    gap: 14px;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--line);
    font-size: 14px
}

.leader-row .place {
    color: var(--dim);
    font-variant-numeric: tabular-nums
}

.leader-row strong {
    font-family: var(--display)
}

.leader-row .record {
    color: var(--muted);
    font-variant-numeric: tabular-nums
}

.leader-row .elo {
    text-align: right;
    font-weight: 750;
    font-variant-numeric: tabular-nums
}

.leader-row:first-child .place,
.leader-row:first-child .elo {
    color: var(--orange)
}

.loading-line {
    padding: 8px 24px 24px;
    color: var(--muted)
}

.results-list {
    display: grid;
    gap: 14px
}

.result-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card)
}
.onyx-start-marker { display: grid; place-items: center; border: 1px solid #f5d06f; background: rgba(22, 18, 8, .88); color: #f5d06f; font: 800 9px/1 var(--display); letter-spacing: .08em; }

.community-row.match-row { display: block; position: relative; padding: 0; }
.match-row > a { display: grid; grid-template-columns: 54px 1fr 120px 100px; align-items: center; gap: 16px; width: 100%; padding: 17px 118px 17px 20px; color: inherit; text-decoration: none; }
.match-row strong span { display: inline; }
.match-row > a:hover { background: #ffffff04; }
.match-share { border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font: inherit; }
.match-row .match-share { position: absolute; right: 20px; top: 50%; min-height: 32px; padding: 0 10px; transform: translateY(-50%); }
.match-share:hover, .match-share:focus-visible { border-color: var(--accent); color: var(--text); }
.match-detail { display: grid; gap: 14px; }
.match-back { color: var(--muted); font: 700 12px/1 var(--display); text-decoration: none; }
.match-back:hover { color: var(--text); }
.match-detail h2 { margin: 0; }
.match-detail p { margin: 0; color: var(--muted); }
.match-detail-map { min-height: 520px; margin-top: 8px; border: 1px solid var(--line); background: #07101d; }
.match-detail-map.match-map-empty { display: grid; place-items: center; padding: 24px; color: var(--muted); text-align: center; }
.match-share-detail { justify-self: start; min-height: 38px; padding: 0 15px; }

.result-summary {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr 26px;
    align-items: center;
    gap: 15px;
    padding: 18px 21px;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
    cursor: pointer
}

.result-summary:hover {
    background: #ffffff04
}

.result-driver {
    min-width: 0
}

.result-driver.right {
    text-align: right
}

.result-driver b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 750 16px var(--display)
}

.result-driver small {
    color: var(--muted)
}

.result-mid {
    text-align: center
}

.winner-badge {
    display: block;
    color: var(--green);
    font: 750 10px var(--display);
    letter-spacing: .1em;
    text-transform: uppercase
}

.result-mid b {
    font: 800 14px var(--display)
}

.chevron {
    color: var(--dim);
    transition: transform .2s
}

.result-card.open .chevron {
    transform: rotate(180deg)
}

.result-detail {
    display: none;
    padding: 18px 21px 22px;
    border-top: 1px solid var(--line)
}

.result-card.open .result-detail {
    display: block
}

.result-map {
    height: 330px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line)
}

footer {
    padding: 70px 0 38px;
    background: var(--bg-2)
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center
}

.footer-logo {
    margin-bottom: 14px
}

.footer-inner p {
    margin: 0;
    color: var(--muted)
}

.footer-play {
    margin: 24px 0
}

.footer-inner small {
    max-width: 700px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--dim)
}

:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px
}

@keyframes pulse {
    50% {
        opacity: .42
    }
}

@media(max-width:800px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .console-body {
        grid-template-columns: 1fr
    }

    .telemetry {
        border-left: 0;
        border-top: 1px solid var(--line);
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0 18px
    }

    .telemetry h3,
    .capture {
        grid-column: 1/-1
    }

    .desktop-nav {
        display: none
    }

    .menu-button {
        display: grid;
        width: 38px;
        height: 38px;
        place-content: center;
        gap: 4px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: none
    }

    .menu-button b {
        width: 17px;
        height: 2px;
        background: var(--text);
        transition: .2s
    }

    .menu-button[aria-expanded=true] b:first-child {
        transform: translateY(6px) rotate(45deg)
    }

    .menu-button[aria-expanded=true] b:nth-child(2) {
        opacity: 0
    }

    .menu-button[aria-expanded=true] b:last-child {
        transform: translateY(-6px) rotate(-45deg)
    }

    .mobile-nav.open {
        display: flex;
        flex-direction: column;
        padding: 10px 24px 18px;
        border-top: 1px solid var(--line)
    }

    .mobile-nav a {
        padding: 10px;
        color: var(--muted);
        font-weight: 700;
        text-decoration: none
    }

    .match-row > a { grid-template-columns: 34px 1fr; padding-right: 92px; }
    .match-row > a > span, .match-row > a > em { grid-column: 2; }
    .community-row.match-row > a > span { display: block; }
    .match-detail-map { min-height: 390px; }
}

@media(max-width:560px) {
    .wrap {
        width: min(100% - 30px, var(--max))
    }

    .hero {
        padding: 55px 0
    }

    .hero h1 {
        font-size: 45px
    }

    .stat-grid {
        gap: 10px
    }

    .stat-grid article {
        min-height: 100px;
        padding: 16px
    }

    .stat-grid strong {
        font-size: 30px
    }

    .split-heading {
        display: block
    }

    .online-count {
        margin-top: 16px
    }

    .console-top {
        grid-template-columns: 1fr
    }

    .driver,
    .driver.right {
        text-align: center
    }

    .versus {
        order: 3
    }

    .map-wrap,
    .chase-map {
        min-height: 330px
    }

    .telemetry {
        grid-template-columns: 1fr
    }

    .metric {
        grid-column: 1/-1
    }

    .result-summary {
        grid-template-columns: 1fr
    }

    .result-driver,
    .result-driver.right {
        text-align: center
    }

    .result-mid {
        order: 3
    }

    .chevron {
        display: none
    }

    .header-actions {
        gap: 8px
    }

    .header-actions .play-button {
        display: none
    }

    .wordmark span {
        display: none
    }

    .live-pill {
        padding: 7px 11px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *:before,
    *:after {
        animation: none !important;
        transition: none !important
    }
}
