.swa-hero-carousel {
    --hero-panel: var(--swa-home-surface);
    --hero-tile: var(--swa-home-raised);
    --hero-text: var(--swa-home-text);
    --hero-muted: var(--swa-home-muted);
    --hero-accent: #baa7f7;
    width: min(100%, 22.4rem);
    min-width: 0;
    align-self: center;
    container-type: inline-size;
    color: var(--hero-text);
}

.swa-hero-carousel [hidden] { display: none; }

.swa-hero-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-rows: minmax(0, 1fr);
    block-size: clamp(21.5rem, 123cqi, 28.8rem);
    overflow: auto hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.swa-hero-carousel:has([data-hero-controls]:not([hidden])) .swa-hero-track { scrollbar-width: none; }

.swa-hero-slide {
    min-width: 0;
    min-height: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.swa-hero-controls {
    position: relative;
    display: flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: .75rem auto 0;
}

.swa-hero-arrow {
    display: grid;
    flex: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: .625rem;
    color: var(--hero-muted);
}

.swa-hero-arrow[aria-disabled="true"] {
    cursor: default;
    opacity: .5;
}

.swa-hero-arrow:not([aria-disabled="true"]):hover { color: var(--hero-text); }

.swa-hero-pagination {
    display: flex;
    align-items: center;
}

.swa-hero-dot,
.swa-hero-playback {
    display: grid;
    place-items: center;
    min-width: 36px;
    min-height: 36px;
    border-radius: .5rem;
    color: var(--hero-muted);
}

.swa-hero-dot-track {
    position: relative;
    display: block;
    width: 7px;
    height: 7px;
    overflow: hidden;
    border-radius: 1rem;
    background: currentColor;
    opacity: .6;
}

.swa-hero-dot:hover .swa-hero-dot-track { opacity: 1; }

.swa-hero-dot[aria-pressed="true"] .swa-hero-dot-track {
    width: 23px;
    background: color-mix(in srgb, var(--hero-accent) 42%, transparent);
    opacity: 1;
}

.swa-hero-dot[aria-pressed="true"] .swa-hero-dot-fill {
    position: absolute;
    inset: 0;
    background: var(--hero-accent);
    transform-origin: left center;
    animation: swa-hero-dot-progress 8s linear forwards paused;
}

.swa-hero-carousel[data-hero-playing] .swa-hero-dot-fill { animation-play-state: running; }

@keyframes swa-hero-dot-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.swa-hero-playback {
    position: absolute;
    inset-inline-start: 100%;
    inset-block-start: 0;
}

.swa-hero-playback:hover { color: var(--hero-text); }
.swa-hero-play-icon,
.swa-hero-playback[data-paused] .swa-hero-pause-icon { display: none; }
.swa-hero-playback[data-paused] .swa-hero-play-icon { display: block; }

@media (prefers-reduced-motion: reduce) {
    .swa-hero-dot[aria-pressed="true"] .swa-hero-dot-track { background: var(--hero-accent); }
    .swa-hero-dot[aria-pressed="true"] .swa-hero-dot-fill { animation: none; }
}

.swa-hero-carousel :where(a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--hero-accent);
    outline-offset: -2px;
}

.swa-hero-gallery {
    --hero-cover-gap: .75rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: var(--hero-cover-gap);
    height: 100%;
}

.swa-hero-gallery-pinned {
    display: grid;
    grid-auto-rows: calc((100% - var(--hero-cover-gap)) / 2);
    gap: var(--hero-cover-gap);
    min-height: 0;
}

.swa-hero-gallery img {
    display: block;
    width: 100%;
    min-height: 0;
    height: 100%;
    border-radius: 1rem;
    object-fit: cover;
}

.swa-hero-gallery-reel {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    container-type: size;
}

.swa-hero-gallery-cycle {
    display: grid;
    grid-auto-rows: calc((100cqb - var(--hero-cover-gap)) / 2);
    gap: var(--hero-cover-gap);
}

.swa-hero-gallery-repeat { display: none; }

