* {
    margin: 0;
    padding: 0;
}

html,
body {
    overflow: hidden;
}

.webgl {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
}

.jitter {
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: jittery;
    z-index: -10;
}

.interface-wrapper {
    width: 100%;
    top: 64px;
    left: 64px;
}

.icon-control-container {
    height: 26.5px;
    width: 26.5px;
}

.export-glb-button {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 20;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    cursor: pointer;
}

.export-glb-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-glb-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media only screen and (max-width: 768px) {
    .interface-wrapper {
        width: 100%;
        top: 24px;
        left: 24px;
    }

    .icon-control-container {
        height: 19.5px;
        width: 19.5px;
    }
}

@keyframes jittery {
    10% {
        transform: translate(-0.1px, -0.15px) scale(1, 1);
    }

    20% {
        transform: translate(0.15px, 0.1px) scale(1, 1);
    }

    30% {
        transform: translate(-0.2px, -0.25px) scale(1, 1);
    }

    40% {
        transform: translate(0.05px, 0.1px) scale(1, 1);
    }

    50% {
        transform: translate(-0.025px, -0.05px) scale(1, 1);
    }

    60% {
        transform: translate(0px, 0.075px) scale(1, 1);
    }

    70% {
        transform: translate(-0.075px, -0.1px) scale(1, 1);
    }

    80% {
        transform: translate(0.075px, 0.125px) scale(1, 1);
    }

    90% {
        transform: translate(-0.125px, -0.075px) scale(1, 1);
    }

    100% {
        transform: translate(0.075px, 0.025px) scale(1, 1);
    }
}

/* the label that follows the pointer over something clickable */
.room-chip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    pointer-events: none;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(12, 12, 16, 0.82);
    color: #fff;
    font: 500 13px/1.2 -apple-system, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.room-chip-button {
    position: fixed;
    z-index: 30;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(12, 12, 16, 0.78);
    color: #fff;
    font: 500 14px/1 -apple-system, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
}

.room-chip-button:hover,
.room-chip-button:focus-visible {
    background: rgba(40, 40, 48, 0.9);
    outline: none;
}

.room-back {
    left: 18px;
    bottom: 18px;
}

.room-open-os {
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
}

.room-overlay-close {
    top: 14px;
    right: 14px;
}

/* the room's targets for keyboard users, shown only while one has focus */
.room-nav {
    position: fixed;
    left: 18px;
    top: 50%;
    z-index: 31;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform: translateY(-50%);
}

.room-nav button {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.room-nav:focus-within button {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(12, 12, 16, 0.82);
    color: #fff;
    font: 500 14px/1 -apple-system, 'Segoe UI', Roboto, sans-serif;
    text-align: left;
    cursor: pointer;
}

.room-nav button:focus-visible {
    outline: 2px solid #7cc4ff;
    outline-offset: 2px;
}

.room-spec-card {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    min-width: 280px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(12, 12, 16, 0.84);
    color: #fff;
    font: 400 13px/1.5 -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.room-spec-title {
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 15px;
}

.room-spec-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.room-spec-row span:first-child {
    color: rgba(255, 255, 255, 0.55);
}

/* the hybrid loading screen: the scan line of the pipeline sweeps */

.hyb-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.pipe-scan {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    margin-top: -1px;
    opacity: 0;
    background: linear-gradient(
        90deg,
        rgba(143, 227, 255, 0),
        rgba(143, 227, 255, 0.9) 12%,
        rgba(255, 255, 255, 1) 50%,
        rgba(143, 227, 255, 0.9) 88%,
        rgba(143, 227, 255, 0)
    );
    box-shadow: 0 0 14px 2px rgba(110, 205, 255, 0.5);
    will-change: transform;
}

h1,
h2,
h3,
h4,
h5,
p {
    /* font-family: ocr-a-std, monospace; */
    font-family: monospace;
    font-weight: 400;
    font-style: normal;
    color: white;
    /* mobile friendly font size */
    font-size: 16px;
}

/* if on mobile */
@media only screen and (max-width: 768px) {
    h1,
    h2,
    h3,
    h4,
    h5,
    p {
        font-size: 10px;
    }
}

br {
    padding-top: 8px;
    padding-bottom: 8px;
    height: 16px;
}

.loading::after {
    display: inline-block;
    animation: dotty steps(1, end) 1s infinite;
    content: '';
}

@keyframes dotty {
    0% {
        content: '   ';
    }
    25% {
        content: '. ';
    }
    50% {
        content: '.. ';
    }
    75% {
        content: '...';
    }
    100% {
        content: '   ';
    }
}
.blinking-cursor {
    background-color: #fff;
    width: 0.8em;
    height: 0.15em;
    -webkit-animation: 0.65s blink step-end infinite;
    -moz-animation: 0.65s blink step-end infinite;
    -ms-animation: 0.65s blink step-end infinite;
    -o-animation: 0.65s blink step-end infinite;
    animation: 0.65s blink step-end infinite;
}

@keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-moz-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-webkit-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-ms-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-o-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

.bios-start-button {
    background-color: #000;
    border: 4px solid #fff;
    border-width: 4px 3px 4px 3px;
}

.bios-start-button p {
    box-sizing: border-box;
    padding: 8px;
}

.bios-start-button:hover p {
    background-color: #fff;
    cursor: pointer;
    color: #000;
}

.loading-screen-header {
    padding: 48px;
}

.loading-screen-body {
    padding-left: 48px;
    padding-right: 48px;
}

.loading-screen-footer {
    padding: 48px;
    padding-bottom: 64px;
}

.info-wrapper {
    top: 64px;
    left: 64px;
}

/* the ui's palette: black glass, hairlines, and white for whatever is picked
   or pressed, like the room's black desk and white pc */
:root {
    --ui-panel: rgba(12, 12, 13, 0.84);
    --ui-panel-solid: rgba(14, 14, 15, 0.96);
    --ui-line: rgba(255, 255, 255, 0.09);
    --ui-line-strong: rgba(255, 255, 255, 0.24);
    --ui-fill: rgba(255, 255, 255, 0.05);
    --ui-fill-hover: rgba(255, 255, 255, 0.1);
    --ui-text: #f4f4f4;
    --ui-muted: rgba(255, 255, 255, 0.55);
    --ui-accent: #fff;
    --ui-accent-hover: #e2e2e2;
    --ui-on-accent: #0c0c0d;
    --ui-warn: rgb(255, 150, 150);
    --ui-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
}

/* the room's panel (and race mode's): a black glass card. sections stack with
   small caps labels, the render modes are one segmented control, and the
   one white button is what to do next */
.look-hint {
    position: fixed;
    top: 18px;
    left: 18px;
    width: 292px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 13px;
    line-height: 1.35;
    pointer-events: none;
    user-select: none;
    z-index: 10;
}

.look-hint.racing {
    width: 268px;
}

.look-hint button,
.look-hint input,
.look-hint select {
    font: inherit;
    box-sizing: border-box;
}

.look-hint .look-hint-begin {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.look-hint .look-hint-pulse {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ui-accent);
}

.look-hint .look-hint-os {
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-top: -6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12.5px;
    text-decoration: none;
    pointer-events: auto;
}

.look-hint .look-hint-os strong {
    color: #fff;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.look-hint .look-hint-os svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.look-hint .look-hint-os:hover strong,
.look-hint .look-hint-os:focus-visible strong {
    color: #fff;
    border-color: #fff;
}

.look-hint label,
.look-hint .look-hint-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.look-hint .car-switcher {
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: auto;
}

.look-hint .car-picker-open {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 5px 10px 5px 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.look-hint .car-picker-open:hover,
.look-hint .car-picker-open:focus-visible {
    border-color: var(--ui-line-strong);
    background: var(--ui-fill-hover);
}

.car-picker-open img {
    width: 64px;
    height: 36px;
    flex: none;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.car-picker-open span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.car-picker-open em {
    font-style: normal;
    font-size: 11px;
    color: var(--ui-muted);
}

.look-hint .car-switcher-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.car-picker {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    box-sizing: border-box;
    background: #08090c;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    pointer-events: auto;
}

/* capable devices browse with the room's car swapping behind, so the panel
   docks left and leaves it in view */
.car-picker.live {
    inset: 18px auto 18px 18px;
    width: min(560px, calc(100vw - 36px));
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: var(--ui-panel-solid);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(14px);
}

.car-picker.live.right {
    inset: 18px 18px 18px auto;
}

.car-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
}

.car-picker button {
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.car-picker .car-picker-close {
    padding: 7px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 600;
}

.car-picker-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.car-picker-filters button {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.car-picker-filters button.active {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
}

.car-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 40vw), 1fr));
    gap: 10px;
    overflow-y: auto;
    padding-right: 2px;
}

.car-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.car-card:hover,
.car-card:focus-visible {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.car-card.selected {
    border-color: var(--ui-accent);
    background: rgba(255, 255, 255, 0.09);
}

.car-card img {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.car-card-name {
    font-size: 13px;
    font-weight: 600;
}

.car-card-class {
    align-self: center;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ui-muted);
}

.car-card-stats {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
}

.car-card-stats b {
    color: #fff;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .car-card {
        transition: none;
    }
}

.look-hint select,
.look-hint input {
    height: 31px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    outline: none;
    pointer-events: auto;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.look-hint select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23ffffff%27 stroke-opacity=%270.7%27 stroke-width=%272.4%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px;
    cursor: pointer;
}

.look-hint select option {
    background: #17181d;
    color: #fff;
}

.look-hint input::placeholder {
    color: rgba(255, 255, 255, 0.32);
}

.look-hint select:hover,
.look-hint input:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background-color: rgba(255, 255, 255, 0.09);
}

.look-hint select:focus-visible,
.look-hint input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: none;
}

