/* Character outfits: a centered, native scrolling card rail. */
#v142-skin-vault #v200-character-wardrobe-panel #v142-skin-options:has(> .v272-skin-carousel) {
    display: block;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    container: wardrobe-cards / size;
    background: radial-gradient(ellipse at 50% 51%, #9a733c1c, transparent 70%);
}

#v142-skin-options > .v272-skin-carousel {
    --outfit-width: min(45cqw, clamp(70px, calc(65cqh - 38px), 252px));
    --outfit-gap: clamp(2px, 0.65cqw, 9px);
    --outfit-gutter: clamp(32px, 5.5cqw, 54px);
    position: relative;
    isolation: isolate;
    width: min(100%, calc(2.9 * var(--outfit-width) + 2 * var(--outfit-gap) + 2 * var(--outfit-gutter)));
    height: 100%;
    min-height: 130px;
    margin-inline: auto;
}

#v142-skin-options .v272-carousel-track {
    display: flex;
    align-items: center;
    width: calc(100% - 2 * var(--outfit-gutter));
    height: 100%;
    margin-inline: auto;
    gap: var(--outfit-gap);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #77603c #141210;
}

#v142-skin-options .v272-carousel-track::before,
#v142-skin-options .v272-carousel-track::after {
    content: "";
    flex: 0 0 max(0px, calc((100% - var(--outfit-width)) / 2 - var(--outfit-gap)));
    pointer-events: none;
}

#v142-skin-options .v272-carousel-track > .v272-skin-tile {
    box-sizing: border-box;
    flex: 0 0 var(--outfit-width);
    width: var(--outfit-width);
    max-width: none;
    padding: clamp(5px, 1cqw, 10px);
    gap: clamp(3px, 0.65cqw, 7px);
    scroll-snap-align: center;
    transform: scale(0.77);
    opacity: 0.78;
    border-color: #91784f6e;
    background: linear-gradient(155deg, #221c19, #0e0e0f 72%);
    box-shadow: 0 5px 15px #0006;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 200ms ease-out, opacity 170ms ease-out, border-color 170ms ease-out;
}

#v142-skin-options .v272-carousel-track > .v272-skin-tile.is-centered {
    position: relative;
    z-index: 1;
    transform: scale(1);
    opacity: 1;
    border-color: #ad905d;
    box-shadow: 0 9px 24px #0008;
}

#v142-skin-options .v272-carousel-track > .v272-skin-tile.is-equipped {
    border-color: #dfc071;
}

#v142-skin-options .v272-carousel-track > .v272-skin-tile:is(:hover, :focus-visible) {
    opacity: 1;
    border-color: #f2d589;
}

#v142-skin-options .v272-carousel-track .v272-skin-tile-art img {
    object-fit: contain;
}

#v142-skin-options .v272-carousel-track .v272-skin-tile strong {
    font-size: clamp(11px, 2cqw, 15px);
    line-height: 1.3;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#v142-skin-options .v272-carousel-track .v272-skin-tile-status {
    font-size: clamp(10px, 1.6cqw, 12px);
    line-height: 1.25;
}

#v142-skin-options .v272-carousel-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: var(--outfit-gutter);
    height: 48px;
    padding: 0;
    border: 0;
    color: #f3da9f;
    background: transparent;
    font: 26px/1 Georgia, serif;
    cursor: pointer;
}

#v142-skin-options .v272-carousel-arrow::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: min(36px, 85%);
    aspect-ratio: 1;
    border: 1px solid #9e814d;
    border-radius: 50%;
    background: linear-gradient(155deg, #342323, #101012 80%);
}

#v142-skin-options .v272-carousel-prev { left: 0; }
#v142-skin-options .v272-carousel-next { right: 0; }
#v142-skin-options .v272-carousel-arrow:disabled { opacity: 0.32; cursor: default; }
#v142-skin-options .v272-carousel-arrow[hidden] { display: none; }
#v142-skin-options .v272-carousel-arrow:focus-visible { outline: 2px solid #ffe7a6; outline-offset: -3px; }
#v142-skin-options .v272-carousel-arrow:enabled:hover::before { border-color: #f3da9f; background: #3a2c23; }

#v142-skin-options .v272-carousel-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

#v142-skin-options .v272-carousel-track.is-dragging > .v272-skin-tile { cursor: grabbing; }
#v142-skin-options .v272-carousel-track.is-rebasing > .v272-skin-tile { transition: none; }

/* Let all three faces share the full width of a narrow pane. The end spacers
   use the signed tile margin so the first and last cards still snap to center. */
@container wardrobe-cards (max-width: 680px) and (min-height: 220px) {
    #v142-skin-options > .v272-skin-carousel {
        --outfit-width: min(41.5cqw, clamp(80px, calc(65cqh - 52px), 235px));
        --outfit-overlap: calc(var(--outfit-width) * 0.09);
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, min(calc(100% - 44px), calc(var(--outfit-width) * 1.4 + 65px))) 44px;
        align-content: center;
        width: min(100%, calc(2.42 * var(--outfit-width) + 2 * var(--outfit-gap) + 10px));
    }
    #v142-skin-options .v272-carousel-track {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
    }
    #v142-skin-options .v272-carousel-track > .v272-skin-tile {
        margin-inline: calc(-1 * var(--outfit-overlap));
    }
    #v142-skin-options .v272-carousel-track > .v272-skin-tile:not(.is-centered) {
        transform: scale(0.69);
        opacity: 0.87;
    }
    #v142-skin-options .v272-carousel-track::before,
    #v142-skin-options .v272-carousel-track::after {
        flex-basis: max(0px, calc((100% - var(--outfit-width)) / 2 - var(--outfit-gap) + var(--outfit-overlap)));
    }
    #v142-skin-options .v272-carousel-arrow {
        position: static;
        grid-row: 2;
        transform: none;
        width: 48px;
        height: 44px;
        isolation: isolate;
    }
    #v142-skin-options .v272-carousel-arrow::before { width: 31px; }
    #v142-skin-options .v272-carousel-prev { grid-column: 1; justify-self: end; }
    #v142-skin-options .v272-carousel-next { grid-column: 2; justify-self: start; }
    #v142-skin-options > .v272-skin-carousel:has(.v272-carousel-prev[hidden]) {
        grid-template-rows: minmax(0, min(100%, calc(var(--outfit-width) * 1.4 + 65px)));
    }
}

@container wardrobe-cards (max-height: 185px) {
    #v142-skin-options .v272-carousel-track > .v272-skin-tile { padding: 4px; gap: 2px; }
    #v142-skin-options .v272-carousel-track .v272-skin-tile strong { font-size: 10px; }
    #v142-skin-options .v272-carousel-track .v272-skin-tile-status { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    #v142-skin-options .v272-carousel-track > .v272-skin-tile { transition: none; }
}