@media (prefers-reduced-motion: no-preference) {
    .swa-hero-carousel:has(> [data-hero-controls]:not([hidden])) .swa-hero-gallery-reel--animated {
        overflow: clip;
        mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent);
    }

    .swa-hero-carousel:has(> [data-hero-controls]:not([hidden])) .swa-hero-gallery-reel--animated .swa-hero-gallery-cycle {
        display: grid;
        padding-block-end: var(--hero-cover-gap);
    }

    .swa-hero-carousel:has(> [data-hero-controls]:not([hidden])) .swa-hero-gallery-reel--animated .swa-hero-gallery-scroll {
        animation: swa-hero-gallery-up var(--hero-reel-duration) linear infinite paused;
    }

    .swa-hero-carousel[data-hero-playing] #hero-showcase-games:not([inert]) .swa-hero-gallery-scroll {
        animation-play-state: running;
    }
}

@keyframes swa-hero-gallery-up {
    to { transform: translateY(-50%); }
}

.swa-hero-item-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .375rem .75rem;
    height: 100%;
    padding: .75rem clamp(.75rem, 3.75cqi, 1rem) .25rem;
    border: 1px solid var(--swa-home-border);
    border-radius: 1rem;
    background: var(--hero-panel);
}

.swa-hero-item-header {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .125rem .5rem;
    padding-block-end: .25rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--hero-muted);
}

.swa-hero-item-header a { color: var(--hero-accent); }
.swa-hero-item-header a:hover { text-decoration: underline; text-underline-offset: .2em; }

.swa-hero-item-track {
    grid-column: 1 / -1;
    align-self: stretch;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-rows: minmax(0, 1fr);
    overflow: auto hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.swa-hero-item-gallery:has(> [data-hero-controls]:not([hidden])) .swa-hero-item-track { scrollbar-width: none; }

.swa-hero-item {
    display: grid;
    grid-template-rows: minmax(5.5rem, 1fr) auto auto;
    gap: .5rem;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.swa-hero-item-image {
    position: relative;
    overflow: hidden;
    border-radius: .625rem;
    background: var(--swa-home-panel);
}

.swa-hero-item-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: .375rem;
    object-fit: contain;
}

.swa-hero-item-views {
    position: absolute;
    inset-block-end: .25rem;
    inset-inline-end: .25rem;
    display: flex;
    padding-inline: .25rem;
    border-radius: .375rem;
    background: var(--hero-panel);
}

.swa-hero-item-gallery:not(:has(> [data-hero-controls]:not([hidden]))) .swa-hero-item-views { display: none; }

.swa-hero-item-views button {
    min-width: 44px;
    min-height: 28px;
    padding-inline: .375rem;
    color: var(--hero-muted);
    font-size: .6875rem;
    font-weight: 600;
}

.swa-hero-item-views button[aria-pressed="true"] { color: var(--hero-accent); }

.swa-hero-item-name {
    font-size: clamp(.9375rem, 4.3cqi, 1.1875rem);
    font-weight: 700;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.swa-hero-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .125rem .5rem;
    margin-top: .25rem;
    color: var(--hero-muted);
    font-size: .75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.swa-hero-item-meta strong { color: var(--hero-text); font-weight: 600; }
.swa-hero-item-phase {
    padding: .125rem .375rem;
    border-radius: .375rem;
    background: var(--hero-tile);
    color: var(--hero-accent);
    font-weight: 650;
}

.swa-hero-item-prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: .375rem .5rem;
    font-variant-numeric: tabular-nums;
}

.swa-hero-item-prices dt {
    color: var(--hero-muted);
    font-size: .6875rem;
    line-height: 1.25;
}

.swa-hero-item-prices dd {
    margin: .125rem 0 0;
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.25;
}

.swa-hero-item-lowest {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding-block-end: .375rem;
    border-block-end: 1px solid var(--swa-home-border);
}

.swa-hero-item-lowest dt strong {
    display: block;
    margin-top: .125rem;
    font-size: .8125rem;
    font-weight: 650;
    color: var(--hero-text);
}

.swa-hero-item-lowest dd { color: var(--hero-accent); font-size: 1.1875rem; white-space: nowrap; }
.swa-hero-item-sample { color: var(--hero-muted); font-size: .6875rem; }

.swa-hero-item-controls {
    display: flex;
    align-items: center;
    gap: .125rem;
    color: var(--hero-muted);
}

.swa-hero-item-counter { font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 1024px) {
    .swa-hero-carousel {
        flex: none;
        width: clamp(20rem, 28.8vw, 25.6rem);
    }
}