.look-hint .render-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    pointer-events: auto;
}

.look-hint .render-mode .look-hint-label {
    width: 100%;
}

.look-hint .look-hint-segment {
    flex: 1;
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.look-hint .look-hint-segment button {
    flex: 1;
    height: 26px;
    padding: 0 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.look-hint .look-hint-segment button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.look-hint .look-hint-segment button.active {
    color: var(--ui-on-accent);
    background: var(--ui-accent);
}

.look-hint .render-mode-scale {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* the panel's plain buttons */
.look-hint .look-hint-chip,
.look-hint .view-toggle button,
.look-hint .multiplayer-actions button,
.look-hint .multiplayer-row button,
.look-hint .multiplayer-status button,
.look-hint .race-error button,
.look-hint .race-actions button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.look-hint .look-hint-chip:hover,
.look-hint .view-toggle button:hover,
.look-hint .multiplayer-actions button:hover,
.look-hint .multiplayer-row button:hover,
.look-hint .multiplayer-status button:hover,
.look-hint .race-error button:hover,
.look-hint .race-actions button:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.24);
}

.look-hint button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.look-hint .look-hint-chip.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
}

.look-hint .view-toggle {
    display: flex;
    pointer-events: auto;
}

.look-hint .view-toggle button {
    flex: 1;
}

.look-hint .view-toggle button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* race mode: garage and pause side by side, the way out under them */
.look-hint .race-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    pointer-events: auto;
}

.look-hint .race-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
}

.look-hint .race-actions button span {
    flex: 1;
    text-align: left;
}

.look-hint .race-actions svg {
    flex: none;
    width: 15px;
    height: 15px;
    fill: rgba(255, 255, 255, 0.85);
}

.look-hint .race-actions kbd {
    padding: 3px 5px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.look-hint .race-actions .race-garage svg {
    fill: #fff;
}

/* no garage in the middle of a lobby race */
.look-hint .race-actions .race-garage:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.look-hint .race-actions .race-toggle {
    grid-column: 1 / -1;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.look-hint .race-actions .race-toggle span {
    flex: none;
}

.look-hint .race-lock-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11.5px;
}

body.race-mode-touch {
    overscroll-behavior: none;
}

body.race-mode-touch #webgl,
body.race-mode-touch #ui-app {
    touch-action: none;
    user-select: none;
}

.lobby-code-banner {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.62);
    color: rgba(255, 255, 255, 0.92);
    font-family: monospace;
    font-size: 12px;
    pointer-events: auto;
}

.lobby-code-banner button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    color: rgba(0, 0, 0, 0.92);
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    cursor: pointer;
}

.look-hint .race-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 110, 110, 0.35);
    border-radius: 9px;
    background: rgba(120, 20, 20, 0.25);
    color: rgba(255, 190, 190, 0.95);
    font-size: 12px;
}

.look-hint .multiplayer-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: auto;
}

/* the two tracks side by side, the picked one outlined in white */
.look-hint .track-pick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.look-hint .track-pick button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: var(--ui-fill);
    color: var(--ui-muted);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.look-hint .track-pick button:hover {
    border-color: var(--ui-line-strong);
    background: var(--ui-fill-hover);
}

.look-hint .track-pick button.on {
    border-color: var(--ui-accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px var(--ui-accent);
}

.look-hint .track-pick strong {
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}

.look-hint .track-pick small {
    font-size: 11px;
    line-height: 1.3;
}

.look-hint .track-pick-note {
    margin: 0;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 11px;
    line-height: 1.35;
}

.look-hint .multiplayer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.look-hint .multiplayer-row label {
    flex: none;
    width: 50px;
}

.look-hint .multiplayer-row input {
    flex: 1;
    min-width: 0;
}

.look-hint #multiplayer-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.look-hint .multiplayer-actions {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 8px;
}

.look-hint .multiplayer-actions .look-hint-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 600;
}

.look-hint .multiplayer-actions .look-hint-primary:hover {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

.look-hint .multiplayer-actions .look-hint-primary svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.look-hint .multiplayer-actions button:not(.look-hint-primary) {
    height: 36px;
}

.look-hint .multiplayer-secondary-actions {
    display: flex;
    justify-content: flex-end;
}

.look-hint .multiplayer-secondary-actions .look-hint-link {
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    pointer-events: auto;
}

.look-hint .multiplayer-secondary-actions .look-hint-link:hover {
    color: #fff;
}

.look-hint .multiplayer-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
}

.look-hint .multiplayer-status button,
.look-hint .race-error button {
    height: 28px;
    padding: 0 9px;
    font-size: 12px;
}

.look-hint .multiplayer-row button:disabled,
.look-hint .multiplayer-actions button:disabled,
.look-hint .multiplayer-status button:disabled,
.look-hint .multiplayer-secondary-actions button:disabled,
.look-hint .race-error button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.race-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 7, 9, 0.55);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

/* the pause menu: what to do next along the top, then three columns (one on a
   phone). black glass, hairlines, white for what's picked */
.race-menu-panel {
    width: min(1080px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    border: 1px solid var(--ui-line);
    background: var(--ui-panel-solid);
    color: var(--ui-text);
    border-radius: 16px;
    padding: 22px 24px 16px;
    font-family: var(--ui-font);
    font-size: 13px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    transition: opacity 0.15s ease;
}

/* help is open over it */
.race-menu-overlay.helping > .race-menu-panel {
    opacity: 0.2;
    pointer-events: none;
}

.race-menu-panel h3 {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.2px;
}

.race-menu-panel p {
    margin: 0;
    font-family: inherit;
    font-size: 12.5px;
}

.race-menu-panel button,
.race-help button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--ui-line);
    border-radius: 9px;
    background: var(--ui-fill);
    color: var(--ui-text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.race-menu-panel button:hover:not(:disabled),
.race-help button:hover:not(:disabled) {
    background: var(--ui-fill-hover);
    border-color: var(--ui-line-strong);
}

.race-menu-panel button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.race-menu-panel kbd,
.race-photo-hint kbd,
.race-watch-bar kbd {
    display: inline-block;
    min-width: 12px;
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 5px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.pm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pm-head p {
    margin-top: 3px;
    color: var(--ui-muted);
}

.pm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 4px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ui-line);
}

.pm-actions button {
    height: 38px;
    padding: 0 14px;
}

.race-menu-panel .race-menu-primary {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 650;
}

.race-menu-panel .race-menu-primary:hover:not(:disabled) {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

.race-menu-primary kbd {
    border-color: rgba(0, 0, 0, 0.25);
    color: rgba(0, 0, 0, 0.55);
}

/* exit sits apart, at the end of the row */
.pm-actions .pm-exit {
    margin-left: auto;
    color: var(--ui-muted);
}

.pm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 28px;
}

@media (min-width: 720px) {
    .pm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .pm-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.pm-grid section {
    min-width: 0;
}

.pm-grid h4,
.pm-advanced h4,
.pmp h4 {
    margin: 16px 0 8px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.pm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    min-height: 34px;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.78);
}

/* one segmented control, the picked one white */
.pm-choice {
    display: flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: var(--ui-fill);
}

.race-menu-panel .pm-choice button {
    height: 26px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ui-muted);
}

.race-menu-panel .pm-choice button:hover:not(:disabled) {
    background: var(--ui-fill-hover);
    color: #fff;
}

.race-menu-panel .pm-choice button.on {
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 600;
}

.pm-slider {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 150px;
    max-width: 240px;
}

.pm-slider input[type='range'] {
    flex: 1;
    min-width: 0;
    accent-color: var(--ui-accent);
}

.pm-slider > span {
    min-width: 36px;
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* the two tracks as cards, so the drift park can't be missed */
.pm-tracks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.race-menu-panel .pm-track {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    height: auto;
    padding: 10px 12px;
    border-radius: 11px;
    text-align: left;
}

/* each track's lap as a line on its card, white on the picked one */
.track-map {
    display: block;
    flex: none;
    width: 100%;
    height: 46px;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.15s ease;
}

.track-map path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.track-map circle {
    fill: currentColor;
}

.on > .track-map,
button:hover:not(:disabled) > .track-map {
    color: #fff;
}

.look-hint .track-pick .track-map {
    height: 34px;
    margin-bottom: 4px;
}

.pm-track strong {
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
}

.pm-track small,
.pm-track em {
    color: var(--ui-muted);
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.35;
}

.race-menu-panel .pm-track.on {
    border-color: var(--ui-accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px var(--ui-accent);
}

.race-menu-panel .pm-track.on:disabled {
    opacity: 1;
}

.pm-board {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: pm-board;
}

.pm-board li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--ui-line);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    counter-increment: pm-board;
}

