@font-face
{
    font-family: Shoulders;
    src: url("./fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2");
    font-weight: 800;
}
@font-face
{
    font-family: Shoulders;
    src: url("./fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
}
@font-face
{
    font-family: Shoulders;
    src: url("./fonts/big-shoulders-display-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
}
@font-face
{
    font-family: Outfit;
    src: url("./fonts/outfit-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
}
@font-face
{
    font-family: Outfit;
    src: url("./fonts/outfit-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
}
@font-face
{
    font-family: Outfit;
    src: url("./fonts/outfit-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
}
@font-face
{
    font-family: Mono;
    src: url("./fonts/share-tech-mono-latin-400-normal.woff2") format("woff2");
}
:root
{
    --ink: #1c1612;
    --paper: #f6f1e7;
    --coral: #c4512c;
    --gold: #e7c27a;
}
*
{
    box-sizing: border-box;
}
body
{
    margin: 0;
    overflow: hidden;
    background: #1e3a5f;
    color: var(--paper);
    font: 400 15px/1.5 Outfit, sans-serif;
}
button, a
{
    -webkit-tap-highlight-color: transparent;
}
button
{
    min-height: 46px;
    border: 1px solid #f6f1e74d;
    padding: 10px 22px;
    border-radius: 999px;
    background: transparent;
    color: var(--paper);
    font: 500 14px Outfit, sans-serif;
    cursor: pointer;
    touch-action: none;
}
button:hover
{
    background: #f6f1e719;
}
button:focus-visible, a:focus-visible
{
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}
button.primary
{
    background: var(--coral);
    border-color: var(--coral);
}
button.primary:hover
{
    background: #d7653e;
}
#world, #ui
{
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}
#world
{
    display: block;
}
#ui
{
    pointer-events: none;
}
button, .sheet, .topbar a
{
    pointer-events: auto;
}
.topbar
{
    position: absolute;
    top: max(22px, env(safe-area-inset-top));
    left: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.wordmark
{
    font: 800 24px Shoulders, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.wordmark::before
{
    content: "";
    display: inline-block;
    width: 20px;
    height: 14px;
    background: var(--coral);
    clip-path: polygon(0 0, 62% 0, 100% 50%, 62% 100%, 0 100%);
    margin-right: 10px;
}
.topright
{
    display: flex;
    gap: 12px;
    align-items: center;
}
.topright small
{
    font-size: 10px;
    letter-spacing: 2px;
}
.sound
{
    background: #1c16124d;
    min-height: 44px;
    padding: 7px 16px;
    font-size: 12px;
}
.sheet
{
    position: absolute;
    width: 420px;
    max-height: calc(100dvh - 150px);
    overflow-y: auto;
    top: 50%;
    left: 32px;
    transform: translateY(-50%);
    padding: 28px;
    border-radius: 18px;
    background: #1c1612b8;
    backdrop-filter: blur(8px);
    border: 1px solid #f6f1e71c;
    box-shadow: 0 20px 70px #1c16121c;
    animation: arrive 180ms ease-out;
}
.eyebrow, .micro
{
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
}
.eyebrow
{
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.eyebrow::before
{
    content: "";
    width: 24px;
    height: 1px;
    background: var(--gold);
}
h1, h2
{
    font: 800 76px/.98 Shoulders, sans-serif;
    letter-spacing: -1px;
    margin: 20px 0 10px;
}
h2
{
    font-size: 54px;
}
.subtitle
{
    font-size: 18px;
    margin: 0 0 22px;
}
.deck
{
    font-size: 14px;
    line-height: 1.65;
    color: #e2d9cb;
    margin-bottom: 24px;
}
.best
{
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #f6f1e72b;
    border-bottom: 1px solid #f6f1e72b;
    padding: 14px 0;
    font: 14px Mono, monospace;
    margin: 0 0 24px;
}
.actions
{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.actions .primary
{
    flex: 1;
    min-width: 150px;
}
.fine
{
    font-size: 11px;
    color: #d5c9b9;
    line-height: 1.7;
    margin: 21px 0 12px;
}
.credit
{
    color: #d5c9b9;
    font-size: 10px;
    text-underline-offset: 3px;
}
.small-button
{
    min-height: 44px;
    font-size: 11px;
    padding: 4px 12px;
    margin-top: 12px;
}
.bottomline
{
    position: absolute;
    bottom: 24px;
    left: 32px;
    right: 32px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    letter-spacing: 1.7px;
    color: #fff3dc;
    text-shadow: 0 1px 5px #1c1612;
}
.scene-label
{
    position: absolute;
    bottom: 105px;
    right: 72px;
    border-left: 2px solid var(--gold);
    padding-left: 12px;
    text-shadow: 0 2px 6px #1c1612;
}
.scene-label strong
{
    display: block;
    font: 700 28px Shoulders, sans-serif;
    text-transform: uppercase;
}
.scene-label span
{
    font: 11px Mono, monospace;
}
.hud
{
    position: absolute;
    inset: 20px;
}
.race-top
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.stats
{
    display: flex;
    gap: 28px;
}
.stat
{
    text-shadow: 0 2px 10px #1c1612;
}
.stat small
{
    display: block;
    font-size: 10px;
    letter-spacing: 2px;
}
.stat strong
{
    font: 700 50px/1.1 Shoulders, sans-serif;
}
.timing
{
    text-align: center;
}
.timing strong
{
    font: 28px Mono, monospace;
}
.timing em
{
    display: block;
    font: 12px Mono, monospace;
    margin-top: 6px;
}
.speed
{
    text-align: right;
}
.speed strong
{
    font-size: 64px;
}
#pause
{
    position: absolute;
    right: 0;
    top: 104px;
    background: #1c1612b8;
}
#map
{
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 168px;
    height: 168px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: var(--ink);
}
.boost
{
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    text-align: center;
    font-size: 10px;
    letter-spacing: 2px;
}
.boost-track
{
    margin-top: 8px;
    height: 10px;
    background: #1c1612b8;
    border-radius: 999px;
    overflow: hidden;
}
#boost-fill
{
    height: 100%;
    background: var(--gold);
    transform-origin: left;
    transform: scaleX(0);
}
.boost-track.armed
{
    outline: 2px solid var(--paper);
    animation: armed-pulse 400ms ease-out;
}
.race-sound
{
    position: absolute;
    top: 104px;
    left: 0;
}
.controls-sheet
{
    width: 480px;
}
#banner
{
    position: absolute;
    left: 50%;
    top: 22%;
    transform: translateX(-50%);
    background: #1c1612c9;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}
#banner:empty
{
    display: none;
}
#nearby
{
    position: absolute;
    top: 95px;
    left: 0;
    font-size: 12px;
    text-shadow: 0 2px 4px #1c1612;
}
#count
{
    position: absolute;
    top: 38%;
    width: 100%;
    text-align: center;
    font: 800 140px Shoulders, sans-serif;
    text-shadow: 0 4px 40px #1c1612;
}
.touch
{
    display: none;
    position: absolute;
    inset: 0;
}
#steer
{
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: #1c161291;
    border: 1px solid #f6f1e799;
    padding: 0;
    font-size: 32px;
    color: #f6f1e780;
}
#knob
{
    position: absolute;
    width: 44px;
    height: 44px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    left: 43px;
    top: 43px;
    background: #e7c27a4d;
    pointer-events: none;
}
.pedals
{
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 16px;
    display: grid;
    grid-template-columns: 72px 92px;
    gap: 8px;
    align-items: end;
}
.pedals button
{
    width: 72px;
    height: 72px;
    padding: 0;
    color: var(--ink);
    background: var(--paper);
    font-weight: 600;
}
.pedals #gas
{
    background: var(--coral);
    color: var(--paper);
    width: 92px;
    height: 92px;
    grid-row: span 2;
}
.pedals #drift
{
    background: var(--gold);
}
button.held
{
    transform: scale(.96);
    box-shadow: inset 0 0 0 3px #1c161280;
}
.controls-grid
{
    margin: 20px 0;
}
.control-row
{
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #f6f1e724;
    font-size: 13px;
}
kbd
{
    color: var(--gold);
    font: 12px Mono, monospace;
}
.results
{
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.results li
{
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f6f1e726;
    font-size: 13px;
}
.results li.me
{
    color: var(--gold);
}
.results time
{
    margin-left: auto;
    font: 13px Mono, monospace;
}
.sr-only
{
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
[hidden]
{
    display: none !important;
}
@keyframes arrive
{
    from { opacity: 0; margin-top: 8px; }
    to { opacity: 1; margin-top: 0; }
}
@keyframes armed-pulse
{
    50% { box-shadow: 0 0 18px #ffb067; }
}
@media (pointer: coarse), (max-width: 799px)
{
    .touch { display: block; }
    .boost { bottom: 190px; }
}
@media (max-width: 699px)
{
    .topbar { top: max(14px, env(safe-area-inset-top)); left: 18px; right: 18px; }
    .wordmark { font-size: 20px; }
    .topright small { display: none; }
    .sheet
    {
        left: 14px;
        right: 14px;
        bottom: max(16px, env(safe-area-inset-bottom));
        top: auto;
        transform: none;
        width: auto;
        max-height: 58dvh;
        padding: 22px;
    }
    .controls-sheet { width: auto; }
    h1 { font-size: 61px; margin-top: 12px; }
    h2 { font-size: 46px; }
    .subtitle { margin-bottom: 12px; font-size: 16px; }
    .deck { font-size: 12px; line-height: 1.55; margin: 12px 0 16px; }
    .best { padding: 10px 0; margin-bottom: 16px; font-size: 12px; }
    .fine { margin: 14px 0 6px; font-size: 10px; }
    .bottomline, .scene-label { display: none; }
    .hud { inset: max(14px, env(safe-area-inset-top)) 14px 0; }
    .race-top { display: block; }
    .stats { position: absolute; top: 65px; gap: 22px; }
    .stat strong { font-size: 36px; }
    .stat small { font-size: 9px; letter-spacing: 1px; }
    .timing { position: absolute; top: 65px; left: 164px; text-align: left; }
    .timing strong { font-size: 21px; }
    .timing em { font-size: 10px; }
    .speed { position: absolute; top: 0; right: 0; display: flex; align-items: baseline; gap: 6px; }
    .speed strong { font-size: 40px; }
    #pause { top: 0; left: 0; right: auto; }
    .race-sound { top: 0; left: 106px; }
    #map { width: 104px; height: 104px; top: 123px; right: 0; bottom: auto; }
    #nearby { top: 135px; font-size: 11px; }
    #banner { top: 30%; max-width: 95%; font-size: 12px; }
    #count { font-size: 110px; top: 34%; }
}
@media (prefers-reduced-motion: reduce)
{
    *, *::before, *::after { animation: none !important; transition: none !important; }
    button.held { transform: none; }
}
