/* =====================================================================
   Responsive corrections for the static clone.
   The original is a React app whose mobile layout is applied at runtime.
   These rules reproduce that mobile layout (<=992px) using the DOM that
   the static capture already contains: stack the upgrade panels, fit the
   spinner wheel, keep the live-drops ticker as a clipped horizontal row,
   and prevent any horizontal page overflow.
   ===================================================================== */

/* No horizontal scroll on the whole document.
   overflow-x: clip (not hidden) — hidden creates a scroll container on
   <body> and breaks position:sticky for the live-drops sidebar. */
html, body {
    max-width: 100%;
    overflow-x: clip;
}

@media (max-width: 992px) {

    /* ---- Upgrade area: stack the top 3-panel row ---- */
    .upgrade-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem !important;
    }
    /* the fixed-width wheel column -> centered, fits viewport */
    .upgrade-top-row > .w-\[40rem\] {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: -1; /* wheel on top, as in the original mobile view */
    }
    /* spinner scales down to fit small screens */
    .upgrade-spinner-fit,
    .upgrade-spinner-fit > * {
        max-width: 100%;
    }
    .upgrade-top-row .h-\[35rem\].w-\[35rem\] {
        transform: scale(min(1, calc((100vw - 4rem) / 35rem)));
        transform-origin: top center;
    }

    /* ---- Bottom "Мои предметы" / "Выбрать предмет" row: stack ---- */
    .upgrade-panels-row {
        flex-direction: column;
        gap: 1.5rem !important;
    }
    .upgrade-panels-row > div {
        width: 100% !important;
        min-height: 40rem !important;
    }

    /* ---- Live-drops ticker: keep it a clipped horizontal strip ---- */
    .livedrops-list-bg {
        max-width: 100%;
        overflow: hidden;
    }

    /* ---- Header: let the right cluster fit ---- */
    .fixed.top-0 .header__gradient_transparent {
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 0.5rem;
    }
}

/* Small phones */
@media (max-width: 420px) {
    .upgrade-top-row .h-\[35rem\].w-\[35rem\] {
        transform: scale(calc((100vw - 3rem) / 35rem));
    }
}

/* =====================================================================
   Live-drops ticker animation + item-picker visuals (vanilla JS driven)
   ===================================================================== */

/* New drop slides/fades in at the front of the list */
[data-live-drop-id].ldrop-new {
    opacity: 0;
    transform: translateY(-1.2rem);
}
[data-live-drop-id] {
    transition: opacity 0.12s ease, transform 0.12s ease;
}
@media (max-width: 992px) {
    [data-live-drop-id].ldrop-new {
        transform: translateX(-1.2rem);
    }
}

/* Subtle continuous drift of the whole track (desktop = vertical feel via
   the new-arrival animation; horizontal marquee on mobile handled by the
   native overflow-x scroll container). Respect reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    [data-live-drop-id] { transition: none; }
    [data-live-drop-id].ldrop-new { opacity: 1; transform: none; }
}

/* ---- Picked item in the upgrade slot ---- */
.picked-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    padding: 2rem;
    width: 100%;
    animation: picked-pop 0.28s ease;
}
@keyframes picked-pop {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}
.picked-item__frame {
    position: relative;
    width: 20rem;
    max-width: 70%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0.3rem;
    background: linear-gradient(180deg, #454645 0%, #939393 100%);
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.35);
}
.picked-item__frame::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 0.4rem;
    background: var(--accent, #5e98d9);
}
.picked-item__frame img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.picked-item__name {
    font-family: var(--font-sofia-sans, 'Sofia Sans', system-ui, sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    max-width: 90%;
}
.picked-item__clear {
    height: 3.6rem;
    padding: 0 1.6rem;
    border: 0.1rem solid rgba(255, 255, 255, 0.2);
    border-radius: 0.2rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-sofia-sans, 'Sofia Sans', system-ui, sans-serif);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.picked-item__clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Selected source card highlight */
[data-item-card].item-card--selected {
    outline: 0.2rem solid #44c987;
    outline-offset: -0.2rem;
    border-radius: 0.2rem;
}
[data-item-card] { transition: outline-color 0.15s ease; }