.pm-board li::before {
    content: counter(pm-board);
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
}

.pm-board li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-board li strong {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* the ring's board in the menu: each lap a row that opens its card */
.pm-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.78);
}

.pm-board.pm-laps {
    margin-top: 6px;
}

.pm-board.pm-laps li {
    display: block;
    padding: 0;
}

.pm-board.pm-laps li::before {
    content: none;
}

.race-menu-panel .pm-laps button {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
    height: auto;
    padding: 5px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: left;
}

.race-menu-panel .pm-laps button::before {
    content: counter(pm-board);
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
}

.race-menu-panel .pm-laps button:hover:not(:disabled) {
    background: var(--ui-fill-hover);
    color: #fff;
}

.pm-laps button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-laps button strong {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.race-menu-panel .pm-car {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: auto;
    padding: 6px 12px 6px 6px;
    border-radius: 11px;
    text-align: left;
}

.pm-car img {
    width: 72px;
    height: 40px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    object-fit: cover;
}

.pm-car span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-car em {
    color: var(--ui-muted);
    font-size: 12px;
    font-style: normal;
}

.pm-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.race-menu-panel .pm-wide {
    width: 100%;
}

.race-menu-panel .pm-note {
    margin: -2px 0 8px;
    color: var(--ui-muted);
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.4;
}

.pm-row .pm-note {
    margin: 0;
}

.pm-graphics-links {
    margin: 2px 0 6px;
}

.race-menu-panel .pm-graphics-links button[aria-expanded='true'] {
    border-color: var(--ui-line-strong);
    background: var(--ui-fill-hover);
}

/* the advanced switches: a block under the columns, the groups side by side */
.pm-advanced {
    margin-top: 16px;
    padding: 0 16px 8px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
}

.race-menu-panel .pm-advanced .pm-note {
    margin: -4px 0 4px;
}

.pm-advanced-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 28px;
}

.pm-switches h5 {
    margin: 8px 0 2px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* a switch: the label, and a track whose knob goes right and white when on */
.race-menu-panel .pm-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 30px;
    padding: 4px 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-muted);
    text-align: left;
}

/* mute sits with the rows, so it reads like one */
.race-menu-panel .pm-grid .pm-switch {
    min-height: 34px;
    margin-bottom: 6px;
    padding: 0;
    color: rgba(255, 255, 255, 0.78);
}

.race-menu-panel .pm-switch:hover:not(:disabled) {
    background: var(--ui-fill);
    color: #fff;
}

.race-menu-panel .pm-switch.on {
    color: rgba(255, 255, 255, 0.86);
}

.pm-switch i {
    position: relative;
    flex: none;
    width: 30px;
    height: 18px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 9px;
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pm-switch i::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ui-muted);
    transition: transform 0.15s ease, background 0.15s ease;
}

.pm-switch.on i {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
}

.pm-switch.on i::after {
    background: var(--ui-on-accent);
    transform: translateX(12px);
}

.race-menu-panel .graphics-info {
    margin-top: 8px;
}

.pm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--ui-line);
    color: var(--ui-muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.race-menu-panel .pm-foot button {
    flex: none;
    height: 26px;
    font-size: 11.5px;
}

/* help: over the pause menu, wide on a desktop, one size for every tab */
.race-help {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 41;
    display: flex;
    flex-direction: column;
    width: min(880px, calc(100vw - 48px));
    height: min(620px, calc(100vh - 48px));
    height: min(620px, calc(100dvh - 48px));
    transform: translate(-50%, -50%);
    border: 1px solid var(--ui-line-strong);
    border-radius: 16px;
    background: #0e0e0f;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 13px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    overflow: hidden;
}

.race-help header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 0;
}

.race-help h3 {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 18px;
    font-weight: 650;
}

.race-help-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--ui-line);
}

.race-help .race-help-tabs button {
    height: 30px;
    border-color: transparent;
    background: transparent;
    color: var(--ui-muted);
}

.race-help .race-help-tabs button.on {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 600;
}

.race-help-body {
    padding: 16px 22px 22px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.race-help-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 8px 32px;
}

.race-help-keys h5 {
    margin: 0 0 8px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.race-help-keys dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 7px 14px;
    margin: 0;
}

.race-help-keys dt {
    align-self: start;
    justify-self: start;
    padding: 1px 7px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 6px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    white-space: pre;
}

.race-help-keys dd {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.45;
}

.race-help-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.race-help-points li {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.race-help-points strong {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.race-help-points span {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.5;
}

.race-help-credits > p {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.72);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
}

/* the driver name: the menu's field, and the card on a first drive */
.race-menu-panel .pm-input {
    flex: 1;
    min-width: 0;
    max-width: 220px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--ui-line);
    border-radius: 9px;
    background: var(--ui-fill);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.race-menu-panel .pm-input:focus,
.race-name-row input:focus {
    border-color: var(--ui-accent);
}

.race-name {
    position: fixed;
    inset: 0;
    z-index: 42;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.race-name-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(420px, 100%);
    padding: 22px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: #0e0e0f;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 13px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    animation: race-lobby-in 0.35s ease-out;
}

.race-name-card h3 {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 19px;
    font-weight: 650;
}

.race-name-card p {
    margin: -4px 0 4px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.45;
}

.race-name-row {
    display: flex;
    gap: 8px;
}

/* a removed lap: its time and car over why */
.race-removed-lap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
}

.race-removed-lap strong {
    color: #fff;
    font-size: 18px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.race-removed-lap span {
    color: var(--ui-muted);
    font-size: 12.5px;
}

.race-name-card .race-removed-lap + p {
    margin-top: 0;
    color: rgba(255, 255, 255, 0.85);
}

.race-name-row input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 10px;
    background: var(--ui-fill);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    outline: none;
}

