/* ==========================================================================
   /otomates as an item shop (Fortnite-style tiles) in the games hub's own
   look (static/discord-activity/index.html: its dark greys, Baloo 2, its
   small spaced section signs): every tile in its tier's gradient with a dark
   name strip under the picture, legendary tiles shining. Loaded
   last by otomates.html (html.item-shop) over otomates.css; the structure is
   the same page's (otomates.js), only the look is here. Tier colours follow
   the shop mockups (common green, rare blue, epic purple, legendary gold,
   a sale red).
   ========================================================================== */

/* the hub's font (its Latin file; the full one only for what that lacks) */
@font-face {
    font-family: "Baloo 2";
    src: url("/static/games/shared/fonts/Baloo2-latin.woff2") format("woff2");
    font-weight: 400 800;
    font-display: swap;
}

@font-face {
    font-family: "Baloo 2";
    src: url("/static/games/shared/fonts/Baloo2.ttf") format("truetype");
    font-weight: 400 800;
    font-display: swap;
    unicode-range: U+0251, U+0261, U+03C0, U+0900-097F, U+A8FB;
}

/* (the hub's --bg, --panel, --panel-2, --line, --ink, --muted, --accent) */
:root.item-shop {
    --is-bg: #1e1f22;
    --is-panel: #2b2d31;
    --is-pill: #313338;
    --is-pill-hover: #383a40;
    --is-line: #3f4147;
    --is-ink: #f2f3f5;
    --is-muted: #a6abb3;
    --is-dim: #8a8f98;
    /* (buttons keep the shop's own blue: the hub's green read too plain here) */
    --is-accent: linear-gradient(135deg, #3fd8ff 0%, #4f97ff 50%, #b9a0ff 100%);
    --is-sale: #df3b52;
    --ob-ink: var(--is-ink);
    --ob-muted: var(--is-muted);
    --ob-backdrop: var(--is-bg);
    --ob-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    --ob-shadow-hover: 0 16px 34px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

/* ---- tiers: the frame, the picture's gradient, the name strip, its label ---- */
:root.item-shop .tier-common {
    --tier-art: linear-gradient(135deg, #d4f77a 0%, #5fd66a 40%, #2fbf86 72%, #8fe6cf 100%);
    --tier-line: #b8f5a0;
    --tier-soft: #146b47;
    --tier-text: #c9f7b0;
}

:root.item-shop .tier-rare {
    --tier-art: linear-gradient(135deg, #6ff0ff 0%, #2f9bff 40%, #3a6cf2 72%, #9bb6ff 100%);
    --tier-line: #a8e0ff;
    --tier-soft: #173c9e;
    --tier-text: #bfe3ff;
}

:root.item-shop .tier-epic {
    --tier-art: linear-gradient(135deg, #ff9df2 0%, #c254ff 38%, #8040f2 72%, #c4a6ff 100%);
    --tier-line: #e2b8ff;
    --tier-soft: #4a1a9c;
    --tier-text: #e6ccff;
}

:root.item-shop .tier-legendary {
    --tier-art: linear-gradient(135deg, #fff38a 0%, #ffc21a 32%, #ff8a1a 66%, #ff5a3c 100%);
    --tier-line: #ffe680;
    --tier-soft: #8a3300;
    --tier-text: #ffe7a8;
}

/* ---- the page: no site sidebar (the shop is a screen off the games hub,
   its back button top left), a dark ground ---- */
:root.item-shop body.oto-ui-page,
:root.item-shop .otomates-page {
    background: var(--is-bg);
    color: var(--is-ink);
    font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root.item-shop .ob-backdrop {
    background: var(--is-bg);
    animation: none;
}

:root.item-shop .ob-curtain {
    background: var(--is-panel);
}

:root.item-shop .oto-app-sidebar,
:root.item-shop .oto-app-drawer-toggle,
:root.item-shop .oto-app-drawer-backdrop,
:root.item-shop .otomates-mobile-create {
    display: none !important;
}

/* (no room kept for the site's floating Menu button: the bar has its own) */
:root.item-shop .oto-app-main {
    margin-left: 0 !important;
    padding-top: 0 !important;
}

:root.item-shop .otomates-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

:root.item-shop .otomates-footer,
:root.item-shop .otomates-footer a,
:root.item-shop .otomates-footer-copy {
    color: var(--is-dim);
}

/* ---- the shop's bar: back, ITEM SHOP, the wallet, the menu ---- */
:root.item-shop .shop-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;   /* (the page's own grid gap sets the space under it) */
    padding: max(12px, env(safe-area-inset-top)) 0 12px;
    background: var(--is-bg);
}

/* full bleed behind the bar, past the page's side padding (on its own layer,
   so its clip leaves the menu's dropdown free to hang below the bar) */
:root.item-shop .shop-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--is-bg);
    box-shadow: 0 0 0 100vmax var(--is-bg), 0 1px 0 100vmax rgba(255, 255, 255, 0.06);
    clip-path: inset(0 -100vmax -1px);
    pointer-events: none;
}

/* (in the apps' hub the WebView already sits below the status bar: the hub's own 14px) */
:root.item-shop.oto-hub-app .shop-header {
    padding-top: 14px;
}

/* the games' back button (shared/game-menu.js #otomateBackBtn): a round dark
   glass button with a white chevron */
:root.item-shop .shop-back {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    box-sizing: border-box;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(10, 18, 28, 0.55);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 6, 14, 0.35);
    transition: transform 120ms ease;
    touch-action: manipulation;
}

:root.item-shop .shop-back:active {
    transform: scale(0.9);
}

:root.item-shop .shop-back:focus-visible {
    outline: 2px solid #d6a3ef;
    outline-offset: 2px;
}

:root.item-shop .shop-back[hidden] {
    display: none;
}

:root.item-shop .shop-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--is-ink);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:root.item-shop .shop-header-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

:root.item-shop .shop-messages-slot {
    display: flex;
    align-items: center;
    flex: none;
}

:root.item-shop .shop-messages-slot:empty {
    display: none;
}

:root.item-shop .otomate-bits,
:root.item-shop .otomate-crystals {
    height: 38px;
    padding: 0 12px 0 8px;
    border-radius: 10px;
    border: 0;
    background: var(--is-pill);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

:root.item-shop .otomate-bits[hidden],
:root.item-shop .otomate-crystals[hidden] {
    display: none;
}

:root.item-shop .otomate-crystals:hover {
    background: var(--is-pill-hover);
}

:root.item-shop .otomate-bits .oto-bits-coin {
    width: 20px;
    height: 20px;
}

:root.item-shop .shop-menu {
    position: relative;
    flex: none;
}

:root.item-shop .shop-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--is-pill);
    color: #ffffff;
    font-size: 17px;
    cursor: pointer;
    touch-action: manipulation;
}

:root.item-shop .shop-menu-toggle:hover,
:root.item-shop .shop-menu-toggle[aria-expanded="true"] {
    background: var(--is-pill-hover);
}

:root.item-shop .shop-menu-toggle:focus-visible,
:root.item-shop .shop-menu-item:focus-visible {
    outline: 2px solid #d6a3ef;
    outline-offset: 2px;
}

:root.item-shop .shop-menu-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--is-line);
    border-radius: 12px;
    background: var(--is-panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

:root.item-shop .shop-menu-list[hidden] {
    display: none;
}

:root.item-shop .shop-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--is-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

:root.item-shop .shop-menu-item:hover {
    background: var(--is-pill-hover);
}

:root.item-shop .shop-menu-item i {
    width: 18px;
    color: #8fb8ff;
    text-align: center;
}

:root.item-shop .shop-menu-create {
    margin-bottom: 4px;
    background: var(--is-accent);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(63, 120, 255, 0.3);
}

:root.item-shop .shop-menu-create:hover {
    background: var(--is-accent);
    filter: brightness(1.08);
}

:root.item-shop .shop-menu-create i {
    color: #ffffff;
}

/* the Redeem code dialog's "You got": a burst, then each reward in turn */
.redeem-done {
    position: relative;
    overflow: hidden;
}

.redeem-done > :not(.redeem-burst):not(.buy-confetti) {
    position: relative;
}

.redeem-burst {
    position: absolute;
    top: -140px;
    left: 50%;
    width: 420px;
    height: 420px;
    margin-left: -210px;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(79, 151, 255, 0.16) 0deg 10deg, transparent 10deg 20deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
    mask-image: radial-gradient(circle, #000 0%, transparent 62%);
    opacity: 0;
    pointer-events: none;
}

.redeem-done.is-revealing .redeem-burst {
    animation: redeem-burst-in 700ms ease-out forwards, redeem-burst-spin 14s linear infinite;
}

.redeem-rewards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.redeem-reward {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f2f4f8;
    font-size: 16px;
    font-weight: 700;
}

.redeem-reward b {
    font-weight: 900;
}

.redeem-done.is-revealing .redeem-reward {
    animation: redeem-pop 460ms cubic-bezier(.2, 1.4, .4, 1) both;
    animation-delay: calc(var(--i, 0) * 160ms + 220ms);
}

.redeem-reward .oto-bits-coin,
.redeem-reward .oto-crystal-gem {
    width: 28px;
    height: 28px;
}

.redeem-reward--look {
    align-items: stretch;
    padding: 12px;
    background: linear-gradient(135deg, #eef5ff 0%, #f4efff 100%);
    border: 1.5px solid #c9dafc;
}

.redeem-look-art {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 92px;
    border-radius: 12px;
    background: linear-gradient(160deg, #3fd8ff 0%, #4f97ff 55%, #b9a0ff 100%);
    overflow: hidden;
    color: #ffffff;
    font-size: 26px;
}

.redeem-look-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.redeem-look-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.redeem-look-name {
    font-size: 17px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.redeem-look-kind {
    color: #5e6778;
    font-size: 13px;
    font-weight: 700;
}

.redeem-look-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: auto;
    padding-top: 8px;
}

.redeem-look-wear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #3fd8ff 0%, #4f97ff 50%, #b9a0ff 100%);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.redeem-look-wear.is-done {
    background: #2f7a4a;
}

.redeem-look-wear:disabled {
    cursor: default;
}

.redeem-look-see {
    color: #3b6fd8;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
}

.redeem-look-see:hover {
    text-decoration: underline;
}

/* the coins and gems flying from the dialog to the bar's pills */
.redeem-flyer {
    position: fixed;
    z-index: 2147483000;
    pointer-events: none;
}

.redeem-flyer .oto-bits-coin,
.redeem-flyer .oto-crystal-gem {
    display: block;
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

:root.item-shop .otomate-bits.is-collecting,
:root.item-shop .otomate-crystals.is-collecting {
    animation: redeem-pill-pulse 700ms ease-out;
}

/* a look the code just gave, in the Shop's Featured and Daily */
:root.item-shop .shop-tile.is-just-redeemed {
    box-shadow: 0 0 0 3px #ffd85e, 0 0 24px rgba(255, 216, 94, 0.55);
}

@keyframes redeem-burst-in {
    0% { opacity: 0; transform: scale(0.4); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes redeem-burst-spin {
    to { rotate: 360deg; }
}

@keyframes redeem-pop {
    0% { opacity: 0; transform: translateY(14px) scale(0.92); }
    100% { opacity: 1; transform: none; }
}

@keyframes redeem-pill-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 216, 94, 0.7); }
    35% { transform: scale(1.14); box-shadow: 0 0 0 6px rgba(255, 216, 94, 0.35); }
    100% { transform: scale(1); box-shadow: 0 0 0 12px rgba(255, 216, 94, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .redeem-done.is-revealing .redeem-burst,
    .redeem-done.is-revealing .redeem-reward,
    :root.item-shop .otomate-bits.is-collecting,
    :root.item-shop .otomate-crystals.is-collecting {
        animation: none;
        opacity: 1;
    }
}

@media (max-width: 560px) {
    :root.item-shop .shop-header {
        gap: 8px;
    }

    :root.item-shop .otomate-bits,
    :root.item-shop .otomate-crystals {
        height: 34px;
        font-size: 14px;
        padding: 0 9px 0 6px;
    }
}

@media (max-width: 400px) {
    :root.item-shop .otomate-crystals {
        display: none;
    }

    :root.item-shop .shop-header-end {
        gap: 4px;
    }
}

@media (max-width: 340px) {
    :root.item-shop .shop-header:has(.otomate-bits:not([hidden])) {
        flex-wrap: wrap;
    }

    :root.item-shop .shop-header:has(.otomate-bits:not([hidden])) .shop-title {
        flex: 1 1 calc(100% - 54px);
    }

    :root.item-shop .shop-header:has(.otomate-bits:not([hidden])) .shop-header-end {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    :root.item-shop:has(.otomate-bits:not([hidden])) .all-otomates-head {
        scroll-margin-top: 130px;
    }
}

/* ---- tabs and filters: the hub's grey pills, the active one in the shop's blue ---- */
/* (no Shop | Collection tabs: the page is the Shop, and who lives with you is
   Home's household panel and the list's own first; /otomates/collection stays) */
:root.item-shop .gallery-heading-row:not(.all-otomates-head) {
    display: none;
}

:root.item-shop .otomates-tabs,
:root.item-shop .otomates-tabs:not(:has(.otomates-tab:not([hidden]):not(.is-active))) {
    gap: 8px;
    padding: 0;
    background: transparent;
}

:root.item-shop .otomates-tab,
:root.item-shop .otomates-tabs:not(:has(.otomates-tab:not([hidden]):not(.is-active))) .otomates-tab.is-active {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--is-pill);
    color: var(--is-muted);
    font-size: 14px;
    font-weight: 800;
    box-shadow: none;
}

:root.item-shop .otomates-tab:not(.is-active):hover,
:root.item-shop .otomates-tab:not(.is-active):focus-visible {
    background: var(--is-pill-hover);
    color: #ffffff;
}

:root.item-shop .otomates-tab.is-active,
:root.item-shop .otomates-tabs:not(:has(.otomates-tab:not([hidden]):not(.is-active))) .otomates-tab.is-active {
    background: var(--is-accent);
    color: #ffffff;
}

:root.item-shop .browse-toolbar,
:root.item-shop .browse-toolbar.oto-surface-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
}

:root.item-shop .search-field,
:root.item-shop .sort-field {
    background: var(--is-pill);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    color: var(--is-muted);
}

:root.item-shop .search-input,
:root.item-shop .sort-select,
:root.item-shop .sort-label,
:root.item-shop .search-icon {
    background: transparent;
    color: #ffffff;
}

:root.item-shop .search-input::placeholder {
    color: var(--is-dim);
}

:root.item-shop .sort-select option {
    background: var(--is-panel);
    color: #ffffff;
}

:root.item-shop .filter-chip,
:root.item-shop .clear-filters-btn,
:root.item-shop .admin-select-toggle {
    background: var(--is-pill);
    border-color: transparent;
    color: var(--is-muted);
    font-weight: 800;
}

:root.item-shop .filter-chip:hover {
    background: var(--is-pill-hover);
    color: #ffffff;
}

:root.item-shop .filter-chip.is-active {
    background: var(--is-accent);
    border-color: transparent;
    color: #ffffff;
}

:root.item-shop .filter-chip.tier-chip.is-active {
    background: var(--tier-art);
    border-color: var(--tier-line);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

:root.item-shop .owned-progress,
:root.item-shop .search-fallback-note,
:root.item-shop .kind-count {
    color: var(--is-muted);
}

:root.item-shop .state-panel {
    background: var(--is-panel);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

:root.item-shop .state-panel p {
    color: var(--is-muted);
}

/* ---- section signs: Featured and Most Popular ---- */
:root.item-shop .todays-deals-head {
    align-items: center;
    margin: 0 2px 10px;
}

:root.item-shop .todays-deals-title {
    display: inline-block;
    margin: 0;
    color: var(--is-ink);
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

:root.item-shop .todays-deals-ends:not(:empty) {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--is-line);
    border-radius: 999px;
    background: var(--is-pill);
    color: var(--is-ink);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---- prices on the strips: white numbers, the coin and gem beside them ---- */
:root.item-shop .price-chip.is-bits,
:root.item-shop .price-chip.is-gems {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

:root.item-shop .price-chip s {
    color: rgba(255, 255, 255, 0.6);
}

:root.item-shop .price-or {
    color: rgba(255, 255, 255, 0.55);
}

/* ---- one scroll: Featured, Daily, then All Otomates ---- */
:root.item-shop .shop-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    margin: 0 0 30px;
}

:root.item-shop .shop-top > .shop-section {
    min-width: 0;
}

:root.item-shop .shop-browse-jump {
    display: none;
}

:root.item-shop .shop-section[hidden],
:root.item-shop .shop-empty[hidden] {
    display: none;
}

:root.item-shop .shop-empty {
    margin: 30px 0 0;
    color: var(--is-muted);
    font-weight: 800;
    text-align: center;
}

/* All Otomates: its sign, the search and sort beside it */
:root.item-shop .all-otomates-head {
    gap: 14px;
    margin: 0 2px 12px;
    scroll-margin-top: 84px;
}

:root.item-shop .all-otomates-head .browse-toolbar-row {
    margin-left: auto;
}

/* Featured: one large rotating scene, with today's discounts beside it. */
:root.item-shop .shop-featured-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 12px;
    height: clamp(360px, 36vw, 440px);
}

:root.item-shop .shop-featured-layout[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}

:root.item-shop .shop-featured-carousel {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

:root.item-shop .shop-featured-side {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
    min-height: 0;
}

:root.item-shop .shop-featured-side[hidden] {
    display: none;
}

:root.item-shop .shop-featured-layout[data-count="2"] .shop-featured-side {
    grid-template-rows: minmax(0, 1fr);
}

:root.item-shop .shop-featured-track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

:root.item-shop .shop-featured-track::-webkit-scrollbar {
    display: none;
}

:root.item-shop .shop-featured-track > .shop-tile {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

:root.item-shop .shop-featured-track > .shop-tile:hover {
    transform: none;
}

:root.item-shop .shop-featured-pager:not([hidden]) {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
}

:root.item-shop .shop-featured-pager button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 10px;
    background: rgba(35, 38, 44, 0.76);
    color: rgba(255, 255, 255, 0.65);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

:root.item-shop .shop-featured-pager button.is-active {
    border: 2px solid #ffffff;
    color: #ffffff;
}

:root.item-shop .shop-featured-pager button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -1px;
}

/* Most Popular: four wide skin scenes in two rows. */
:root.item-shop .shop-daily-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 230px;
    gap: 10px;
}

:root.item-shop .shop-daily-nav {
    display: none;
}

:root.item-shop .shop-daily-nav[hidden] {
    display: none;
}

@media (max-width: 1000px) {
    :root.item-shop .shop-daily-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 220px;
    }
}

@media (max-width: 640px) {
    :root.item-shop .shop-top {
        gap: 22px;
    }

    :root.item-shop .shop-browse-jump {
        display: inline-flex;
        align-items: center;
        justify-self: end;
        gap: 8px;
        min-height: 36px;
        margin-bottom: -12px;
        padding: 0 12px;
        border: 1px solid var(--is-line);
        border-radius: 10px;
        background: var(--is-pill);
        color: var(--is-ink);
        font-size: 13px;
        font-weight: 800;
        text-decoration: none;
    }

    :root.item-shop .shop-browse-jump:focus-visible {
        outline: 2px solid #d6a3ef;
        outline-offset: 2px;
    }

    :root.item-shop .shop-featured-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 270px 170px;
        height: auto;
    }

    :root.item-shop .shop-featured-layout[data-count="1"] {
        grid-template-rows: 270px;
    }

    :root.item-shop .shop-featured-carousel {
        grid-column: 1 / -1;
        grid-row: 1;
        height: 270px;
    }

    :root.item-shop .shop-featured-side {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
    }

    :root.item-shop .shop-featured-layout[data-count="2"] .shop-featured-side {
        grid-template-columns: minmax(0, 1fr);
    }

    :root.item-shop .shop-featured-side .shop-tile-name {
        font-size: 14px;
    }

    :root.item-shop .shop-featured-side .shop-tile-kind,
    :root.item-shop .shop-featured-side .price-or,
    :root.item-shop .shop-featured-side .price-chip.is-gems {
        display: none;
    }

    :root.item-shop .shop-daily-grid {
        grid-template-columns: none;
        grid-template-rows: 210px;
        grid-auto-flow: column;
        grid-auto-columns: minmax(270px, 80vw);
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
        padding-bottom: 6px;
    }

    :root.item-shop .shop-daily-nav:not([hidden]) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 40px;
        margin: 2px 0 8px;
        color: var(--is-muted);
        font-size: 13px;
        font-weight: 800;
    }

    :root.item-shop .shop-daily-nav-buttons {
        display: flex;
        gap: 6px;
    }

    :root.item-shop .shop-daily-nav-buttons button {
        width: 40px;
        height: 40px;
        border: 1px solid var(--is-line);
        border-radius: 10px;
        background: var(--is-pill);
        color: var(--is-ink);
        font: inherit;
        cursor: pointer;
    }

    :root.item-shop .shop-daily-nav-buttons button:disabled {
        opacity: 0.4;
        cursor: default;
    }

    :root.item-shop .shop-daily-nav-buttons button:focus-visible {
        outline: 2px solid #d6a3ef;
        outline-offset: 2px;
    }

    :root.item-shop .shop-daily-grid .shop-tile {
        scroll-snap-align: start;
    }
}

/* ---- a Shop tile: her picture on the tier's gradient, the name strip under it ---- */
:root.item-shop .shop-tile {
    position: relative;
    display: block;
    min-width: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
    isolation: isolate;
    border-radius: 12px;
    border: 3px solid var(--tier-line);
    background: var(--tier-art);
    color: #ffffff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

:root.item-shop .shop-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
}

:root.item-shop .shop-tile:focus-visible {
    outline: 2px solid #d6a3ef;
    outline-offset: 2px;
}

/* (the placeholders until the Shop's prices arrive: plain panels, a slow pulse) */
:root.item-shop .shop-tile.is-skeleton {
    border-color: var(--is-line);
    background: var(--is-panel);
    box-shadow: none;
    cursor: default;
    animation: item-shop-pulse 1.2s ease-in-out infinite alternate;
}

:root.item-shop .shop-tile.is-skeleton:hover {
    transform: none;
}

:root.item-shop .shop-tile.is-skeleton.is-hero::before {
    content: none;
}

@keyframes item-shop-pulse {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    :root.item-shop .shop-tile.is-skeleton { animation: none; }
}

/* (rays turning behind the big one) */
:root.item-shop .shop-tile.is-hero::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 42%;
    z-index: -1;
    width: 1200px;
    height: 1200px;
    margin: -600px 0 0 -600px;
    background: repeating-conic-gradient(rgba(255, 255, 255, 0.14) 0deg 8deg, rgba(255, 255, 255, 0) 8deg 24deg);
    animation: item-shop-rays 40s linear infinite;
    pointer-events: none;
}

:root.item-shop .shop-tile-art {
    position: absolute;
    inset: 8px 6px 56px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

:root.item-shop .shop-tile.is-hero .shop-tile-art {
    inset: 16px 16px 84px;
}

:root.item-shop .shop-tile-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    transition: transform 250ms ease;
}

/* Horizontal splash scenes fill the Shop's art windows. */
:root.item-shop .shop-tile.has-splash {
    border-width: 1px;
}

:root.item-shop .shop-tile.has-splash .shop-tile-art,
:root.item-shop .shop-daily-grid .shop-tile.has-splash .shop-tile-art,
:root.item-shop .shop-tile.is-hero.has-splash .shop-tile-art {
    inset: 0;
}

:root.item-shop .shop-tile.has-splash .shop-tile-art img {
    object-fit: cover;
    object-position: center;
}

:root.item-shop .shop-tile.has-splash .shop-tile-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: none;
    pointer-events: none;
}

:root.item-shop .shop-tile:hover .shop-tile-art img {
    transform: scale(1.04);
}

:root.item-shop .shop-tile-tags {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 4;
    display: flex;
    gap: 5px;
}

:root.item-shop .shop-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

:root.item-shop .shop-tag.is-new {
    background: #ffe36b;
    color: var(--is-bg);
}

:root.item-shop .shop-tag.is-sale {
    background: var(--is-sale);
    color: #ffffff;
}

:root.item-shop .card-deal {
    background: var(--is-sale);
}

:root.item-shop .shop-tile-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 10px 9px;
    background: var(--tier-soft);
}

