html:has([data-city-fair]) {
    scrollbar-gutter: stable;
}

.city-fair-map {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    isolation: isolate;
    background: #bbd6e9;
}

.game-hero[data-city-signed-in="0"] .city-fair-map::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 0;
    background: rgb(10 30 52 / 22%);
    pointer-events: none;
}

.city-fair-login {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.city-fair-snow,
.city-fair-scene {
    position: absolute;
    pointer-events: none;
}

.city-fair-snow {
    inset: 0;
    width: 100%;
    height: 100%;
}

.city-fair-scene {
    z-index: 1;
    opacity: 0;
    transition: opacity 320ms ease-out;
}

.city-fair-scene.is-open {
    opacity: 1;
}

.city-fair-spot {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
}

.city-fair-spot span {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: #173e61;
    box-shadow: 0 1px 5px #12355470;
    font: 700 11px/1 system-ui, sans-serif;
}

.city-fair-spot:focus-visible {
    outline: 2px solid #173e61;
    outline-offset: 1px;
}

.city-fair-spot:disabled {
    cursor: default;
}

[data-city-app] [hidden] {
    display: none;
}

[data-city-outcome="prize"] h2 {
    text-transform: uppercase;
}

.city-fair-burst {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.city-fair-flake {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: #f7fcff;
    box-shadow: 0 1px 3px #305b7e55;
    animation: city-fair-flake 480ms ease-out both;
}

@keyframes city-fair-flake {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.7); }
    38% { opacity: 1; transform: translate(var(--near), var(--rise)) scale(1); }
    100% { opacity: 0; transform: translate(var(--far), var(--drop)) scale(.35); }
}

.city-game-controls {
    padding: 1rem;
    text-align: center;
}

.city-account-auth {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 22rem));
    justify-content: center;
    align-items: start;
    gap: clamp(2rem, 6vw, 5rem);
    padding: clamp(2rem, 5vw, 4rem) 1rem;
}

.city-account-auth form {
    display: grid;
    gap: 1rem;
}

.city-account-auth h2 {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
}

.city-account-auth label {
    text-align: left;
}

.city-account-auth label > :is(input:not([type="checkbox"]), select) {
    display: block;
    width: 100%;
    min-height: 3rem;
    margin-top: .3rem;
    padding: .5rem .75rem;
    border: 1px solid #777;
    border-radius: .5rem;
    background: #fff;
    color: inherit;
    font: inherit;
}

.city-account-auth label > :user-invalid {
    border-color: var(--red);
}

.city-account-auth__hint {
    display: block;
    margin-top: .35rem;
    color: #555;
    font-size: .875rem;
}

.city-account-auth__checkbox {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.city-account-auth__checkbox input {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin: .15rem 0 0;
}

.city-account-auth__checkbox a {
    color: var(--violet);
    text-decoration: underline;
    text-underline-offset: .12em;
}

.city-account-auth .button {
    justify-self: center;
    min-height: 2.75rem;
    padding: .55em 1.1em;
    line-height: 1.15;
    white-space: normal;
}

.city-account-auth details {
    margin-top: .85rem;
}

.city-account-auth summary {
    color: var(--violet);
    cursor: pointer;
    list-style: none;
    text-decoration: underline;
    text-underline-offset: .15em;
}

.city-account-auth summary::-webkit-details-marker {
    display: none;
}

.city-account-auth details form {
    margin-top: 1rem;
}

.city-account-auth [data-city-form-status] {
    color: var(--red);
    font-weight: 700;
}

.city-account-auth [data-city-form-status]:empty {
    position: absolute;
}

.city-account-auth [data-city-reset-sent] {
    color: var(--green);
}

@media (max-width: 42rem) {
    .city-account-auth {
        grid-template-columns: minmax(0, 22rem);
    }

    .city-account-auth #registration {
        border-top: 1px solid #ddd;
        padding-top: 2rem;
    }
}

[data-city-claim-qr] {
    width: min(100%, 16rem);
    margin: 1rem auto;
}

[data-city-claim-text] {
    white-space: pre-line;
}

.action-dialog.city-claim--money {
    width: min(26rem, calc(100% - 2rem));
    padding: clamp(1rem, 5vw, 2rem);
    text-align: center;
}

.action-dialog.city-claim--code {
    padding-inline: clamp(1rem, 4vw, 1.5rem);
}

.action-dialog.city-claim--code h2 {
    padding: 0;
    font: 400 clamp(1rem, 3.5vw, 1.125rem)/1.35 Arial, sans-serif;
    text-align: center;
    text-transform: none;
    overflow-wrap: anywhere;
}

.city-claim--money h2 {
    padding: 0;
}

.city-claim--money [data-city-claim-text] {
    display: none;
}

.city-claim-contact:not([hidden]) {
    display: grid;
    gap: .875rem;
    margin-block: 1rem 1.25rem;
    line-height: 1.4;
}

.city-claim-contact__links {
    display: grid;
    justify-items: center;
    gap: .35rem;
}

.city-claim-contact a {
    color: var(--violet);
    text-decoration: underline;
    text-underline-offset: .15em;
    overflow-wrap: anywhere;
}

.city-claim--money .button {
    min-height: 2.75rem;
    padding-inline: 1.1em;
    border: 1px solid var(--violet);
    background: #fff;
    color: var(--violet);
    font-size: clamp(.875rem, 4.5vw, 1.125rem);
}

@media (prefers-reduced-motion: reduce) {
    .city-fair-scene {
        transition: none;
    }
}
