.sticky-race-launcher {
    align-items: center;
    background: rgba(255, 184, 28, 0.08);
    border: 1px solid rgba(255, 184, 28, 0.36);
    border-radius: 999px;
    color: #f7f1df;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: 'Oswald', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 8px;
    letter-spacing: 0.06em;
    min-height: 46px;
    padding: 8px 14px;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sticky-race-launcher svg,
.footer-race-link svg {
    flex: 0 0 auto;
    height: 21px;
    width: 21px;
}

.sticky-race-launcher:hover {
    background: rgba(255, 184, 28, 0.16);
    border-color: #ffb81c;
    color: #ffcf60;
    transform: translateY(-1px);
}

.sticky-race-launcher:focus-visible,
.footer-race-link:focus-visible,
.pierogi-race-full-page-link:focus-visible,
.pierogi-race-close:focus-visible {
    outline: 3px solid #ffcf60;
    outline-offset: 3px;
}

.browse-race-launcher {
    text-decoration: none;
}

.footer-race-link {
    min-width: 220px;
}

body.pierogi-race-overlay-open {
    overflow: hidden;
}

.pierogi-race-dialog {
    background: #080b0d;
    border: 0;
    color: #f7f1df;
    height: 100dvh;
    margin: 0;
    max-height: none;
    max-width: none;
    padding: 0;
    width: 100dvw;
}

.pierogi-race-dialog::backdrop {
    background: rgba(4, 6, 7, 0.92);
}

.pierogi-race-dialog-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.pierogi-race-dialog:fullscreen {
    height: 100dvh;
    width: 100dvw;
}

.pierogi-race-dialog:fullscreen .pierogi-race-dialog-bar {
    display: none;
}

html:fullscreen .pierogi-race-dialog-bar {
    justify-content: flex-end;
    min-height: 34px;
    padding-bottom: 2px;
    padding-top: max(2px, env(safe-area-inset-top));
}

html:fullscreen .pierogi-race-dialog-title,
html:fullscreen .pierogi-race-full-page-link {
    display: none;
}

.pierogi-race-dialog-bar {
    align-items: center;
    background: #111619;
    border-bottom: 1px solid rgba(255, 184, 28, 0.35);
    display: flex;
    flex: 0 0 auto;
    gap: 14px;
    min-height: 54px;
    padding: max(7px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 7px
        max(14px, env(safe-area-inset-left));
}

.pierogi-race-dialog-title {
    align-items: center;
    color: #ffcf60;
    display: inline-flex;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    gap: 8px;
    letter-spacing: 0.08em;
    margin-right: auto;
    text-transform: uppercase;
}

.pierogi-race-full-page-link {
    border-radius: 6px;
    color: #f7f1df;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 8px 10px;
    text-decoration: underline;
    text-decoration-color: rgba(255, 184, 28, 0.55);
    text-underline-offset: 3px;
}

.pierogi-race-full-page-link:hover {
    color: #ffcf60;
}

.pierogi-race-close {
    align-items: center;
    background: #ffb81c;
    border: 0;
    border-radius: 8px;
    color: #101416;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.75rem;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
    width: 44px;
}

.pierogi-race-close:hover {
    background: #ffcf60;
    transform: translateY(-1px);
}

.pierogi-race-frame-host {
    align-items: center;
    background: #dff3ff;
    color: #172029;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 0;
    position: relative;
}

.pierogi-race-frame-host > p {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.pierogi-race-frame {
    background: #dff3ff;
    border: 0;
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

@media (max-width: 820px) {
    .sticky-race-launcher {
        min-height: 42px;
        padding: 8px 10px;
    }

    .sticky-race-launcher span {
        display: none;
    }
}

@media (max-width: 719px) {
    .pierogi-race-dialog-bar {
        gap: 8px;
        min-height: 50px;
    }

    .pierogi-race-dialog-title {
        font-size: 0.85rem;
        letter-spacing: 0.06em;
    }

    .pierogi-race-full-page-link {
        font-size: 0.7rem;
        padding: 7px 4px;
    }
}

/* On a phone held sideways, the embedded game already has its own controls.
   Keep the fallback dialog chrome to a small close affordance so it never
   steals half of the playable viewport when browser fullscreen is unavailable. */
@media (max-width: 900px) and (min-width: 500px),
       (max-height: 600px) and (orientation: landscape) {
    .pierogi-race-dialog-bar {
        justify-content: flex-end;
        min-height: 34px;
        padding-bottom: 2px;
        padding-top: max(2px, env(safe-area-inset-top));
    }

    .pierogi-race-dialog-title,
    .pierogi-race-full-page-link {
        display: none;
    }

    .pierogi-race-close {
        height: 30px;
        width: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sticky-race-launcher,
    .pierogi-race-close {
        transition: none;
    }
}