:root.item-shop .shop-tile.has-splash .shop-tile-strip {
    padding: 26px 10px 5px;
    background: linear-gradient(180deg, rgba(8, 10, 17, 0) 0%, rgba(8, 10, 17, 0.74) 42%, rgba(8, 10, 17, 0.92) 100%);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

:root.item-shop .shop-tile.is-hero.has-splash .shop-tile-strip {
    padding: 46px 14px 8px;
}

:root.item-shop .shop-tile-name {
    overflow: hidden;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root.item-shop .shop-tile.is-hero .shop-tile-name {
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.05;
}

:root.item-shop .shop-tile-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}

:root.item-shop .shop-tile-kind {
    min-width: 0;
    overflow: hidden;
    color: var(--tier-text);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

:root.item-shop .shop-tile.is-hero .shop-tile-kind {
    font-size: 12.5px;
}

:root.item-shop .shop-tile-price {
    flex: none;
}

:root.item-shop .shop-tile-price .price-chip {
    background: transparent;
    border: 0;
    padding: 0 2px 0 0;
}

:root.item-shop .shop-tile-owned {
    color: var(--tier-text);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Featured and Daily keep their prices at the same lower-right edge. */
:root.item-shop .shop-daily-grid .shop-tile-line {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

:root.item-shop .shop-daily-grid .shop-tile-kind {
    max-width: 100%;
}

:root.item-shop .shop-daily-grid .shop-tile-price {
    margin-left: auto;
}

:root.item-shop .shop-daily-grid .shop-tile-art {
    bottom: 72px;
}

/* (small tiles on a phone: the price under the name, the tier line left out) */
@media (max-width: 640px) {
    :root.item-shop .shop-daily-grid .shop-tile-art {
        inset: 6px 4px 50px;
    }

    :root.item-shop .shop-daily-grid .shop-tile-strip {
        padding: 5px 7px 6px;
    }

    :root.item-shop .shop-daily-grid .shop-tile.has-splash .shop-tile-strip {
        padding: 5px 7px 3px;
    }

    :root.item-shop .shop-daily-grid .shop-tile-name {
        font-size: 14px;
    }

    :root.item-shop .shop-daily-grid .shop-tile-kind {
        display: none;
    }

    /* (Bits alone on a small tile: Crystals are in the buy popup, as on the grid's cards) */
    :root.item-shop .shop-daily-grid .price-or,
    :root.item-shop .shop-daily-grid .price-chip.is-gems,
    :root.item-shop .shop-featured-track .shop-tile:not(.is-hero) .price-or,
    :root.item-shop .shop-featured-track .shop-tile:not(.is-hero) .price-chip.is-gems {
        display: none;
    }

    :root.item-shop .shop-tile-tags {
        left: 6px;
        top: 6px;
    }

    :root.item-shop .shop-tag {
        height: 20px;
        padding: 0 6px;
        font-size: 10px;
    }
}

/* ---- the grid: portrait art with the name and price over a dark fade ---- */
:root.item-shop .card-grid {
    gap: 12px;
}

:root.item-shop .character-card,
:root.item-shop .card-grid .character-card.has-tier,
:root.item-shop .card-grid .character-card.has-tier:hover,
:root.item-shop .card-grid .character-card.has-tier:focus-visible {
    grid-template-areas: "art";
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--tier-line, #4a3f8f);
    background: #0b0d15;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

:root.item-shop .card-grid .character-card {
    container-type: inline-size;
}

:root.item-shop .character-card:hover,
:root.item-shop .character-card:focus-visible,
:root.item-shop .card-grid .character-card.has-tier:hover,
:root.item-shop .card-grid .character-card.has-tier:focus-visible {
    transform: none;
    border-color: #f8f7ff;
    box-shadow: 0 0 0 2px var(--tier-line, #bba9e7), 0 8px 20px rgba(0, 0, 0, 0.35);
}

:root.item-shop .character-card:focus-visible {
    outline: 2px solid #d6a3ef;
    outline-offset: 2px;
}

:root.item-shop .card-media,
:root.item-shop .card-grid .character-card.has-tier .card-media {
    grid-area: art;
    z-index: 0;
    background: var(--tier-art, linear-gradient(135deg, #3a2f80 0%, #241c55 100%));
}

:root.item-shop .card-media::after {
    background: none;
}

:root.item-shop .card-body,
:root.item-shop .card-grid .character-card.has-tier .card-body {
    grid-area: art;
    z-index: 1;
    align-self: end;
    gap: 4px;
    padding-top: 22px;
    padding-bottom: 1px;
    background: linear-gradient(180deg, rgba(8, 10, 17, 0), rgba(8, 10, 17, 0.72) 58%, rgba(8, 10, 17, 0.94));
    border-top: 0;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

:root.item-shop .card-grid .character-card:is(:hover, :focus-visible) .card-body {
    background: linear-gradient(180deg, rgba(8, 10, 17, 0), rgba(8, 10, 17, 0.62) 58%, rgba(8, 10, 17, 0.86));
}

:root.item-shop .card-grid .card-head,
:root.item-shop .card-grid .card-name {
    text-align: center;
}

:root.item-shop .card-grid .card-name {
    transform: translateY(11px);
}

:root.item-shop .card-grid .card-unlock-cue {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 13px;
    background: rgba(18, 19, 28, 0.62);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 150ms ease;
}

:root.item-shop .card-grid .card-unlock-cue svg {
    width: 24px;
    height: 24px;
}

:root.item-shop .card-grid .character-card.is-unlockable:is(:hover, :focus-visible) .card-unlock-cue {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    :root.item-shop .card-grid .card-unlock-cue {
        transition: none;
    }
}

:root.item-shop .card-name,
:root.item-shop a.card-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
}

:root.item-shop .card-code,
:root.item-shop .card-snippet,
:root.item-shop .card-created,
:root.item-shop .card-tier {
    color: var(--tier-text, var(--is-muted));
}

:root.item-shop .tag-pill,
:root.item-shop .tag-pill.warm {
    background: rgba(0, 0, 0, 0.22);
    color: #ffffff;
}

:root.item-shop .card-downloads,
:root.item-shop .card-info-btn {
    background: rgba(30, 31, 34, 0.6);
    color: #ffffff;
    border-color: transparent;
}

:root.item-shop .card-info-btn {
    transition: transform 160ms ease, background-color 160ms ease;
}

:root.item-shop .card-info-btn:is(:hover, :focus-visible) {
    background-color: rgba(30, 31, 34, 0.88);
    transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
    :root.item-shop .card-info-btn {
        transition: none;
    }
}

/* Her actions share one compact bottom row. The price still uses the full row
   when she isn't yours. */
:root.item-shop .card-grid .card-buy-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn,
:root.item-shop .card-grid .card-buy-row .card-add-btn {
    position: static;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    gap: 5px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: hidden;
    white-space: nowrap;
}

:root.item-shop .card-grid .card-buy-row:has(.card-add-btn:not([hidden])) :is(.card-main-btn, .card-add-btn) {
    min-height: 34px;
}

@container (max-width: 205px) {
    :root.item-shop .card-grid .card-buy-row .card-main-btn,
    :root.item-shop .card-grid .card-buy-row .card-add-btn {
        padding-inline: 3px;
        font-size: 11px;
        gap: 3px;
    }

    :root.item-shop .card-grid .card-buy-row .card-add-btn i {
        display: none;
    }
}

:root.item-shop .card-grid .card-buy-row .card-main-btn {
    border: 0;
    background: #ffe36b;
    color: var(--is-bg);
}

:root.item-shop .card-grid .card-buy-row .card-main-btn:not(.is-for-sale):not(:disabled):hover,
:root.item-shop .card-grid .character-card:is(:hover, :focus-visible) .card-buy-row .card-main-btn:not(:disabled):not(.is-for-sale):not(.is-visits):not(.is-main) {
    border-color: transparent;
    background: #fff0a0;
    color: var(--is-bg);
}

/* (the main: "★ Main", quiet; she's home, so no Roommate button beside it) */
:root.item-shop .card-grid .card-buy-row .card-main-btn.is-main,
:root.item-shop .card-grid .card-buy-row .card-main-btn:disabled.is-main {
    background: transparent;
    border: 1.5px solid #ffe36b;
    color: #ffe36b;
}

:root.item-shop .card-grid .card-buy-row .card-add-btn {
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    color: #ffffff;
}

:root.item-shop .card-grid .card-buy-row .card-add-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.12);
}

:root.item-shop .card-grid .card-buy-row .card-add-btn.is-added,
:root.item-shop .card-grid .card-buy-row .card-add-btn:disabled.is-added {
    border-color: rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
}

/* one button in the row (her price, the main, one for sale): it takes the row */
:root.item-shop .card-grid .card-buy-row:has(.card-add-btn[hidden]) .card-main-btn,
:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale,
:root.item-shop .card-grid .card-buy-row .card-main-btn.is-visits,
:root.item-shop .card-grid .card-buy-row .card-main-btn.is-shop-loading {
    grid-column: 1 / -1;
}

/* Prices stay centered without an opaque footer band. */
:root.item-shop .card-grid .card-buy-row .card-main-btn:is(.is-for-sale, .is-visits, .is-shop-loading) {
    background: transparent;
    color: #ffffff;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale {
    position: relative;
    top: 2px;
    justify-self: center;
    width: fit-content;
    max-width: 100%;
    gap: 5px;
    padding-inline: 12px;
    font-size: 15px;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale b {
    font-size: 15.5px;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale > .oto-bits-coin {
    width: 17px;
    height: 17px;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale .price-chip.is-gems {
    height: 23px;
    margin-right: 0;
    padding: 0 8px 0 4px;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale .oto-crystal-gem {
    width: 15px;
    height: 15px;
}

:root.item-shop .card-grid .character-card:is(:hover, :focus-visible) .card-buy-row .card-main-btn.is-for-sale,
:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale:is(:hover, :focus-visible) {
    border-color: transparent;
    background: transparent;
    color: #ffffff;
    transform: none;
}

:root.item-shop .card-grid .card-buy-row .card-main-btn.is-for-sale:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* her tier and "Yours" stay for screen readers: the buttons say the rest */
:root.item-shop .card-grid .card-buy-row .card-meta {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* the quality chip under the buttons: small */
:root.item-shop .card-grid .card-job.is-quality {
    align-self: flex-start;
    min-height: 0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.5;
}

:root.item-shop .card-grid .card-job.is-quality i {
    font-size: 9px;
}

:root.item-shop .card-main-btn .price-chip.is-gems {
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
}

/* ---- legendary shines: a sheen sweeping across and twinkles; epic, softer ---- */
:root.item-shop .tier-legendary:is(.shop-tile, .character-card) {
    box-shadow: 0 0 0 2px rgba(255, 236, 150, 0.95), 0 0 22px rgba(255, 190, 60, 0.6);
}

:root.item-shop .tier-epic:is(.shop-tile, .character-card) {
    box-shadow: 0 0 0 1.5px rgba(235, 200, 255, 0.8), 0 0 12px rgba(190, 110, 255, 0.45);
}

:root.item-shop .shop-tile.tier-legendary .shop-tile-art::after,
:root.item-shop .character-card.tier-legendary .card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 20%, #fff 0 1.6px, rgba(255, 255, 255, 0) 3px),
        radial-gradient(circle at 84% 28%, #fff 0 2.2px, rgba(255, 255, 255, 0) 3.6px),
        radial-gradient(circle at 72% 64%, #fff 0 1.4px, rgba(255, 255, 255, 0) 2.6px),
        radial-gradient(circle at 26% 58%, #fff 0 1.9px, rgba(255, 255, 255, 0) 3.2px),
        linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.55) 47%, rgba(255, 255, 255, 0.12) 53%, rgba(255, 255, 255, 0) 62%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 260% 100%;
    animation: item-shop-sheen 2.8s ease-in-out infinite;
}

:root.item-shop .shop-tile.tier-epic .shop-tile-art::after,
:root.item-shop .character-card.tier-epic .card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.3) 49%, rgba(255, 255, 255, 0) 58%);
    background-size: 260% 100%;
    animation: item-shop-sheen-soft 4.6s ease-in-out infinite;
}

@keyframes item-shop-sheen {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 160% 0; opacity: 0.85; }
    50% { opacity: 1; }
    55%, 100% { background-position: 0 0, 0 0, 0 0, 0 0, -70% 0; opacity: 0.85; }
}

@keyframes item-shop-sheen-soft {
    0% { background-position: 160% 0; }
    55%, 100% { background-position: -70% 0; }
}

@keyframes item-shop-rays {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    :root.item-shop .shop-tile::before,
    :root.item-shop .shop-tile-art::after,
    :root.item-shop .shop-tile-art img,
    :root.item-shop .character-card .card-media::after {
        animation: none;
    }
}

/* ---- the rest of the shop's strip: "who visits Home first", jobs being made ---- */
:root.item-shop .visit-first-card,
:root.item-shop .creator-jobs > * {
    background: var(--is-panel);
    border: 2px dashed #4a3f8f;
    color: #ffffff;
}

@media (min-width: 900px) {
    :root.item-shop .browse-toolbar.oto-surface-panel {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 18px;
    }

    :root.item-shop .browse-toolbar:has(> .browse-chips[hidden]) {
        display: none;
    }

    :root.item-shop .browse-toolbar .kind-switch,
    :root.item-shop .browse-toolbar .owned-progress {
        flex-basis: 100%;
    }

    :root.item-shop .visit-first-card {
        width: auto;
        max-width: 100%;
        min-height: 38px;
        margin: 0 0 0 auto;
        padding: 4px 10px;
        gap: 9px;
        border-radius: 12px;
    }

    :root.item-shop .visit-first-face {
        width: 28px;
        height: 28px;
        margin-left: -8px;
    }

    :root.item-shop .visit-first-copy {
        display: block;
        flex: none;
        white-space: nowrap;
    }

    :root.item-shop .visit-first-copy b {
        font-size: 13px;
    }

    :root.item-shop .visit-first-copy span {
        display: none;
    }
}

@media (max-width: 899px) {
    :root.item-shop .visit-first-card {
        order: -1;
    }
}

@media (max-width: 400px) {
    :root.item-shop .visit-first-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 12px;
    }

    :root.item-shop .visit-first-card[hidden] {
        display: none;
    }

    :root.item-shop .visit-first-faces {
        grid-column: 1;
        grid-row: 1;
    }

    :root.item-shop .visit-first-copy {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    :root.item-shop .visit-first-go {
        grid-column: 2;
        grid-row: 1;
    }
}

/* ---- the Messages button: a small round icon, not a pill over the tiles ---- */
:root.item-shop .oto-messages-launcher {
    width: 48px;
    min-height: 48px;
    padding: 0;
    border-color: var(--is-line);
    background: var(--is-panel);
    color: var(--is-ink);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

:root.item-shop .shop-messages-slot .oto-messages-launcher {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 40px;
    height: 40px;
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
}

:root.item-shop .oto-messages-launcher > span:not(.oto-dm-nav-badge) {
    display: none;
}

:root.item-shop .oto-messages-launcher:hover,
:root.item-shop .oto-messages-launcher[aria-expanded="true"] {
    background: var(--is-pill-hover);
}

:root.item-shop .oto-messages-launcher .oto-dm-nav-badge {
    border-color: var(--is-bg);
}

/* ---- her details sheet (the i, her own page) and the buy and Crystal popups:
   the Shop's greys, not the old light sheet ---- */
:root.item-shop .detail-overlay {
    background: rgba(0, 0, 0, 0.6);
}

:root.item-shop :is(.detail-panel, .buy-dialog-card, .crystal-shop-card, #crystal-shop .crystal-shop-card, .detail-layout--page .detail-actions) {
    border-color: var(--is-line);
    background: var(--is-panel);
    color: var(--is-ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Character art leads the sheet; its live preview sits inside the scene. */
:root.item-shop .detail-layout.detail-layout--page {
    grid-template-rows: auto 1fr;
    grid-template-areas: "splash splash" "about feed";
}

:root.item-shop .detail-layout.detail-layout--page:has(.detail-splash[hidden]) {
    grid-template-rows: auto 1fr;
    grid-template-areas: "visual feed" "about feed";
}

:root.item-shop .detail-splash {
    grid-area: splash;
    min-width: 0;
    overflow: hidden;
    background: #17191f;
    color: #fff;
}

:root.item-shop .detail-splash[hidden],
:root.item-shop .detail-splash-looks[hidden] {
    display: none;
}

:root.item-shop .detail-panel:has(.detail-splash:not([hidden])) .detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    z-index: 6;
    margin: 0;
}

:root.item-shop .detail-panel:has(.detail-splash:not([hidden])) .detail-analytics-btn {
    position: absolute;
    top: 15px;
    right: 62px;
    left: auto;
    z-index: 6;
    margin: 0;
}

:root.item-shop .detail-splash-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 8.5;
    overflow: hidden;
}

:root.item-shop .detail-splash-scene .detail-visual {
    position: absolute;
    right: clamp(12px, 3vw, 42px);
    bottom: 0;
    z-index: 3;
    width: clamp(140px, 18vw, 230px);
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: auto;
}

:root.item-shop .detail-splash-scene .detail-stage {
    cursor: grab;
    touch-action: none;
}

:root.item-shop .detail-splash-scene .detail-visual.is-held .detail-stage {
    cursor: grabbing;
}

:root.item-shop .detail-splash-scene .detail-stage-shell {
    gap: 0;
}

:root.item-shop .detail-splash-scene .detail-stage {
    min-height: 0;
    height: clamp(155px, 21vw, 240px);
    border: 0;
    border-radius: 0;
    background: transparent;
    filter: none;
    box-shadow: none;
}

:root.item-shop .detail-splash-scene .detail-ground {
    display: none;
}

:root.item-shop .detail-splash-scene .detail-stage-placeholder {
    bottom: var(--detail-stage-ground-offset);
}

:root.item-shop .detail-splash-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:root.item-shop .detail-splash.is-loading .detail-splash-image {
    opacity: 0;
}

:root.item-shop .detail-splash-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    place-items: center;
    pointer-events: none;
}

:root.item-shop .detail-splash.is-loading .detail-splash-loader {
    display: grid;
}

:root.item-shop .detail-splash-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #f7d894;
    border-radius: 50%;
    animation: detail-splash-spin 750ms linear infinite;
}

@keyframes detail-splash-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    :root.item-shop .detail-splash-spinner { animation-duration: 2s; }
}

:root.item-shop .detail-splash-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 6, 14, .72), transparent 68%),
        linear-gradient(0deg, rgba(5, 6, 14, .76), transparent 55%);
    pointer-events: none;
}

:root.item-shop .detail-splash-copy {
    position: absolute;
    left: clamp(22px, 4vw, 52px);
    bottom: clamp(18px, 3vw, 40px);
    max-width: min(70%, 650px);
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}

:root.item-shop .detail-splash-scene:has(.detail-visual) .detail-splash-copy {
    max-width: calc(100% - clamp(140px, 18vw, 230px) - 52px);
}

:root.item-shop .detail-layout--page .detail-head .detail-name[hidden] {
    display: none;
}

:root.item-shop .detail-layout--page .detail-head .detail-snippet:not([hidden]) {
    margin: 4px 0 0;
    color: var(--is-ink);
    font-size: 14px;
    line-height: 1.45;
}

:root.item-shop .detail-splash-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #f7d894 !important;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .22em;
}

:root.item-shop .detail-splash-name {
    margin: 0;
    color: #fff !important;
    font-size: clamp(30px, 5vw, 64px);
    line-height: 1;
    font-weight: 900;
}

:root.item-shop .detail-splash-title {
    margin: 8px 0 0;
    color: #fff !important;
    font-size: clamp(14px, 1.7vw, 20px);
    font-weight: 650;
}

:root.item-shop .detail-splash-looks {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 12px 22px;
    scrollbar-width: thin;
    background: #1d1f26;
}

:root.item-shop .detail-splash-look {
    flex: 0 0 112px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #2c2e37;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

:root.item-shop .detail-splash-look.is-current,
:root.item-shop .detail-splash-look:focus-visible {
    border-color: #f7d894;
    outline: none;
}

:root.item-shop .detail-splash-look img {
    width: 100%;
    aspect-ratio: 1.4;
    border-radius: 4px;
    object-fit: cover;
}

:root.item-shop .detail-splash-look span {
    overflow: hidden;
    padding: 0 4px 2px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:root.item-shop .card-image.is-splash {
    object-position: center;
}

@media (max-width: 980px) {
    :root.item-shop .detail-layout.detail-layout--page {
        display: flex;
    }
    :root.item-shop .detail-splash {
        order: -1;
    }
}

@media (max-width: 640px) {
    :root.item-shop .detail-splash-scene {
        aspect-ratio: 1.35;
    }
    :root.item-shop .detail-splash-copy {
        left: 18px;
        bottom: 18px;
        max-width: 80%;
    }
    :root.item-shop .detail-splash-scene:has(.detail-visual) .detail-splash-copy {
        max-width: calc(100% - 172px);
    }
    :root.item-shop .detail-splash-looks {
        padding: 9px 12px;
    }
    :root.item-shop .detail-splash-look {
        flex-basis: 90px;
    }
}

/* (her words take the sheet's light ink; their quieter lines its muted grey) */
:root.item-shop :is(.detail-panel, .buy-dialog-card, .crystal-shop-card) :is(h1, h2, h3, h4, p, dt, dd, li, strong, b, small, label, span, a, div):not(.price-chip):not(.price-chip *):not(button *) {
    color: inherit;
}

:root.item-shop .detail-panel :is(.detail-credit, .detail-fanmade, .detail-meta-label, .detail-stage-label, .detail-who-head, .detail-section-hint, .detail-comment-time, .detail-created) {
    color: var(--is-muted) !important;
}

:root.item-shop :is(.detail-close, .detail-analytics-btn, .detail-copy-btn, .detail-videos-arrow, #crystal-shop .buy-dialog-close, .buy-dialog-cancel) {
    border-color: var(--is-line);
    background: var(--is-pill);
    color: var(--is-ink);
}

:root.item-shop :is(.detail-copy-btn, .detail-videos-arrow, .buy-dialog-cancel):hover {
    background: var(--is-pill-hover);
}

/* her stage: a soft spotlight on the panel's grey */
:root.item-shop :is(.detail-visual, .detail-stage) {
    background: radial-gradient(120% 90% at 50% 30%, #3a3d44 0%, #2b2d31 70%);
    border-color: var(--is-line);
}

:root.item-shop .detail-ground {
    opacity: 0.35;
}

:root.item-shop :is(.detail-code-box, .detail-meta-item, .detail-author-chip, .detail-who, .detail-who-head,
    .detail-fanart-empty, .detail-outfit, .detail-outfit.is-current, .detail-sort, .detail-feed-btn,
    .detail-comment-form input, .detail-reply-form input, .detail-art-img, .detail-outfit-blank,
    .crystal-shop-balance, .crystal-shop-bonus) {
    border-color: var(--is-line);
    background: var(--is-pill);
    color: var(--is-ink);
}

:root.item-shop :is(.detail-author-chip--link, .detail-outfit, .detail-feed-btn):hover {
    background: var(--is-pill-hover);
}

:root.item-shop .detail-sort-btn.is-on {
    background: var(--is-pill-hover);
    color: var(--is-ink);
}

:root.item-shop :is(.detail-author-avatar, .detail-comment-avatar) {
    background: var(--is-pill-hover);
}


:root.item-shop .buy-dialog {
    background: rgba(0, 0, 0, 0.6);
}

:root.item-shop .buy-dialog-portrait {
    background: radial-gradient(120% 90% at 50% 30%, #3a3d44 0%, #2b2d31 70%);
}

:root.item-shop .buy-dialog-confirm {
    border: 0;
    background: #ffe36b;
    color: var(--is-bg);
}

:root.item-shop .buy-dialog-confirm:not(:disabled):hover {
    background: #fff0a0;
}

:root.item-shop .buy-dialog-confirm:disabled {
    background: var(--is-pill);
    color: var(--is-muted);
}

/* Crystals keep their purple here too (the yellow above is the Bits button's) */
:root.item-shop .buy-dialog-confirm.is-crystals {
    background: linear-gradient(160deg, #8f6bf0, #6a45cf);
    color: #fff;
}
:root.item-shop .buy-dialog-confirm.is-crystals:not(:disabled):hover {
    background: linear-gradient(160deg, #a184f6, #7550d8);
}

/* short: outlined in the currency's colour, its price and "Need N more" in that colour too */
:root.item-shop .buy-dialog-confirm.is-short {
    background: transparent;
    border: 2px solid #ffe36b;
    color: #ffe9a0;
}
:root.item-shop .buy-dialog-confirm.is-short:not(:disabled):hover {
    background: rgba(255, 227, 107, 0.12);
}
:root.item-shop .buy-dialog-confirm.is-crystals.is-short {
    background: transparent;
    border: 2px solid #a184f6;
    color: #ddd2ff;
}
:root.item-shop .buy-dialog-confirm.is-crystals.is-short:not(:disabled):hover {
    background: rgba(161, 132, 246, 0.16);
}

/* "You have": both balances as matching pills, light ink on a tint of their colour */
:root.item-shop #buy-dialog .pill-gems,
:root.item-shop #buy-dialog .buy-dialog-held {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 6px;
    border-radius: 999px;
    line-height: 1;
    font-weight: 800;
}
:root.item-shop #buy-dialog .pill-gems {
    background: rgba(143, 107, 240, 0.22);
    border: 1px solid rgba(161, 132, 246, 0.55);
    color: #e6deff;
}
:root.item-shop #buy-dialog .buy-dialog-held {
    background: rgba(255, 227, 107, 0.14);
    border: 1px solid rgba(255, 227, 107, 0.45);
    color: #ffefb0;
}
:root.item-shop #buy-dialog .pill-gems + .buy-dialog-held { margin-left: 6px; }
:root.item-shop #buy-dialog .buy-dialog-status { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }

/* her close button: visible on the dark card, as the other dialogs' */
:root.item-shop #buy-dialog .buy-dialog-close {
    border: 1px solid var(--is-line);
    background: var(--is-pill);
    color: var(--is-ink);
}
:root.item-shop #buy-dialog .buy-dialog-close:hover { background: var(--is-pill-hover); }

/* ---- the filter chips: one row, each with its count ---- */
:root.item-shop .browse-chips .chip-group {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

:root.item-shop .browse-chips .chip-group::-webkit-scrollbar {
    display: none;
}

:root.item-shop .browse-chips .filter-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    font-size: 14px;
}

:root.item-shop .chip-count {
    color: var(--is-muted);
    font-size: 12.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

:root.item-shop .chip-count:empty {
    display: none;
}

:root.item-shop .filter-chip.is-active .chip-count {
    color: rgba(255, 255, 255, 0.8);
}

/* (admin view: an Otomate hidden from the shop) */
:root.item-shop .card-hidden-tag {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(10, 12, 16, 0.78);
    color: #ffd27a;
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

:root.item-shop .card-hidden-tag[hidden] {
    display: none;
}

/* ---- her sheet's buttons: one row inside the panel's edges, the size of the
   cards' buttons or bigger. Set main the Shop's yellow (her price on it: dark
   glass, her main: "★ Main" outlined), Home beside it a grey pill. ---- */
:root.item-shop .detail-layout--page .detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-status:empty {
    display: none;
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-status {
    flex: 1 0 100%;
}

:root.item-shop .detail-layout--page .detail-actions :is(.detail-main-otomate-btn, .detail-home-btn) {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    opacity: 1;
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-otomate-btn {
    background: #ffe36b;
    color: var(--is-bg);
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-otomate-btn:not(:disabled):is(:hover, :focus-visible) {
    background: #fff0a0;
    color: var(--is-bg);
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-otomate-btn:is(.is-main, :disabled.is-main) {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px #ffe36b;
    color: #ffe36b;
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-otomate-btn:is(.is-for-sale, .is-visits, .is-shop-loading) {
    background: var(--is-pill);
    color: #ffffff;
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-otomate-btn.is-for-sale:not(:disabled):is(:hover, :focus-visible) {
    background: #ffe36b;
    color: var(--is-bg);
}

:root.item-shop .detail-layout--page .detail-actions .detail-main-otomate-btn:disabled:not(.is-main) {
    opacity: 0.6;
}

:root.item-shop .detail-layout--page .detail-actions .detail-home-btn {
    background: var(--is-pill);
    color: var(--is-ink);
}

:root.item-shop .detail-layout--page .detail-actions .detail-home-btn:not(:disabled):is(:hover, :focus-visible) {
    background: var(--is-pill-hover);
    color: #ffffff;
}

/* (a phone: the row is a bar along the sheet's bottom, its edges the sheet's cards') */
@media (max-width: 980px) {
    :root.item-shop .detail-layout--page .detail-actions {
        padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--is-line);
        background: var(--is-panel);
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.35);
    }
}