.race-name-card button {
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: var(--ui-fill);
    color: var(--ui-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.race-name-card button:hover {
    border-color: var(--ui-line-strong);
    background: var(--ui-fill-hover);
}

.race-name-card .race-menu-primary {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-size: 14px;
    font-weight: 650;
}

.race-name-card .race-menu-primary:hover {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

@media (max-width: 719px) {
    /* up top, clear of the rotate hint and the touch controls */
    .race-name {
        align-items: flex-start;
        padding-top: calc(16px + env(safe-area-inset-top));
    }

    .race-menu-panel {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        padding: 16px 14px 12px;
    }

    .pm-actions button {
        flex: 1 1 calc(50% - 4px);
    }

    .pm-actions .pm-exit {
        margin-left: 0;
    }

    .pm-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .race-help {
        width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
    }

    .race-help header,
    .race-help-tabs,
    .race-help-body {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* photo mode: the whole screen drags the camera, one bar at the bottom */
.race-photo {
    position: fixed;
    inset: 0;
    z-index: 40;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
}

.race-photo:active {
    cursor: grabbing;
}

.race-photo-bar {
    position: absolute;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 10px 14px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(14, 15, 18, 0.78);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    font-size: 12.5px;
    cursor: default;
}

.race-photo-hint {
    color: rgba(255, 255, 255, 0.55);
}

.race-photo-fov {
    display: flex;
    align-items: center;
    gap: 8px;
}

.race-photo-fov input {
    width: 120px;
    accent-color: var(--ui-accent);
}

.race-photo-fov span:last-child {
    min-width: 28px;
    font-variant-numeric: tabular-nums;
}

.race-photo-bar button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.race-photo-bar button:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.24);
}

.race-photo-bar .race-photo-save {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 650;
}

.race-photo-bar .race-photo-save:hover {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

.race-photo-hint kbd {
    margin: 0 1px;
}

/* watching a lap: who's driving up top, the replay's controls along the
   bottom like photo mode's */
.race-watch-tag {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(14, 15, 18, 0.78);
    backdrop-filter: blur(8px);
    color: #fff;
    font-family: var(--ui-font);
    cursor: default;
}

.race-watch-tag span {
    color: var(--ui-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.race-watch-tag strong {
    font-size: 17px;
    font-weight: 650;
}

.race-watch-tag small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.race-watch-bar .race-watch-play {
    min-width: 64px;
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 650;
}

.race-watch-bar .race-watch-play:hover {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

.race-watch-time,
.race-watch-speed {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.race-watch-scrub {
    width: min(320px, 40vw);
    accent-color: var(--ui-accent);
}

.race-watch-rates {
    display: flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
}

.race-watch-bar .race-watch-rates button {
    height: 26px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}

.race-watch-bar .race-watch-rates button.on {
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 600;
}

.race-watch-speed strong {
    display: inline-block;
    min-width: 3ch;
    color: #fff;
    font-size: 16px;
    text-align: right;
}

/* a lap from the board: who, the car and setup with its numbers, the line
   it took, and its replay. over the pause menu like help */
.lap-card {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 41;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    transform: translate(-50%, -50%);
    padding: 20px 22px 18px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 16px;
    background: #0e0e0f;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 13px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    pointer-events: auto;
}

.lap-card header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.lap-card header p {
    margin: 0 0 2px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 11.5px;
}

.lap-card h3 {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 22px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.lap-card-time {
    color: #fff;
    font-size: 26px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.lap-card-car {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 4px;
    padding: 8px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
}

.lap-card-car img {
    width: 96px;
    height: 54px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    object-fit: cover;
}

.lap-card-car > div:not(.garage-pi) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lap-card-car strong {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.lap-card-car span {
    color: var(--ui-muted);
    font-size: 12px;
}

.lap-card-car .garage-pi span {
    color: #111;
}

.lap-card-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 24px;
}

@media (min-width: 640px) {
    .lap-card-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.lap-card h4 {
    margin: 16px 0 8px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.lap-card dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 5px 14px;
    margin: 0;
}

.lap-card dt {
    color: var(--ui-muted);
}

.lap-card dd {
    margin: 0;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.lap-card dd small {
    color: var(--ui-muted);
    font-size: 11.5px;
}

.lap-card-note {
    margin: 6px 0 0;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 12px;
}

.lap-card-warn {
    margin: 10px 0 0;
    color: #ffc163;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.45;
}

.lap-map {
    display: block;
    width: 100%;
    max-width: 230px;
    margin: 0 0 10px;
}

.lap-map path {
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.lap-map .track {
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 3px;
}

.lap-map .lap {
    stroke: #fff;
    stroke-width: 1.5px;
}

.lap-card footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-line);
}

.lap-card button {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ui-line);
    border-radius: 9px;
    background: var(--ui-fill);
    color: var(--ui-text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.lap-card button:hover:not(:disabled) {
    background: var(--ui-fill-hover);
    border-color: var(--ui-line-strong);
}

.lap-card button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.lap-card .race-menu-primary {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 650;
}

.lap-card .race-menu-primary:hover:not(:disabled) {
    border-color: var(--ui-accent-hover);
    background: var(--ui-accent-hover);
}

.lap-card footer button:last-child {
    margin-left: auto;
}

.lap-card kbd {
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 5px;
    color: var(--ui-muted);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
}

/* the menu's tabs: the leaderboard (where esc lands), your profile, and the
   race's settings */
.pm-tabs {
    display: flex;
    gap: 2px;
    margin: 4px 0 2px;
    border-bottom: 1px solid var(--ui-line);
}

.pm-actions {
    padding-bottom: 10px;
    border-bottom: 0;
}

.race-menu-panel .pm-tabs button {
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ui-muted);
    font-size: 13.5px;
    font-weight: 600;
}

.race-menu-panel .pm-tabs button:hover:not(:disabled) {
    border-color: transparent;
    border-bottom-color: var(--ui-line-strong);
    background: transparent;
    color: #fff;
}

.race-menu-panel .pm-tabs button.on {
    border-bottom-color: #fff;
    color: #fff;
}

.race-menu-panel .pm-select {
    height: 32px;
    max-width: 260px;
    padding: 0 8px;
    border: 1px solid var(--ui-line);
    border-radius: 9px;
    background: var(--ui-fill);
    color: #fff;
    color-scheme: dark;
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
}

.race-menu-panel .pm-select:focus {
    border-color: var(--ui-accent);
}

/* a driver's badge: a glyph, initials or number on their color */
.player-badge {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.player-badge svg {
    width: 60%;
    height: 60%;
    fill: currentColor;
}

.player-badge b {
    font-family: var(--ui-font);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    line-height: 1;
}

.player-badge i {
    position: absolute;
    right: -5px;
    bottom: -3px;
    min-width: 16px;
    padding: 1px 4px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 8px;
    background: #0e0e0f;
    color: #fff;
    font-family: var(--ui-font);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 700;
    text-align: center;
}

.player-badge-empty {
    background: var(--ui-fill);
}

/* the menu's leaderboard: rank, the driver (opens their card), then the lap
   (opens its card): car, setup, time and the gap to the top */
.pmb-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 10px;
}

.pmb-hint {
    margin-left: auto;
    color: var(--ui-muted);
    font-size: 11.5px;
}

.pmb-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pmb-list li {
    display: grid;
    grid-template-columns: 30px minmax(110px, 1fr) minmax(0, 2.3fr);
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--ui-line);
}

.pmb-list li.me {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
}

.pmb-rank {
    padding-right: 4px;
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.pmb-driver,
.race-menu-panel .pmb-driver {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: 40px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 550;
    text-align: left;
}

.race-menu-panel button.pmb-driver:hover:not(:disabled) {
    background: var(--ui-fill-hover);
}

.pmb-driver span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pmb-driver em {
    flex: none;
    padding: 1px 6px;
    border-radius: 6px;
    background: #fff;
    color: #0c0c0d;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.race-menu-panel .pmb-lap,
.pmb-run {
    display: grid;
    grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr) auto 76px;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 40px;
    padding: 0 8px 0 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12.5px;
    text-align: left;
}

.pmb-drift .pmb-run {
    grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr) auto;
}

.race-menu-panel .pmb-lap:hover:not(:disabled) {
    background: var(--ui-fill-hover);
    color: #fff;
}

.pmb-lap img,
.pmb-run img {
    width: 40px;
    height: 22px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    object-fit: cover;
}

.pmb-car,
.pmb-setup {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pmb-setup,
.pmb-gap {
    color: var(--ui-muted);
    font-size: 12px;
}

.pmb-lap strong,
.pmb-run strong {
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.pmb-gap {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* your best, when it's lower than the list goes */
.pmb-mine {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--ui-line-strong);
}

.race-menu-panel .pmb-empty {
    padding: 22px 0;
    text-align: center;
}

@media (max-width: 640px) {
    .pmb-hint,
    .pmb-setup,
    .pmb-gap {
        display: none;
    }

    .pmb-list li {
        grid-template-columns: 24px minmax(90px, 1fr) minmax(0, 1.4fr);
    }

    .race-menu-panel .pmb-lap,
    .pmb-run,
    .pmb-drift .pmb-run {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .pmb-lap img,
    .pmb-run img {
        display: none;
    }
}

/* the profile tab: a preview of your card, and what goes on it */
.pmp {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 32px;
}

@media (min-width: 820px) {
    .pmp {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    }
}

.pmp-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    background: var(--ui-fill);
}

.pmp-card > div {
    min-width: 0;
}

.pmp-card strong {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.pmp-card em {
    color: var(--ui-muted);
    font-size: 13px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.race-menu-panel .pmp-card p {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    overflow-wrap: anywhere;
}

.pmp-car {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 6px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
}

.pmp-car img {
    width: 72px;
    height: 40px;
    border-radius: 7px;
    object-fit: cover;
}

.pmp-car span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pmp-car strong {
    color: #fff;
    font-weight: 600;
}

.pmp-car small {
    color: var(--ui-muted);
    font-size: 11.5px;
}

.race-menu-panel .pmp-status {
    margin: 12px 0 10px;
}

.pmp-avatars {
    display: grid;
    grid-template-columns: repeat(auto-fill, 44px);
    gap: 6px;
}

.race-menu-panel .pmp-avatars button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
}

.race-menu-panel .pmp-avatars button.on {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px #fff;
}

.pmp-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.race-menu-panel .pmp-colors button,
.pmp-custom {
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    box-sizing: border-box;
    cursor: pointer;
}

.race-menu-panel .pmp-colors button.on,
.pmp-custom.on {
    border-color: #fff;
    box-shadow: inset 0 0 0 2px #0e0e0f;
}

.pmp-custom {
    background: conic-gradient(#e5484d, #ffc53d, #46a758, #0090ff, #8e4ec6, #e5484d);
}

.pmp-custom input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.pmp-pair {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 18px;
}

.race-menu-panel .pmp-number {
    flex: none;
    width: 76px;
}

.pmp-bio {
    display: flex;
    align-items: center;
    gap: 10px;
}

.race-menu-panel .pmp-bio input {
    max-width: none;
}

.pmp-bio small {
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
}

.race-menu-panel .pmp-remove {
    border-color: var(--ui-warn);
    color: var(--ui-warn);
}

/* a driver's card, over the menu like a lap's (which can open over it) */
.player-card.covered {
    opacity: 0.15;
    pointer-events: none;
}

.player-card-who {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.lap-card .player-card-bio {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.player-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    vertical-align: -1px;
}

.lap-card dl.player-look {
    margin-top: 10px;
}

.player-garage {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lap-card .player-garage button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px 0 4px;
}

.lap-card .player-garage button.on {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.player-garage img {
    width: 48px;
    height: 27px;
    border-radius: 5px;
    object-fit: cover;
}

.player-laps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lap-card .player-laps button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 34px;
    padding: 0 8px;
    border: 0;
    border-bottom: 1px solid var(--ui-line);
    border-radius: 0;
    background: transparent;
    text-align: left;
}

.lap-card .player-laps button:hover:not(:disabled) {
    background: var(--ui-fill-hover);
}

.player-laps strong {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.player-laps span {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.75);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-laps em {
    color: var(--ui-muted);
    font-size: 11.5px;
    font-style: normal;
}

/* no keyboard on a phone */
@media (pointer: coarse) {
    .race-photo-keys {
        display: none;
    }
}

.race-hud {
    position: fixed;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 22;
    pointer-events: none;
}

.race-hud-main,
.race-hud-board {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 230px;
    backdrop-filter: blur(3px);
    font-family: monospace;
}

.race-hud-speed {
    color: rgba(255, 255, 255, 0.95);
    font-size: 24px;
    line-height: 1;
}

.race-hud-speed span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.race-hud-meta {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

.race-hud-board h4 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
}

.race-hud-board h4.race-hud-subtitle {
    margin-top: 10px;
}

.race-hud-board p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
}

.race-hud-board ol {
    margin: 0;
    padding-left: 16px;
}

.race-hud-board li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.84);
}

/* a lap on the hud's board opens its card */
.race-hud-board li button {
    display: flex;
    flex: 1;
    justify-content: space-between;
    gap: 10px;
    margin: 0 -4px;
    padding: 0 4px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    pointer-events: auto;
}

.race-hud-board li button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* a lobby race: the places, you picked out in white */
.race-standings h4 {
    display: flex;
    justify-content: space-between;
}

.race-standings h4 span {
    font-weight: 400;
    opacity: 0.7;
}

.race-standings ol {
    padding-left: 0;
}

.race-standings li.you {
    margin: 0 -6px;
    padding: 0 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 700;
}

.race-countdown {
    position: fixed;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.race-countdown strong {
    font-size: 120px;
    font-weight: 800;
    line-height: 1;
    animation: race-count 1s ease-out;
}

.race-countdown strong.race-countdown-ready {
    font-size: 44px;
    animation: none;
}

.race-countdown small {
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.race-countdown.go strong {
    color: #5dff8a;
}

@keyframes race-count {
    from {
        transform: scale(1.35);
        opacity: 0.4;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.race-pill {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 23;
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 6px 16px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: var(--ui-panel);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.85);
    font-family: monospace;
    font-size: 13px;
    pointer-events: none;
}

.race-pill strong {
    color: #fff;
    font-size: 20px;
}

.race-pill strong small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.race-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 38;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(340px, calc(100vw - 32px));
    padding: 18px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: var(--ui-panel-solid);
    color: #fff;
    font-family: var(--ui-font);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.race-result h3 {
    margin: 0;
    font-family: inherit;
    font-size: 22px;
}

.race-result h3 small {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.7;
}

.race-result p {
    margin: 0;
    font-family: monospace;
    font-size: 16px;
    color: #fff;
}

.race-result .race-standings {
    width: 100%;
    box-sizing: border-box;
}

.race-result button {
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--ui-accent);
    border-radius: 9px;
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-family: inherit;
    font-weight: 650;
    cursor: pointer;
}

.race-result button:hover {
    background: var(--ui-accent-hover);
}

.race-touch-controls {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 35;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 0 max(14px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(14px, env(safe-area-inset-left));
    pointer-events: none;
    touch-action: none;
}

.race-touch-cluster {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    pointer-events: auto;
}

.race-touch-button {
    min-width: clamp(54px, 13vw, 86px);
    min-height: clamp(48px, 12vw, 72px);
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.56);
    color: rgba(255, 255, 255, 0.94);
    font-family: monospace;
    font-size: clamp(12px, 2.4vw, 16px);
    font-weight: 700;
    backdrop-filter: blur(5px);
    touch-action: none;
    user-select: none;
}

.race-touch-button:active {
    background: rgba(255, 255, 255, 0.22);
}

.race-touch-secondary {
    min-width: clamp(48px, 11vw, 70px);
}

.race-touch-reset {
    min-width: clamp(58px, 12vw, 80px);
    min-height: clamp(40px, 10vw, 58px);
    font-size: clamp(11px, 2.1vw, 14px);
}

.race-rotate-hint,
.graphics-context-lost,
.race-debug-panel {
    position: fixed;
    z-index: 60;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.68);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.race-rotate-hint {
    left: 50%;
    bottom: calc(88px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 32px));
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
}

.graphics-context-lost {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.race-debug-panel {
    left: 12px;
    bottom: 112px;
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.45;
}

.lap-name-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}

.lap-name-panel {
    width: min(400px, calc(100vw - 24px));
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(12, 13, 18, 0.94);
    color: rgba(255, 255, 255, 0.92);
    padding: 16px;
    font-family: monospace;
}

.lap-name-panel h3 {
    margin: 0;
    font-size: 15px;
}

.lap-name-panel p {
    margin-top: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.lap-name-panel input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.92);
    padding: 8px;
    font-family: monospace;
    margin-bottom: 10px;
}

.lap-name-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.lap-name-actions button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-family: monospace;
    font-size: 12px;
    padding: 6px 8px;
    cursor: pointer;
}

/* if on mobile make all loading screen elements have a padding of 16 */
@media only screen and (max-width: 768px) {
    .loading-screen-header {
        padding: 16px;
    }

    .info-wrapper {
        top: 16px;
        left: 16px;
    }

    .blinking-cursor {
        background-color: #fff;
        width: 0.4em;
        height: 0.08em;
        -webkit-animation: 0.65s blink step-end infinite;
        -moz-animation: 0.65s blink step-end infinite;
        -ms-animation: 0.65s blink step-end infinite;
        -o-animation: 0.65s blink step-end infinite;
        animation: 0.65s blink step-end infinite;
    }

    .loading-screen-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .loading-screen-footer {
        padding: 16px;
        padding-bottom: 32px;
    }

    .look-hint {
        top: max(10px, env(safe-area-inset-top));
        left: max(10px, env(safe-area-inset-left));
        right: auto;
        width: min(280px, calc(100vw - 20px));
        max-height: min(48dvh, 320px);
        overflow: auto;
        gap: 10px;
        padding: 12px;
        font-size: 12.5px;
        border-radius: 12px;
        box-sizing: border-box;
    }

    .look-hint.racing {
        width: min(250px, calc(100vw - 20px));
    }

    .look-hint .multiplayer-menu {
        gap: 7px;
    }

    .look-hint .multiplayer-row {
        gap: 7px;
    }

    .look-hint .multiplayer-row label {
        width: 44px;
    }

    .look-hint .multiplayer-row input,
    .look-hint .car-switcher select,
    .look-hint .look-hint-chip,
    .look-hint .view-toggle button,
    .look-hint .multiplayer-row button,
    .look-hint .multiplayer-actions button,
    .look-hint .multiplayer-status button {
        font-size: 12px;
    }

    .race-hud {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        gap: 6px;
        max-width: min(260px, calc(100vw - 16px));
    }

    .race-hud-main,
    .race-hud-board {
        min-width: 0;
        padding: 6px 8px;
        border-radius: 6px;
    }

    .race-hud-speed {
        font-size: 18px;
    }

    .race-hud-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px 8px;
        font-size: 10px;
    }

    .race-hud-board {
        display: none;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .look-hint {
        max-width: 245px;
        max-height: calc(100dvh - 18px);
    }

    body.race-mode-active .look-hint {
        width: auto;
        max-width: 240px;
    }

    body.race-mode-active .look-hint > :not(.race-actions) {
        display: none;
    }

    .race-hud {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
    }

    .race-hud-main {
        min-width: 170px;
    }

    .race-hud-speed {
        font-size: 17px;
    }

    .race-hud-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        font-size: 9px;
    }

    .race-touch-controls {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .race-rotate-hint {
        display: none;
    }
}

@media (orientation: portrait) and (pointer: coarse) {
    .race-touch-controls {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .race-touch-button {
        min-width: 54px;
        min-height: 46px;
    }
}

.shell-credits {
    display: flex;
    flex-wrap: wrap;
    column-gap: 14px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1.45;
}

/* the global p rule is 16px monospace */
.shell-credits p {
    margin: 4px 0 0;
    font: inherit;
    color: inherit;
}

.shell-credits a {
    color: inherit;
}

.shell-credits .race-menu-credits {
    margin: 0;
}

/* the open one takes the row, the other wraps under it */
.shell-credits details[open] {
    flex-basis: 100%;
}

.look-hint .shell-credits {
    padding-top: 2px;
}

.race-menu-credits {
    margin: -6px 0 12px;
    font-size: 10.5px;
    opacity: 0.55;
}

.race-menu-credits a {
    color: inherit;
    text-decoration: underline;
}

.model-credits summary {
    cursor: pointer;
}

.model-credits ul {
    margin: 4px 0 0;
    padding-left: 14px;
    max-height: 160px;
    overflow-y: auto;
}

.model-credits li {
    margin-bottom: 4px;
}

/* weak gpus and the performance preset: a software compositor pays ~25 ms a
   frame for backdrop blur, so the panels go solid instead */
.race-lite .race-hud-board,
.race-lite .race-menu-overlay,
.race-lite .race-lobby-card,
.race-lite .race-touch-button,
.race-lite .race-debug-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(0, 0, 0, 0.72);
}

/* solo, quick join or invite, after the homepage transition */
.race-lobby-choice {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12vh;
    z-index: 30;
    pointer-events: none;
}

.race-lobby-card {
    pointer-events: auto;
    max-width: min(980px, 94vw) !important;
    background: var(--ui-panel);
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    padding: 18px 20px;
    color: var(--ui-text);
    font-family: var(--ui-font);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: race-lobby-in 0.35s ease-out;
}

.race-lobby-card h3 {
    margin: 0 0 14px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 650;
}

.race-lobby-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.race-lobby-options button {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 12px 12px 12px 38px;
    background: var(--ui-fill);
    border: 1px solid var(--ui-line);
    border-radius: 11px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.race-lobby-options button:hover:not(:disabled) {
    background: var(--ui-fill-hover);
    border-color: var(--ui-line-strong);
}

.race-lobby-options button:disabled {
    opacity: 0.6;
    cursor: default;
}

.race-lobby-options strong {
    font-weight: 600;
}

.race-lobby-options small {
    color: var(--ui-muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.race-lobby-key {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 18px;
    height: 18px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 5px;
    color: var(--ui-muted);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.race-lobby-error {
    margin: 10px 0 0;
    color: #ffb4a8;
    font-size: 12px;
}

.race-lobby-link {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin: 4px 0 10px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #fff;
}

.race-lobby-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.race-lobby-actions button,
.race-lobby-error button {
    padding: 6px 14px;
    background: #fff;
    color: #111;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
}

@keyframes race-lobby-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@media (max-width: 900px) {
    .race-lobby-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .race-lobby-options {
        grid-template-columns: 1fr;
    }
}

/* tach, speed, gear, lap and sector times, bottom right, clear of the car */
.race-gauges {
    position: fixed;
    right: 14px;
    bottom: 14px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    z-index: 12;
    pointer-events: none;
    font-family: monospace;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.race-tach {
    width: 168px;
    height: 168px;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.55) 58%, rgba(0, 0, 0, 0) 71%);
    border-radius: 50%;
}

.race-tach .dial {
    fill: none;
    stroke: rgba(255, 255, 255, 0.28);
    stroke-width: 3;
}

.race-tach .dial.red {
    stroke: #ff4d3d;
}

.race-tach .fill {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
}

.race-tach .fill.near {
    stroke: #ff4d3d;
}

.race-tach .tick {
    stroke: rgba(255, 255, 255, 0.75);
    stroke-width: 1.6;
}

.race-tach .tick.red {
    stroke: #ff4d3d;
}

.race-tach .tick-label {
    fill: rgba(255, 255, 255, 0.8);
    font-size: 9px;
    text-anchor: middle;
}

.race-tach .needle {
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.race-tach .hub {
    fill: #fff;
}

.race-tach .gear {
    fill: #fff;
    font-size: 26px;
    font-weight: bold;
    text-anchor: middle;
}

.race-tach .speed {
    fill: #fff;
    font-size: 20px;
    text-anchor: middle;
}

.race-tach .unit {
    fill: rgba(255, 255, 255, 0.6);
    font-size: 8px;
    text-anchor: middle;
}

.race-laps {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 210px;
    margin-bottom: 14px;
}

.race-lap-now {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

/* the live gap to your best lap: green ahead, red behind */
.race-lap-delta {
    font-size: 14px;
}

.race-lap-delta.ahead {
    color: rgb(90, 225, 130);
}

.race-lap-delta.behind {
    color: rgb(255, 115, 115);
}

.race-lap-dirty {
    font-size: 11px;
    color: rgb(255, 150, 150);
    margin-bottom: 4px;
}

/* rewind playing back: a badge up top, the bar is what's left to go back */
.race-rewind {
    position: fixed;
    top: 16%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: var(--ui-panel);
    backdrop-filter: blur(6px);
    color: #fff;
    font-family: var(--ui-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
}

.race-rewind svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.race-rewind i {
    display: block;
    width: 90px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.race-rewind b {
    display: block;
    height: 100%;
    background: #fff;
}

.race-lap-row em {
    font-style: normal;
    font-size: 10px;
    color: rgb(255, 150, 150);
    margin-left: 6px;
}

.race-lap-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.85;
}

.race-sectors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 6px;
}

.race-sector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
}

.race-sector span {
    opacity: 0.7;
    font-size: 9px;
}

.race-sector em {
    font-style: normal;
    font-size: 9px;
}

.race-sector.live {
    outline: 1px solid rgba(255, 255, 255, 0.45);
}

.race-sector.good {
    background: rgba(40, 200, 90, 0.35);
}

.race-sector.slow {
    background: rgba(230, 190, 40, 0.3);
}

/* the whole lap, bottom left */
.race-minimap {
    position: fixed;
    left: 14px;
    bottom: 14px;
    width: 180px;
    height: 180px;
    z-index: 12;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.race-minimap .track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 2.2;
    stroke-linejoin: round;
}

.race-minimap .start {
    fill: #fff;
    stroke: #111;
    stroke-width: 1;
}

.race-minimap .split {
    fill: #ffd34d;
}

.race-minimap .remote {
    fill: #7fd0ff;
    stroke: #102030;
    stroke-width: 1;
}

.race-minimap .me {
    fill: #fff;
    stroke: #000;
    stroke-width: 1.2;
}

.race-lite .race-laps,
.race-lite .race-minimap {
    background: rgba(0, 0, 0, 0.72);
}

/* touch controls (phones, and any window small enough to get them): the
   buttons own the bottom row, so the gauges and the map sit above it */
body.race-mode-touch {
    --race-touch-row: calc(
        clamp(48px, 12vw, 72px) + max(12px, env(safe-area-inset-bottom)) +
            10px
    );
}

body.race-mode-touch .race-gauges {
    right: max(14px, env(safe-area-inset-right));
    bottom: var(--race-touch-row);
    transform: scale(0.75);
    transform-origin: bottom right;
}

body.race-mode-touch .race-laps {
    margin-bottom: 0;
}

body.race-mode-touch .race-rotate-hint {
    bottom: calc(var(--race-touch-row) + 140px);
}

body.race-mode-touch .race-minimap {
    left: max(14px, env(safe-area-inset-left));
    bottom: var(--race-touch-row);
    width: 120px;
    height: 120px;
}

/* phones in landscape: shrink the gauges so they clear the leaderboard */
@media (max-height: 420px) {
    body.race-mode-touch .race-gauges {
        transform: scale(0.62);
    }

    body.race-mode-touch .race-minimap {
        width: 100px;
        height: 100px;
    }
}

/* narrow portrait: gauges above the pedals, map above the gauges, the
   rotate hint above the map */
@media (max-width: 600px) {
    body.race-mode-touch .race-gauges {
        transform: scale(0.68);
    }

    body.race-mode-touch .race-minimap {
        bottom: calc(var(--race-touch-row) + 130px);
    }

    body.race-mode-touch .race-rotate-hint {
        bottom: calc(var(--race-touch-row) + 262px);
    }
}

/* garage: the car on the left, the panel on the right */
.garage {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: auto;
    display: flex;
    font-family: monospace;
    color: #fff;
}

.garage-stage {
    flex: 1;
    cursor: grab;
    position: relative;
}

.garage-stage:active {
    cursor: grabbing;
}

.garage-title {
    position: absolute;
    left: 24px;
    top: 20px;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.garage-title h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.garage-title p {
    margin: 4px 0 2px;
    font-size: 15px;
}

.garage-title small {
    opacity: 0.7;
}

/* the car on the stand, with the picker one click away */
.garage-car {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin: 8px 0 6px;
    pointer-events: auto;
    text-shadow: none;
}

.garage-car button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(8, 10, 14, 0.72);
    color: #fff;
    font-family: inherit;
    cursor: pointer;
}

.garage-car button:hover,
.garage-car button:focus-visible {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(30, 32, 38, 0.86);
}

.garage-car-step {
    width: 34px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.garage-car-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 5px 12px 5px 5px;
    text-align: left;
}

.garage-car-pick img {
    flex: none;
    width: 64px;
    height: 36px;
    border-radius: 5px;
    object-fit: cover;
}

.garage-car-pick span {
    max-width: 220px;
    overflow: hidden;
    font-size: 15px;
    font-weight: bold;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.garage-car-pick em {
    color: var(--ui-muted);
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
}

.garage-panel {
    width: min(400px, 92vw);
    display: flex;
    flex-direction: column;
    background: rgba(8, 10, 14, 0.84);
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    padding: 16px;
    box-sizing: border-box;
    gap: 10px;
    overflow: hidden;
}

.garage-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.garage-tabs button,
.garage-options button,
.garage-actions button,
.garage-factory {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    padding: 7px 8px;
    cursor: pointer;
}

.garage-tabs button.on,
.garage-options button.on,
.garage-factory.on {
    background: #fff;
    color: #111;
}

.garage-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.garage-body h4 {
    margin: 12px 0 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
}

.garage-h4-note {
    margin-left: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.garage-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.garage-swatches.disabled {
    opacity: 0.35;
}

.garage-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
}

.garage-swatch.on {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.garage-custom {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    cursor: pointer;
}

.garage-custom input {
    width: 28px;
    height: 26px;
    border: none;
    background: none;
    padding: 0;
}

.garage-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.garage-options.wrap {
    grid-template-columns: repeat(2, 1fr);
}

.garage-options.column {
    grid-template-columns: 1fr;
}

.garage-options.column button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.garage-options small {
    opacity: 0.7;
    font-size: 11px;
}

.garage-options button:disabled {
    opacity: 0.35;
    cursor: default;
}

.garage-rev {
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    border-radius: 8px;
    border: 1px solid var(--ui-line-strong);
    background: var(--ui-fill);
    color: #fff;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 0.04em;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.garage-rev.on {
    border-color: var(--ui-accent);
    background: var(--ui-accent);
    color: var(--ui-on-accent);
}

.garage-slider {
    margin: 10px 0;
}

.garage-slider-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

/* a value off its default gets a dot */
.garage-slider-head strong.changed::before {
    content: '\2022';
    margin-right: 5px;
}

.garage-slider input {
    width: 100%;
    accent-color: var(--ui-accent);
}

.garage-slider-ends {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    opacity: 0.6;
}

.garage-note {
    font-size: 11px;
    opacity: 0.7;
}

.garage-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    font-size: 11px;
}

.garage-stats div {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 5px 6px;
}

.garage-stats span {
    opacity: 0.65;
}

/* the performance index in its class colour, and Forza's five bars */
.garage-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
}

.garage-rating p {
    margin: 0;
    opacity: 0.6;
}

.garage-pi {
    display: flex;
    flex: none;
    border-radius: 4px;
    overflow: hidden;
    font-size: 13px;
    font-weight: bold;
    color: #111;
}

.garage-pi strong {
    padding: 4px 7px;
    background: var(--pi);
}

.garage-pi span {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.92);
}

.pi-d { --pi: #5bc8f0; }
.pi-c { --pi: #f5c518; }
.pi-b { --pi: #f68b1f; }
.pi-a { --pi: #e8384f; }
.pi-s1 { --pi: #a35ddb; }
.pi-s2 { --pi: #3d7ef0; }
.pi-x { --pi: #2fbf71; }

.garage-bars {
    flex: 1;
    display: grid;
    gap: 3px;
}

.garage-bars div {
    display: grid;
    grid-template-columns: 76px 1fr 24px;
    align-items: center;
    gap: 6px;
}

.garage-bars span {
    opacity: 0.65;
}

.garage-bars i {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.garage-bars b {
    display: block;
    height: 100%;
    background: #f2f2f2;
}

.garage-bars em {
    font-style: normal;
    text-align: right;
}

.garage-board {
    font-size: 11px;
    margin: 0;
    opacity: 0.8;
}

.garage-board.tuned {
    color: #fff;
    opacity: 1;
}

.garage-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.garage-actions .primary {
    background: #fff;
    color: #111;
    font-weight: bold;
    padding: 8px 22px;
}

@media (max-width: 760px) {
    .garage {
        flex-direction: column;
    }

    .garage-stage {
        min-height: 34vh;
    }

    /* half the screen at most, the car is framed in the other half */
    .garage-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        max-height: 52vh;
        max-height: 52dvh;
        padding: 12px;
        gap: 8px;
    }
}

/* phones on their side: a narrow panel, the car framed beside it */
@media (orientation: landscape) and (max-height: 520px) {
    .garage-panel {
        width: min(330px, 42vw);
        padding: 10px;
        gap: 6px;
    }

    .garage-title {
        left: 14px;
        top: 10px;
    }

    .garage-title h2 {
        font-size: 18px;
    }
}

@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
    .garage-tabs button {
        padding: 6px 2px;
        font-size: 11px;
    }

    .garage-board {
        display: none;
    }

    /* power, grip and top speed, one row */
    .garage-stats {
        gap: 4px;
        font-size: 10px;
    }

    .garage-stats div {
        padding: 3px 5px;
    }

    .garage-stats div:nth-child(2),
    .garage-stats div:nth-child(n + 5) {
        display: none;
    }

    .garage-bars {
        display: none;
    }

    .garage-actions button {
        padding: 6px 8px;
        font-size: 11px;
        white-space: nowrap;
    }

    .garage-title {
        left: 14px;
    }

    .garage-car-pick {
        gap: 8px;
    }

    .garage-car-pick img {
        width: 48px;
        height: 27px;
    }

    .garage-car-pick span {
        max-width: 150px;
        font-size: 13px;
    }

    .garage-car-pick em {
        font-size: 10px;
    }
}

.race-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.race-board-switch {
    display: inline-flex;
    gap: 2px;
    pointer-events: auto;
}

.race-board-switch button {
    font-family: inherit;
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    cursor: pointer;
}

.race-board-switch button.on {
    background: #fff;
    color: #111;
}

/* the hud's top five, then the way to the menu's whole board */
.race-hud-board .race-board-more {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 3px 0 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 10.5px;
    text-align: left;
    cursor: pointer;
    pointer-events: auto;
}

.race-hud-board .race-board-more:hover {
    color: #fff;
}

.race-board-more kbd {
    margin-left: 4px;
    padding: 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    font-family: inherit;
    font-size: 9.5px;
}

/* the garage has the screen to itself, and the car picker it opens */
.garage-open > *:not(.garage):not(.garage-fade):not(.car-picker) {
    visibility: hidden;
}

/* the homepage to race transition: the page's panels step aside while the
   camera flies and the ring builds, then the race's panels fade in */
body.race-transition #ui-app > *,
body.race-transition-out #ui-app > * {
    transition: opacity 0.5s ease;
}

body.race-transition #ui-app > :not(.race-lobby-choice):not(.garage-fade) {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* graphics info: renderer, tier, scale and frame times, with a copy button */
.graphics-info {
    margin: 6px 0 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.9);
    font-family: monospace;
    font-size: 11px;
    line-height: 1.45;
    max-width: 520px;
    pointer-events: auto;
    user-select: text;
}

.graphics-info-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.graphics-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-wrap: anywhere;
}

.graphics-info p {
    margin: 0;
}

.graphics-info.floating {
    position: fixed;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    max-width: min(460px, calc(100vw - 28px));
    font-size: 10px;
}

/* a room target has the camera: the panel fades out of its way, and nothing
   in it takes a click or a key while it's gone (its controls set their own
   pointer-events, hence the important) */
.look-hint.room-focused {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0s linear 0.3s;
}

.look-hint.room-focused * {
    pointer-events: none !important;
}

.look-hint {
    transition: opacity 0.3s ease;
}

/* the room's film grain: a noise tile under soft light, moved to a new
   offset every 1/120 s so each frame shows fresh noise, like the per frame
   shader did. transform only, so it stays on the compositor */
.film-grain {
    position: absolute;
    top: -256px;
    left: -256px;
    width: calc(100% + 512px);
    height: calc(100% + 512px);
    mix-blend-mode: soft-light;
    pointer-events: none;
    z-index: 3;
    will-change: transform;
    animation: film-grain 0.2s steps(1) infinite;
}

@keyframes film-grain {
    0% {
        transform: translate(0px, 0px);
    }
    4.167% {
        transform: translate(-214px, -91px);
    }
    8.333% {
        transform: translate(-28px, 222px);
    }
    12.5% {
        transform: translate(-124px, 152px);
    }
    16.667% {
        transform: translate(-22px, -100px);
    }
    20.833% {
        transform: translate(-119px, 250px);
    }
    25% {
        transform: translate(191px, 151px);
    }
    29.167% {
        transform: translate(36px, -202px);
    }
    33.333% {
        transform: translate(131px, 193px);
    }
    37.5% {
        transform: translate(224px, 181px);
    }
    41.667% {
        transform: translate(3px, -156px);
    }
    45.833% {
        transform: translate(-11px, 17px);
    }
    50% {
        transform: translate(-185px, 219px);
    }
    54.167% {
        transform: translate(151px, 116px);
    }
    58.333% {
        transform: translate(-215px, 115px);
    }
    62.5% {
        transform: translate(-64px, 122px);
    }
    66.667% {
        transform: translate(-165px, -42px);
    }
    70.833% {
        transform: translate(122px, 110px);
    }
    75% {
        transform: translate(-16px, 77px);
    }
    79.167% {
        transform: translate(8px, -235px);
    }
    83.333% {
        transform: translate(181px, -54px);
    }
    87.5% {
        transform: translate(-181px, -61px);
    }
    91.667% {
        transform: translate(-238px, 200px);
    }
    95.833% {
        transform: translate(-145px, 106px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .film-grain {
        animation: none;
    }
}

/* the desk view: the panel folds to a tab in its corner and opens again on
   hover or keyboard focus, so it never sits over the top screen */
.look-hint.room-desk {
    pointer-events: auto;
    cursor: default;
}

.look-hint.room-desk:not(:hover):not(:focus-within) {
    width: auto;
    min-width: 0;
    padding: 8px 14px;
    border-radius: 999px;
}

.look-hint.room-desk:not(:hover):not(:focus-within) > * {
    display: none;
}

.look-hint.room-desk:not(:hover):not(:focus-within)::before {
    content: attr(data-label);
    font-size: 13px;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

/* with a mouse the room panel folds to its hint and a menu tab */
@media (hover: hover) {
    .look-hint.room-hover {
        pointer-events: auto;
        cursor: default;
    }

    .look-hint.room-hover:not(:hover):not(:focus-within) {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        width: auto;
        max-height: none;
        overflow: visible;
        padding: 7px 7px 7px 14px;
        border-radius: 999px;
    }

    .look-hint.room-hover:not(:hover):not(:focus-within) > :not(.look-hint-begin) {
        display: none;
    }

    .look-hint.room-hover:not(:hover):not(:focus-within)::after {
        content: attr(data-label);
        padding: 5px 11px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        font-size: 12px;
        font-weight: 600;
    }

    .look-hint.room-hover:is(:hover, :focus-within) > :not(.look-hint-begin) {
        animation: look-hint-open 0.18s ease-out;
    }
}

@keyframes look-hint-open {
    from {
        opacity: 0;
    }
}

/* small screens: the panel folds to its menu button and the hint, clear of
   the car, and opens over the scene on tap */
.look-hint .look-hint-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    pointer-events: auto;
    cursor: pointer;
}

.look-hint.compact:not(.folded) .look-hint-begin {
    padding-right: 70px;
}

.look-hint.folded {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 6px 12px 6px 6px;
}

.look-hint.folded .look-hint-menu {
    position: static;
}

.look-hint.folded > :not(.look-hint-menu):not(.look-hint-begin) {
    display: none;
}

.look-hint.compact:not(.folded) {
    max-height: calc(100dvh - 20px);
}

@media (pointer: coarse) {
    .look-hint.compact button,
    .look-hint.compact select,
    .look-hint.compact input {
        min-height: 30px;
    }

    /* no keyboard to press them on */
    .look-hint .race-actions kbd {
        display: none;
    }
}

/* the homepage's way into the garage: a pill in the corner, with a slow
   white glow so it's noticed */
.garage-launch {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px 11px 14px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 999px;
    background: var(--ui-panel);
    color: #fff;
    font-family: var(--ui-font);
    text-align: left;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 255, 255, 0.35);
    animation: garage-launch-glow 2.8s ease-in-out 1.5s 4;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.garage-launch:hover,
.garage-launch:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(26, 26, 28, 0.92);
    outline: none;
}

.garage-launch svg {
    width: 26px;
    height: 26px;
    padding: 7px;
    border-radius: 50%;
    background: #fff;
    fill: var(--ui-on-accent);
    flex: none;
}

.garage-launch span {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.garage-launch strong {
    font-size: 15px;
    letter-spacing: 0.3px;
}

.garage-launch small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes garage-launch-glow {
    0%,
    100% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 255, 255, 0.35);
    }
    50% {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 12px rgba(255, 255, 255, 0);
    }
}

@media (max-width: 520px) {
    .garage-launch {
        padding: 9px 16px 9px 11px;
    }
    .garage-launch small {
        display: none;
    }
}

/* the cut to black going into the garage from the room and back */
.garage-fade {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050506;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
}

.garage-fade.on {
    opacity: 1;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .garage-launch {
        animation: none;
    }
}

/* the room's nudge toward its car: a tag riding the roof on screen
   (World/CarTag.ts), pointing down at it */
.car-tag {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: transform;
}

.car-tag.on {
    opacity: 1;
}

.car-tag span {
    position: absolute;
    left: 0;
    bottom: 16px;
    display: block;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: #121214;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    color: #fff;
    font: 600 13px/1 var(--ui-font);
    letter-spacing: 0.2px;
    white-space: nowrap;
    transform: translateX(-50%);
    animation: car-tag-float 2.6s ease-in-out infinite;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.car-tag span::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    background: inherit;
    transform: rotate(45deg);
}

.car-tag b {
    color: #fff;
}

.car-tag.hover span {
    border-color: #fff;
    background: #232326;
}

@keyframes car-tag-float {
    0%,
    100% {
        transform: translate(-50%, 0);
    }
    50% {
        transform: translate(-50%, -6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .car-tag span {
        animation: none;
    }
}

/* the drift park's score, top middle */
.drift-hud {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 22;
    min-width: 220px;
    padding: 10px 18px 12px;
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    background: var(--ui-panel);
    backdrop-filter: blur(6px);
    color: #fff;
    text-align: center;
    font-family: var(--ui-font);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.drift-hud-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.drift-hud-total {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
}

.drift-hud-chain {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    height: 22px;
    margin-top: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drift-hud-chain.on {
    opacity: 0.75;
}

.drift-hud-chain.live {
    opacity: 1;
}

.drift-hud-points {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.drift-hud-multiplier {
    padding: 1px 6px;
    border-radius: 6px;
    background: #fff;
    color: var(--ui-on-accent);
    font-size: 13px;
    font-weight: 800;
}

.drift-hud-angle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.drift-hud-flash {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    animation: drift-flash 1.6s ease forwards;
}

.drift-hud-flash.banked {
    color: #6be38a;
}

.drift-hud-flash.lost {
    color: #ff6b5e;
}

/* what became of the run at the line */
.drift-hud-result {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.drift-hud-result.ok {
    color: #6be38a;
}

.drift-hud-result.off {
    color: var(--ui-warn);
}

.drift-hud-runs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.drift-hud-runs:empty {
    display: none;
}

@keyframes drift-flash {
    0% {
        opacity: 0;
        transform: translateY(4px) scale(0.96);
    }
    12% {
        opacity: 1;
        transform: none;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.drift-building {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(8, 9, 12, 0.8);
    color: rgba(255, 255, 255, 0.85);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    pointer-events: none;
}

@media (max-width: 520px) {
    .drift-hud {
        top: 8px;
        min-width: 170px;
        padding: 6px 12px 8px;
    }

    .drift-hud-total {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .drift-hud-flash {
        animation: none;
    }
}

/* the controller's focus: a ring on the page's controls, a frame and a name
   over the room's screens, the car, the pc and the flipper, and the buttons
   for what's on screen along the bottom. only while the pad is in use */

.pad-mode [data-pad-focus] {
    outline: 2px solid #fff !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);
}

.pad-target {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 29;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 14px;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.14),
        0 0 28px rgba(255, 255, 255, 0.18);
    pointer-events: none;
    opacity: 0;
    transition:
        transform 0.16s ease,
        width 0.16s ease,
        height 0.16s ease,
        opacity 0.15s ease;
}

.pad-target.on {
    opacity: 1;
}

.pad-target span {
    position: absolute;
    left: 50%;
    top: 0;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(12, 12, 16, 0.86);
    color: #fff;
    font:
        500 13px/1.2 -apple-system,
        'Segoe UI',
        Roboto,
        sans-serif;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 8px));
}

.pad-hints {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 70;
    display: flex;
    gap: 16px;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(12, 12, 16, 0.8);
    color: #e9e6e1;
    font:
        500 12px/20px -apple-system,
        'Segoe UI',
        Roboto,
        sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.25s ease;
}

.pad-hints.on {
    opacity: 1;
}

/* clear of the flipper's notes and the back button */
.pad-hints.raised {
    bottom: 64px;
}

/* menus sit in the middle or on one side, so their hints go in a corner */
.pad-hints.corner {
    left: 18px;
    transform: none;
}

.pad-hints.corner.right {
    left: auto;
    right: 18px;
}

.pad-hints kbd {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    margin-right: 6px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font:
        600 11px/20px -apple-system,
        'Segoe UI',
        Roboto,
        sans-serif;
    text-align: center;
}

/* a pad needs neither the touch buttons nor the mouse lock hint */
.pad-mode .race-touch-controls,
.pad-mode .race-lock-hint {
    display: none !important;
}

@media (max-width: 560px) {
    .pad-hints {
        gap: 10px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pad-target {
        transition: opacity 0.15s ease;
    }
}

