:root
{
    --pistachio: #9CC96B;
    --apricot: #F2A65A;
    --dusk: #22213F;
    --ink: #17162B;
    --kerb: #E0483E;
    --chalk: #F4F1EC;
    --behind: #FF8A7A;
    --display: "Barlow Condensed", "Bahnschrift", "DIN Alternate", "Arial Narrow", system-ui, sans-serif;
    --body: "Barlow", "Inter", system-ui, -apple-system, sans-serif;
}
*
{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body
{
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--dusk);
    color: #fff;
    font-family: var(--body);
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}
#game
{
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.hidden
{
    display: none !important;
}
#speedfx
{
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 52%, rgba(242, 166, 90, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 5;
}
#hud
{
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}
.hud-tl
{
    position: absolute;
    top: 16px;
    left: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}
.panel
{
    background: rgba(23, 22, 43, 0.72);
    border-left: 5px solid var(--pistachio);
    transform: skewX(-12deg);
    padding: 8px 22px 10px 16px;
}
.panel > .un
{
    transform: skewX(12deg);
}
.lab
{
    font-family: var(--display);
    font-size: 15px;
    letter-spacing: 0.02em;
    opacity: 0.8;
}
.time
{
    font-family: var(--display);
    font-size: 44px;
    font-weight: 800;
    font-style: italic;
    font-variant-numeric: tabular-nums;
    line-height: 1.02;
}
.delta
{
    border-left-color: var(--apricot);
    padding: 5px 18px 6px 14px;
}
#deltaTxt
{
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    font-style: italic;
    font-variant-numeric: tabular-nums;
}
#deltaTxt.ahead
{
    color: var(--pistachio);
}
#deltaTxt.behind
{
    color: var(--behind);
}
#sectorBar
{
    display: flex;
    gap: 5px;
}
.sec
{
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 4px 10px;
    min-width: 58px;
    text-align: center;
    background: rgba(23, 22, 43, 0.7);
    border-bottom: 3px solid rgba(255, 255, 255, 0.25);
    transform: skewX(-12deg);
}
.sec.live
{
    border-bottom-color: var(--apricot);
}
.sec.ahead
{
    border-bottom-color: var(--pistachio);
    color: var(--pistachio);
}
.sec.behind
{
    border-bottom-color: var(--behind);
    color: var(--behind);
}
.sec.first
{
    border-bottom-color: #C9A8FF;
    color: #C9A8FF;
}
#split
{
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
    font-family: var(--display);
    font-size: 46px;
    font-weight: 800;
    font-style: italic;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 22px rgba(23, 22, 43, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}
#split.show
{
    opacity: 1;
}
#split.ahead
{
    color: var(--pistachio);
}
#split.behind
{
    color: var(--behind);
}
#split.first
{
    color: #C9A8FF;
}
#tower
{
    position: absolute;
    top: 200px;
    right: 18px;
    width: 190px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tw
{
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    padding: 3px 12px 3px 6px;
    background: rgba(23, 22, 43, 0.68);
    border-left: 4px solid rgba(255, 255, 255, 0.28);
    transform: skewX(-12deg);
}
.tw > span
{
    display: inline-block;
    transform: skewX(12deg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.twp
{
    width: 20px;
    text-align: center;
    font-weight: 800;
    font-style: italic;
    opacity: 0.75;
}
.tw.me
{
    background: rgba(156, 201, 107, 0.4);
    border-left-color: var(--pistachio);
}
.tw.fin
{
    opacity: 0.6;
}
#mini
{
    position: absolute;
    top: 16px;
    right: 18px;
    width: 170px;
    height: 170px;
}
.hud-bl
{
    position: absolute;
    left: 22px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mrow
{
    display: flex;
    gap: 12px;
    font-family: var(--display);
    font-size: 16px;
    background: rgba(23, 22, 43, 0.6);
    padding: 3px 14px 3px 10px;
    border-left: 4px solid;
    transform: skewX(-12deg);
    font-variant-numeric: tabular-nums;
}
.mrow > span
{
    display: inline-block;
    transform: skewX(12deg);
}
.mrow .mn
{
    width: 52px;
}
.mrow.got
{
    background: rgba(156, 201, 107, 0.38);
}
.hud-br
{
    position: absolute;
    right: 26px;
    bottom: 22px;
    text-align: right;
}
.speed
{
    font-family: var(--display);
    font-weight: 800;
    font-style: italic;
    line-height: 0.9;
}
#spd
{
    font-size: 82px;
    font-variant-numeric: tabular-nums;
}
.unit
{
    font-size: 19px;
    margin-left: 6px;
    opacity: 0.8;
}
.boost-lab
{
    font-family: var(--display);
    font-size: 14px;
    opacity: 0.8;
    margin-top: 6px;
}
.boost
{
    position: relative;
    width: 240px;
    height: 14px;
    margin-top: 4px;
    margin-left: auto;
    background: rgba(23, 22, 43, 0.72);
    transform: skewX(-24deg);
    overflow: hidden;
}
.boost-fill
{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 30%;
    background: linear-gradient(90deg, var(--apricot), #FFD37A);
}
#lookTag
{
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--display);
    font-size: 15px;
    padding: 5px 14px;
    background: rgba(23, 22, 43, 0.6);
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
#count
{
    position: fixed;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    font-family: var(--display);
    font-size: 180px;
    font-weight: 800;
    font-style: italic;
    text-shadow: 0 6px 30px rgba(23, 22, 43, 0.6);
    pointer-events: none;
    z-index: 12;
}
#count.pop
{
    animation: pop 0.5s ease-out;
}
@keyframes pop
{
    from
    {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
    to
    {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
#toast
{
    position: fixed;
    left: 50%;
    top: 20%;
    transform: translateX(-50%);
    font-family: var(--display);
    font-size: clamp(28px, 4vw, 50px);
    font-weight: 800;
    font-style: italic;
    text-align: center;
    text-shadow: 0 4px 24px rgba(23, 22, 43, 0.7);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 40;
    width: max-content;
    max-width: 90vw;
}
#toast.show
{
    opacity: 1;
}
#menu
{
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(90deg, rgba(23, 22, 43, 0.95) 0%, rgba(23, 22, 43, 0.88) 26%, rgba(23, 22, 43, 0.3) 44%, rgba(23, 22, 43, 0) 56%, rgba(23, 22, 43, 0) 62%, rgba(23, 22, 43, 0.38) 72%, rgba(23, 22, 43, 0.9) 84%, rgba(23, 22, 43, 0.95) 100%);
}
.menu-grid
{
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 4vh 3vw;
}
.col
{
    width: 400px;
    max-width: 100%;
}
.col-right
{
    width: 340px;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: thin;
}
.col
{
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.col-right
{
    gap: 14px;
}
.logo
{
    font-family: var(--display);
    font-size: clamp(50px, 6.5vw, 84px);
    font-weight: 800;
    font-style: italic;
    letter-spacing: -0.02em;
    line-height: 0.82;
    color: var(--chalk);
}
.kerb
{
    margin-top: 12px;
    height: 11px;
    background: repeating-linear-gradient(90deg, var(--kerb) 0 28px, var(--chalk) 28px 56px);
    transform: skewX(-30deg);
    transform-origin: left;
}
.today-head
{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.track-no
{
    font-family: var(--display);
    font-size: 32px;
    font-weight: 800;
    font-style: italic;
}
.date
{
    font-size: 15px;
    opacity: 0.7;
}
#preview
{
    width: 100%;
    max-width: 330px;
    aspect-ratio: 2 / 1;
    display: block;
    margin-top: 4px;
}
.mod
{
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--pistachio);
}
.mod-wet
{
    border-left-color: #6FA8DC;
    background: rgba(111, 168, 220, 0.18);
}
.mod-noboost
{
    border-left-color: var(--apricot);
    background: rgba(242, 166, 90, 0.16);
}
.mod-reverse
{
    border-left-color: #C9A8FF;
    background: rgba(201, 168, 255, 0.16);
}
.track-len, .hint
{
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.68;
}
.online
{
    font-family: var(--display);
    font-size: 16px;
    color: var(--pistachio);
    min-height: 1em;
}
.challenge
{
    font-size: 15px;
    line-height: 1.45;
    padding: 10px 14px;
    background: rgba(242, 166, 90, 0.18);
    border-left: 4px solid var(--apricot);
}
.start-row
{
    display: flex;
    gap: 12px;
    align-items: stretch;
}
#name
{
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font: inherit;
    font-size: 18px;
    padding: 10px 12px;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}
#name:focus
{
    border-bottom-color: var(--pistachio);
}
.btn-drive
{
    background: var(--pistachio);
    color: var(--ink);
    border: 0;
    padding: 12px 38px;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 800;
    font-style: italic;
    transform: skewX(-12deg);
    cursor: pointer;
}
.btn-drive > span
{
    display: inline-block;
    transform: skewX(12deg);
}
.btn-drive:hover
{
    background: #B2DB84;
}
.btn-race
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--apricot);
    color: var(--ink);
    border: 0;
    padding: 12px 22px;
    font-family: var(--display);
    font-size: 26px;
    font-weight: 800;
    font-style: italic;
    transform: skewX(-12deg);
    cursor: pointer;
}
.btn-race > span, .btn-race > em
{
    display: inline-block;
    transform: skewX(12deg);
}
.btn-race > em
{
    font-size: 20px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}
.btn-race:hover
{
    background: #FFBE76;
}
.btn-drive:focus-visible, .btn-line:focus-visible, .btn-race:focus-visible
{
    outline: 3px solid var(--apricot);
    outline-offset: 3px;
}
.look-row
{
    display: flex;
    align-items: center;
    gap: 12px;
}
.seg
{
    display: flex;
    transform: skewX(-12deg);
    border: 2px solid rgba(255, 255, 255, 0.35);
}
.seg button
{
    background: transparent;
    border: 0;
    color: #fff;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
    padding: 6px 16px;
    cursor: pointer;
}
.seg button > span
{
    display: inline-block;
    transform: skewX(12deg);
}
.seg button.on
{
    background: var(--chalk);
    color: var(--ink);
}
#menuFps
{
    font-size: 13px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}
.medals
{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.medal
{
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 4px solid;
    transform: skewX(-12deg);
}
.medal > div
{
    transform: skewX(12deg);
}
.medal .mname
{
    font-family: var(--display);
    font-size: 14px;
    opacity: 0.8;
}
.medal .mtime
{
    font-family: var(--display);
    font-size: 21px;
    font-weight: 700;
    font-style: italic;
    font-variant-numeric: tabular-nums;
}
.medal.got
{
    background: rgba(156, 201, 107, 0.25);
}
.pb
{
    font-size: 15px;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}
.board h2
{
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 7px;
    display: flex;
    gap: 10px;
    align-items: baseline;
}
.board h2 em
{
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    opacity: 0.6;
}
.board ol
{
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.board li
{
    display: grid;
    grid-template-columns: 28px 1fr auto;
    font-size: 15px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    font-variant-numeric: tabular-nums;
}
.board li.me
{
    background: rgba(156, 201, 107, 0.22);
}
.board li.empty
{
    display: block;
    opacity: 0.7;
}
.board li.gap
{
    display: block;
    text-align: center;
    background: transparent;
    opacity: 0.5;
    padding: 0;
}
.promo
{
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #fff;
    background: rgba(242, 166, 90, 0.16);
    border-left: 4px solid var(--apricot);
}
.promo.watch
{
    background: rgba(156, 201, 107, 0.14);
    border-left-color: var(--pistachio);
}
.promo strong
{
    display: block;
    font-family: var(--display);
    font-size: 19px;
    font-weight: 700;
    font-style: italic;
}
.promo span
{
    display: block;
    font-size: 14px;
    opacity: 0.8;
    margin-top: 2px;
}
.promo:hover
{
    background: rgba(242, 166, 90, 0.28);
}
.promo.watch:hover
{
    background: rgba(156, 201, 107, 0.26);
}
.menu-actions, .account-actions
{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.menu-actions .btn-line, .account-actions .btn-line
{
    flex: 1;
    text-align: center;
    min-width: 130px;
}
.account
{
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.9;
}
.ads
{
    font-size: 13px;
    opacity: 0.75;
}
.ads a
{
    color: var(--apricot);
}
#pause, #results, #lobby
{
    position: fixed;
    inset: 0;
    background: rgba(23, 22, 43, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
}
.pause-box, .results-box, .lobby-box
{
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pause-box h2, .results-box h2
{
    font-family: var(--display);
    font-size: 54px;
    font-style: italic;
    font-weight: 800;
    line-height: 1;
}
.lobby-box
{
    text-align: center;
    align-items: center;
}
.lobby-box h2
{
    font-family: var(--display);
    font-size: 30px;
    font-weight: 600;
    opacity: 0.85;
}
.lobby-count
{
    font-family: var(--display);
    font-size: 120px;
    font-weight: 800;
    font-style: italic;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--apricot);
}
.lobby-box p
{
    font-size: 16px;
    line-height: 1.5;
    max-width: 36ch;
}
.results-box ol
{
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 40vh;
    overflow-y: auto;
}
.results-box li
{
    display: grid;
    grid-template-columns: 30px 1fr auto;
    font-size: 16px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    font-variant-numeric: tabular-nums;
}
.results-box li.me
{
    background: rgba(156, 201, 107, 0.3);
}
.btn-line
{
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.35);
    padding: 10px 16px;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.btn-line:hover
{
    border-color: var(--pistachio);
}
#garage
{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(460px, 100%);
    padding: 4vh 28px;
    background: linear-gradient(90deg, rgba(23, 22, 43, 0.95), rgba(23, 22, 43, 0.84));
    z-index: 25;
    overflow-y: auto;
}
.garage-box
{
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.garage-head
{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.garage-head h2
{
    font-family: var(--display);
    font-size: 50px;
    font-weight: 800;
    font-style: italic;
}
.garage-box h3
{
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 7px;
    opacity: 0.85;
}
.chips
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip
{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    padding: 7px 12px;
    cursor: pointer;
}
.chip i
{
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.chip.on
{
    border-color: var(--pistachio);
    background: rgba(156, 201, 107, 0.2);
}
.chip:focus-visible
{
    outline: 3px solid var(--apricot);
}
#touch
{
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}
.tp
{
    position: absolute;
    bottom: 18px;
    display: flex;
    gap: 12px;
    pointer-events: auto;
}
.tp-left
{
    left: 16px;
}
.tp-right
{
    right: 14px;
    flex-direction: column;
    gap: 10px;
}
.tp button, #tpause
{
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(23, 22, 43, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 700;
    touch-action: none;
}
.tp-left button
{
    font-size: 30px;
}
.tp-right button
{
    width: 72px;
    height: 72px;
}
.tp button.on
{
    background: rgba(156, 201, 107, 0.6);
}
#tpause
{
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    pointer-events: auto;
}
body.touch .hud-br
{
    right: 104px;
    bottom: 18px;
}
body.touch #spd
{
    font-size: 52px;
}
body.touch .boost
{
    width: 140px;
}
body.touch .hud-bl
{
    display: none;
}
body.touch #mini
{
    width: 112px;
    height: 112px;
}
body.touch .time
{
    font-size: 30px;
}
body.touch #tower
{
    top: 142px;
    width: 150px;
}
body.touch .sec
{
    min-width: 48px;
    font-size: 13px;
}
@media (max-width: 1000px)
{
    .menu-grid
    {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 20px;
    }
    .col, .col-right
    {
        width: 100%;
        max-height: none;
        overflow: visible;
    }
    #menu
    {
        background: rgba(23, 22, 43, 0.9);
    }
    #preview
    {
        max-width: none;
    }
}
@media (prefers-reduced-motion: reduce)
{
    #count.pop
    {
        animation: none;
    }
    #toast, #speedfx, #split
    {
        transition: none;
    }
}
