/*
   Skins upgrader. Deliberately small: the page reuses the trade-up primitives by name
   (.tu-slot, .tu-card-grid, .tu-picker-modal, .tu-result, .tu-arrow, .tu-tag, .tu-odds-chip)
   rather than copying them. Only the wheel and the history rows had no existing class.

   Naming debt, recorded on purpose: .tu- classes now appear on a page that is not a
   trade-up. If a third feature wants these primitives, that is the point to rename the
   shared subset to a neutral prefix across all of them.

   Zero font-size declarations here by design; sizing comes from Bootstrap fs- utilities.
*/

.up-wheel {
    position: relative;
    width: 100%;
    max-width: 190px;
    aspect-ratio: 1;
    flex: 0 0 auto;
}

/*
   Win arc runs clockwise from 12 o'clock and is sized by --up-chance-deg, so the needle
   landing inside the green is the same statement as roll < chance. The mask turns the
   disc into a ring. Not transitioned: an unregistered custom property inside a
   conic-gradient does not interpolate, so an eased sweep is not available here.
*/
.up-wheel-track {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        rgb(25, 238, 25) 0deg var(--up-chance-deg, 0deg),
        rgba(255, 255, 255, 0.07) var(--up-chance-deg, 0deg) 360deg
    );
    -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 62.5%);
    mask: radial-gradient(circle, transparent 0 62%, #000 62.5%);
}

.up-wheel.is-spinning .up-wheel-track {
    box-shadow: 0 0 28px rgba(13, 202, 240, 0.28);
}

/*
   Transition is always on rather than added with .is-spinning: a transition declared in
   the same style recalculation as the value change does not animate.
   Duration is paired with SpinDurationSeconds in Upgrader.razor.
*/
.up-wheel-needle {
    position: absolute;
    inset: 0;
    transform-origin: 50% 50%;
    pointer-events: none;
    transition: transform 4.5s cubic-bezier(0.16, 0.84, 0.28, 1);
}

.up-wheel-needle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    width: 4px;
    height: 24%;
    translate: -50% 0;
    border-radius: 2px;
    background: rgb(255, 203, 49);
    box-shadow: 0 0 12px rgba(255, 203, 49, 0.85);
}

.up-wheel-center {
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    text-align: center;
    line-height: 1.1;
    background: rgba(15, 22, 33, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}

.up-wheel-label {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.up-history-row {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.up-history-row.is-win {
    border-color: rgba(25, 238, 25, 0.3);
    background: rgba(25, 238, 25, 0.05);
}

.up-history-row.is-loss {
    border-color: rgba(220, 53, 69, 0.22);
}

.up-history-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

/* A grid item defaults to min-width: auto, which stops the truncation inside from ever
   kicking in — the column would just grow to fit the prize name instead. */
.up-history-main {
    min-width: 0;
}

.up-history-name {
    color: #fff;
    font-weight: 600;
}

.up-history-name:hover {
    color: rgb(13, 202, 240);
}

.up-history-trade {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.up-history-outcome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
}

@media (max-width: 575.98px) {
    .up-history-outcome {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.15rem;
    }
}

/*
   .tu-result is sized with min-height: 100%, which resolves against the whole column.
   Trade-up puts it alone in a flex wrapper, but here a heading sits above it in the same
   column, so 100% plus the heading overflows the row. Content height is what this layout
   wants anyway, since the row centres its panels rather than stretching them.
*/
.up-prize .tu-result {
    min-height: 0;
}
